From 98dab3184e220970c0ae1db899210d59c6df838f Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 9 Feb 2024 14:26:00 +0530 Subject: [PATCH 001/113] chore: run make prettier (#760) --- twilio/rest/__init__.py | 1 + .../rest/accounts/v1/auth_token_promotion.py | 2 -- .../rest/accounts/v1/credential/__init__.py | 1 - twilio/rest/accounts/v1/credential/aws.py | 2 -- .../rest/accounts/v1/credential/public_key.py | 2 -- twilio/rest/accounts/v1/safelist.py | 2 -- .../rest/accounts/v1/secondary_auth_token.py | 2 -- twilio/rest/api/v2010/account/__init__.py | 1 - .../api/v2010/account/address/__init__.py | 2 -- .../account/address/dependent_phone_number.py | 1 - twilio/rest/api/v2010/account/application.py | 2 -- .../v2010/account/authorized_connect_app.py | 7 ++--- .../__init__.py | 2 -- .../available_phone_number_country/local.py | 2 -- .../machine_to_machine.py | 2 -- .../available_phone_number_country/mobile.py | 2 -- .../national.py | 2 -- .../shared_cost.py | 2 -- .../toll_free.py | 2 -- .../available_phone_number_country/voip.py | 2 -- twilio/rest/api/v2010/account/balance.py | 2 -- .../rest/api/v2010/account/call/__init__.py | 1 - twilio/rest/api/v2010/account/call/event.py | 2 -- .../rest/api/v2010/account/call/feedback.py | 1 - .../v2010/account/call/feedback_summary.py | 1 - .../api/v2010/account/call/notification.py | 2 -- twilio/rest/api/v2010/account/call/payment.py | 1 - .../rest/api/v2010/account/call/recording.py | 1 - twilio/rest/api/v2010/account/call/siprec.py | 1 - twilio/rest/api/v2010/account/call/stream.py | 1 - .../account/call/user_defined_message.py | 2 -- .../call/user_defined_message_subscription.py | 2 -- .../api/v2010/account/conference/__init__.py | 1 - .../v2010/account/conference/participant.py | 1 - .../api/v2010/account/conference/recording.py | 1 - twilio/rest/api/v2010/account/connect_app.py | 1 - .../account/incoming_phone_number/__init__.py | 1 - .../assigned_add_on/__init__.py | 2 -- .../assigned_add_on_extension.py | 2 -- .../account/incoming_phone_number/local.py | 13 ++++---- .../account/incoming_phone_number/mobile.py | 13 ++++---- .../incoming_phone_number/toll_free.py | 19 ++++++------ twilio/rest/api/v2010/account/key.py | 2 -- .../api/v2010/account/message/__init__.py | 1 - .../api/v2010/account/message/feedback.py | 1 - .../rest/api/v2010/account/message/media.py | 2 -- twilio/rest/api/v2010/account/new_key.py | 2 -- .../rest/api/v2010/account/new_signing_key.py | 2 -- twilio/rest/api/v2010/account/notification.py | 2 -- .../api/v2010/account/outgoing_caller_id.py | 2 -- .../rest/api/v2010/account/queue/__init__.py | 2 -- twilio/rest/api/v2010/account/queue/member.py | 2 -- .../api/v2010/account/recording/__init__.py | 1 - .../recording/add_on_result/__init__.py | 1 - .../recording/add_on_result/payload.py | 2 -- .../v2010/account/recording/transcription.py | 1 - twilio/rest/api/v2010/account/short_code.py | 2 -- twilio/rest/api/v2010/account/signing_key.py | 2 -- twilio/rest/api/v2010/account/sip/__init__.py | 1 - .../account/sip/credential_list/__init__.py | 2 -- .../account/sip/credential_list/credential.py | 2 -- .../api/v2010/account/sip/domain/__init__.py | 2 -- .../account/sip/domain/auth_types/__init__.py | 1 - .../auth_types/auth_type_calls/__init__.py | 7 ++--- .../auth_calls_credential_list_mapping.py | 2 -- ...th_calls_ip_access_control_list_mapping.py | 2 -- .../auth_type_registrations/__init__.py | 1 - ...h_registrations_credential_list_mapping.py | 2 -- .../sip/domain/credential_list_mapping.py | 2 -- .../domain/ip_access_control_list_mapping.py | 2 -- .../sip/ip_access_control_list/__init__.py | 2 -- .../sip/ip_access_control_list/ip_address.py | 2 -- twilio/rest/api/v2010/account/token.py | 2 -- .../rest/api/v2010/account/transcription.py | 1 - .../rest/api/v2010/account/usage/__init__.py | 1 - .../v2010/account/usage/record/__init__.py | 1 - .../v2010/account/usage/record/all_time.py | 1 - .../api/v2010/account/usage/record/daily.py | 1 - .../v2010/account/usage/record/last_month.py | 1 - .../api/v2010/account/usage/record/monthly.py | 1 - .../v2010/account/usage/record/this_month.py | 1 - .../api/v2010/account/usage/record/today.py | 1 - .../api/v2010/account/usage/record/yearly.py | 1 - .../v2010/account/usage/record/yesterday.py | 1 - .../rest/api/v2010/account/usage/trigger.py | 1 - .../api/v2010/account/validation_request.py | 2 -- .../rest/autopilot/v1/assistant/__init__.py | 2 -- .../rest/autopilot/v1/assistant/defaults.py | 2 -- .../rest/autopilot/v1/assistant/dialogue.py | 2 -- .../v1/assistant/field_type/__init__.py | 2 -- .../v1/assistant/field_type/field_value.py | 2 -- .../autopilot/v1/assistant/model_build.py | 1 - twilio/rest/autopilot/v1/assistant/query.py | 2 -- .../autopilot/v1/assistant/style_sheet.py | 2 -- .../autopilot/v1/assistant/task/__init__.py | 2 -- .../rest/autopilot/v1/assistant/task/field.py | 2 -- .../autopilot/v1/assistant/task/sample.py | 2 -- .../v1/assistant/task/task_actions.py | 2 -- .../v1/assistant/task/task_statistics.py | 2 -- twilio/rest/autopilot/v1/assistant/webhook.py | 2 -- twilio/rest/autopilot/v1/restore_assistant.py | 2 -- twilio/rest/bulkexports/v1/export/__init__.py | 2 -- twilio/rest/bulkexports/v1/export/day.py | 2 -- .../v1/export/export_custom_job.py | 2 -- twilio/rest/bulkexports/v1/export/job.py | 2 -- .../bulkexports/v1/export_configuration.py | 2 -- twilio/rest/chat/v1/credential.py | 1 - twilio/rest/chat/v1/service/__init__.py | 2 -- .../rest/chat/v1/service/channel/__init__.py | 1 - twilio/rest/chat/v1/service/channel/invite.py | 2 -- twilio/rest/chat/v1/service/channel/member.py | 8 ++--- .../rest/chat/v1/service/channel/message.py | 1 - twilio/rest/chat/v1/service/role.py | 1 - twilio/rest/chat/v1/service/user/__init__.py | 2 -- .../rest/chat/v1/service/user/user_channel.py | 1 - twilio/rest/chat/v2/credential.py | 1 - twilio/rest/chat/v2/service/__init__.py | 2 -- twilio/rest/chat/v2/service/binding.py | 1 - .../rest/chat/v2/service/channel/__init__.py | 1 - twilio/rest/chat/v2/service/channel/invite.py | 2 -- twilio/rest/chat/v2/service/channel/member.py | 7 ++--- .../rest/chat/v2/service/channel/message.py | 1 - .../rest/chat/v2/service/channel/webhook.py | 1 - twilio/rest/chat/v2/service/role.py | 1 - twilio/rest/chat/v2/service/user/__init__.py | 1 - .../rest/chat/v2/service/user/user_binding.py | 1 - .../rest/chat/v2/service/user/user_channel.py | 7 ++--- twilio/rest/chat/v3/channel.py | 1 - twilio/rest/content/v1/content/__init__.py | 2 -- .../rest/content/v1/content/approval_fetch.py | 2 -- .../rest/content/v1/content_and_approvals.py | 2 -- twilio/rest/content/v1/legacy_content.py | 2 -- .../conversations/v1/address_configuration.py | 1 - .../v1/configuration/__init__.py | 2 -- .../conversations/v1/configuration/webhook.py | 1 - .../conversations/v1/conversation/__init__.py | 1 - .../v1/conversation/message/__init__.py | 1 - .../conversation/message/delivery_receipt.py | 1 - .../v1/conversation/participant.py | 1 - .../conversations/v1/conversation/webhook.py | 1 - twilio/rest/conversations/v1/credential.py | 1 - .../v1/participant_conversation.py | 19 ++++++------ twilio/rest/conversations/v1/role.py | 1 - .../rest/conversations/v1/service/__init__.py | 2 -- .../rest/conversations/v1/service/binding.py | 1 - .../v1/service/configuration/__init__.py | 2 -- .../v1/service/configuration/notification.py | 2 -- .../v1/service/configuration/webhook.py | 1 - .../v1/service/conversation/__init__.py | 1 - .../service/conversation/message/__init__.py | 1 - .../conversation/message/delivery_receipt.py | 1 - .../v1/service/conversation/participant.py | 1 - .../v1/service/conversation/webhook.py | 1 - .../v1/service/participant_conversation.py | 19 ++++++------ twilio/rest/conversations/v1/service/role.py | 1 - .../conversations/v1/service/user/__init__.py | 1 - .../v1/service/user/user_conversation.py | 7 ++--- twilio/rest/conversations/v1/user/__init__.py | 1 - .../v1/user/user_conversation.py | 7 ++--- twilio/rest/events/v1/event_type.py | 2 -- twilio/rest/events/v1/schema/__init__.py | 8 ++--- .../rest/events/v1/schema/schema_version.py | 2 -- twilio/rest/events/v1/sink/__init__.py | 1 - twilio/rest/events/v1/sink/sink_test.py | 2 -- twilio/rest/events/v1/sink/sink_validate.py | 2 -- .../rest/events/v1/subscription/__init__.py | 2 -- .../v1/subscription/subscribed_event.py | 2 -- twilio/rest/flex_api/v1/__init__.py | 6 ++-- twilio/rest/flex_api/v1/assessments.py | 2 -- twilio/rest/flex_api/v1/channel.py | 2 -- twilio/rest/flex_api/v1/configuration.py | 1 - twilio/rest/flex_api/v1/flex_flow.py | 7 ++--- .../v1/insights_assessments_comment.py | 2 -- .../flex_api/v1/insights_conversations.py | 2 -- .../flex_api/v1/insights_questionnaires.py | 2 -- .../v1/insights_questionnaires_category.py | 2 -- .../v1/insights_questionnaires_question.py | 2 -- twilio/rest/flex_api/v1/insights_segments.py | 2 -- twilio/rest/flex_api/v1/insights_session.py | 2 -- .../v1/insights_settings_answer_sets.py | 2 -- .../flex_api/v1/insights_settings_comment.py | 2 -- .../rest/flex_api/v1/insights_user_roles.py | 2 -- .../rest/flex_api/v1/interaction/__init__.py | 2 -- .../interaction_channel/__init__.py | 1 - .../interaction_channel_invite.py | 2 -- .../interaction_channel_participant.py | 1 - twilio/rest/flex_api/v1/web_channel.py | 1 - twilio/rest/flex_api/v2/web_channels.py | 2 -- twilio/rest/frontline_api/v1/user.py | 1 - twilio/rest/insights/v1/call/__init__.py | 2 -- twilio/rest/insights/v1/call/annotation.py | 7 ++--- twilio/rest/insights/v1/call/call_summary.py | 7 ++--- twilio/rest/insights/v1/call/event.py | 1 - twilio/rest/insights/v1/call/metric.py | 1 - twilio/rest/insights/v1/call_summaries.py | 7 ++--- .../rest/insights/v1/conference/__init__.py | 19 ++++++------ .../v1/conference/conference_participant.py | 31 +++++++++---------- twilio/rest/insights/v1/room/__init__.py | 1 - twilio/rest/insights/v1/room/participant.py | 1 - twilio/rest/insights/v1/setting.py | 2 -- twilio/rest/intelligence/v2/service.py | 1 - .../intelligence/v2/transcript/__init__.py | 1 - .../rest/intelligence/v2/transcript/media.py | 2 -- .../v2/transcript/operator_result.py | 7 ++--- .../intelligence/v2/transcript/sentence.py | 2 -- twilio/rest/ip_messaging/v1/credential.py | 1 - .../rest/ip_messaging/v1/service/__init__.py | 2 -- .../v1/service/channel/__init__.py | 1 - .../ip_messaging/v1/service/channel/invite.py | 2 -- .../ip_messaging/v1/service/channel/member.py | 8 ++--- .../v1/service/channel/message.py | 1 - twilio/rest/ip_messaging/v1/service/role.py | 1 - .../ip_messaging/v1/service/user/__init__.py | 2 -- .../v1/service/user/user_channel.py | 1 - twilio/rest/ip_messaging/v2/credential.py | 1 - .../rest/ip_messaging/v2/service/__init__.py | 2 -- .../rest/ip_messaging/v2/service/binding.py | 1 - .../v2/service/channel/__init__.py | 1 - .../ip_messaging/v2/service/channel/invite.py | 2 -- .../ip_messaging/v2/service/channel/member.py | 7 ++--- .../v2/service/channel/message.py | 1 - .../v2/service/channel/webhook.py | 1 - twilio/rest/ip_messaging/v2/service/role.py | 1 - .../ip_messaging/v2/service/user/__init__.py | 1 - .../v2/service/user/user_binding.py | 1 - .../v2/service/user/user_channel.py | 7 ++--- twilio/rest/lookups/v1/phone_number.py | 2 -- twilio/rest/lookups/v2/phone_number.py | 1 - twilio/rest/media/v1/media_processor.py | 1 - twilio/rest/media/v1/media_recording.py | 1 - .../rest/media/v1/player_streamer/__init__.py | 1 - .../v1/player_streamer/playback_grant.py | 2 -- .../v1/brand_registration/__init__.py | 7 ++--- .../brand_registration_otp.py | 2 -- .../v1/brand_registration/brand_vetting.py | 7 ++--- twilio/rest/messaging/v1/deactivations.py | 2 -- twilio/rest/messaging/v1/domain_certs.py | 2 -- twilio/rest/messaging/v1/domain_config.py | 2 -- .../v1/domain_config_messaging_service.py | 2 -- twilio/rest/messaging/v1/external_campaign.py | 2 -- .../v1/linkshortening_messaging_service.py | 2 -- ...ng_messaging_service_domain_association.py | 2 -- twilio/rest/messaging/v1/service/__init__.py | 7 ++--- .../rest/messaging/v1/service/alpha_sender.py | 2 -- .../messaging/v1/service/channel_sender.py | 2 -- .../rest/messaging/v1/service/phone_number.py | 2 -- .../rest/messaging/v1/service/short_code.py | 2 -- .../messaging/v1/service/us_app_to_person.py | 2 -- .../v1/service/us_app_to_person_usecase.py | 2 -- .../messaging/v1/tollfree_verification.py | 7 ++--- twilio/rest/messaging/v1/usecase.py | 2 -- twilio/rest/microvisor/v1/account_config.py | 2 -- twilio/rest/microvisor/v1/account_secret.py | 2 -- twilio/rest/microvisor/v1/app/__init__.py | 2 -- twilio/rest/microvisor/v1/app/app_manifest.py | 2 -- twilio/rest/microvisor/v1/device/__init__.py | 2 -- .../microvisor/v1/device/device_config.py | 2 -- .../microvisor/v1/device/device_secret.py | 2 -- twilio/rest/monitor/v1/alert.py | 2 -- twilio/rest/monitor/v1/event.py | 2 -- twilio/rest/notify/v1/credential.py | 1 - twilio/rest/notify/v1/service/__init__.py | 2 -- twilio/rest/notify/v1/service/binding.py | 1 - twilio/rest/notify/v1/service/notification.py | 1 - twilio/rest/numbers/v1/bulk_eligibility.py | 2 -- .../numbers/v1/porting_bulk_portability.py | 1 - twilio/rest/numbers/v1/porting_portability.py | 7 ++--- .../v2/authorization_document/__init__.py | 1 - .../dependent_hosted_number_order.py | 7 ++--- .../numbers/v2/bulk_hosted_number_order.py | 7 ++--- twilio/rest/numbers/v2/hosted_number_order.py | 1 - .../v2/regulatory_compliance/__init__.py | 1 - .../regulatory_compliance/bundle/__init__.py | 1 - .../bundle/bundle_copy.py | 1 - .../bundle/evaluation.py | 1 - .../bundle/item_assignment.py | 2 -- .../bundle/replace_items.py | 1 - .../v2/regulatory_compliance/end_user.py | 1 - .../v2/regulatory_compliance/end_user_type.py | 2 -- .../v2/regulatory_compliance/regulation.py | 1 - .../supporting_document.py | 1 - .../supporting_document_type.py | 2 -- twilio/rest/oauth/v1/device_code.py | 2 -- twilio/rest/oauth/v1/oauth.py | 2 -- twilio/rest/oauth/v1/openid_discovery.py | 2 -- twilio/rest/oauth/v1/token.py | 8 ++--- twilio/rest/oauth/v1/user_info.py | 2 -- .../deployed_devices/fleet/__init__.py | 2 -- .../deployed_devices/fleet/certificate.py | 2 -- .../deployed_devices/fleet/deployment.py | 2 -- .../preview/deployed_devices/fleet/device.py | 2 -- .../preview/deployed_devices/fleet/key.py | 2 -- .../authorization_document/__init__.py | 1 - .../dependent_hosted_number_order.py | 7 ++--- .../hosted_numbers/hosted_number_order.py | 1 - .../marketplace/available_add_on/__init__.py | 2 -- .../available_add_on_extension.py | 2 -- .../marketplace/installed_add_on/__init__.py | 2 -- .../installed_add_on_extension.py | 2 -- twilio/rest/preview/sync/service/__init__.py | 2 -- .../preview/sync/service/document/__init__.py | 2 -- .../service/document/document_permission.py | 2 -- .../sync/service/sync_list/__init__.py | 2 -- .../sync/service/sync_list/sync_list_item.py | 1 - .../service/sync_list/sync_list_permission.py | 2 -- .../preview/sync/service/sync_map/__init__.py | 2 -- .../sync/service/sync_map/sync_map_item.py | 1 - .../service/sync_map/sync_map_permission.py | 2 -- .../preview/understand/assistant/__init__.py | 8 ++--- .../assistant/assistant_fallback_actions.py | 2 -- .../assistant/assistant_initiation_actions.py | 2 -- .../preview/understand/assistant/dialogue.py | 2 -- .../assistant/field_type/__init__.py | 2 -- .../assistant/field_type/field_value.py | 2 -- .../understand/assistant/model_build.py | 1 - .../preview/understand/assistant/query.py | 2 -- .../understand/assistant/style_sheet.py | 2 -- .../understand/assistant/task/__init__.py | 2 -- .../understand/assistant/task/field.py | 2 -- .../understand/assistant/task/sample.py | 2 -- .../understand/assistant/task/task_actions.py | 2 -- .../assistant/task/task_statistics.py | 2 -- twilio/rest/preview/wireless/command.py | 2 -- twilio/rest/preview/wireless/rate_plan.py | 2 -- twilio/rest/preview/wireless/sim/__init__.py | 2 -- twilio/rest/preview/wireless/sim/usage.py | 2 -- twilio/rest/pricing/v1/messaging/__init__.py | 1 - twilio/rest/pricing/v1/messaging/country.py | 2 -- .../rest/pricing/v1/phone_number/__init__.py | 1 - .../rest/pricing/v1/phone_number/country.py | 2 -- twilio/rest/pricing/v1/voice/__init__.py | 1 - twilio/rest/pricing/v1/voice/country.py | 2 -- twilio/rest/pricing/v1/voice/number.py | 2 -- twilio/rest/pricing/v2/country.py | 2 -- twilio/rest/pricing/v2/number.py | 2 -- twilio/rest/pricing/v2/voice/__init__.py | 1 - twilio/rest/pricing/v2/voice/country.py | 2 -- twilio/rest/pricing/v2/voice/number.py | 2 -- twilio/rest/proxy/v1/service/__init__.py | 1 - twilio/rest/proxy/v1/service/phone_number.py | 2 -- .../rest/proxy/v1/service/session/__init__.py | 1 - .../proxy/v1/service/session/interaction.py | 7 ++--- .../service/session/participant/__init__.py | 2 -- .../participant/message_interaction.py | 1 - twilio/rest/proxy/v1/service/short_code.py | 2 -- twilio/rest/routes/v2/phone_number.py | 2 -- twilio/rest/routes/v2/sip_domain.py | 2 -- twilio/rest/routes/v2/trunk.py | 2 -- twilio/rest/serverless/v1/service/__init__.py | 2 -- .../serverless/v1/service/asset/__init__.py | 2 -- .../v1/service/asset/asset_version.py | 1 - .../v1/service/environment/__init__.py | 2 -- .../v1/service/environment/deployment.py | 2 -- .../serverless/v1/service/environment/log.py | 1 - .../v1/service/environment/variable.py | 2 -- .../v1/service/function/__init__.py | 2 -- .../function/function_version/__init__.py | 1 - .../function_version_content.py | 2 -- twilio/rest/studio/v1/flow/__init__.py | 1 - .../studio/v1/flow/engagement/__init__.py | 1 - .../v1/flow/engagement/engagement_context.py | 2 -- .../v1/flow/engagement/step/__init__.py | 2 -- .../v1/flow/engagement/step/step_context.py | 2 -- .../rest/studio/v1/flow/execution/__init__.py | 1 - .../v1/flow/execution/execution_context.py | 2 -- .../flow/execution/execution_step/__init__.py | 2 -- .../execution_step/execution_step_context.py | 2 -- twilio/rest/studio/v2/flow/__init__.py | 1 - .../rest/studio/v2/flow/execution/__init__.py | 1 - .../v2/flow/execution/execution_context.py | 2 -- .../flow/execution/execution_step/__init__.py | 2 -- .../execution_step/execution_step_context.py | 2 -- twilio/rest/studio/v2/flow/flow_revision.py | 1 - twilio/rest/studio/v2/flow/flow_test_user.py | 2 -- twilio/rest/studio/v2/flow_validate.py | 1 - twilio/rest/supersim/v1/esim_profile.py | 1 - twilio/rest/supersim/v1/fleet.py | 1 - twilio/rest/supersim/v1/ip_command.py | 1 - twilio/rest/supersim/v1/network.py | 2 -- .../v1/network_access_profile/__init__.py | 2 -- .../network_access_profile_network.py | 2 -- twilio/rest/supersim/v1/settings_update.py | 1 - twilio/rest/supersim/v1/sim/__init__.py | 1 - twilio/rest/supersim/v1/sim/billing_period.py | 1 - twilio/rest/supersim/v1/sim/sim_ip_address.py | 7 ++--- twilio/rest/supersim/v1/sms_command.py | 1 - twilio/rest/supersim/v1/usage_record.py | 1 - twilio/rest/sync/v1/service/__init__.py | 2 -- .../rest/sync/v1/service/document/__init__.py | 2 -- .../service/document/document_permission.py | 2 -- .../sync/v1/service/sync_list/__init__.py | 2 -- .../v1/service/sync_list/sync_list_item.py | 1 - .../service/sync_list/sync_list_permission.py | 2 -- .../rest/sync/v1/service/sync_map/__init__.py | 2 -- .../sync/v1/service/sync_map/sync_map_item.py | 1 - .../service/sync_map/sync_map_permission.py | 2 -- .../sync/v1/service/sync_stream/__init__.py | 2 -- .../v1/service/sync_stream/stream_message.py | 2 -- .../rest/taskrouter/v1/workspace/__init__.py | 7 ++--- .../rest/taskrouter/v1/workspace/activity.py | 2 -- twilio/rest/taskrouter/v1/workspace/event.py | 2 -- .../taskrouter/v1/workspace/task/__init__.py | 1 - .../v1/workspace/task/reservation.py | 1 - .../taskrouter/v1/workspace/task_channel.py | 2 -- .../v1/workspace/task_queue/__init__.py | 1 - .../task_queue_cumulative_statistics.py | 8 ++--- .../task_queue_real_time_statistics.py | 2 -- .../task_queue/task_queue_statistics.py | 2 -- .../task_queue/task_queues_statistics.py | 2 -- .../v1/workspace/worker/__init__.py | 2 -- .../v1/workspace/worker/reservation.py | 1 - .../v1/workspace/worker/worker_channel.py | 2 -- .../v1/workspace/worker/worker_statistics.py | 2 -- .../worker/workers_cumulative_statistics.py | 2 -- .../worker/workers_real_time_statistics.py | 2 -- .../v1/workspace/worker/workers_statistics.py | 2 -- .../v1/workspace/workflow/__init__.py | 2 -- .../workflow_cumulative_statistics.py | 2 -- .../workflow/workflow_real_time_statistics.py | 2 -- .../workspace/workflow/workflow_statistics.py | 2 -- .../workspace_cumulative_statistics.py | 2 -- .../workspace_real_time_statistics.py | 2 -- .../v1/workspace/workspace_statistics.py | 2 -- twilio/rest/trunking/v1/trunk/__init__.py | 7 ++--- .../rest/trunking/v1/trunk/credential_list.py | 2 -- .../v1/trunk/ip_access_control_list.py | 2 -- .../rest/trunking/v1/trunk/origination_url.py | 2 -- twilio/rest/trunking/v1/trunk/phone_number.py | 1 - twilio/rest/trunking/v1/trunk/recording.py | 1 - .../rest/trusthub/v1/compliance_inquiries.py | 2 -- .../trusthub/v1/customer_profiles/__init__.py | 1 - ...er_profiles_channel_endpoint_assignment.py | 2 -- .../customer_profiles_entity_assignments.py | 2 -- .../customer_profiles_evaluations.py | 7 ++--- twilio/rest/trusthub/v1/end_user.py | 2 -- twilio/rest/trusthub/v1/end_user_type.py | 2 -- twilio/rest/trusthub/v1/policies.py | 2 -- .../rest/trusthub/v1/supporting_document.py | 1 - .../trusthub/v1/supporting_document_type.py | 2 -- .../trusthub/v1/trust_products/__init__.py | 1 - ...st_products_channel_endpoint_assignment.py | 2 -- .../trust_products_entity_assignments.py | 2 -- .../trust_products_evaluations.py | 1 - twilio/rest/verify/v2/form.py | 1 - twilio/rest/verify/v2/safelist.py | 2 -- twilio/rest/verify/v2/service/__init__.py | 2 -- twilio/rest/verify/v2/service/access_token.py | 1 - .../rest/verify/v2/service/entity/__init__.py | 2 -- .../v2/service/entity/challenge/__init__.py | 7 ++--- .../service/entity/challenge/notification.py | 2 -- .../rest/verify/v2/service/entity/factor.py | 1 - .../verify/v2/service/entity/new_factor.py | 1 - .../v2/service/messaging_configuration.py | 2 -- .../verify/v2/service/rate_limit/__init__.py | 2 -- .../verify/v2/service/rate_limit/bucket.py | 2 -- twilio/rest/verify/v2/service/verification.py | 1 - .../verify/v2/service/verification_check.py | 1 - twilio/rest/verify/v2/service/webhook.py | 1 - twilio/rest/verify/v2/template.py | 2 -- twilio/rest/verify/v2/verification_attempt.py | 1 - .../v2/verification_attempts_summary.py | 1 - twilio/rest/video/v1/composition.py | 1 - twilio/rest/video/v1/composition_hook.py | 1 - twilio/rest/video/v1/composition_settings.py | 2 -- twilio/rest/video/v1/recording.py | 1 - twilio/rest/video/v1/recording_settings.py | 2 -- twilio/rest/video/v1/room/__init__.py | 1 - .../video/v1/room/participant/__init__.py | 1 - .../video/v1/room/participant/anonymize.py | 1 - .../v1/room/participant/published_track.py | 1 - .../v1/room/participant/subscribe_rules.py | 2 -- .../v1/room/participant/subscribed_track.py | 1 - twilio/rest/video/v1/room/recording_rules.py | 2 -- twilio/rest/video/v1/room/room_recording.py | 1 - twilio/rest/voice/v1/archived_call.py | 1 - twilio/rest/voice/v1/byoc_trunk.py | 2 -- .../voice/v1/connection_policy/__init__.py | 2 -- .../connection_policy_target.py | 2 -- .../voice/v1/dialing_permissions/__init__.py | 1 - .../bulk_country_update.py | 2 -- .../dialing_permissions/country/__init__.py | 2 -- .../country/highrisk_special_prefix.py | 2 -- .../voice/v1/dialing_permissions/settings.py | 2 -- twilio/rest/voice/v1/ip_record.py | 2 -- twilio/rest/voice/v1/source_ip_mapping.py | 2 -- twilio/rest/wireless/v1/command.py | 1 - twilio/rest/wireless/v1/rate_plan.py | 2 -- twilio/rest/wireless/v1/sim/__init__.py | 1 - twilio/rest/wireless/v1/sim/data_session.py | 2 -- twilio/rest/wireless/v1/sim/usage_record.py | 1 - twilio/rest/wireless/v1/usage_record.py | 1 - 491 files changed, 166 insertions(+), 931 deletions(-) diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index e883e66ec7..9f2d2e9634 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -8,6 +8,7 @@ https://openapi-generator.tech Do not edit the class manually. """ + from typing import TYPE_CHECKING, Optional from twilio.base.client_base import ClientBase diff --git a/twilio/rest/accounts/v1/auth_token_promotion.py b/twilio/rest/accounts/v1/auth_token_promotion.py index 0dbf1eb752..140b5b1809 100644 --- a/twilio/rest/accounts/v1/auth_token_promotion.py +++ b/twilio/rest/accounts/v1/auth_token_promotion.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class AuthTokenPromotionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for. :ivar auth_token: The promoted Auth Token that must be used to authenticate future API requests. diff --git a/twilio/rest/accounts/v1/credential/__init__.py b/twilio/rest/accounts/v1/credential/__init__.py index d76ce584f3..f2ee3c7354 100644 --- a/twilio/rest/accounts/v1/credential/__init__.py +++ b/twilio/rest/accounts/v1/credential/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/accounts/v1/credential/aws.py b/twilio/rest/accounts/v1/credential/aws.py index 0e17164ecb..b49b07507c 100644 --- a/twilio/rest/accounts/v1/credential/aws.py +++ b/twilio/rest/accounts/v1/credential/aws.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AwsInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the AWS resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AWS resource. diff --git a/twilio/rest/accounts/v1/credential/public_key.py b/twilio/rest/accounts/v1/credential/public_key.py index f78a6728c1..6ed07b4e48 100644 --- a/twilio/rest/accounts/v1/credential/public_key.py +++ b/twilio/rest/accounts/v1/credential/public_key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class PublicKeyInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the PublicKey resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Credential that the PublicKey resource belongs to. diff --git a/twilio/rest/accounts/v1/safelist.py b/twilio/rest/accounts/v1/safelist.py index fb658a677f..90b1ee819c 100644 --- a/twilio/rest/accounts/v1/safelist.py +++ b/twilio/rest/accounts/v1/safelist.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import values @@ -22,7 +21,6 @@ class SafelistInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the SafeList resource. :ivar phone_number: The phone number in SafeList. diff --git a/twilio/rest/accounts/v1/secondary_auth_token.py b/twilio/rest/accounts/v1/secondary_auth_token.py index 76b09a764e..4d2e099473 100644 --- a/twilio/rest/accounts/v1/secondary_auth_token.py +++ b/twilio/rest/accounts/v1/secondary_auth_token.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class SecondaryAuthTokenInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the secondary Auth Token was created for. :ivar date_created: The date and time in UTC when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. diff --git a/twilio/rest/api/v2010/account/__init__.py b/twilio/rest/api/v2010/account/__init__.py index fafb4f573c..97e878526b 100644 --- a/twilio/rest/api/v2010/account/__init__.py +++ b/twilio/rest/api/v2010/account/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index 224601e270..066c493fde 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class AddressInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that is responsible for the Address resource. :ivar city: The city in which the address is located. diff --git a/twilio/rest/api/v2010/account/address/dependent_phone_number.py b/twilio/rest/api/v2010/account/address/dependent_phone_number.py index 6e9ff957a0..5db5d89b58 100644 --- a/twilio/rest/api/v2010/account/address/dependent_phone_number.py +++ b/twilio/rest/api/v2010/account/address/dependent_phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/api/v2010/account/application.py b/twilio/rest/api/v2010/account/application.py index 5179d5d55b..50f0e4ad7e 100644 --- a/twilio/rest/api/v2010/account/application.py +++ b/twilio/rest/api/v2010/account/application.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ApplicationInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Application resource. :ivar api_version: The API version used to start a new TwiML session. diff --git a/twilio/rest/api/v2010/account/authorized_connect_app.py b/twilio/rest/api/v2010/account/authorized_connect_app.py index 4d71766b62..1e48d606b1 100644 --- a/twilio/rest/api/v2010/account/authorized_connect_app.py +++ b/twilio/rest/api/v2010/account/authorized_connect_app.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -70,9 +69,9 @@ def __init__( self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( payload.get("date_updated") ) - self.permissions: Optional[ - List["AuthorizedConnectAppInstance.Permission"] - ] = payload.get("permissions") + self.permissions: Optional[List["AuthorizedConnectAppInstance.Permission"]] = ( + payload.get("permissions") + ) self.uri: Optional[str] = payload.get("uri") self._solution = { diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py b/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py index 5645844cfb..32583e778d 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -40,7 +39,6 @@ class AvailablePhoneNumberCountryInstance(InstanceResource): - """ :ivar country_code: The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country. :ivar country: The name of the country. diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/local.py b/twilio/rest/api/v2010/account/available_phone_number_country/local.py index b8e0cee71a..c64739cc88 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/local.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/local.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class LocalInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py index 65e0be2b88..860983f2ab 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class MachineToMachineInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py index 5ef6f891d3..624ccbb302 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class MobileInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/national.py b/twilio/rest/api/v2010/account/available_phone_number_country/national.py index 8b2edb640c..259603284a 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/national.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/national.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class NationalInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py index d167c2f039..75b890592d 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class SharedCostInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py index aea21d7017..b46af0039c 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class TollFreeInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py index fba53f0357..b0bb213695 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class VoipInstance(InstanceResource): - """ :ivar friendly_name: A formatted version of the phone number. :ivar phone_number: The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. diff --git a/twilio/rest/api/v2010/account/balance.py b/twilio/rest/api/v2010/account/balance.py index e3c2d5e7e4..402e25d5f6 100644 --- a/twilio/rest/api/v2010/account/balance.py +++ b/twilio/rest/api/v2010/account/balance.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class BalanceInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar balance: The balance of the Account, in units specified by the unit parameter. Balance changes may not be reflected immediately. Child accounts do not contain balance information diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 7c969eff7d..f35c25f6b7 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/call/event.py b/twilio/rest/api/v2010/account/call/event.py index bb77d6510a..734d3e6cbd 100644 --- a/twilio/rest/api/v2010/account/call/event.py +++ b/twilio/rest/api/v2010/account/call/event.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,7 +22,6 @@ class EventInstance(InstanceResource): - """ :ivar request: Contains a dictionary representing the request of the call. :ivar response: Contains a dictionary representing the call response, including a list of the call events. diff --git a/twilio/rest/api/v2010/account/call/feedback.py b/twilio/rest/api/v2010/account/call/feedback.py index 8eb84a966a..342b032ebd 100644 --- a/twilio/rest/api/v2010/account/call/feedback.py +++ b/twilio/rest/api/v2010/account/call/feedback.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/call/feedback_summary.py b/twilio/rest/api/v2010/account/call/feedback_summary.py index fcfb4e0ab1..3df1660388 100644 --- a/twilio/rest/api/v2010/account/call/feedback_summary.py +++ b/twilio/rest/api/v2010/account/call/feedback_summary.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/call/notification.py b/twilio/rest/api/v2010/account/call/notification.py index 5db223c859..2f704e2c41 100644 --- a/twilio/rest/api/v2010/account/call/notification.py +++ b/twilio/rest/api/v2010/account/call/notification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class NotificationInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Call Notification resource. :ivar api_version: The API version used to create the Call Notification resource. diff --git a/twilio/rest/api/v2010/account/call/payment.py b/twilio/rest/api/v2010/account/call/payment.py index 10d00441ba..229332139e 100644 --- a/twilio/rest/api/v2010/account/call/payment.py +++ b/twilio/rest/api/v2010/account/call/payment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/call/recording.py b/twilio/rest/api/v2010/account/call/recording.py index 7ca36f3e00..4a852d67ea 100644 --- a/twilio/rest/api/v2010/account/call/recording.py +++ b/twilio/rest/api/v2010/account/call/recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/call/siprec.py b/twilio/rest/api/v2010/account/call/siprec.py index 86bfd5c6bc..d7742ed397 100644 --- a/twilio/rest/api/v2010/account/call/siprec.py +++ b/twilio/rest/api/v2010/account/call/siprec.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values diff --git a/twilio/rest/api/v2010/account/call/stream.py b/twilio/rest/api/v2010/account/call/stream.py index 1999e9379b..36b6bbe33c 100644 --- a/twilio/rest/api/v2010/account/call/stream.py +++ b/twilio/rest/api/v2010/account/call/stream.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values diff --git a/twilio/rest/api/v2010/account/call/user_defined_message.py b/twilio/rest/api/v2010/account/call/user_defined_message.py index 0beef389d7..7529a50746 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class UserDefinedMessageInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created User Defined Message. :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Message is associated with. diff --git a/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py b/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py index c34905dcdb..8d9054bc2c 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class UserDefinedMessageSubscriptionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that subscribed to the User Defined Messages. :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the User Defined Message Subscription is associated with. This refers to the Call SID that is producing the User Defined Messages. diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index 062c7013ed..cd4ec22007 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index e1c2e90b36..5b3d7857e0 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/conference/recording.py b/twilio/rest/api/v2010/account/conference/recording.py index e9ac5789cb..cd8abd95dd 100644 --- a/twilio/rest/api/v2010/account/conference/recording.py +++ b/twilio/rest/api/v2010/account/conference/recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/connect_app.py b/twilio/rest/api/v2010/account/connect_app.py index e34fbeae4d..50c4897456 100644 --- a/twilio/rest/api/v2010/account/connect_app.py +++ b/twilio/rest/api/v2010/account/connect_app.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py index 121d2f03c8..805a1b6f02 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py index 4b04d75256..a1206eaa96 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class AssignedAddOnInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource. diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py index 54b1c2a80b..1c1e4b55ca 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class AssignedAddOnExtensionInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the resource. diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/local.py b/twilio/rest/api/v2010/account/incoming_phone_number/local.py index 4af79dcf8a..0b2bd0341e 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/local.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/local.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -88,9 +87,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): self.account_sid: Optional[str] = payload.get("account_sid") self.address_sid: Optional[str] = payload.get("address_sid") - self.address_requirements: Optional[ - "LocalInstance.AddressRequirement" - ] = payload.get("address_requirements") + self.address_requirements: Optional["LocalInstance.AddressRequirement"] = ( + payload.get("address_requirements") + ) self.api_version: Optional[str] = payload.get("api_version") self.beta: Optional[bool] = payload.get("beta") self.capabilities: Optional[str] = payload.get("capabilities") @@ -116,9 +115,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): ) self.trunk_sid: Optional[str] = payload.get("trunk_sid") self.uri: Optional[str] = payload.get("uri") - self.voice_receive_mode: Optional[ - "LocalInstance.VoiceReceiveMode" - ] = payload.get("voice_receive_mode") + self.voice_receive_mode: Optional["LocalInstance.VoiceReceiveMode"] = ( + payload.get("voice_receive_mode") + ) self.voice_application_sid: Optional[str] = payload.get("voice_application_sid") self.voice_caller_id_lookup: Optional[bool] = payload.get( "voice_caller_id_lookup" diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py index 2ab5a652c5..09714c6573 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -88,9 +87,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): self.account_sid: Optional[str] = payload.get("account_sid") self.address_sid: Optional[str] = payload.get("address_sid") - self.address_requirements: Optional[ - "MobileInstance.AddressRequirement" - ] = payload.get("address_requirements") + self.address_requirements: Optional["MobileInstance.AddressRequirement"] = ( + payload.get("address_requirements") + ) self.api_version: Optional[str] = payload.get("api_version") self.beta: Optional[bool] = payload.get("beta") self.capabilities: Optional[str] = payload.get("capabilities") @@ -116,9 +115,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): ) self.trunk_sid: Optional[str] = payload.get("trunk_sid") self.uri: Optional[str] = payload.get("uri") - self.voice_receive_mode: Optional[ - "MobileInstance.VoiceReceiveMode" - ] = payload.get("voice_receive_mode") + self.voice_receive_mode: Optional["MobileInstance.VoiceReceiveMode"] = ( + payload.get("voice_receive_mode") + ) self.voice_application_sid: Optional[str] = payload.get("voice_application_sid") self.voice_caller_id_lookup: Optional[bool] = payload.get( "voice_caller_id_lookup" diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py index 3b995504a5..bb753adc09 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -88,9 +87,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): self.account_sid: Optional[str] = payload.get("account_sid") self.address_sid: Optional[str] = payload.get("address_sid") - self.address_requirements: Optional[ - "TollFreeInstance.AddressRequirement" - ] = payload.get("address_requirements") + self.address_requirements: Optional["TollFreeInstance.AddressRequirement"] = ( + payload.get("address_requirements") + ) self.api_version: Optional[str] = payload.get("api_version") self.beta: Optional[bool] = payload.get("beta") self.capabilities: Optional[str] = payload.get("capabilities") @@ -116,9 +115,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): ) self.trunk_sid: Optional[str] = payload.get("trunk_sid") self.uri: Optional[str] = payload.get("uri") - self.voice_receive_mode: Optional[ - "TollFreeInstance.VoiceReceiveMode" - ] = payload.get("voice_receive_mode") + self.voice_receive_mode: Optional["TollFreeInstance.VoiceReceiveMode"] = ( + payload.get("voice_receive_mode") + ) self.voice_application_sid: Optional[str] = payload.get("voice_application_sid") self.voice_caller_id_lookup: Optional[bool] = payload.get( "voice_caller_id_lookup" @@ -127,9 +126,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], account_sid: str): self.voice_fallback_url: Optional[str] = payload.get("voice_fallback_url") self.voice_method: Optional[str] = payload.get("voice_method") self.voice_url: Optional[str] = payload.get("voice_url") - self.emergency_status: Optional[ - "TollFreeInstance.EmergencyStatus" - ] = payload.get("emergency_status") + self.emergency_status: Optional["TollFreeInstance.EmergencyStatus"] = ( + payload.get("emergency_status") + ) self.emergency_address_sid: Optional[str] = payload.get("emergency_address_sid") self.emergency_address_status: Optional[ "TollFreeInstance.EmergencyAddressStatus" diff --git a/twilio/rest/api/v2010/account/key.py b/twilio/rest/api/v2010/account/key.py index 76c8f1d55c..e4ff85955f 100644 --- a/twilio/rest/api/v2010/account/key.py +++ b/twilio/rest/api/v2010/account/key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class KeyInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the Key resource. :ivar friendly_name: The string that you assigned to describe the resource. diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 58ea4f32b8..f84b821fd3 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/message/feedback.py b/twilio/rest/api/v2010/account/message/feedback.py index 7c371ee883..59758491ff 100644 --- a/twilio/rest/api/v2010/account/message/feedback.py +++ b/twilio/rest/api/v2010/account/message/feedback.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values diff --git a/twilio/rest/api/v2010/account/message/media.py b/twilio/rest/api/v2010/account/message/media.py index 45638e9c53..900c73a60d 100644 --- a/twilio/rest/api/v2010/account/message/media.py +++ b/twilio/rest/api/v2010/account/message/media.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class MediaInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with this Media resource. :ivar content_type: The default [MIME type](https://en.wikipedia.org/wiki/Internet_media_type) of the media, for example `image/jpeg`, `image/png`, or `image/gif`. diff --git a/twilio/rest/api/v2010/account/new_key.py b/twilio/rest/api/v2010/account/new_key.py index e7af236ebe..51581f4f86 100644 --- a/twilio/rest/api/v2010/account/new_key.py +++ b/twilio/rest/api/v2010/account/new_key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class NewKeyInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API. :ivar friendly_name: The string that you assigned to describe the resource. diff --git a/twilio/rest/api/v2010/account/new_signing_key.py b/twilio/rest/api/v2010/account/new_signing_key.py index d24e833b86..7cc7758397 100644 --- a/twilio/rest/api/v2010/account/new_signing_key.py +++ b/twilio/rest/api/v2010/account/new_signing_key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class NewSigningKeyInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the NewSigningKey resource. :ivar friendly_name: The string that you assigned to describe the resource. diff --git a/twilio/rest/api/v2010/account/notification.py b/twilio/rest/api/v2010/account/notification.py index 69e647cd4a..0892b2db65 100644 --- a/twilio/rest/api/v2010/account/notification.py +++ b/twilio/rest/api/v2010/account/notification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class NotificationInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Notification resource. :ivar api_version: The API version used to generate the notification. Can be empty for events that don't have a specific API version, such as incoming phone calls. diff --git a/twilio/rest/api/v2010/account/outgoing_caller_id.py b/twilio/rest/api/v2010/account/outgoing_caller_id.py index 90d5e472e4..a0504da872 100644 --- a/twilio/rest/api/v2010/account/outgoing_caller_id.py +++ b/twilio/rest/api/v2010/account/outgoing_caller_id.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class OutgoingCallerIdInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the OutgoingCallerId resource. :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/api/v2010/account/queue/__init__.py b/twilio/rest/api/v2010/account/queue/__init__.py index 73589708fb..5b9d212694 100644 --- a/twilio/rest/api/v2010/account/queue/__init__.py +++ b/twilio/rest/api/v2010/account/queue/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class QueueInstance(InstanceResource): - """ :ivar date_updated: The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar current_size: The number of calls currently in the queue. diff --git a/twilio/rest/api/v2010/account/queue/member.py b/twilio/rest/api/v2010/account/queue/member.py index 842a178953..9d8e26ead9 100644 --- a/twilio/rest/api/v2010/account/queue/member.py +++ b/twilio/rest/api/v2010/account/queue/member.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class MemberInstance(InstanceResource): - """ :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Member resource is associated with. :ivar date_enqueued: The date that the member was enqueued, given in RFC 2822 format. diff --git a/twilio/rest/api/v2010/account/recording/__init__.py b/twilio/rest/api/v2010/account/recording/__init__.py index 10ee3e1b90..c03c48c7a7 100644 --- a/twilio/rest/api/v2010/account/recording/__init__.py +++ b/twilio/rest/api/v2010/account/recording/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py b/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py index 79d3a71365..2e7bab3807 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/payload.py b/twilio/rest/api/v2010/account/recording/add_on_result/payload.py index 08e8822202..2b2aa7648a 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/payload.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/payload.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class PayloadInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the Recording AddOnResult Payload resource. :ivar add_on_result_sid: The SID of the AddOnResult to which the payload belongs. diff --git a/twilio/rest/api/v2010/account/recording/transcription.py b/twilio/rest/api/v2010/account/recording/transcription.py index 6aa104d427..a89b5e0ca2 100644 --- a/twilio/rest/api/v2010/account/recording/transcription.py +++ b/twilio/rest/api/v2010/account/recording/transcription.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/api/v2010/account/short_code.py b/twilio/rest/api/v2010/account/short_code.py index 831cb770af..5644f9214a 100644 --- a/twilio/rest/api/v2010/account/short_code.py +++ b/twilio/rest/api/v2010/account/short_code.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ShortCodeInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this ShortCode resource. :ivar api_version: The API version used to start a new TwiML session when an SMS message is sent to this short code. diff --git a/twilio/rest/api/v2010/account/signing_key.py b/twilio/rest/api/v2010/account/signing_key.py index e14f42c777..51ee4a409a 100644 --- a/twilio/rest/api/v2010/account/signing_key.py +++ b/twilio/rest/api/v2010/account/signing_key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class SigningKeyInstance(InstanceResource): - """ :ivar sid: :ivar friendly_name: diff --git a/twilio/rest/api/v2010/account/sip/__init__.py b/twilio/rest/api/v2010/account/sip/__init__.py index a0780cb1e4..49d5a5db4f 100644 --- a/twilio/rest/api/v2010/account/sip/__init__.py +++ b/twilio/rest/api/v2010/account/sip/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py index 08ac5bcfe6..d56f55a812 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class CredentialListInstance(InstanceResource): - """ :ivar account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) that owns this resource. :ivar date_created: The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. diff --git a/twilio/rest/api/v2010/account/sip/credential_list/credential.py b/twilio/rest/api/v2010/account/sip/credential_list/credential.py index 585950c25c..5a9dbe60bb 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/credential.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CredentialInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this resource. :ivar account_sid: The unique id of the Account that is responsible for this resource. diff --git a/twilio/rest/api/v2010/account/sip/domain/__init__.py b/twilio/rest/api/v2010/account/sip/domain/__init__.py index 29a2aaeb2a..e430836416 100644 --- a/twilio/rest/api/v2010/account/sip/domain/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -31,7 +30,6 @@ class DomainInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the SipDomain resource. :ivar api_version: The API version used to process the call. diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py index 282d3b64e5..19935cf604 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py index 9d822b4fe9..8f75485248 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional @@ -50,9 +49,9 @@ def __init__(self, version: Version, account_sid: str, domain_sid: str): ) ) - self._credential_list_mappings: Optional[ - AuthCallsCredentialListMappingList - ] = None + self._credential_list_mappings: Optional[AuthCallsCredentialListMappingList] = ( + None + ) self._ip_access_control_list_mappings: Optional[ AuthCallsIpAccessControlListMappingList ] = None diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py index c9cade64f9..05935b4173 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AuthCallsCredentialListMappingInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource. :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py index f83393c377..b4ad167afe 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AuthCallsIpAccessControlListMappingInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlListMapping resource. :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py index 41c1805ff2..20229d8990 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py index a63a6e3290..4881459574 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AuthRegistrationsCredentialListMappingInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialListMapping resource. :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py index 248e0ca37b..d951074aaa 100644 --- a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CredentialListMappingInstance(InstanceResource): - """ :ivar account_sid: The unique id of the Account that is responsible for this resource. :ivar date_created: The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. diff --git a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py index cfe65e99dc..b534af960b 100644 --- a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class IpAccessControlListMappingInstance(InstanceResource): - """ :ivar account_sid: The unique id of the Account that is responsible for this resource. :ivar date_created: The date that this resource was created, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py index fac56d8573..38ea58900d 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class IpAccessControlListInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this resource. :ivar account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) that owns this resource. diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py index 2ce7f69f18..0f96c154b6 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class IpAddressInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this resource. :ivar account_sid: The unique id of the Account that is responsible for this resource. diff --git a/twilio/rest/api/v2010/account/token.py b/twilio/rest/api/v2010/account/token.py index 744bedd295..d726fe7094 100644 --- a/twilio/rest/api/v2010/account/token.py +++ b/twilio/rest/api/v2010/account/token.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class TokenInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Token resource. :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/api/v2010/account/transcription.py b/twilio/rest/api/v2010/account/transcription.py index 2baa8af865..b757351ae4 100644 --- a/twilio/rest/api/v2010/account/transcription.py +++ b/twilio/rest/api/v2010/account/transcription.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/api/v2010/account/usage/__init__.py b/twilio/rest/api/v2010/account/usage/__init__.py index 3f3f2c76fb..0e7d123eeb 100644 --- a/twilio/rest/api/v2010/account/usage/__init__.py +++ b/twilio/rest/api/v2010/account/usage/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/api/v2010/account/usage/record/__init__.py b/twilio/rest/api/v2010/account/usage/record/__init__.py index 356526f854..dab521ac97 100644 --- a/twilio/rest/api/v2010/account/usage/record/__init__.py +++ b/twilio/rest/api/v2010/account/usage/record/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/usage/record/all_time.py b/twilio/rest/api/v2010/account/usage/record/all_time.py index e61511d41e..a40bdcbb72 100644 --- a/twilio/rest/api/v2010/account/usage/record/all_time.py +++ b/twilio/rest/api/v2010/account/usage/record/all_time.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/usage/record/daily.py b/twilio/rest/api/v2010/account/usage/record/daily.py index 783a16ac81..5716e1c45e 100644 --- a/twilio/rest/api/v2010/account/usage/record/daily.py +++ b/twilio/rest/api/v2010/account/usage/record/daily.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/usage/record/last_month.py b/twilio/rest/api/v2010/account/usage/record/last_month.py index 22ed568cf0..2c61b57137 100644 --- a/twilio/rest/api/v2010/account/usage/record/last_month.py +++ b/twilio/rest/api/v2010/account/usage/record/last_month.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/usage/record/monthly.py b/twilio/rest/api/v2010/account/usage/record/monthly.py index b64ef27f74..aa397d46b3 100644 --- a/twilio/rest/api/v2010/account/usage/record/monthly.py +++ b/twilio/rest/api/v2010/account/usage/record/monthly.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/usage/record/this_month.py b/twilio/rest/api/v2010/account/usage/record/this_month.py index 3515831260..4b11038ca9 100644 --- a/twilio/rest/api/v2010/account/usage/record/this_month.py +++ b/twilio/rest/api/v2010/account/usage/record/this_month.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/usage/record/today.py b/twilio/rest/api/v2010/account/usage/record/today.py index 9b47ad6969..32ca2f48ff 100644 --- a/twilio/rest/api/v2010/account/usage/record/today.py +++ b/twilio/rest/api/v2010/account/usage/record/today.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/usage/record/yearly.py b/twilio/rest/api/v2010/account/usage/record/yearly.py index b53ae265af..3e83d5bc7a 100644 --- a/twilio/rest/api/v2010/account/usage/record/yearly.py +++ b/twilio/rest/api/v2010/account/usage/record/yearly.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/usage/record/yesterday.py b/twilio/rest/api/v2010/account/usage/record/yesterday.py index 4a7e246f0f..f9e7f41e94 100644 --- a/twilio/rest/api/v2010/account/usage/record/yesterday.py +++ b/twilio/rest/api/v2010/account/usage/record/yesterday.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/api/v2010/account/usage/trigger.py b/twilio/rest/api/v2010/account/usage/trigger.py index bd165916e2..fe070c356d 100644 --- a/twilio/rest/api/v2010/account/usage/trigger.py +++ b/twilio/rest/api/v2010/account/usage/trigger.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/api/v2010/account/validation_request.py b/twilio/rest/api/v2010/account/validation_request.py index 84ef8ee253..922cc25c85 100644 --- a/twilio/rest/api/v2010/account/validation_request.py +++ b/twilio/rest/api/v2010/account/validation_request.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values @@ -22,7 +21,6 @@ class ValidationRequestInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for the Caller ID. :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Caller ID is associated with. diff --git a/twilio/rest/autopilot/v1/assistant/__init__.py b/twilio/rest/autopilot/v1/assistant/__init__.py index a25268fc45..8ac157ed6e 100644 --- a/twilio/rest/autopilot/v1/assistant/__init__.py +++ b/twilio/rest/autopilot/v1/assistant/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -32,7 +31,6 @@ class AssistantInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/autopilot/v1/assistant/defaults.py b/twilio/rest/autopilot/v1/assistant/defaults.py index 0db77b8417..f460301071 100644 --- a/twilio/rest/autopilot/v1/assistant/defaults.py +++ b/twilio/rest/autopilot/v1/assistant/defaults.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class DefaultsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Defaults resource. :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. diff --git a/twilio/rest/autopilot/v1/assistant/dialogue.py b/twilio/rest/autopilot/v1/assistant/dialogue.py index 6e06f4ff2b..0630694fb5 100644 --- a/twilio/rest/autopilot/v1/assistant/dialogue.py +++ b/twilio/rest/autopilot/v1/assistant/dialogue.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class DialogueInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Dialogue resource. :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. diff --git a/twilio/rest/autopilot/v1/assistant/field_type/__init__.py b/twilio/rest/autopilot/v1/assistant/field_type/__init__.py index 4639a6e962..ce9f8ba349 100644 --- a/twilio/rest/autopilot/v1/assistant/field_type/__init__.py +++ b/twilio/rest/autopilot/v1/assistant/field_type/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class FieldTypeInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the FieldType resource. :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/autopilot/v1/assistant/field_type/field_value.py b/twilio/rest/autopilot/v1/assistant/field_type/field_value.py index 38cb71161f..4180f31681 100644 --- a/twilio/rest/autopilot/v1/assistant/field_type/field_value.py +++ b/twilio/rest/autopilot/v1/assistant/field_type/field_value.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class FieldValueInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the FieldValue resource. :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/autopilot/v1/assistant/model_build.py b/twilio/rest/autopilot/v1/assistant/model_build.py index ccfb8a1c36..f3c4b708af 100644 --- a/twilio/rest/autopilot/v1/assistant/model_build.py +++ b/twilio/rest/autopilot/v1/assistant/model_build.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/autopilot/v1/assistant/query.py b/twilio/rest/autopilot/v1/assistant/query.py index 500f6bb7f7..0d4286d50d 100644 --- a/twilio/rest/autopilot/v1/assistant/query.py +++ b/twilio/rest/autopilot/v1/assistant/query.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class QueryInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Query resource. :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/autopilot/v1/assistant/style_sheet.py b/twilio/rest/autopilot/v1/assistant/style_sheet.py index 980ab40111..54a0533e27 100644 --- a/twilio/rest/autopilot/v1/assistant/style_sheet.py +++ b/twilio/rest/autopilot/v1/assistant/style_sheet.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class StyleSheetInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the StyleSheet resource. :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. diff --git a/twilio/rest/autopilot/v1/assistant/task/__init__.py b/twilio/rest/autopilot/v1/assistant/task/__init__.py index c90b412acf..7efae45947 100644 --- a/twilio/rest/autopilot/v1/assistant/task/__init__.py +++ b/twilio/rest/autopilot/v1/assistant/task/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -28,7 +27,6 @@ class TaskInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Task resource. :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/autopilot/v1/assistant/task/field.py b/twilio/rest/autopilot/v1/assistant/task/field.py index dc48c44659..bf256ab4d4 100644 --- a/twilio/rest/autopilot/v1/assistant/task/field.py +++ b/twilio/rest/autopilot/v1/assistant/task/field.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class FieldInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Field resource. :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/autopilot/v1/assistant/task/sample.py b/twilio/rest/autopilot/v1/assistant/task/sample.py index ce413aeaa1..e61906bf23 100644 --- a/twilio/rest/autopilot/v1/assistant/task/sample.py +++ b/twilio/rest/autopilot/v1/assistant/task/sample.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class SampleInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sample resource. :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/autopilot/v1/assistant/task/task_actions.py b/twilio/rest/autopilot/v1/assistant/task/task_actions.py index 01d4efa2c1..46f5f20d8e 100644 --- a/twilio/rest/autopilot/v1/assistant/task/task_actions.py +++ b/twilio/rest/autopilot/v1/assistant/task/task_actions.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class TaskActionsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskActions resource. :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. diff --git a/twilio/rest/autopilot/v1/assistant/task/task_statistics.py b/twilio/rest/autopilot/v1/assistant/task/task_statistics.py index 3d92b05cb9..c0749fabc8 100644 --- a/twilio/rest/autopilot/v1/assistant/task/task_statistics.py +++ b/twilio/rest/autopilot/v1/assistant/task/task_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import deserialize from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class TaskStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskStatistics resource. :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. diff --git a/twilio/rest/autopilot/v1/assistant/webhook.py b/twilio/rest/autopilot/v1/assistant/webhook.py index 8a3e3da2f6..13fcadb79d 100644 --- a/twilio/rest/autopilot/v1/assistant/webhook.py +++ b/twilio/rest/autopilot/v1/assistant/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class WebhookInstance(InstanceResource): - """ :ivar url: The absolute URL of the Webhook resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Webhook resource. diff --git a/twilio/rest/autopilot/v1/restore_assistant.py b/twilio/rest/autopilot/v1/restore_assistant.py index aae8dd3f8f..7b6daf8ec1 100644 --- a/twilio/rest/autopilot/v1/restore_assistant.py +++ b/twilio/rest/autopilot/v1/restore_assistant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class RestoreAssistantInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. :ivar sid: The unique string that we created to identify the Assistant resource. diff --git a/twilio/rest/bulkexports/v1/export/__init__.py b/twilio/rest/bulkexports/v1/export/__init__.py index 03d6c449ea..938bf8d882 100644 --- a/twilio/rest/bulkexports/v1/export/__init__.py +++ b/twilio/rest/bulkexports/v1/export/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -25,7 +24,6 @@ class ExportInstance(InstanceResource): - """ :ivar resource_type: The type of communication – Messages, Calls, Conferences, and Participants :ivar url: The URL of this resource. diff --git a/twilio/rest/bulkexports/v1/export/day.py b/twilio/rest/bulkexports/v1/export/day.py index 26daf02ed1..af03131372 100644 --- a/twilio/rest/bulkexports/v1/export/day.py +++ b/twilio/rest/bulkexports/v1/export/day.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class DayInstance(InstanceResource): - """ :ivar redirect_to: :ivar day: The ISO 8601 format date of the resources in the file, for a UTC day diff --git a/twilio/rest/bulkexports/v1/export/export_custom_job.py b/twilio/rest/bulkexports/v1/export/export_custom_job.py index 2c571489d6..da66ae08d0 100644 --- a/twilio/rest/bulkexports/v1/export/export_custom_job.py +++ b/twilio/rest/bulkexports/v1/export/export_custom_job.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,7 +22,6 @@ class ExportCustomJobInstance(InstanceResource): - """ :ivar friendly_name: The friendly name specified when creating the job :ivar resource_type: The type of communication – Messages, Calls, Conferences, and Participants diff --git a/twilio/rest/bulkexports/v1/export/job.py b/twilio/rest/bulkexports/v1/export/job.py index 64c3c0f46f..65cebd0e55 100644 --- a/twilio/rest/bulkexports/v1/export/job.py +++ b/twilio/rest/bulkexports/v1/export/job.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class JobInstance(InstanceResource): - """ :ivar resource_type: The type of communication – Messages, Calls, Conferences, and Participants :ivar friendly_name: The friendly name specified when creating the job diff --git a/twilio/rest/bulkexports/v1/export_configuration.py b/twilio/rest/bulkexports/v1/export_configuration.py index 28e64c5cdc..bfb6307f59 100644 --- a/twilio/rest/bulkexports/v1/export_configuration.py +++ b/twilio/rest/bulkexports/v1/export_configuration.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class ExportConfigurationInstance(InstanceResource): - """ :ivar enabled: If true, Twilio will automatically generate every day's file when the day is over. :ivar webhook_url: Stores the URL destination for the method specified in webhook_method. diff --git a/twilio/rest/chat/v1/credential.py b/twilio/rest/chat/v1/credential.py index ecdf1d58e2..9e6503f46a 100644 --- a/twilio/rest/chat/v1/credential.py +++ b/twilio/rest/chat/v1/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/chat/v1/service/__init__.py b/twilio/rest/chat/v1/service/__init__.py index f8a377057c..b6feae0cc4 100644 --- a/twilio/rest/chat/v1/service/__init__.py +++ b/twilio/rest/chat/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Service resource. diff --git a/twilio/rest/chat/v1/service/channel/__init__.py b/twilio/rest/chat/v1/service/channel/__init__.py index e04d95a433..fbfe141fce 100644 --- a/twilio/rest/chat/v1/service/channel/__init__.py +++ b/twilio/rest/chat/v1/service/channel/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/chat/v1/service/channel/invite.py b/twilio/rest/chat/v1/service/channel/invite.py index e3dbbae07f..639c4c5091 100644 --- a/twilio/rest/chat/v1/service/channel/invite.py +++ b/twilio/rest/chat/v1/service/channel/invite.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class InviteInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Invite resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Invite resource. diff --git a/twilio/rest/chat/v1/service/channel/member.py b/twilio/rest/chat/v1/service/channel/member.py index 62e3912bf9..6880f064e8 100644 --- a/twilio/rest/chat/v1/service/channel/member.py +++ b/twilio/rest/chat/v1/service/channel/member.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class MemberInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Member resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the Member resource. @@ -64,9 +62,9 @@ def __init__( self.last_consumed_message_index: Optional[int] = deserialize.integer( payload.get("last_consumed_message_index") ) - self.last_consumption_timestamp: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + self.last_consumption_timestamp: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + ) self.url: Optional[str] = payload.get("url") self._solution = { diff --git a/twilio/rest/chat/v1/service/channel/message.py b/twilio/rest/chat/v1/service/channel/message.py index ad45b6eb59..bf4db73dd8 100644 --- a/twilio/rest/chat/v1/service/channel/message.py +++ b/twilio/rest/chat/v1/service/channel/message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/chat/v1/service/role.py b/twilio/rest/chat/v1/service/role.py index e1a5e5cd53..e83e30fd5b 100644 --- a/twilio/rest/chat/v1/service/role.py +++ b/twilio/rest/chat/v1/service/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/chat/v1/service/user/__init__.py b/twilio/rest/chat/v1/service/user/__init__.py index fd6e9d6c44..ba5d038e2a 100644 --- a/twilio/rest/chat/v1/service/user/__init__.py +++ b/twilio/rest/chat/v1/service/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class UserInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the User resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/api/rest/account) that created the User resource. diff --git a/twilio/rest/chat/v1/service/user/user_channel.py b/twilio/rest/chat/v1/service/user/user_channel.py index 353f6bf68f..6a781e9ff5 100644 --- a/twilio/rest/chat/v1/service/user/user_channel.py +++ b/twilio/rest/chat/v1/service/user/user_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/chat/v2/credential.py b/twilio/rest/chat/v2/credential.py index 4a3df30e93..1c2f8a5cf8 100644 --- a/twilio/rest/chat/v2/credential.py +++ b/twilio/rest/chat/v2/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/chat/v2/service/__init__.py b/twilio/rest/chat/v2/service/__init__.py index 208805c7b7..d7ba975bd0 100644 --- a/twilio/rest/chat/v2/service/__init__.py +++ b/twilio/rest/chat/v2/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -28,7 +27,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. diff --git a/twilio/rest/chat/v2/service/binding.py b/twilio/rest/chat/v2/service/binding.py index 424ad98c0c..cf792202c3 100644 --- a/twilio/rest/chat/v2/service/binding.py +++ b/twilio/rest/chat/v2/service/binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/chat/v2/service/channel/__init__.py b/twilio/rest/chat/v2/service/channel/__init__.py index 82fc71f80b..421d2a7df8 100644 --- a/twilio/rest/chat/v2/service/channel/__init__.py +++ b/twilio/rest/chat/v2/service/channel/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/chat/v2/service/channel/invite.py b/twilio/rest/chat/v2/service/channel/invite.py index 3b89e94f85..3c6ed82443 100644 --- a/twilio/rest/chat/v2/service/channel/invite.py +++ b/twilio/rest/chat/v2/service/channel/invite.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class InviteInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Invite resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Invite resource. diff --git a/twilio/rest/chat/v2/service/channel/member.py b/twilio/rest/chat/v2/service/channel/member.py index aa03d8bac3..689233b285 100644 --- a/twilio/rest/chat/v2/service/channel/member.py +++ b/twilio/rest/chat/v2/service/channel/member.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -68,9 +67,9 @@ def __init__( self.last_consumed_message_index: Optional[int] = deserialize.integer( payload.get("last_consumed_message_index") ) - self.last_consumption_timestamp: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + self.last_consumption_timestamp: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + ) self.url: Optional[str] = payload.get("url") self.attributes: Optional[str] = payload.get("attributes") diff --git a/twilio/rest/chat/v2/service/channel/message.py b/twilio/rest/chat/v2/service/channel/message.py index 07f6a9dc90..847f063dcc 100644 --- a/twilio/rest/chat/v2/service/channel/message.py +++ b/twilio/rest/chat/v2/service/channel/message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/chat/v2/service/channel/webhook.py b/twilio/rest/chat/v2/service/channel/webhook.py index 6e05e41742..072fe1cba1 100644 --- a/twilio/rest/chat/v2/service/channel/webhook.py +++ b/twilio/rest/chat/v2/service/channel/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/chat/v2/service/role.py b/twilio/rest/chat/v2/service/role.py index 7f77ee6e4b..4fddd4c9ef 100644 --- a/twilio/rest/chat/v2/service/role.py +++ b/twilio/rest/chat/v2/service/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/chat/v2/service/user/__init__.py b/twilio/rest/chat/v2/service/user/__init__.py index 9977023e7f..bfb71480c9 100644 --- a/twilio/rest/chat/v2/service/user/__init__.py +++ b/twilio/rest/chat/v2/service/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/chat/v2/service/user/user_binding.py b/twilio/rest/chat/v2/service/user/user_binding.py index 5ea1628840..ef934a6d3e 100644 --- a/twilio/rest/chat/v2/service/user/user_binding.py +++ b/twilio/rest/chat/v2/service/user/user_binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/chat/v2/service/user/user_channel.py b/twilio/rest/chat/v2/service/user/user_channel.py index 2f72e8c59c..94b9ddbd70 100644 --- a/twilio/rest/chat/v2/service/user/user_channel.py +++ b/twilio/rest/chat/v2/service/user/user_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -77,9 +76,9 @@ def __init__( ) self.links: Optional[Dict[str, object]] = payload.get("links") self.url: Optional[str] = payload.get("url") - self.notification_level: Optional[ - "UserChannelInstance.NotificationLevel" - ] = payload.get("notification_level") + self.notification_level: Optional["UserChannelInstance.NotificationLevel"] = ( + payload.get("notification_level") + ) self._solution = { "service_sid": service_sid, diff --git a/twilio/rest/chat/v3/channel.py b/twilio/rest/chat/v3/channel.py index 001334e854..92ba531edc 100644 --- a/twilio/rest/chat/v3/channel.py +++ b/twilio/rest/chat/v3/channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index b0eaaa0fad..87ed5b58e0 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class ContentInstance(InstanceResource): - """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index ccd3b96d84..31466a4e91 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class ApprovalFetchInstance(InstanceResource): - """ :ivar sid: The unique string that that we created to identify the Content resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. diff --git a/twilio/rest/content/v1/content_and_approvals.py b/twilio/rest/content/v1/content_and_approvals.py index 914376ea0b..b826a1b289 100644 --- a/twilio/rest/content/v1/content_and_approvals.py +++ b/twilio/rest/content/v1/content_and_approvals.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ContentAndApprovalsInstance(InstanceResource): - """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/content/v1/legacy_content.py b/twilio/rest/content/v1/legacy_content.py index 9a1370b98a..15ea2f9398 100644 --- a/twilio/rest/content/v1/legacy_content.py +++ b/twilio/rest/content/v1/legacy_content.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class LegacyContentInstance(InstanceResource): - """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index ccaf87dee6..17310d8e3b 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/configuration/__init__.py b/twilio/rest/conversations/v1/configuration/__init__.py index afd5a6cfa1..64a5a6b1b8 100644 --- a/twilio/rest/conversations/v1/configuration/__init__.py +++ b/twilio/rest/conversations/v1/configuration/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -24,7 +23,6 @@ class ConfigurationInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this configuration. :ivar default_chat_service_sid: The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) used when creating a conversation. diff --git a/twilio/rest/conversations/v1/configuration/webhook.py b/twilio/rest/conversations/v1/configuration/webhook.py index 4b2f1c1d7c..d357acbeaf 100644 --- a/twilio/rest/conversations/v1/configuration/webhook.py +++ b/twilio/rest/conversations/v1/configuration/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext diff --git a/twilio/rest/conversations/v1/conversation/__init__.py b/twilio/rest/conversations/v1/conversation/__init__.py index 9194b30934..d3ea6dfb1f 100644 --- a/twilio/rest/conversations/v1/conversation/__init__.py +++ b/twilio/rest/conversations/v1/conversation/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/conversation/message/__init__.py b/twilio/rest/conversations/v1/conversation/message/__init__.py index 3250a59dd8..87b3fd048b 100644 --- a/twilio/rest/conversations/v1/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/conversation/message/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py b/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py index 3949c67032..f8b74d74bc 100644 --- a/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py +++ b/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/conversations/v1/conversation/participant.py b/twilio/rest/conversations/v1/conversation/participant.py index e9cb028ff3..2a9c45a594 100644 --- a/twilio/rest/conversations/v1/conversation/participant.py +++ b/twilio/rest/conversations/v1/conversation/participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/conversation/webhook.py b/twilio/rest/conversations/v1/conversation/webhook.py index 8b7493388a..cb7690cfce 100644 --- a/twilio/rest/conversations/v1/conversation/webhook.py +++ b/twilio/rest/conversations/v1/conversation/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/credential.py b/twilio/rest/conversations/v1/credential.py index 0b6dfd8289..1a5c0fb951 100644 --- a/twilio/rest/conversations/v1/credential.py +++ b/twilio/rest/conversations/v1/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/conversations/v1/participant_conversation.py b/twilio/rest/conversations/v1/participant_conversation.py index 0a7d0634b9..e61383c32f 100644 --- a/twilio/rest/conversations/v1/participant_conversation.py +++ b/twilio/rest/conversations/v1/participant_conversation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -69,18 +68,18 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.conversation_attributes: Optional[str] = payload.get( "conversation_attributes" ) - self.conversation_date_created: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("conversation_date_created")) - self.conversation_date_updated: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("conversation_date_updated")) + self.conversation_date_created: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("conversation_date_created")) + ) + self.conversation_date_updated: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("conversation_date_updated")) + ) self.conversation_created_by: Optional[str] = payload.get( "conversation_created_by" ) - self.conversation_state: Optional[ - "ParticipantConversationInstance.State" - ] = payload.get("conversation_state") + self.conversation_state: Optional["ParticipantConversationInstance.State"] = ( + payload.get("conversation_state") + ) self.conversation_timers: Optional[Dict[str, object]] = payload.get( "conversation_timers" ) diff --git a/twilio/rest/conversations/v1/role.py b/twilio/rest/conversations/v1/role.py index fb7626ce0c..4a8dccfaab 100644 --- a/twilio/rest/conversations/v1/role.py +++ b/twilio/rest/conversations/v1/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/service/__init__.py b/twilio/rest/conversations/v1/service/__init__.py index ad4066710f..e8bf95e970 100644 --- a/twilio/rest/conversations/v1/service/__init__.py +++ b/twilio/rest/conversations/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -32,7 +31,6 @@ class ServiceInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this service. :ivar sid: A 34 character string that uniquely identifies this resource. diff --git a/twilio/rest/conversations/v1/service/binding.py b/twilio/rest/conversations/v1/service/binding.py index 264ef0490c..5a9f2d1e2a 100644 --- a/twilio/rest/conversations/v1/service/binding.py +++ b/twilio/rest/conversations/v1/service/binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/service/configuration/__init__.py b/twilio/rest/conversations/v1/service/configuration/__init__.py index f5e96dc279..4f21918828 100644 --- a/twilio/rest/conversations/v1/service/configuration/__init__.py +++ b/twilio/rest/conversations/v1/service/configuration/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -27,7 +26,6 @@ class ConfigurationInstance(InstanceResource): - """ :ivar chat_service_sid: The unique string that we created to identify the Service configuration resource. :ivar default_conversation_creator_role_sid: The conversation-level role assigned to a conversation creator when they join a new conversation. See [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. diff --git a/twilio/rest/conversations/v1/service/configuration/notification.py b/twilio/rest/conversations/v1/service/configuration/notification.py index 388f310e9d..cc79c53620 100644 --- a/twilio/rest/conversations/v1/service/configuration/notification.py +++ b/twilio/rest/conversations/v1/service/configuration/notification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class NotificationInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this configuration. :ivar chat_service_sid: The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Configuration applies to. diff --git a/twilio/rest/conversations/v1/service/configuration/webhook.py b/twilio/rest/conversations/v1/service/configuration/webhook.py index 6152c44333..7d6ad0df06 100644 --- a/twilio/rest/conversations/v1/service/configuration/webhook.py +++ b/twilio/rest/conversations/v1/service/configuration/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext diff --git a/twilio/rest/conversations/v1/service/conversation/__init__.py b/twilio/rest/conversations/v1/service/conversation/__init__.py index 3fe88d5564..8f072a653c 100644 --- a/twilio/rest/conversations/v1/service/conversation/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/service/conversation/message/__init__.py b/twilio/rest/conversations/v1/service/conversation/message/__init__.py index 3c42151531..d6bc253b67 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/message/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py b/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py index 01e6f392f2..73c197cd72 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py +++ b/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/conversations/v1/service/conversation/participant.py b/twilio/rest/conversations/v1/service/conversation/participant.py index 70345aed67..a2f4497dbd 100644 --- a/twilio/rest/conversations/v1/service/conversation/participant.py +++ b/twilio/rest/conversations/v1/service/conversation/participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/service/conversation/webhook.py b/twilio/rest/conversations/v1/service/conversation/webhook.py index 88e848f351..cd3b8a73d7 100644 --- a/twilio/rest/conversations/v1/service/conversation/webhook.py +++ b/twilio/rest/conversations/v1/service/conversation/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/service/participant_conversation.py b/twilio/rest/conversations/v1/service/participant_conversation.py index b4de04f277..156fc65343 100644 --- a/twilio/rest/conversations/v1/service/participant_conversation.py +++ b/twilio/rest/conversations/v1/service/participant_conversation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -71,18 +70,18 @@ def __init__( self.conversation_attributes: Optional[str] = payload.get( "conversation_attributes" ) - self.conversation_date_created: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("conversation_date_created")) - self.conversation_date_updated: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("conversation_date_updated")) + self.conversation_date_created: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("conversation_date_created")) + ) + self.conversation_date_updated: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("conversation_date_updated")) + ) self.conversation_created_by: Optional[str] = payload.get( "conversation_created_by" ) - self.conversation_state: Optional[ - "ParticipantConversationInstance.State" - ] = payload.get("conversation_state") + self.conversation_state: Optional["ParticipantConversationInstance.State"] = ( + payload.get("conversation_state") + ) self.conversation_timers: Optional[Dict[str, object]] = payload.get( "conversation_timers" ) diff --git a/twilio/rest/conversations/v1/service/role.py b/twilio/rest/conversations/v1/service/role.py index 2ae2c16fb1..dfd7391c69 100644 --- a/twilio/rest/conversations/v1/service/role.py +++ b/twilio/rest/conversations/v1/service/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/conversations/v1/service/user/__init__.py b/twilio/rest/conversations/v1/service/user/__init__.py index 10747179bf..7d8be91f86 100644 --- a/twilio/rest/conversations/v1/service/user/__init__.py +++ b/twilio/rest/conversations/v1/service/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/conversations/v1/service/user/user_conversation.py b/twilio/rest/conversations/v1/service/user/user_conversation.py index 40e02f746a..625d219d49 100644 --- a/twilio/rest/conversations/v1/service/user/user_conversation.py +++ b/twilio/rest/conversations/v1/service/user/user_conversation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -76,9 +75,9 @@ def __init__( self.participant_sid: Optional[str] = payload.get("participant_sid") self.user_sid: Optional[str] = payload.get("user_sid") self.friendly_name: Optional[str] = payload.get("friendly_name") - self.conversation_state: Optional[ - "UserConversationInstance.State" - ] = payload.get("conversation_state") + self.conversation_state: Optional["UserConversationInstance.State"] = ( + payload.get("conversation_state") + ) self.timers: Optional[Dict[str, object]] = payload.get("timers") self.attributes: Optional[str] = payload.get("attributes") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( diff --git a/twilio/rest/conversations/v1/user/__init__.py b/twilio/rest/conversations/v1/user/__init__.py index 72a285885e..e983da13a3 100644 --- a/twilio/rest/conversations/v1/user/__init__.py +++ b/twilio/rest/conversations/v1/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/conversations/v1/user/user_conversation.py b/twilio/rest/conversations/v1/user/user_conversation.py index 4134066afd..d7d06a6ee6 100644 --- a/twilio/rest/conversations/v1/user/user_conversation.py +++ b/twilio/rest/conversations/v1/user/user_conversation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -75,9 +74,9 @@ def __init__( self.participant_sid: Optional[str] = payload.get("participant_sid") self.user_sid: Optional[str] = payload.get("user_sid") self.friendly_name: Optional[str] = payload.get("friendly_name") - self.conversation_state: Optional[ - "UserConversationInstance.State" - ] = payload.get("conversation_state") + self.conversation_state: Optional["UserConversationInstance.State"] = ( + payload.get("conversation_state") + ) self.timers: Optional[Dict[str, object]] = payload.get("timers") self.attributes: Optional[str] = payload.get("attributes") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( diff --git a/twilio/rest/events/v1/event_type.py b/twilio/rest/events/v1/event_type.py index beaeed332b..451c74d2a8 100644 --- a/twilio/rest/events/v1/event_type.py +++ b/twilio/rest/events/v1/event_type.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class EventTypeInstance(InstanceResource): - """ :ivar type: A string that uniquely identifies this Event Type. :ivar schema_id: A string that uniquely identifies the Schema this Event Type adheres to. diff --git a/twilio/rest/events/v1/schema/__init__.py b/twilio/rest/events/v1/schema/__init__.py index 5bd099d56b..22383e76d5 100644 --- a/twilio/rest/events/v1/schema/__init__.py +++ b/twilio/rest/events/v1/schema/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize @@ -25,7 +24,6 @@ class SchemaInstance(InstanceResource): - """ :ivar id: The unique identifier of the schema. Each schema can have multiple versions, that share the same id. :ivar url: The URL of this resource. @@ -42,9 +40,9 @@ def __init__( self.id: Optional[str] = payload.get("id") self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") - self.latest_version_date_created: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("latest_version_date_created")) + self.latest_version_date_created: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("latest_version_date_created")) + ) self.latest_version: Optional[int] = deserialize.integer( payload.get("latest_version") ) diff --git a/twilio/rest/events/v1/schema/schema_version.py b/twilio/rest/events/v1/schema/schema_version.py index 823aefbf73..58c8207cad 100644 --- a/twilio/rest/events/v1/schema/schema_version.py +++ b/twilio/rest/events/v1/schema/schema_version.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class SchemaVersionInstance(InstanceResource): - """ :ivar id: The unique identifier of the schema. Each schema can have multiple versions, that share the same id. :ivar schema_version: The version of this schema. diff --git a/twilio/rest/events/v1/sink/__init__.py b/twilio/rest/events/v1/sink/__init__.py index 5a7626ad83..51d25b800a 100644 --- a/twilio/rest/events/v1/sink/__init__.py +++ b/twilio/rest/events/v1/sink/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/events/v1/sink/sink_test.py b/twilio/rest/events/v1/sink/sink_test.py index c85c422e7b..3b49a36cfa 100644 --- a/twilio/rest/events/v1/sink/sink_test.py +++ b/twilio/rest/events/v1/sink/sink_test.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class SinkTestInstance(InstanceResource): - """ :ivar result: Feedback indicating whether the test event was generated. """ diff --git a/twilio/rest/events/v1/sink/sink_validate.py b/twilio/rest/events/v1/sink/sink_validate.py index 8539a1ef41..be24c8869c 100644 --- a/twilio/rest/events/v1/sink/sink_validate.py +++ b/twilio/rest/events/v1/sink/sink_validate.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import values @@ -22,7 +21,6 @@ class SinkValidateInstance(InstanceResource): - """ :ivar result: Feedback indicating whether the given Sink was validated. """ diff --git a/twilio/rest/events/v1/subscription/__init__.py b/twilio/rest/events/v1/subscription/__init__.py index 458177d487..5b0651a011 100644 --- a/twilio/rest/events/v1/subscription/__init__.py +++ b/twilio/rest/events/v1/subscription/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -25,7 +24,6 @@ class SubscriptionInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar sid: A 34 character string that uniquely identifies this Subscription. diff --git a/twilio/rest/events/v1/subscription/subscribed_event.py b/twilio/rest/events/v1/subscription/subscribed_event.py index f45fe0b2e0..03017f0dd3 100644 --- a/twilio/rest/events/v1/subscription/subscribed_event.py +++ b/twilio/rest/events/v1/subscription/subscribed_event.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SubscribedEventInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar type: Type of event being subscribed to. diff --git a/twilio/rest/flex_api/v1/__init__.py b/twilio/rest/flex_api/v1/__init__.py index 64701c623f..1b895467f0 100644 --- a/twilio/rest/flex_api/v1/__init__.py +++ b/twilio/rest/flex_api/v1/__init__.py @@ -55,9 +55,9 @@ def __init__(self, domain: Domain): self._channel: Optional[ChannelList] = None self._configuration: Optional[ConfigurationList] = None self._flex_flow: Optional[FlexFlowList] = None - self._insights_assessments_comment: Optional[ - InsightsAssessmentsCommentList - ] = None + self._insights_assessments_comment: Optional[InsightsAssessmentsCommentList] = ( + None + ) self._insights_conversations: Optional[InsightsConversationsList] = None self._insights_questionnaires: Optional[InsightsQuestionnairesList] = None self._insights_questionnaires_category: Optional[ diff --git a/twilio/rest/flex_api/v1/assessments.py b/twilio/rest/flex_api/v1/assessments.py index 06a335189c..1e2030a8fb 100644 --- a/twilio/rest/flex_api/v1/assessments.py +++ b/twilio/rest/flex_api/v1/assessments.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class AssessmentsInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar assessment_sid: The SID of the assessment diff --git a/twilio/rest/flex_api/v1/channel.py b/twilio/rest/flex_api/v1/channel.py index cf2d765879..5b2300952b 100644 --- a/twilio/rest/flex_api/v1/channel.py +++ b/twilio/rest/flex_api/v1/channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ChannelInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Channel resource and owns this Workflow. :ivar flex_flow_sid: The SID of the Flex Flow. diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index d46150795a..fc9a60923d 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values diff --git a/twilio/rest/flex_api/v1/flex_flow.py b/twilio/rest/flex_api/v1/flex_flow.py index 45402a43b6..15e3276501 100644 --- a/twilio/rest/flex_api/v1/flex_flow.py +++ b/twilio/rest/flex_api/v1/flex_flow.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -74,9 +73,9 @@ def __init__( ) self.contact_identity: Optional[str] = payload.get("contact_identity") self.enabled: Optional[bool] = payload.get("enabled") - self.integration_type: Optional[ - "FlexFlowInstance.IntegrationType" - ] = payload.get("integration_type") + self.integration_type: Optional["FlexFlowInstance.IntegrationType"] = ( + payload.get("integration_type") + ) self.integration: Optional[Dict[str, object]] = payload.get("integration") self.long_lived: Optional[bool] = payload.get("long_lived") self.janitor_enabled: Optional[bool] = payload.get("janitor_enabled") diff --git a/twilio/rest/flex_api/v1/insights_assessments_comment.py b/twilio/rest/flex_api/v1/insights_assessments_comment.py index 05b2dfb3e7..8ac4a527a7 100644 --- a/twilio/rest/flex_api/v1/insights_assessments_comment.py +++ b/twilio/rest/flex_api/v1/insights_assessments_comment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class InsightsAssessmentsCommentInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar assessment_sid: The SID of the assessment. diff --git a/twilio/rest/flex_api/v1/insights_conversations.py b/twilio/rest/flex_api/v1/insights_conversations.py index 204d9807f1..54b33ad8ee 100644 --- a/twilio/rest/flex_api/v1/insights_conversations.py +++ b/twilio/rest/flex_api/v1/insights_conversations.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class InsightsConversationsInstance(InstanceResource): - """ :ivar account_id: The id of the account. :ivar conversation_id: The unique id of the conversation diff --git a/twilio/rest/flex_api/v1/insights_questionnaires.py b/twilio/rest/flex_api/v1/insights_questionnaires.py index d65c33aaf4..f4bb0fad03 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class InsightsQuestionnairesInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar questionnaire_sid: The sid of this questionnaire diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_category.py b/twilio/rest/flex_api/v1/insights_questionnaires_category.py index 74a05e68b3..3f95d9656b 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_category.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_category.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class InsightsQuestionnairesCategoryInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar category_sid: The SID of the category diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_question.py b/twilio/rest/flex_api/v1/insights_questionnaires_question.py index 78739bbcbb..e68e04e2a3 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_question.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_question.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class InsightsQuestionnairesQuestionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar question_sid: The SID of the question diff --git a/twilio/rest/flex_api/v1/insights_segments.py b/twilio/rest/flex_api/v1/insights_segments.py index 3de3138ff2..a0d12d4bf3 100644 --- a/twilio/rest/flex_api/v1/insights_segments.py +++ b/twilio/rest/flex_api/v1/insights_segments.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values @@ -23,7 +22,6 @@ class InsightsSegmentsInstance(InstanceResource): - """ :ivar segment_id: To unique id of the segment :ivar external_id: The unique id for the conversation. diff --git a/twilio/rest/flex_api/v1/insights_session.py b/twilio/rest/flex_api/v1/insights_session.py index d0b889822e..32fa5c81e0 100644 --- a/twilio/rest/flex_api/v1/insights_session.py +++ b/twilio/rest/flex_api/v1/insights_session.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class InsightsSessionInstance(InstanceResource): - """ :ivar workspace_id: Unique ID to identify the user's workspace :ivar session_expiry: The session expiry date and time, given in ISO 8601 format. diff --git a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py index 4a38d3b137..a8be81c914 100644 --- a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py +++ b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class InsightsSettingsAnswerSetsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar answer_sets: The lis of answer sets diff --git a/twilio/rest/flex_api/v1/insights_settings_comment.py b/twilio/rest/flex_api/v1/insights_settings_comment.py index 681dc5800d..1d4c2f19a4 100644 --- a/twilio/rest/flex_api/v1/insights_settings_comment.py +++ b/twilio/rest/flex_api/v1/insights_settings_comment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class InsightsSettingsCommentInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Insights resource and owns this resource. :ivar comments: diff --git a/twilio/rest/flex_api/v1/insights_user_roles.py b/twilio/rest/flex_api/v1/insights_user_roles.py index 25d406bcb2..705c0e97d1 100644 --- a/twilio/rest/flex_api/v1/insights_user_roles.py +++ b/twilio/rest/flex_api/v1/insights_user_roles.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class InsightsUserRolesInstance(InstanceResource): - """ :ivar roles: Flex Insights roles for the user :ivar url: diff --git a/twilio/rest/flex_api/v1/interaction/__init__.py b/twilio/rest/flex_api/v1/interaction/__init__.py index 40fe054fdf..90a48bc06a 100644 --- a/twilio/rest/flex_api/v1/interaction/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -26,7 +25,6 @@ class InteractionInstance(InstanceResource): - """ :ivar sid: The unique string created by Twilio to identify an Interaction resource, prefixed with KD. :ivar channel: A JSON object that defines the Interaction’s communication channel and includes details about the channel. See the [Outbound SMS](https://www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#agent-initiated-outbound-interactions) and [inbound (API-initiated)](https://www.twilio.com/docs/flex/developer/conversations/interactions-api/interactions#api-initiated-contact) Channel object examples. diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py index d15ff24080..791ad4d67f 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py index b585176ec9..9c97a85ce7 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values @@ -23,7 +22,6 @@ class InteractionChannelInviteInstance(InstanceResource): - """ :ivar sid: The unique string created by Twilio to identify an Interaction Channel Invite resource. :ivar interaction_sid: The Interaction SID for this Channel. diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py index 761516f9fa..d76a2275a7 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext diff --git a/twilio/rest/flex_api/v1/web_channel.py b/twilio/rest/flex_api/v1/web_channel.py index 436c0be8b2..0ff675533f 100644 --- a/twilio/rest/flex_api/v1/web_channel.py +++ b/twilio/rest/flex_api/v1/web_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/flex_api/v2/web_channels.py b/twilio/rest/flex_api/v2/web_channels.py index b8953bd651..d4c2e33968 100644 --- a/twilio/rest/flex_api/v2/web_channels.py +++ b/twilio/rest/flex_api/v2/web_channels.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values @@ -22,7 +21,6 @@ class WebChannelsInstance(InstanceResource): - """ :ivar conversation_sid: The unique string representing the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) created. :ivar identity: The unique string representing the User created and should be authorized to participate in the Conversation. For more details, see [User Identity & Access Tokens](https://www.twilio.com/docs/conversations/identity). diff --git a/twilio/rest/frontline_api/v1/user.py b/twilio/rest/frontline_api/v1/user.py index aa279937e8..7c032ac5e1 100644 --- a/twilio/rest/frontline_api/v1/user.py +++ b/twilio/rest/frontline_api/v1/user.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext diff --git a/twilio/rest/insights/v1/call/__init__.py b/twilio/rest/insights/v1/call/__init__.py index 32672015ba..824793a6ae 100644 --- a/twilio/rest/insights/v1/call/__init__.py +++ b/twilio/rest/insights/v1/call/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -26,7 +25,6 @@ class CallInstance(InstanceResource): - """ :ivar sid: :ivar url: diff --git a/twilio/rest/insights/v1/call/annotation.py b/twilio/rest/insights/v1/call/annotation.py index acb2567549..ddf1f829fc 100644 --- a/twilio/rest/insights/v1/call/annotation.py +++ b/twilio/rest/insights/v1/call/annotation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -56,9 +55,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], call_sid: str): self.answered_by: Optional["AnnotationInstance.AnsweredBy"] = payload.get( "answered_by" ) - self.connectivity_issue: Optional[ - "AnnotationInstance.ConnectivityIssue" - ] = payload.get("connectivity_issue") + self.connectivity_issue: Optional["AnnotationInstance.ConnectivityIssue"] = ( + payload.get("connectivity_issue") + ) self.quality_issues: Optional[List[str]] = payload.get("quality_issues") self.spam: Optional[bool] = payload.get("spam") self.call_score: Optional[int] = deserialize.integer(payload.get("call_score")) diff --git a/twilio/rest/insights/v1/call/call_summary.py b/twilio/rest/insights/v1/call/call_summary.py index bb12443697..ce52583a13 100644 --- a/twilio/rest/insights/v1/call/call_summary.py +++ b/twilio/rest/insights/v1/call/call_summary.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values @@ -92,9 +91,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], call_sid: str): self.answered_by: Optional["CallSummaryInstance.AnsweredBy"] = payload.get( "answered_by" ) - self.processing_state: Optional[ - "CallSummaryInstance.ProcessingState" - ] = payload.get("processing_state") + self.processing_state: Optional["CallSummaryInstance.ProcessingState"] = ( + payload.get("processing_state") + ) self.created_time: Optional[datetime] = deserialize.iso8601_datetime( payload.get("created_time") ) diff --git a/twilio/rest/insights/v1/call/event.py b/twilio/rest/insights/v1/call/event.py index f970b8298b..fa118a7266 100644 --- a/twilio/rest/insights/v1/call/event.py +++ b/twilio/rest/insights/v1/call/event.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values diff --git a/twilio/rest/insights/v1/call/metric.py b/twilio/rest/insights/v1/call/metric.py index fea59cc284..5869527732 100644 --- a/twilio/rest/insights/v1/call/metric.py +++ b/twilio/rest/insights/v1/call/metric.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values diff --git a/twilio/rest/insights/v1/call_summaries.py b/twilio/rest/insights/v1/call_summaries.py index 98555812e4..e7c27ea73d 100644 --- a/twilio/rest/insights/v1/call_summaries.py +++ b/twilio/rest/insights/v1/call_summaries.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -103,9 +102,9 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.call_state: Optional["CallSummariesInstance.CallState"] = payload.get( "call_state" ) - self.processing_state: Optional[ - "CallSummariesInstance.ProcessingState" - ] = payload.get("processing_state") + self.processing_state: Optional["CallSummariesInstance.ProcessingState"] = ( + payload.get("processing_state") + ) self.created_time: Optional[datetime] = deserialize.iso8601_datetime( payload.get("created_time") ) diff --git a/twilio/rest/insights/v1/conference/__init__.py b/twilio/rest/insights/v1/conference/__init__.py index ca0a316eee..cd3203aa15 100644 --- a/twilio/rest/insights/v1/conference/__init__.py +++ b/twilio/rest/insights/v1/conference/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -135,25 +134,25 @@ def __init__( self.unique_participants: Optional[int] = deserialize.integer( payload.get("unique_participants") ) - self.end_reason: Optional[ - "ConferenceInstance.ConferenceEndReason" - ] = payload.get("end_reason") + self.end_reason: Optional["ConferenceInstance.ConferenceEndReason"] = ( + payload.get("end_reason") + ) self.ended_by: Optional[str] = payload.get("ended_by") self.mixer_region: Optional["ConferenceInstance.Region"] = payload.get( "mixer_region" ) - self.mixer_region_requested: Optional[ - "ConferenceInstance.Region" - ] = payload.get("mixer_region_requested") + self.mixer_region_requested: Optional["ConferenceInstance.Region"] = ( + payload.get("mixer_region_requested") + ) self.recording_enabled: Optional[bool] = payload.get("recording_enabled") self.detected_issues: Optional[Dict[str, object]] = payload.get( "detected_issues" ) self.tags: Optional[List["ConferenceInstance.Tag"]] = payload.get("tags") self.tag_info: Optional[Dict[str, object]] = payload.get("tag_info") - self.processing_state: Optional[ - "ConferenceInstance.ProcessingState" - ] = payload.get("processing_state") + self.processing_state: Optional["ConferenceInstance.ProcessingState"] = ( + payload.get("processing_state") + ) self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") diff --git a/twilio/rest/insights/v1/conference/conference_participant.py b/twilio/rest/insights/v1/conference/conference_participant.py index e6c5489b41..6489c50ed0 100644 --- a/twilio/rest/insights/v1/conference/conference_participant.py +++ b/twilio/rest/insights/v1/conference/conference_participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -107,14 +106,14 @@ def __init__( self.conference_sid: Optional[str] = payload.get("conference_sid") self.call_sid: Optional[str] = payload.get("call_sid") self.account_sid: Optional[str] = payload.get("account_sid") - self.call_direction: Optional[ - "ConferenceParticipantInstance.CallDirection" - ] = payload.get("call_direction") + self.call_direction: Optional["ConferenceParticipantInstance.CallDirection"] = ( + payload.get("call_direction") + ) self._from: Optional[str] = payload.get("from") self.to: Optional[str] = payload.get("to") - self.call_status: Optional[ - "ConferenceParticipantInstance.CallStatus" - ] = payload.get("call_status") + self.call_status: Optional["ConferenceParticipantInstance.CallStatus"] = ( + payload.get("call_status") + ) self.country_code: Optional[str] = payload.get("country_code") self.is_moderator: Optional[bool] = payload.get("is_moderator") self.join_time: Optional[datetime] = deserialize.iso8601_datetime( @@ -139,15 +138,15 @@ def __init__( self.coached_participants: Optional[List[str]] = payload.get( "coached_participants" ) - self.participant_region: Optional[ - "ConferenceParticipantInstance.Region" - ] = payload.get("participant_region") - self.conference_region: Optional[ - "ConferenceParticipantInstance.Region" - ] = payload.get("conference_region") - self.call_type: Optional[ - "ConferenceParticipantInstance.CallType" - ] = payload.get("call_type") + self.participant_region: Optional["ConferenceParticipantInstance.Region"] = ( + payload.get("participant_region") + ) + self.conference_region: Optional["ConferenceParticipantInstance.Region"] = ( + payload.get("conference_region") + ) + self.call_type: Optional["ConferenceParticipantInstance.CallType"] = ( + payload.get("call_type") + ) self.processing_state: Optional[ "ConferenceParticipantInstance.ProcessingState" ] = payload.get("processing_state") diff --git a/twilio/rest/insights/v1/room/__init__.py b/twilio/rest/insights/v1/room/__init__.py index c17dd25648..1730be8b34 100644 --- a/twilio/rest/insights/v1/room/__init__.py +++ b/twilio/rest/insights/v1/room/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/insights/v1/room/participant.py b/twilio/rest/insights/v1/room/participant.py index f9ed4723e4..7d7103af3a 100644 --- a/twilio/rest/insights/v1/room/participant.py +++ b/twilio/rest/insights/v1/room/participant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/insights/v1/setting.py b/twilio/rest/insights/v1/setting.py index 10dc574239..649fd001ae 100644 --- a/twilio/rest/insights/v1/setting.py +++ b/twilio/rest/insights/v1/setting.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class SettingInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar advanced_features: A boolean flag indicating whether Advanced Features for Voice Insights are enabled. diff --git a/twilio/rest/intelligence/v2/service.py b/twilio/rest/intelligence/v2/service.py index ae63037ed0..fa27ee1a99 100644 --- a/twilio/rest/intelligence/v2/service.py +++ b/twilio/rest/intelligence/v2/service.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/intelligence/v2/transcript/__init__.py b/twilio/rest/intelligence/v2/transcript/__init__.py index 7b479526cb..4f4b3bb588 100644 --- a/twilio/rest/intelligence/v2/transcript/__init__.py +++ b/twilio/rest/intelligence/v2/transcript/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/intelligence/v2/transcript/media.py b/twilio/rest/intelligence/v2/transcript/media.py index 89a675a95c..469d4a4f67 100644 --- a/twilio/rest/intelligence/v2/transcript/media.py +++ b/twilio/rest/intelligence/v2/transcript/media.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class MediaInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Account. :ivar media_url: Downloadable URL for media, if stored in Twilio AI. diff --git a/twilio/rest/intelligence/v2/transcript/operator_result.py b/twilio/rest/intelligence/v2/transcript/operator_result.py index 662828ce51..00e9cbae42 100644 --- a/twilio/rest/intelligence/v2/transcript/operator_result.py +++ b/twilio/rest/intelligence/v2/transcript/operator_result.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -56,9 +55,9 @@ def __init__( ): super().__init__(version) - self.operator_type: Optional[ - "OperatorResultInstance.OperatorType" - ] = payload.get("operator_type") + self.operator_type: Optional["OperatorResultInstance.OperatorType"] = ( + payload.get("operator_type") + ) self.name: Optional[str] = payload.get("name") self.operator_sid: Optional[str] = payload.get("operator_sid") self.extract_match: Optional[bool] = payload.get("extract_match") diff --git a/twilio/rest/intelligence/v2/transcript/sentence.py b/twilio/rest/intelligence/v2/transcript/sentence.py index 0f31769443..a85953b80e 100644 --- a/twilio/rest/intelligence/v2/transcript/sentence.py +++ b/twilio/rest/intelligence/v2/transcript/sentence.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class SentenceInstance(InstanceResource): - """ :ivar media_channel: The channel number. :ivar sentence_index: The index of the sentence in the transcript. diff --git a/twilio/rest/ip_messaging/v1/credential.py b/twilio/rest/ip_messaging/v1/credential.py index 6a193aa1f4..f7f847e832 100644 --- a/twilio/rest/ip_messaging/v1/credential.py +++ b/twilio/rest/ip_messaging/v1/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/ip_messaging/v1/service/__init__.py b/twilio/rest/ip_messaging/v1/service/__init__.py index c07b4cc252..f70358dad5 100644 --- a/twilio/rest/ip_messaging/v1/service/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: diff --git a/twilio/rest/ip_messaging/v1/service/channel/__init__.py b/twilio/rest/ip_messaging/v1/service/channel/__init__.py index 32961bcff0..343f744df7 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/channel/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/ip_messaging/v1/service/channel/invite.py b/twilio/rest/ip_messaging/v1/service/channel/invite.py index 476e89f4c2..b76f91facf 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v1/service/channel/invite.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class InviteInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: diff --git a/twilio/rest/ip_messaging/v1/service/channel/member.py b/twilio/rest/ip_messaging/v1/service/channel/member.py index 2414e72c93..4bc3827743 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/member.py +++ b/twilio/rest/ip_messaging/v1/service/channel/member.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class MemberInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: @@ -64,9 +62,9 @@ def __init__( self.last_consumed_message_index: Optional[int] = deserialize.integer( payload.get("last_consumed_message_index") ) - self.last_consumption_timestamp: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + self.last_consumption_timestamp: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + ) self.url: Optional[str] = payload.get("url") self._solution = { diff --git a/twilio/rest/ip_messaging/v1/service/channel/message.py b/twilio/rest/ip_messaging/v1/service/channel/message.py index e562faafb6..c5e5973775 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/message.py +++ b/twilio/rest/ip_messaging/v1/service/channel/message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/ip_messaging/v1/service/role.py b/twilio/rest/ip_messaging/v1/service/role.py index e637e2c900..05234ed2ef 100644 --- a/twilio/rest/ip_messaging/v1/service/role.py +++ b/twilio/rest/ip_messaging/v1/service/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/ip_messaging/v1/service/user/__init__.py b/twilio/rest/ip_messaging/v1/service/user/__init__.py index e19eb82be6..76888f9125 100644 --- a/twilio/rest/ip_messaging/v1/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class UserInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: diff --git a/twilio/rest/ip_messaging/v1/service/user/user_channel.py b/twilio/rest/ip_messaging/v1/service/user/user_channel.py index 4d00fa50c0..8286725e69 100644 --- a/twilio/rest/ip_messaging/v1/service/user/user_channel.py +++ b/twilio/rest/ip_messaging/v1/service/user/user_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/ip_messaging/v2/credential.py b/twilio/rest/ip_messaging/v2/credential.py index 3d72b3a0d6..93f54df5f1 100644 --- a/twilio/rest/ip_messaging/v2/credential.py +++ b/twilio/rest/ip_messaging/v2/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/ip_messaging/v2/service/__init__.py b/twilio/rest/ip_messaging/v2/service/__init__.py index b94def1fa6..8bea3947cc 100644 --- a/twilio/rest/ip_messaging/v2/service/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -28,7 +27,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: diff --git a/twilio/rest/ip_messaging/v2/service/binding.py b/twilio/rest/ip_messaging/v2/service/binding.py index 70dbc78fb7..dcc7e93d76 100644 --- a/twilio/rest/ip_messaging/v2/service/binding.py +++ b/twilio/rest/ip_messaging/v2/service/binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/ip_messaging/v2/service/channel/__init__.py b/twilio/rest/ip_messaging/v2/service/channel/__init__.py index 6e62c31093..1eda6522f8 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/channel/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/ip_messaging/v2/service/channel/invite.py b/twilio/rest/ip_messaging/v2/service/channel/invite.py index aeb07b7b92..ab862e72cd 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v2/service/channel/invite.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class InviteInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: diff --git a/twilio/rest/ip_messaging/v2/service/channel/member.py b/twilio/rest/ip_messaging/v2/service/channel/member.py index 823c37b6df..9c50f8d56a 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/member.py +++ b/twilio/rest/ip_messaging/v2/service/channel/member.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -68,9 +67,9 @@ def __init__( self.last_consumed_message_index: Optional[int] = deserialize.integer( payload.get("last_consumed_message_index") ) - self.last_consumption_timestamp: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + self.last_consumption_timestamp: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("last_consumption_timestamp")) + ) self.url: Optional[str] = payload.get("url") self.attributes: Optional[str] = payload.get("attributes") diff --git a/twilio/rest/ip_messaging/v2/service/channel/message.py b/twilio/rest/ip_messaging/v2/service/channel/message.py index c2401c53f9..d0d5ceca73 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/message.py +++ b/twilio/rest/ip_messaging/v2/service/channel/message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/ip_messaging/v2/service/channel/webhook.py b/twilio/rest/ip_messaging/v2/service/channel/webhook.py index 077bbfa8e4..bf02e7c634 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/webhook.py +++ b/twilio/rest/ip_messaging/v2/service/channel/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/ip_messaging/v2/service/role.py b/twilio/rest/ip_messaging/v2/service/role.py index c8e3b95611..bb816fd5f0 100644 --- a/twilio/rest/ip_messaging/v2/service/role.py +++ b/twilio/rest/ip_messaging/v2/service/role.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/ip_messaging/v2/service/user/__init__.py b/twilio/rest/ip_messaging/v2/service/user/__init__.py index 1f11793877..6d87f2b713 100644 --- a/twilio/rest/ip_messaging/v2/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/user/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/ip_messaging/v2/service/user/user_binding.py b/twilio/rest/ip_messaging/v2/service/user/user_binding.py index c2e389fc92..9ff3bb9e04 100644 --- a/twilio/rest/ip_messaging/v2/service/user/user_binding.py +++ b/twilio/rest/ip_messaging/v2/service/user/user_binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/ip_messaging/v2/service/user/user_channel.py b/twilio/rest/ip_messaging/v2/service/user/user_channel.py index 51239956f0..cb7f1a4fcd 100644 --- a/twilio/rest/ip_messaging/v2/service/user/user_channel.py +++ b/twilio/rest/ip_messaging/v2/service/user/user_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -73,9 +72,9 @@ def __init__( ) self.links: Optional[Dict[str, object]] = payload.get("links") self.url: Optional[str] = payload.get("url") - self.notification_level: Optional[ - "UserChannelInstance.NotificationLevel" - ] = payload.get("notification_level") + self.notification_level: Optional["UserChannelInstance.NotificationLevel"] = ( + payload.get("notification_level") + ) self._solution = { "service_sid": service_sid, diff --git a/twilio/rest/lookups/v1/phone_number.py b/twilio/rest/lookups/v1/phone_number.py index f38a5c9f0b..b5d8c83515 100644 --- a/twilio/rest/lookups/v1/phone_number.py +++ b/twilio/rest/lookups/v1/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class PhoneNumberInstance(InstanceResource): - """ :ivar caller_name: The name of the phone number's owner. If `null`, that information was not available. :ivar country_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) for the phone number. diff --git a/twilio/rest/lookups/v2/phone_number.py b/twilio/rest/lookups/v2/phone_number.py index 3a3640fbea..f72f112f24 100644 --- a/twilio/rest/lookups/v2/phone_number.py +++ b/twilio/rest/lookups/v2/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext diff --git a/twilio/rest/media/v1/media_processor.py b/twilio/rest/media/v1/media_processor.py index 16ac32aa2f..a55c80db96 100644 --- a/twilio/rest/media/v1/media_processor.py +++ b/twilio/rest/media/v1/media_processor.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/media/v1/media_recording.py b/twilio/rest/media/v1/media_recording.py index 16d47af34e..837845306b 100644 --- a/twilio/rest/media/v1/media_recording.py +++ b/twilio/rest/media/v1/media_recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/media/v1/player_streamer/__init__.py b/twilio/rest/media/v1/player_streamer/__init__.py index 6bc535cdfa..e25fc3f4af 100644 --- a/twilio/rest/media/v1/player_streamer/__init__.py +++ b/twilio/rest/media/v1/player_streamer/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/media/v1/player_streamer/playback_grant.py b/twilio/rest/media/v1/player_streamer/playback_grant.py index 4ea581b474..2aa42efade 100644 --- a/twilio/rest/media/v1/player_streamer/playback_grant.py +++ b/twilio/rest/media/v1/player_streamer/playback_grant.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class PlaybackGrantInstance(InstanceResource): - """ :ivar sid: The unique string generated to identify the PlayerStreamer resource that this PlaybackGrant authorizes views for. :ivar url: The absolute URL of the resource. diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index 68a669e3ce..54be98b15a 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -103,9 +102,9 @@ def __init__( self.brand_feedback: Optional[ List["BrandRegistrationInstance.BrandFeedback"] ] = payload.get("brand_feedback") - self.identity_status: Optional[ - "BrandRegistrationInstance.IdentityStatus" - ] = payload.get("identity_status") + self.identity_status: Optional["BrandRegistrationInstance.IdentityStatus"] = ( + payload.get("identity_status") + ) self.russell_3000: Optional[bool] = payload.get("russell_3000") self.government_entity: Optional[bool] = payload.get("government_entity") self.tax_exempt_status: Optional[str] = payload.get("tax_exempt_status") diff --git a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py index 3cc7d364bb..676d116608 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class BrandRegistrationOtpInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Brand Registration resource. :ivar brand_registration_sid: The unique string to identify Brand Registration of Sole Proprietor Brand diff --git a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py index 2fff9ebbed..6517d08605 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -61,9 +60,9 @@ def __init__( self.vetting_id: Optional[str] = payload.get("vetting_id") self.vetting_class: Optional[str] = payload.get("vetting_class") self.vetting_status: Optional[str] = payload.get("vetting_status") - self.vetting_provider: Optional[ - "BrandVettingInstance.VettingProvider" - ] = payload.get("vetting_provider") + self.vetting_provider: Optional["BrandVettingInstance.VettingProvider"] = ( + payload.get("vetting_provider") + ) self.url: Optional[str] = payload.get("url") self._solution = { diff --git a/twilio/rest/messaging/v1/deactivations.py b/twilio/rest/messaging/v1/deactivations.py index 972ee62e30..9081be42a3 100644 --- a/twilio/rest/messaging/v1/deactivations.py +++ b/twilio/rest/messaging/v1/deactivations.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class DeactivationsInstance(InstanceResource): - """ :ivar redirect_to: Returns an authenticated url that redirects to a file containing the deactivated numbers for the requested day. This url is valid for up to two minutes. """ diff --git a/twilio/rest/messaging/v1/domain_certs.py b/twilio/rest/messaging/v1/domain_certs.py index 71ef3105bc..e5586d238c 100644 --- a/twilio/rest/messaging/v1/domain_certs.py +++ b/twilio/rest/messaging/v1/domain_certs.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class DomainCertsInstance(InstanceResource): - """ :ivar domain_sid: The unique string that we created to identify the Domain resource. :ivar date_updated: Date that this Domain was last updated. diff --git a/twilio/rest/messaging/v1/domain_config.py b/twilio/rest/messaging/v1/domain_config.py index fa8a65912a..048ad79529 100644 --- a/twilio/rest/messaging/v1/domain_config.py +++ b/twilio/rest/messaging/v1/domain_config.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class DomainConfigInstance(InstanceResource): - """ :ivar domain_sid: The unique string that we created to identify the Domain resource. :ivar config_sid: The unique string that we created to identify the Domain config (prefix ZK). diff --git a/twilio/rest/messaging/v1/domain_config_messaging_service.py b/twilio/rest/messaging/v1/domain_config_messaging_service.py index 8cded6fb47..864e487bd4 100644 --- a/twilio/rest/messaging/v1/domain_config_messaging_service.py +++ b/twilio/rest/messaging/v1/domain_config_messaging_service.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize @@ -23,7 +22,6 @@ class DomainConfigMessagingServiceInstance(InstanceResource): - """ :ivar domain_sid: The unique string that we created to identify the Domain resource. :ivar config_sid: The unique string that we created to identify the Domain config (prefix ZK). diff --git a/twilio/rest/messaging/v1/external_campaign.py b/twilio/rest/messaging/v1/external_campaign.py index 53af9869d3..a57261c5a0 100644 --- a/twilio/rest/messaging/v1/external_campaign.py +++ b/twilio/rest/messaging/v1/external_campaign.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class ExternalCampaignInstance(InstanceResource): - """ :ivar sid: The unique string that identifies a US A2P Compliance resource `QE2c6890da8086d771620e9b13fadeba0b`. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the Campaign belongs to. diff --git a/twilio/rest/messaging/v1/linkshortening_messaging_service.py b/twilio/rest/messaging/v1/linkshortening_messaging_service.py index c5b20e28a5..8c1475da99 100644 --- a/twilio/rest/messaging/v1/linkshortening_messaging_service.py +++ b/twilio/rest/messaging/v1/linkshortening_messaging_service.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class LinkshorteningMessagingServiceInstance(InstanceResource): - """ :ivar domain_sid: The unique string identifies the domain resource :ivar messaging_service_sid: The unique string that identifies the messaging service diff --git a/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py b/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py index 37e9e7a867..1ec176e0c6 100644 --- a/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py +++ b/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class LinkshorteningMessagingServiceDomainAssociationInstance(InstanceResource): - """ :ivar domain_sid: The unique string that we created to identify the Domain resource. :ivar messaging_service_sid: The unique string that identifies the messaging service diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index d1772d7d76..24d7075794 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -85,9 +84,9 @@ def __init__( self.sticky_sender: Optional[bool] = payload.get("sticky_sender") self.mms_converter: Optional[bool] = payload.get("mms_converter") self.smart_encoding: Optional[bool] = payload.get("smart_encoding") - self.scan_message_content: Optional[ - "ServiceInstance.ScanMessageContent" - ] = payload.get("scan_message_content") + self.scan_message_content: Optional["ServiceInstance.ScanMessageContent"] = ( + payload.get("scan_message_content") + ) self.fallback_to_long_code: Optional[bool] = payload.get( "fallback_to_long_code" ) diff --git a/twilio/rest/messaging/v1/service/alpha_sender.py b/twilio/rest/messaging/v1/service/alpha_sender.py index 92d81e9fc4..77a1e4e374 100644 --- a/twilio/rest/messaging/v1/service/alpha_sender.py +++ b/twilio/rest/messaging/v1/service/alpha_sender.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AlphaSenderInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the AlphaSender resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AlphaSender resource. diff --git a/twilio/rest/messaging/v1/service/channel_sender.py b/twilio/rest/messaging/v1/service/channel_sender.py index 579c6d39fd..c165e64d62 100644 --- a/twilio/rest/messaging/v1/service/channel_sender.py +++ b/twilio/rest/messaging/v1/service/channel_sender.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ChannelSenderInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ChannelSender resource. :ivar messaging_service_sid: The SID of the [Service](https://www.twilio.com/docs/messaging/services) the resource is associated with. diff --git a/twilio/rest/messaging/v1/service/phone_number.py b/twilio/rest/messaging/v1/service/phone_number.py index c01c76a3b7..4252b40b17 100644 --- a/twilio/rest/messaging/v1/service/phone_number.py +++ b/twilio/rest/messaging/v1/service/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class PhoneNumberInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the PhoneNumber resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PhoneNumber resource. diff --git a/twilio/rest/messaging/v1/service/short_code.py b/twilio/rest/messaging/v1/service/short_code.py index 104f03f6ec..ca3b0d749c 100644 --- a/twilio/rest/messaging/v1/service/short_code.py +++ b/twilio/rest/messaging/v1/service/short_code.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ShortCodeInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the ShortCode resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource. diff --git a/twilio/rest/messaging/v1/service/us_app_to_person.py b/twilio/rest/messaging/v1/service/us_app_to_person.py index 7ccb534319..6cae9d709b 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class UsAppToPersonInstance(InstanceResource): - """ :ivar sid: The unique string that identifies a US A2P Compliance resource `QE2c6890da8086d771620e9b13fadeba0b`. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the Campaign belongs to. diff --git a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py index 0c25e6892c..2d77f51be4 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class UsAppToPersonUsecaseInstance(InstanceResource): - """ :ivar us_app_to_person_usecases: Human readable name, code, description and post_approval_required (indicates whether or not post approval is required for this Use Case) of A2P Campaign Use Cases. """ diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index 47b73d7da6..b8ec79f00b 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -126,9 +125,9 @@ def __init__( "production_message_sample" ) self.opt_in_image_urls: Optional[List[str]] = payload.get("opt_in_image_urls") - self.opt_in_type: Optional[ - "TollfreeVerificationInstance.OptInType" - ] = payload.get("opt_in_type") + self.opt_in_type: Optional["TollfreeVerificationInstance.OptInType"] = ( + payload.get("opt_in_type") + ) self.message_volume: Optional[str] = payload.get("message_volume") self.additional_information: Optional[str] = payload.get( "additional_information" diff --git a/twilio/rest/messaging/v1/usecase.py b/twilio/rest/messaging/v1/usecase.py index ba65e8b106..0b35400e48 100644 --- a/twilio/rest/messaging/v1/usecase.py +++ b/twilio/rest/messaging/v1/usecase.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class UsecaseInstance(InstanceResource): - """ :ivar usecases: Human readable use case details (usecase, description and purpose) of Messaging Service Use Cases. """ diff --git a/twilio/rest/microvisor/v1/account_config.py b/twilio/rest/microvisor/v1/account_config.py index 7d8119a3de..03198f6f6c 100644 --- a/twilio/rest/microvisor/v1/account_config.py +++ b/twilio/rest/microvisor/v1/account_config.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AccountConfigInstance(InstanceResource): - """ :ivar key: The config key; up to 100 characters. :ivar date_updated: diff --git a/twilio/rest/microvisor/v1/account_secret.py b/twilio/rest/microvisor/v1/account_secret.py index a7fc4f8969..d4012b3b1c 100644 --- a/twilio/rest/microvisor/v1/account_secret.py +++ b/twilio/rest/microvisor/v1/account_secret.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class AccountSecretInstance(InstanceResource): - """ :ivar key: The secret key; up to 100 characters. :ivar date_rotated: diff --git a/twilio/rest/microvisor/v1/app/__init__.py b/twilio/rest/microvisor/v1/app/__init__.py index e9f547af76..517e523c7d 100644 --- a/twilio/rest/microvisor/v1/app/__init__.py +++ b/twilio/rest/microvisor/v1/app/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class AppInstance(InstanceResource): - """ :ivar sid: A 34-character string that uniquely identifies this App. :ivar account_sid: The unique SID identifier of the Account. diff --git a/twilio/rest/microvisor/v1/app/app_manifest.py b/twilio/rest/microvisor/v1/app/app_manifest.py index dba0240e91..143154b32c 100644 --- a/twilio/rest/microvisor/v1/app/app_manifest.py +++ b/twilio/rest/microvisor/v1/app/app_manifest.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class AppManifestInstance(InstanceResource): - """ :ivar app_sid: A 34-character string that uniquely identifies this App. :ivar hash: App manifest hash represented as `hash_algorithm:hash_value`. diff --git a/twilio/rest/microvisor/v1/device/__init__.py b/twilio/rest/microvisor/v1/device/__init__.py index e3023ae499..0a6bea2d60 100644 --- a/twilio/rest/microvisor/v1/device/__init__.py +++ b/twilio/rest/microvisor/v1/device/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -26,7 +25,6 @@ class DeviceInstance(InstanceResource): - """ :ivar sid: A 34-character string that uniquely identifies this Device. :ivar unique_name: A developer-defined string that uniquely identifies the Device. This value must be unique for all Devices on this Account. The `unique_name` value may be used as an alternative to the `sid` in the URL path to address the resource. diff --git a/twilio/rest/microvisor/v1/device/device_config.py b/twilio/rest/microvisor/v1/device/device_config.py index a954727bf0..0b027ecb53 100644 --- a/twilio/rest/microvisor/v1/device/device_config.py +++ b/twilio/rest/microvisor/v1/device/device_config.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DeviceConfigInstance(InstanceResource): - """ :ivar device_sid: A 34-character string that uniquely identifies the parent Device. :ivar key: The config key; up to 100 characters. diff --git a/twilio/rest/microvisor/v1/device/device_secret.py b/twilio/rest/microvisor/v1/device/device_secret.py index 7f2ee0eeb0..2f1f1add74 100644 --- a/twilio/rest/microvisor/v1/device/device_secret.py +++ b/twilio/rest/microvisor/v1/device/device_secret.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DeviceSecretInstance(InstanceResource): - """ :ivar device_sid: A 34-character string that uniquely identifies the parent Device. :ivar key: The secret key; up to 100 characters. diff --git a/twilio/rest/monitor/v1/alert.py b/twilio/rest/monitor/v1/alert.py index b3c44374e5..e531f58e7d 100644 --- a/twilio/rest/monitor/v1/alert.py +++ b/twilio/rest/monitor/v1/alert.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class AlertInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Alert resource. :ivar alert_text: The text of the alert. diff --git a/twilio/rest/monitor/v1/event.py b/twilio/rest/monitor/v1/event.py index 63829c43e0..7a810bd6c8 100644 --- a/twilio/rest/monitor/v1/event.py +++ b/twilio/rest/monitor/v1/event.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class EventInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Event resource. :ivar actor_sid: The SID of the actor that caused the event, if available. Can be `null`. diff --git a/twilio/rest/notify/v1/credential.py b/twilio/rest/notify/v1/credential.py index 2b1efcf82a..bd895da81a 100644 --- a/twilio/rest/notify/v1/credential.py +++ b/twilio/rest/notify/v1/credential.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/notify/v1/service/__init__.py b/twilio/rest/notify/v1/service/__init__.py index fa07045470..7a9f3f7300 100644 --- a/twilio/rest/notify/v1/service/__init__.py +++ b/twilio/rest/notify/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -26,7 +25,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. diff --git a/twilio/rest/notify/v1/service/binding.py b/twilio/rest/notify/v1/service/binding.py index dba36be720..52a800f33c 100644 --- a/twilio/rest/notify/v1/service/binding.py +++ b/twilio/rest/notify/v1/service/binding.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date, datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/notify/v1/service/notification.py b/twilio/rest/notify/v1/service/notification.py index 980dbe633c..5d5106b2c5 100644 --- a/twilio/rest/notify/v1/service/notification.py +++ b/twilio/rest/notify/v1/service/notification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index 805f6b1bdc..acd8d3ecf2 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional from twilio.base import deserialize @@ -23,7 +22,6 @@ class BulkEligibilityInstance(InstanceResource): - """ :ivar request_id: The SID of the bulk eligibility check that you want to know about. :ivar url: This is the url of the request that you're trying to reach out to locate the resource. diff --git a/twilio/rest/numbers/v1/porting_bulk_portability.py b/twilio/rest/numbers/v1/porting_bulk_portability.py index 3abc24b6e7..20e47ca6d5 100644 --- a/twilio/rest/numbers/v1/porting_bulk_portability.py +++ b/twilio/rest/numbers/v1/porting_bulk_portability.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/numbers/v1/porting_portability.py b/twilio/rest/numbers/v1/porting_portability.py index cb08535d1e..c2f3398c89 100644 --- a/twilio/rest/numbers/v1/porting_portability.py +++ b/twilio/rest/numbers/v1/porting_portability.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -60,9 +59,9 @@ def __init__( self.not_portable_reason_code: Optional[int] = deserialize.integer( payload.get("not_portable_reason_code") ) - self.number_type: Optional[ - "PortingPortabilityInstance.NumberType" - ] = payload.get("number_type") + self.number_type: Optional["PortingPortabilityInstance.NumberType"] = ( + payload.get("number_type") + ) self.country: Optional[str] = payload.get("country") self.messaging_carrier: Optional[str] = payload.get("messaging_carrier") self.voice_carrier: Optional[str] = payload.get("voice_carrier") diff --git a/twilio/rest/numbers/v2/authorization_document/__init__.py b/twilio/rest/numbers/v2/authorization_document/__init__.py index f8ac50dcca..2456debf6d 100644 --- a/twilio/rest/numbers/v2/authorization_document/__init__.py +++ b/twilio/rest/numbers/v2/authorization_document/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py b/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py index 51587325c7..013b12874a 100644 --- a/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py +++ b/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -73,9 +72,9 @@ def __init__( self.phone_number: Optional[str] = payload.get("phone_number") self.capabilities: Optional[str] = payload.get("capabilities") self.friendly_name: Optional[str] = payload.get("friendly_name") - self.status: Optional[ - "DependentHostedNumberOrderInstance.Status" - ] = payload.get("status") + self.status: Optional["DependentHostedNumberOrderInstance.Status"] = ( + payload.get("status") + ) self.failure_reason: Optional[str] = payload.get("failure_reason") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index 57e8723e7d..3a7383904b 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values @@ -49,9 +48,9 @@ def __init__( super().__init__(version) self.bulk_hosting_sid: Optional[str] = payload.get("bulk_hosting_sid") - self.request_status: Optional[ - "BulkHostedNumberOrderInstance.RequestStatus" - ] = payload.get("request_status") + self.request_status: Optional["BulkHostedNumberOrderInstance.RequestStatus"] = ( + payload.get("request_status") + ) self.friendly_name: Optional[str] = payload.get("friendly_name") self.notification_email: Optional[str] = payload.get("notification_email") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index 813b9b4826..985faa1f12 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/numbers/v2/regulatory_compliance/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/__init__.py index 9afca8a972..10d88d8134 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index ff7b1d7c01..684259fc91 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py index 5a0cf036b9..9af90f46da 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py index 53ad9d7694..8bfeae12e3 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py index f5f36206bf..1483cdb363 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ItemAssignmentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Item Assignment resource. :ivar bundle_sid: The unique string that we created to identify the Bundle resource. diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py index e8ab99ad71..fcf31e953b 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py index f9bc9d270f..bbc133b33e 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py index 0a762cea38..f9b8069ee9 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class EndUserTypeInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the End-User Type resource. :ivar friendly_name: A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc diff --git a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py index ab0bf1a332..2698bf0b4d 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py index e619ecdc26..236139eee9 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py index 65c097b994..907cc1924b 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SupportingDocumentTypeInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the Supporting Document Type resource. :ivar friendly_name: A human-readable description of the Supporting Document Type resource. diff --git a/twilio/rest/oauth/v1/device_code.py b/twilio/rest/oauth/v1/device_code.py index ed0998ee94..a50af2cad2 100644 --- a/twilio/rest/oauth/v1/device_code.py +++ b/twilio/rest/oauth/v1/device_code.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -22,7 +21,6 @@ class DeviceCodeInstance(InstanceResource): - """ :ivar device_code: The device verification code. :ivar user_code: The verification code which end user uses to verify authorization request. diff --git a/twilio/rest/oauth/v1/oauth.py b/twilio/rest/oauth/v1/oauth.py index 3765b65180..5a45ae9d9e 100644 --- a/twilio/rest/oauth/v1/oauth.py +++ b/twilio/rest/oauth/v1/oauth.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class OauthInstance(InstanceResource): - """ :ivar keys: A collection of certificates where are signed Twilio-issued tokens. :ivar url: diff --git a/twilio/rest/oauth/v1/openid_discovery.py b/twilio/rest/oauth/v1/openid_discovery.py index 00a551a2fe..242f3b6d7e 100644 --- a/twilio/rest/oauth/v1/openid_discovery.py +++ b/twilio/rest/oauth/v1/openid_discovery.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class OpenidDiscoveryInstance(InstanceResource): - """ :ivar issuer: The URL of the party that will create the token and sign it with its private key. :ivar authorization_endpoint: The endpoint that validates all authorization requests. diff --git a/twilio/rest/oauth/v1/token.py b/twilio/rest/oauth/v1/token.py index d236731a9f..d3fd5888ad 100644 --- a/twilio/rest/oauth/v1/token.py +++ b/twilio/rest/oauth/v1/token.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class TokenInstance(InstanceResource): - """ :ivar access_token: Token which carries the necessary information to access a Twilio resource directly. :ivar refresh_token: Token which carries the information necessary to get a new access token. @@ -38,9 +36,9 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.access_token: Optional[str] = payload.get("access_token") self.refresh_token: Optional[str] = payload.get("refresh_token") self.id_token: Optional[str] = payload.get("id_token") - self.refresh_token_expires_at: Optional[ - datetime - ] = deserialize.iso8601_datetime(payload.get("refresh_token_expires_at")) + self.refresh_token_expires_at: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("refresh_token_expires_at")) + ) self.access_token_expires_at: Optional[datetime] = deserialize.iso8601_datetime( payload.get("access_token_expires_at") ) diff --git a/twilio/rest/oauth/v1/user_info.py b/twilio/rest/oauth/v1/user_info.py index f7b7f0f5df..e59ab8b0cc 100644 --- a/twilio/rest/oauth/v1/user_info.py +++ b/twilio/rest/oauth/v1/user_info.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class UserInfoInstance(InstanceResource): - """ :ivar user_sid: The URL of the party that will create the token and sign it with its private key. :ivar first_name: The first name of the end-user. diff --git a/twilio/rest/preview/deployed_devices/fleet/__init__.py b/twilio/rest/preview/deployed_devices/fleet/__init__.py index cb0c45498a..1b66879632 100644 --- a/twilio/rest/preview/deployed_devices/fleet/__init__.py +++ b/twilio/rest/preview/deployed_devices/fleet/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class FleetInstance(InstanceResource): - """ :ivar sid: Contains a 34 character string that uniquely identifies this Fleet resource. :ivar url: Contains an absolute URL for this Fleet resource. diff --git a/twilio/rest/preview/deployed_devices/fleet/certificate.py b/twilio/rest/preview/deployed_devices/fleet/certificate.py index a6654de67e..8b3a678d7c 100644 --- a/twilio/rest/preview/deployed_devices/fleet/certificate.py +++ b/twilio/rest/preview/deployed_devices/fleet/certificate.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CertificateInstance(InstanceResource): - """ :ivar sid: Contains a 34 character string that uniquely identifies this Certificate credential resource. :ivar url: Contains an absolute URL for this Certificate credential resource. diff --git a/twilio/rest/preview/deployed_devices/fleet/deployment.py b/twilio/rest/preview/deployed_devices/fleet/deployment.py index 5dbda65c66..7448678832 100644 --- a/twilio/rest/preview/deployed_devices/fleet/deployment.py +++ b/twilio/rest/preview/deployed_devices/fleet/deployment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DeploymentInstance(InstanceResource): - """ :ivar sid: Contains a 34 character string that uniquely identifies this Deployment resource. :ivar url: Contains an absolute URL for this Deployment resource. diff --git a/twilio/rest/preview/deployed_devices/fleet/device.py b/twilio/rest/preview/deployed_devices/fleet/device.py index afaa0fce2a..554e257edd 100644 --- a/twilio/rest/preview/deployed_devices/fleet/device.py +++ b/twilio/rest/preview/deployed_devices/fleet/device.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DeviceInstance(InstanceResource): - """ :ivar sid: Contains a 34 character string that uniquely identifies this Device resource. :ivar url: Contains an absolute URL for this Device resource. diff --git a/twilio/rest/preview/deployed_devices/fleet/key.py b/twilio/rest/preview/deployed_devices/fleet/key.py index 9bcfd8fb0f..dd96745e9c 100644 --- a/twilio/rest/preview/deployed_devices/fleet/key.py +++ b/twilio/rest/preview/deployed_devices/fleet/key.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class KeyInstance(InstanceResource): - """ :ivar sid: Contains a 34 character string that uniquely identifies this Key credential resource. :ivar url: Contains an absolute URL for this Key credential resource. diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py index 1cab771279..9eaf9674bf 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py b/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py index 4931d54c6b..cf9b975777 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -80,9 +79,9 @@ def __init__( self.capabilities: Optional[str] = payload.get("capabilities") self.friendly_name: Optional[str] = payload.get("friendly_name") self.unique_name: Optional[str] = payload.get("unique_name") - self.status: Optional[ - "DependentHostedNumberOrderInstance.Status" - ] = payload.get("status") + self.status: Optional["DependentHostedNumberOrderInstance.Status"] = ( + payload.get("status") + ) self.failure_reason: Optional[str] = payload.get("failure_reason") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") diff --git a/twilio/rest/preview/hosted_numbers/hosted_number_order.py b/twilio/rest/preview/hosted_numbers/hosted_number_order.py index 3927202489..d3a32b6849 100644 --- a/twilio/rest/preview/hosted_numbers/hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/hosted_number_order.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/preview/marketplace/available_add_on/__init__.py b/twilio/rest/preview/marketplace/available_add_on/__init__.py index 776a33e9d9..520cb0fbd4 100644 --- a/twilio/rest/preview/marketplace/available_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/available_add_on/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -26,7 +25,6 @@ class AvailableAddOnInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the AvailableAddOn resource. :ivar friendly_name: The string that you assigned to describe the resource. diff --git a/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py b/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py index 218b48ee3f..96ed8497c1 100644 --- a/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py +++ b/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class AvailableAddOnExtensionInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the AvailableAddOnExtension resource. :ivar available_add_on_sid: The SID of the AvailableAddOn resource to which this extension applies. diff --git a/twilio/rest/preview/marketplace/installed_add_on/__init__.py b/twilio/rest/preview/marketplace/installed_add_on/__init__.py index 87d0926728..019092aac4 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/installed_add_on/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class InstalledAddOnInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the InstalledAddOn resource. This Sid can also be found in the Console on that specific Add-ons page as the 'Available Add-on Sid'. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the InstalledAddOn resource. diff --git a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py index e191c8c48f..592adf0bf5 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py +++ b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class InstalledAddOnExtensionInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the InstalledAddOn Extension resource. :ivar installed_add_on_sid: The SID of the InstalledAddOn resource to which this extension applies. diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py index c9f33d19bf..9bf53d7759 100644 --- a/twilio/rest/preview/sync/service/__init__.py +++ b/twilio/rest/preview/sync/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: diff --git a/twilio/rest/preview/sync/service/document/__init__.py b/twilio/rest/preview/sync/service/document/__init__.py index ebd08889f9..74e89faadf 100644 --- a/twilio/rest/preview/sync/service/document/__init__.py +++ b/twilio/rest/preview/sync/service/document/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class DocumentInstance(InstanceResource): - """ :ivar sid: :ivar unique_name: diff --git a/twilio/rest/preview/sync/service/document/document_permission.py b/twilio/rest/preview/sync/service/document/document_permission.py index 1b43dc9fcf..a32903c5fc 100644 --- a/twilio/rest/preview/sync/service/document/document_permission.py +++ b/twilio/rest/preview/sync/service/document/document_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class DocumentPermissionInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Twilio Account. :ivar service_sid: The unique SID identifier of the Sync Service Instance. diff --git a/twilio/rest/preview/sync/service/sync_list/__init__.py b/twilio/rest/preview/sync/service/sync_list/__init__.py index d3cd34c547..091650c44a 100644 --- a/twilio/rest/preview/sync/service/sync_list/__init__.py +++ b/twilio/rest/preview/sync/service/sync_list/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class SyncListInstance(InstanceResource): - """ :ivar sid: :ivar unique_name: diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py index 592f84a3c4..6308a983eb 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py index 7e1a2db968..1752a95378 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SyncListPermissionInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Twilio Account. :ivar service_sid: The unique SID identifier of the Sync Service Instance. diff --git a/twilio/rest/preview/sync/service/sync_map/__init__.py b/twilio/rest/preview/sync/service/sync_map/__init__.py index 47235fd80c..93fe825c78 100644 --- a/twilio/rest/preview/sync/service/sync_map/__init__.py +++ b/twilio/rest/preview/sync/service/sync_map/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class SyncMapInstance(InstanceResource): - """ :ivar sid: :ivar unique_name: diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py index ef42e77d38..8409fafd19 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py index 3b3230fe17..83d4c87d9b 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SyncMapPermissionInstance(InstanceResource): - """ :ivar account_sid: The unique SID identifier of the Twilio Account. :ivar service_sid: The unique SID identifier of the Sync Service Instance. diff --git a/twilio/rest/preview/understand/assistant/__init__.py b/twilio/rest/preview/understand/assistant/__init__.py index 27970ca4da..52235aa204 100644 --- a/twilio/rest/preview/understand/assistant/__init__.py +++ b/twilio/rest/preview/understand/assistant/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -36,7 +35,6 @@ class AssistantInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Assistant. :ivar date_created: The date that this resource was created @@ -287,9 +285,9 @@ def __init__(self, version: Version, sid: str): self._uri = "/Assistants/{sid}".format(**self._solution) self._assistant_fallback_actions: Optional[AssistantFallbackActionsList] = None - self._assistant_initiation_actions: Optional[ - AssistantInitiationActionsList - ] = None + self._assistant_initiation_actions: Optional[AssistantInitiationActionsList] = ( + None + ) self._dialogues: Optional[DialogueList] = None self._field_types: Optional[FieldTypeList] = None self._model_builds: Optional[ModelBuildList] = None diff --git a/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py b/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py index 84e964de0e..ca696d735d 100644 --- a/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py +++ b/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class AssistantFallbackActionsInstance(InstanceResource): - """ :ivar account_sid: :ivar assistant_sid: diff --git a/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py b/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py index 544154f658..051925df27 100644 --- a/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py +++ b/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class AssistantInitiationActionsInstance(InstanceResource): - """ :ivar account_sid: :ivar assistant_sid: diff --git a/twilio/rest/preview/understand/assistant/dialogue.py b/twilio/rest/preview/understand/assistant/dialogue.py index 57b0016ec2..a9cf86a45c 100644 --- a/twilio/rest/preview/understand/assistant/dialogue.py +++ b/twilio/rest/preview/understand/assistant/dialogue.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class DialogueInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Field. :ivar assistant_sid: The unique ID of the parent Assistant. diff --git a/twilio/rest/preview/understand/assistant/field_type/__init__.py b/twilio/rest/preview/understand/assistant/field_type/__init__.py index 0deb38faf1..18cc0ff735 100644 --- a/twilio/rest/preview/understand/assistant/field_type/__init__.py +++ b/twilio/rest/preview/understand/assistant/field_type/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class FieldTypeInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Field Type. :ivar date_created: The date that this resource was created diff --git a/twilio/rest/preview/understand/assistant/field_type/field_value.py b/twilio/rest/preview/understand/assistant/field_type/field_value.py index 87fb7df94b..58e70c4a7e 100644 --- a/twilio/rest/preview/understand/assistant/field_type/field_value.py +++ b/twilio/rest/preview/understand/assistant/field_type/field_value.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class FieldValueInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Field Value. :ivar date_created: The date that this resource was created diff --git a/twilio/rest/preview/understand/assistant/model_build.py b/twilio/rest/preview/understand/assistant/model_build.py index 8b45b76dc0..bddcf37bac 100644 --- a/twilio/rest/preview/understand/assistant/model_build.py +++ b/twilio/rest/preview/understand/assistant/model_build.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/preview/understand/assistant/query.py b/twilio/rest/preview/understand/assistant/query.py index 62fb2e3e11..3fb1b114ab 100644 --- a/twilio/rest/preview/understand/assistant/query.py +++ b/twilio/rest/preview/understand/assistant/query.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class QueryInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Query. :ivar date_created: The date that this resource was created diff --git a/twilio/rest/preview/understand/assistant/style_sheet.py b/twilio/rest/preview/understand/assistant/style_sheet.py index 4571fc4cb1..881a658a44 100644 --- a/twilio/rest/preview/understand/assistant/style_sheet.py +++ b/twilio/rest/preview/understand/assistant/style_sheet.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class StyleSheetInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Assistant :ivar assistant_sid: The unique ID of the Assistant diff --git a/twilio/rest/preview/understand/assistant/task/__init__.py b/twilio/rest/preview/understand/assistant/task/__init__.py index 135a421ec6..0447151a01 100644 --- a/twilio/rest/preview/understand/assistant/task/__init__.py +++ b/twilio/rest/preview/understand/assistant/task/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -30,7 +29,6 @@ class TaskInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Task. :ivar date_created: The date that this resource was created diff --git a/twilio/rest/preview/understand/assistant/task/field.py b/twilio/rest/preview/understand/assistant/task/field.py index e8f4aa3a8c..2d3ccb83c4 100644 --- a/twilio/rest/preview/understand/assistant/task/field.py +++ b/twilio/rest/preview/understand/assistant/task/field.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class FieldInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Field. :ivar date_created: The date that this resource was created diff --git a/twilio/rest/preview/understand/assistant/task/sample.py b/twilio/rest/preview/understand/assistant/task/sample.py index ef8719c6ac..3c863c4536 100644 --- a/twilio/rest/preview/understand/assistant/task/sample.py +++ b/twilio/rest/preview/understand/assistant/task/sample.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class SampleInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Sample. :ivar date_created: The date that this resource was created diff --git a/twilio/rest/preview/understand/assistant/task/task_actions.py b/twilio/rest/preview/understand/assistant/task/task_actions.py index 41366bbb96..66dd0df4c9 100644 --- a/twilio/rest/preview/understand/assistant/task/task_actions.py +++ b/twilio/rest/preview/understand/assistant/task/task_actions.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class TaskActionsInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Field. :ivar assistant_sid: The unique ID of the parent Assistant. diff --git a/twilio/rest/preview/understand/assistant/task/task_statistics.py b/twilio/rest/preview/understand/assistant/task/task_statistics.py index 07375954c7..2461406eb7 100644 --- a/twilio/rest/preview/understand/assistant/task/task_statistics.py +++ b/twilio/rest/preview/understand/assistant/task/task_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import deserialize from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class TaskStatisticsInstance(InstanceResource): - """ :ivar account_sid: The unique ID of the Account that created this Field. :ivar assistant_sid: The unique ID of the parent Assistant. diff --git a/twilio/rest/preview/wireless/command.py b/twilio/rest/preview/wireless/command.py index 4f3e4603af..371f38c69e 100644 --- a/twilio/rest/preview/wireless/command.py +++ b/twilio/rest/preview/wireless/command.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CommandInstance(InstanceResource): - """ :ivar sid: :ivar account_sid: diff --git a/twilio/rest/preview/wireless/rate_plan.py b/twilio/rest/preview/wireless/rate_plan.py index 04b16f5b38..88b29460ef 100644 --- a/twilio/rest/preview/wireless/rate_plan.py +++ b/twilio/rest/preview/wireless/rate_plan.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class RatePlanInstance(InstanceResource): - """ :ivar sid: :ivar unique_name: diff --git a/twilio/rest/preview/wireless/sim/__init__.py b/twilio/rest/preview/wireless/sim/__init__.py index 3a5dd7e770..79b633cce9 100644 --- a/twilio/rest/preview/wireless/sim/__init__.py +++ b/twilio/rest/preview/wireless/sim/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class SimInstance(InstanceResource): - """ :ivar sid: :ivar unique_name: diff --git a/twilio/rest/preview/wireless/sim/usage.py b/twilio/rest/preview/wireless/sim/usage.py index de1ca5a035..aa3dd0ac82 100644 --- a/twilio/rest/preview/wireless/sim/usage.py +++ b/twilio/rest/preview/wireless/sim/usage.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class UsageInstance(InstanceResource): - """ :ivar sim_sid: :ivar sim_unique_name: diff --git a/twilio/rest/pricing/v1/messaging/__init__.py b/twilio/rest/pricing/v1/messaging/__init__.py index 32230c7135..5b78074052 100644 --- a/twilio/rest/pricing/v1/messaging/__init__.py +++ b/twilio/rest/pricing/v1/messaging/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/pricing/v1/messaging/country.py b/twilio/rest/pricing/v1/messaging/country.py index fba539fc68..39c6bcfdba 100644 --- a/twilio/rest/pricing/v1/messaging/country.py +++ b/twilio/rest/pricing/v1/messaging/country.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class CountryInstance(InstanceResource): - """ :ivar country: The name of the country. :ivar iso_country: The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). diff --git a/twilio/rest/pricing/v1/phone_number/__init__.py b/twilio/rest/pricing/v1/phone_number/__init__.py index b3cfbe50e4..34b5ea7576 100644 --- a/twilio/rest/pricing/v1/phone_number/__init__.py +++ b/twilio/rest/pricing/v1/phone_number/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/pricing/v1/phone_number/country.py b/twilio/rest/pricing/v1/phone_number/country.py index 30a0eeb475..ac550bfd94 100644 --- a/twilio/rest/pricing/v1/phone_number/country.py +++ b/twilio/rest/pricing/v1/phone_number/country.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class CountryInstance(InstanceResource): - """ :ivar country: The name of the country. :ivar iso_country: The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). diff --git a/twilio/rest/pricing/v1/voice/__init__.py b/twilio/rest/pricing/v1/voice/__init__.py index 4d91f382c9..62a7acaf24 100644 --- a/twilio/rest/pricing/v1/voice/__init__.py +++ b/twilio/rest/pricing/v1/voice/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/pricing/v1/voice/country.py b/twilio/rest/pricing/v1/voice/country.py index c65df83f41..7f8e48cf99 100644 --- a/twilio/rest/pricing/v1/voice/country.py +++ b/twilio/rest/pricing/v1/voice/country.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class CountryInstance(InstanceResource): - """ :ivar country: The name of the country. :ivar iso_country: The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). diff --git a/twilio/rest/pricing/v1/voice/number.py b/twilio/rest/pricing/v1/voice/number.py index dfdf4b63f8..3e47c4888e 100644 --- a/twilio/rest/pricing/v1/voice/number.py +++ b/twilio/rest/pricing/v1/voice/number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class NumberInstance(InstanceResource): - """ :ivar number: The phone number. :ivar country: The name of the country. diff --git a/twilio/rest/pricing/v2/country.py b/twilio/rest/pricing/v2/country.py index 6842359b88..f94b6f1cb4 100644 --- a/twilio/rest/pricing/v2/country.py +++ b/twilio/rest/pricing/v2/country.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class CountryInstance(InstanceResource): - """ :ivar country: The name of the country. :ivar iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). diff --git a/twilio/rest/pricing/v2/number.py b/twilio/rest/pricing/v2/number.py index 39d8eb4783..8165f88702 100644 --- a/twilio/rest/pricing/v2/number.py +++ b/twilio/rest/pricing/v2/number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class NumberInstance(InstanceResource): - """ :ivar destination_number: The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. :ivar origination_number: The origination phone number in [[E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. diff --git a/twilio/rest/pricing/v2/voice/__init__.py b/twilio/rest/pricing/v2/voice/__init__.py index 6539469636..62279bebed 100644 --- a/twilio/rest/pricing/v2/voice/__init__.py +++ b/twilio/rest/pricing/v2/voice/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/pricing/v2/voice/country.py b/twilio/rest/pricing/v2/voice/country.py index a06ed0a762..9364c7df35 100644 --- a/twilio/rest/pricing/v2/voice/country.py +++ b/twilio/rest/pricing/v2/voice/country.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class CountryInstance(InstanceResource): - """ :ivar country: The name of the country. :ivar iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). diff --git a/twilio/rest/pricing/v2/voice/number.py b/twilio/rest/pricing/v2/voice/number.py index 6d4f1bddb3..e0fea643fc 100644 --- a/twilio/rest/pricing/v2/voice/number.py +++ b/twilio/rest/pricing/v2/voice/number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class NumberInstance(InstanceResource): - """ :ivar destination_number: The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. :ivar origination_number: The origination phone number in [[E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. diff --git a/twilio/rest/proxy/v1/service/__init__.py b/twilio/rest/proxy/v1/service/__init__.py index ec886ad2bb..7074161065 100644 --- a/twilio/rest/proxy/v1/service/__init__.py +++ b/twilio/rest/proxy/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/proxy/v1/service/phone_number.py b/twilio/rest/proxy/v1/service/phone_number.py index fc8c514f13..8158a72c50 100644 --- a/twilio/rest/proxy/v1/service/phone_number.py +++ b/twilio/rest/proxy/v1/service/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class PhoneNumberInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the PhoneNumber resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PhoneNumber resource. diff --git a/twilio/rest/proxy/v1/service/session/__init__.py b/twilio/rest/proxy/v1/service/session/__init__.py index 7ce76fcab5..7244fae89c 100644 --- a/twilio/rest/proxy/v1/service/session/__init__.py +++ b/twilio/rest/proxy/v1/service/session/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/proxy/v1/service/session/interaction.py b/twilio/rest/proxy/v1/service/session/interaction.py index 145da3a703..9e681c176d 100644 --- a/twilio/rest/proxy/v1/service/session/interaction.py +++ b/twilio/rest/proxy/v1/service/session/interaction.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -94,9 +93,9 @@ def __init__( "inbound_participant_sid" ) self.inbound_resource_sid: Optional[str] = payload.get("inbound_resource_sid") - self.inbound_resource_status: Optional[ - "InteractionInstance.ResourceStatus" - ] = payload.get("inbound_resource_status") + self.inbound_resource_status: Optional["InteractionInstance.ResourceStatus"] = ( + payload.get("inbound_resource_status") + ) self.inbound_resource_type: Optional[str] = payload.get("inbound_resource_type") self.inbound_resource_url: Optional[str] = payload.get("inbound_resource_url") self.outbound_participant_sid: Optional[str] = payload.get( diff --git a/twilio/rest/proxy/v1/service/session/participant/__init__.py b/twilio/rest/proxy/v1/service/session/participant/__init__.py index ce3c16abd0..35f2c622bd 100644 --- a/twilio/rest/proxy/v1/service/session/participant/__init__.py +++ b/twilio/rest/proxy/v1/service/session/participant/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class ParticipantInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Participant resource. :ivar session_sid: The SID of the parent [Session](https://www.twilio.com/docs/proxy/api/session) resource. diff --git a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py index b07b1782fa..1f6ff22814 100644 --- a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py +++ b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/proxy/v1/service/short_code.py b/twilio/rest/proxy/v1/service/short_code.py index 27dc8467f1..83a0a6c1b3 100644 --- a/twilio/rest/proxy/v1/service/short_code.py +++ b/twilio/rest/proxy/v1/service/short_code.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ShortCodeInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the ShortCode resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ShortCode resource. diff --git a/twilio/rest/routes/v2/phone_number.py b/twilio/rest/routes/v2/phone_number.py index 496a3de2ba..4b9de1a97d 100644 --- a/twilio/rest/routes/v2/phone_number.py +++ b/twilio/rest/routes/v2/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class PhoneNumberInstance(InstanceResource): - """ :ivar phone_number: The phone number in E.164 format :ivar url: The absolute URL of the resource. diff --git a/twilio/rest/routes/v2/sip_domain.py b/twilio/rest/routes/v2/sip_domain.py index 42755a43fc..eac3d643f6 100644 --- a/twilio/rest/routes/v2/sip_domain.py +++ b/twilio/rest/routes/v2/sip_domain.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class SipDomainInstance(InstanceResource): - """ :ivar sip_domain: :ivar url: diff --git a/twilio/rest/routes/v2/trunk.py b/twilio/rest/routes/v2/trunk.py index cf02b000b1..0addd96fdf 100644 --- a/twilio/rest/routes/v2/trunk.py +++ b/twilio/rest/routes/v2/trunk.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class TrunkInstance(InstanceResource): - """ :ivar sip_trunk_domain: The absolute URL of the SIP Trunk :ivar url: The absolute URL of the resource. diff --git a/twilio/rest/serverless/v1/service/__init__.py b/twilio/rest/serverless/v1/service/__init__.py index 146827d812..271e399df1 100644 --- a/twilio/rest/serverless/v1/service/__init__.py +++ b/twilio/rest/serverless/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. diff --git a/twilio/rest/serverless/v1/service/asset/__init__.py b/twilio/rest/serverless/v1/service/asset/__init__.py index 7b70adf1c4..17e5ecc38d 100644 --- a/twilio/rest/serverless/v1/service/asset/__init__.py +++ b/twilio/rest/serverless/v1/service/asset/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class AssetInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Asset resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Asset resource. diff --git a/twilio/rest/serverless/v1/service/asset/asset_version.py b/twilio/rest/serverless/v1/service/asset/asset_version.py index 34ebb07ef0..a8fa462d22 100644 --- a/twilio/rest/serverless/v1/service/asset/asset_version.py +++ b/twilio/rest/serverless/v1/service/asset/asset_version.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/serverless/v1/service/environment/__init__.py b/twilio/rest/serverless/v1/service/environment/__init__.py index dac46b9744..a072d8ffa9 100644 --- a/twilio/rest/serverless/v1/service/environment/__init__.py +++ b/twilio/rest/serverless/v1/service/environment/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class EnvironmentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Environment resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Environment resource. diff --git a/twilio/rest/serverless/v1/service/environment/deployment.py b/twilio/rest/serverless/v1/service/environment/deployment.py index f0f6b50037..2738d967ce 100644 --- a/twilio/rest/serverless/v1/service/environment/deployment.py +++ b/twilio/rest/serverless/v1/service/environment/deployment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DeploymentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Deployment resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Deployment resource. diff --git a/twilio/rest/serverless/v1/service/environment/log.py b/twilio/rest/serverless/v1/service/environment/log.py index d856ba75d8..0249ee4ebd 100644 --- a/twilio/rest/serverless/v1/service/environment/log.py +++ b/twilio/rest/serverless/v1/service/environment/log.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/serverless/v1/service/environment/variable.py b/twilio/rest/serverless/v1/service/environment/variable.py index b619e3a655..35447b75cd 100644 --- a/twilio/rest/serverless/v1/service/environment/variable.py +++ b/twilio/rest/serverless/v1/service/environment/variable.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class VariableInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Variable resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Variable resource. diff --git a/twilio/rest/serverless/v1/service/function/__init__.py b/twilio/rest/serverless/v1/service/function/__init__.py index 3f2919316d..a18444d392 100644 --- a/twilio/rest/serverless/v1/service/function/__init__.py +++ b/twilio/rest/serverless/v1/service/function/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class FunctionInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Function resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Function resource. diff --git a/twilio/rest/serverless/v1/service/function/function_version/__init__.py b/twilio/rest/serverless/v1/service/function/function_version/__init__.py index 73443897a9..0b551904ea 100644 --- a/twilio/rest/serverless/v1/service/function/function_version/__init__.py +++ b/twilio/rest/serverless/v1/service/function/function_version/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py b/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py index c39f9f0710..0b99cf8774 100644 --- a/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py +++ b/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class FunctionVersionContentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Function Version resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Function Version resource. diff --git a/twilio/rest/studio/v1/flow/__init__.py b/twilio/rest/studio/v1/flow/__init__.py index a7c5756e04..a950be3cc6 100644 --- a/twilio/rest/studio/v1/flow/__init__.py +++ b/twilio/rest/studio/v1/flow/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/studio/v1/flow/engagement/__init__.py b/twilio/rest/studio/v1/flow/engagement/__init__.py index e0f56dbaf7..7962f7ae04 100644 --- a/twilio/rest/studio/v1/flow/engagement/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/studio/v1/flow/engagement/engagement_context.py b/twilio/rest/studio/v1/flow/engagement/engagement_context.py index d558b38bed..8dc0d1c511 100644 --- a/twilio/rest/studio/v1/flow/engagement/engagement_context.py +++ b/twilio/rest/studio/v1/flow/engagement/engagement_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class EngagementContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the Account. :ivar context: As your flow executes, we save the state in what's called the Flow Context. Any data in the flow context can be accessed by your widgets as variables, either in configuration fields or in text areas as variable substitution. diff --git a/twilio/rest/studio/v1/flow/engagement/step/__init__.py b/twilio/rest/studio/v1/flow/engagement/step/__init__.py index c1638f29cf..8e87942d00 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/step/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class StepInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Step resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Step resource. diff --git a/twilio/rest/studio/v1/flow/engagement/step/step_context.py b/twilio/rest/studio/v1/flow/engagement/step/step_context.py index c1555d05ab..a32c82c6d0 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/step_context.py +++ b/twilio/rest/studio/v1/flow/engagement/step/step_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class StepContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the StepContext resource. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. diff --git a/twilio/rest/studio/v1/flow/execution/__init__.py b/twilio/rest/studio/v1/flow/execution/__init__.py index d0ad05b67a..5cfa28cd28 100644 --- a/twilio/rest/studio/v1/flow/execution/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/studio/v1/flow/execution/execution_context.py b/twilio/rest/studio/v1/flow/execution/execution_context.py index d84431d12a..e36b21e1e1 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_context.py +++ b/twilio/rest/studio/v1/flow/execution/execution_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class ExecutionContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionContext resource. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py index 462e5322b4..0eb15e1253 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class ExecutionStepInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the ExecutionStep resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStep resource. diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py b/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py index 1463adec6b..b33c0c6356 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class ExecutionStepContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStepContext resource. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. diff --git a/twilio/rest/studio/v2/flow/__init__.py b/twilio/rest/studio/v2/flow/__init__.py index 408e29cc7b..f4e24626bf 100644 --- a/twilio/rest/studio/v2/flow/__init__.py +++ b/twilio/rest/studio/v2/flow/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/studio/v2/flow/execution/__init__.py b/twilio/rest/studio/v2/flow/execution/__init__.py index 1173683525..4056a5d3d5 100644 --- a/twilio/rest/studio/v2/flow/execution/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/studio/v2/flow/execution/execution_context.py b/twilio/rest/studio/v2/flow/execution/execution_context.py index 47628b1ea9..eb432cafbd 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_context.py +++ b/twilio/rest/studio/v2/flow/execution/execution_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class ExecutionContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionContext resource. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. diff --git a/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py index 7b43ad5eee..83682a53ea 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class ExecutionStepInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the ExecutionStep resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStep resource. diff --git a/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py b/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py index 5a88321590..c89d9f1edd 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py +++ b/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -21,7 +20,6 @@ class ExecutionStepContextInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStepContext resource. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. diff --git a/twilio/rest/studio/v2/flow/flow_revision.py b/twilio/rest/studio/v2/flow/flow_revision.py index a9a5394a4f..bf9efc6d54 100644 --- a/twilio/rest/studio/v2/flow/flow_revision.py +++ b/twilio/rest/studio/v2/flow/flow_revision.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/studio/v2/flow/flow_test_user.py b/twilio/rest/studio/v2/flow/flow_test_user.py index d5dbee7d68..81bee7ed98 100644 --- a/twilio/rest/studio/v2/flow/flow_test_user.py +++ b/twilio/rest/studio/v2/flow/flow_test_user.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class FlowTestUserInstance(InstanceResource): - """ :ivar sid: Unique identifier of the flow. :ivar test_users: List of test user identities that can test draft versions of the flow. diff --git a/twilio/rest/studio/v2/flow_validate.py b/twilio/rest/studio/v2/flow_validate.py index 74ddfa2362..63ebb7623c 100644 --- a/twilio/rest/studio/v2/flow_validate.py +++ b/twilio/rest/studio/v2/flow_validate.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import serialize, values diff --git a/twilio/rest/supersim/v1/esim_profile.py b/twilio/rest/supersim/v1/esim_profile.py index 230ac298a8..4477dda2fa 100644 --- a/twilio/rest/supersim/v1/esim_profile.py +++ b/twilio/rest/supersim/v1/esim_profile.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/supersim/v1/fleet.py b/twilio/rest/supersim/v1/fleet.py index 0017ff4e92..05058744c2 100644 --- a/twilio/rest/supersim/v1/fleet.py +++ b/twilio/rest/supersim/v1/fleet.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/supersim/v1/ip_command.py b/twilio/rest/supersim/v1/ip_command.py index 98e6e2a0a5..aab4470af1 100644 --- a/twilio/rest/supersim/v1/ip_command.py +++ b/twilio/rest/supersim/v1/ip_command.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/supersim/v1/network.py b/twilio/rest/supersim/v1/network.py index 7364105c88..5ea9a8e4ab 100644 --- a/twilio/rest/supersim/v1/network.py +++ b/twilio/rest/supersim/v1/network.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class NetworkInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Network resource. :ivar friendly_name: A human readable identifier of this resource. diff --git a/twilio/rest/supersim/v1/network_access_profile/__init__.py b/twilio/rest/supersim/v1/network_access_profile/__init__.py index 0712dbe653..a355b746b4 100644 --- a/twilio/rest/supersim/v1/network_access_profile/__init__.py +++ b/twilio/rest/supersim/v1/network_access_profile/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class NetworkAccessProfileInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the Network Access Profile resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. diff --git a/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py b/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py index 065418f39d..eeacec1e73 100644 --- a/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py +++ b/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class NetworkAccessProfileNetworkInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the Network resource. :ivar network_access_profile_sid: The unique string that identifies the Network resource's Network Access Profile resource. diff --git a/twilio/rest/supersim/v1/settings_update.py b/twilio/rest/supersim/v1/settings_update.py index d9b00143ad..ea13986d0b 100644 --- a/twilio/rest/supersim/v1/settings_update.py +++ b/twilio/rest/supersim/v1/settings_update.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/supersim/v1/sim/__init__.py b/twilio/rest/supersim/v1/sim/__init__.py index fae9427497..735e8fadcd 100644 --- a/twilio/rest/supersim/v1/sim/__init__.py +++ b/twilio/rest/supersim/v1/sim/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/supersim/v1/sim/billing_period.py b/twilio/rest/supersim/v1/sim/billing_period.py index 52afd38c70..082622ecee 100644 --- a/twilio/rest/supersim/v1/sim/billing_period.py +++ b/twilio/rest/supersim/v1/sim/billing_period.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/supersim/v1/sim/sim_ip_address.py b/twilio/rest/supersim/v1/sim/sim_ip_address.py index 42911d1372..e0b5a5756d 100644 --- a/twilio/rest/supersim/v1/sim/sim_ip_address.py +++ b/twilio/rest/supersim/v1/sim/sim_ip_address.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -36,9 +35,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], sim_sid: str): super().__init__(version) self.ip_address: Optional[str] = payload.get("ip_address") - self.ip_address_version: Optional[ - "SimIpAddressInstance.IpAddressVersion" - ] = payload.get("ip_address_version") + self.ip_address_version: Optional["SimIpAddressInstance.IpAddressVersion"] = ( + payload.get("ip_address_version") + ) self._solution = { "sim_sid": sim_sid, diff --git a/twilio/rest/supersim/v1/sms_command.py b/twilio/rest/supersim/v1/sms_command.py index 83601dd7ce..18e496c718 100644 --- a/twilio/rest/supersim/v1/sms_command.py +++ b/twilio/rest/supersim/v1/sms_command.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/supersim/v1/usage_record.py b/twilio/rest/supersim/v1/usage_record.py index 5962a59951..19ba4989de 100644 --- a/twilio/rest/supersim/v1/usage_record.py +++ b/twilio/rest/supersim/v1/usage_record.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/sync/v1/service/__init__.py b/twilio/rest/sync/v1/service/__init__.py index 7db062b90d..08434aec32 100644 --- a/twilio/rest/sync/v1/service/__init__.py +++ b/twilio/rest/sync/v1/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. It is a read-only property, it cannot be assigned using REST API. diff --git a/twilio/rest/sync/v1/service/document/__init__.py b/twilio/rest/sync/v1/service/document/__init__.py index 5689594a8a..0cd5c918db 100644 --- a/twilio/rest/sync/v1/service/document/__init__.py +++ b/twilio/rest/sync/v1/service/document/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -27,7 +26,6 @@ class DocumentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Document resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource and can be up to 320 characters long. diff --git a/twilio/rest/sync/v1/service/document/document_permission.py b/twilio/rest/sync/v1/service/document/document_permission.py index da0241f552..0e9a3e29ec 100644 --- a/twilio/rest/sync/v1/service/document/document_permission.py +++ b/twilio/rest/sync/v1/service/document/document_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class DocumentPermissionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Document Permission resource. :ivar service_sid: The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. diff --git a/twilio/rest/sync/v1/service/sync_list/__init__.py b/twilio/rest/sync/v1/service/sync_list/__init__.py index 545ebee389..da694eb36a 100644 --- a/twilio/rest/sync/v1/service/sync_list/__init__.py +++ b/twilio/rest/sync/v1/service/sync_list/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class SyncListInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Sync List resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py index 640b4c38ce..8597395916 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py index f0d970b18d..9b94b7fb5e 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SyncListPermissionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sync List Permission resource. :ivar service_sid: The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. diff --git a/twilio/rest/sync/v1/service/sync_map/__init__.py b/twilio/rest/sync/v1/service/sync_map/__init__.py index 5b38378f2b..3147e502d7 100644 --- a/twilio/rest/sync/v1/service/sync_map/__init__.py +++ b/twilio/rest/sync/v1/service/sync_map/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -28,7 +27,6 @@ class SyncMapInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Sync Map resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py index ef290caab2..0f7681600b 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py index ee34694dd4..b983a77bb5 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SyncMapPermissionInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sync Map Permission resource. :ivar service_sid: The SID of the [Sync Service](https://www.twilio.com/docs/sync/api/service) the resource is associated with. diff --git a/twilio/rest/sync/v1/service/sync_stream/__init__.py b/twilio/rest/sync/v1/service/sync_stream/__init__.py index 59507674dd..f1146e9a83 100644 --- a/twilio/rest/sync/v1/service/sync_stream/__init__.py +++ b/twilio/rest/sync/v1/service/sync_stream/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class SyncStreamInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Sync Stream resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. diff --git a/twilio/rest/sync/v1/service/sync_stream/stream_message.py b/twilio/rest/sync/v1/service/sync_stream/stream_message.py index 5227bb076b..d525b8e2c9 100644 --- a/twilio/rest/sync/v1/service/sync_stream/stream_message.py +++ b/twilio/rest/sync/v1/service/sync_stream/stream_message.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import serialize, values @@ -22,7 +21,6 @@ class StreamMessageInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Stream Message resource. :ivar data: An arbitrary, schema-less object that contains the Stream Message body. Can be up to 4 KiB in length. diff --git a/twilio/rest/taskrouter/v1/workspace/__init__.py b/twilio/rest/taskrouter/v1/workspace/__init__.py index 886ba65c93..fcdea4c373 100644 --- a/twilio/rest/taskrouter/v1/workspace/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -83,9 +82,9 @@ def __init__( self.sid: Optional[str] = payload.get("sid") self.timeout_activity_name: Optional[str] = payload.get("timeout_activity_name") self.timeout_activity_sid: Optional[str] = payload.get("timeout_activity_sid") - self.prioritize_queue_order: Optional[ - "WorkspaceInstance.QueueOrder" - ] = payload.get("prioritize_queue_order") + self.prioritize_queue_order: Optional["WorkspaceInstance.QueueOrder"] = ( + payload.get("prioritize_queue_order") + ) self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") diff --git a/twilio/rest/taskrouter/v1/workspace/activity.py b/twilio/rest/taskrouter/v1/workspace/activity.py index b233113d33..79b4504fdd 100644 --- a/twilio/rest/taskrouter/v1/workspace/activity.py +++ b/twilio/rest/taskrouter/v1/workspace/activity.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ActivityInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Activity resource. :ivar available: Whether the Worker is eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` indicates the Activity is available. All other values indicate that it is not. The value cannot be changed after the Activity is created. diff --git a/twilio/rest/taskrouter/v1/workspace/event.py b/twilio/rest/taskrouter/v1/workspace/event.py index 82f71317e2..1e55f2e9aa 100644 --- a/twilio/rest/taskrouter/v1/workspace/event.py +++ b/twilio/rest/taskrouter/v1/workspace/event.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class EventInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Event resource. :ivar actor_sid: The SID of the resource that triggered the event. diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index 74c5a8fee4..49b3af73e4 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/taskrouter/v1/workspace/task/reservation.py b/twilio/rest/taskrouter/v1/workspace/task/reservation.py index 32e7c6b4da..e053ec8016 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/task/reservation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/taskrouter/v1/workspace/task_channel.py b/twilio/rest/taskrouter/v1/workspace/task_channel.py index d6408dcd74..6fd6f24f41 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/task_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class TaskChannelInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Task Channel resource. :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py index cc523c8514..d4ab32eb54 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py index 94c213b626..f910aa4329 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class TaskQueueCumulativeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. :ivar avg_task_acceptance_time: The average time in seconds between Task creation and acceptance. @@ -96,9 +94,9 @@ def __init__( self.wait_duration_until_canceled: Optional[Dict[str, object]] = payload.get( "wait_duration_until_canceled" ) - self.wait_duration_in_queue_until_accepted: Optional[ - Dict[str, object] - ] = payload.get("wait_duration_in_queue_until_accepted") + self.wait_duration_in_queue_until_accepted: Optional[Dict[str, object]] = ( + payload.get("wait_duration_in_queue_until_accepted") + ) self.tasks_canceled: Optional[int] = deserialize.integer( payload.get("tasks_canceled") ) diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py index d588f99d4d..f8786d42be 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class TaskQueueRealTimeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. :ivar activity_statistics: The number of current Workers by Activity. diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py index 97fef95c2c..53543ec1dc 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class TaskQueueStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. :ivar cumulative: An object that contains the cumulative statistics for the TaskQueue. diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py index 091715e7dd..74768da3f9 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values @@ -24,7 +23,6 @@ class TaskQueuesStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. :ivar cumulative: An object that contains the cumulative statistics for the TaskQueues. diff --git a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py index 104731aeda..851b303467 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -38,7 +37,6 @@ class WorkerInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. :ivar activity_name: The `friendly_name` of the Worker's current Activity. diff --git a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py index e99705d669..f95c2ad143 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py index 74c8531af6..d75955d5ad 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class WorkerChannelInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. :ivar assigned_tasks: The total number of Tasks assigned to Worker for the TaskChannel type. diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py index 7724d5caf0..591d72fb70 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class WorkerStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. :ivar cumulative: An object that contains the cumulative statistics for the Worker. diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py index 14310b05bb..ecb5fe9a01 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class WorkersCumulativeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. :ivar start_time: The beginning of the interval during which these statistics were calculated, in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py index c59611dcfa..5fb8ce12cb 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class WorkersRealTimeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Worker resource. :ivar activity_statistics: The number of current Workers by Activity. diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py index 58ef59969b..78feeda3f9 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class WorkersStatisticsInstance(InstanceResource): - """ :ivar realtime: An object that contains the real-time statistics for the Worker. :ivar cumulative: An object that contains the cumulative statistics for the Worker. diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py index 04cbba20b7..e12a42748b 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -33,7 +32,6 @@ class WorkflowInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. :ivar assignment_callback_url: The URL that we call when a task managed by the Workflow is assigned to a Worker. See Assignment Callback URL for more information. diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py index 28e557b8c2..3fa89fdf0c 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class WorkflowCumulativeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. :ivar avg_task_acceptance_time: The average time in seconds between Task creation and acceptance. diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py index 55a41f5d84..9c21c0e47f 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class WorkflowRealTimeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. :ivar longest_task_waiting_age: The age of the longest waiting Task. diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py index 521b2921b7..087ed816ea 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class WorkflowStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workflow resource. :ivar cumulative: An object that contains the cumulative statistics for the Workflow. diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py index 71e8a56a7a..b13c11d006 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class WorkspaceCumulativeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workspace resource. :ivar avg_task_acceptance_time: The average time in seconds between Task creation and acceptance. diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py index d69600d7f2..92e2b50753 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class WorkspaceRealTimeStatisticsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Workspace resource. :ivar activity_statistics: The number of current Workers by Activity. diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py index 443ee93903..5dd18d9281 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import serialize, values @@ -23,7 +22,6 @@ class WorkspaceStatisticsInstance(InstanceResource): - """ :ivar realtime: An object that contains the real-time statistics for the Workspace. :ivar cumulative: An object that contains the cumulative statistics for the Workspace. diff --git a/twilio/rest/trunking/v1/trunk/__init__.py b/twilio/rest/trunking/v1/trunk/__init__.py index e7a0aa5cfd..954290932e 100644 --- a/twilio/rest/trunking/v1/trunk/__init__.py +++ b/twilio/rest/trunking/v1/trunk/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -75,9 +74,9 @@ def __init__( self.transfer_mode: Optional["TrunkInstance.TransferSetting"] = payload.get( "transfer_mode" ) - self.transfer_caller_id: Optional[ - "TrunkInstance.TransferCallerId" - ] = payload.get("transfer_caller_id") + self.transfer_caller_id: Optional["TrunkInstance.TransferCallerId"] = ( + payload.get("transfer_caller_id") + ) self.cnam_lookup_enabled: Optional[bool] = payload.get("cnam_lookup_enabled") self.auth_type: Optional[str] = payload.get("auth_type") self.auth_type_set: Optional[List[str]] = payload.get("auth_type_set") diff --git a/twilio/rest/trunking/v1/trunk/credential_list.py b/twilio/rest/trunking/v1/trunk/credential_list.py index 805d66260d..cdfb5de7b7 100644 --- a/twilio/rest/trunking/v1/trunk/credential_list.py +++ b/twilio/rest/trunking/v1/trunk/credential_list.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CredentialListInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CredentialList resource. :ivar sid: The unique string that we created to identify the CredentialList resource. diff --git a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py index e528e0b1c3..7f9b51a7a7 100644 --- a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py +++ b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class IpAccessControlListInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IpAccessControlList resource. :ivar sid: The unique string that we created to identify the IpAccessControlList resource. diff --git a/twilio/rest/trunking/v1/trunk/origination_url.py b/twilio/rest/trunking/v1/trunk/origination_url.py index 79dca9387b..27f451d2d5 100644 --- a/twilio/rest/trunking/v1/trunk/origination_url.py +++ b/twilio/rest/trunking/v1/trunk/origination_url.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class OriginationUrlInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the OriginationUrl resource. :ivar sid: The unique string that we created to identify the OriginationUrl resource. diff --git a/twilio/rest/trunking/v1/trunk/phone_number.py b/twilio/rest/trunking/v1/trunk/phone_number.py index 98f53c408f..06f9ded10c 100644 --- a/twilio/rest/trunking/v1/trunk/phone_number.py +++ b/twilio/rest/trunking/v1/trunk/phone_number.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/trunking/v1/trunk/recording.py b/twilio/rest/trunking/v1/trunk/recording.py index 02d9ca290d..7d03f6cda1 100644 --- a/twilio/rest/trunking/v1/trunk/recording.py +++ b/twilio/rest/trunking/v1/trunk/recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext diff --git a/twilio/rest/trusthub/v1/compliance_inquiries.py b/twilio/rest/trusthub/v1/compliance_inquiries.py index c5c88d9155..41d061bdbe 100644 --- a/twilio/rest/trusthub/v1/compliance_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_inquiries.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class ComplianceInquiriesInstance(InstanceResource): - """ :ivar inquiry_id: The unique ID used to start an embedded compliance registration session. :ivar inquiry_session_token: The session token used to start an embedded compliance registration session. diff --git a/twilio/rest/trusthub/v1/customer_profiles/__init__.py b/twilio/rest/trusthub/v1/customer_profiles/__init__.py index a82fafa4da..5158206782 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/__init__.py +++ b/twilio/rest/trusthub/v1/customer_profiles/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py index e1905c1ac5..36005dc32e 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CustomerProfilesChannelEndpointAssignmentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Item Assignment resource. :ivar customer_profile_sid: The unique string that we created to identify the CustomerProfile resource. diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py index c318b539cc..18579c0473 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class CustomerProfilesEntityAssignmentsInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Item Assignment resource. :ivar customer_profile_sid: The unique string that we created to identify the CustomerProfile resource. diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py index c3611f7647..5c158ee0c2 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -52,9 +51,9 @@ def __init__( self.account_sid: Optional[str] = payload.get("account_sid") self.policy_sid: Optional[str] = payload.get("policy_sid") self.customer_profile_sid: Optional[str] = payload.get("customer_profile_sid") - self.status: Optional[ - "CustomerProfilesEvaluationsInstance.Status" - ] = payload.get("status") + self.status: Optional["CustomerProfilesEvaluationsInstance.Status"] = ( + payload.get("status") + ) self.results: Optional[List[object]] = payload.get("results") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") diff --git a/twilio/rest/trusthub/v1/end_user.py b/twilio/rest/trusthub/v1/end_user.py index 05f096b6c3..09c84f2923 100644 --- a/twilio/rest/trusthub/v1/end_user.py +++ b/twilio/rest/trusthub/v1/end_user.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class EndUserInstance(InstanceResource): - """ :ivar sid: The unique string created by Twilio to identify the End User resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the End User resource. diff --git a/twilio/rest/trusthub/v1/end_user_type.py b/twilio/rest/trusthub/v1/end_user_type.py index 391012e1ac..997408b331 100644 --- a/twilio/rest/trusthub/v1/end_user_type.py +++ b/twilio/rest/trusthub/v1/end_user_type.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class EndUserTypeInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the End-User Type resource. :ivar friendly_name: A human-readable description that is assigned to describe the End-User Type resource. Examples can include first name, last name, email, business name, etc diff --git a/twilio/rest/trusthub/v1/policies.py b/twilio/rest/trusthub/v1/policies.py index 6c08335216..82a501554d 100644 --- a/twilio/rest/trusthub/v1/policies.py +++ b/twilio/rest/trusthub/v1/policies.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class PoliciesInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the Policy resource. :ivar friendly_name: A human-readable description that is assigned to describe the Policy resource. Examples can include Primary Customer profile policy diff --git a/twilio/rest/trusthub/v1/supporting_document.py b/twilio/rest/trusthub/v1/supporting_document.py index f1f29a4afa..b8bf6805f5 100644 --- a/twilio/rest/trusthub/v1/supporting_document.py +++ b/twilio/rest/trusthub/v1/supporting_document.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/trusthub/v1/supporting_document_type.py b/twilio/rest/trusthub/v1/supporting_document_type.py index 204c0b53a4..b6a91e24ac 100644 --- a/twilio/rest/trusthub/v1/supporting_document_type.py +++ b/twilio/rest/trusthub/v1/supporting_document_type.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -23,7 +22,6 @@ class SupportingDocumentTypeInstance(InstanceResource): - """ :ivar sid: The unique string that identifies the Supporting Document Type resource. :ivar friendly_name: A human-readable description of the Supporting Document Type resource. diff --git a/twilio/rest/trusthub/v1/trust_products/__init__.py b/twilio/rest/trusthub/v1/trust_products/__init__.py index 627cc5a090..6c25207874 100644 --- a/twilio/rest/trusthub/v1/trust_products/__init__.py +++ b/twilio/rest/trusthub/v1/trust_products/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py b/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py index 42b5923e6f..21c52f5a57 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class TrustProductsChannelEndpointAssignmentInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Item Assignment resource. :ivar trust_product_sid: The unique string that we created to identify the CustomerProfile resource. diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py index 306f9359b5..4de853f054 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class TrustProductsEntityAssignmentsInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Item Assignment resource. :ivar trust_product_sid: The unique string that we created to identify the TrustProduct resource. diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py index f2d435c1cb..1263d7296a 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/verify/v2/form.py b/twilio/rest/verify/v2/form.py index 9b17da9e48..915eab3bdc 100644 --- a/twilio/rest/verify/v2/form.py +++ b/twilio/rest/verify/v2/form.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource diff --git a/twilio/rest/verify/v2/safelist.py b/twilio/rest/verify/v2/safelist.py index 45e5b220e1..1bd1d8c0b4 100644 --- a/twilio/rest/verify/v2/safelist.py +++ b/twilio/rest/verify/v2/safelist.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class SafelistInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the SafeList resource. :ivar phone_number: The phone number in SafeList. diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 32685a079e..7429a3528a 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -33,7 +32,6 @@ class ServiceInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. diff --git a/twilio/rest/verify/v2/service/access_token.py b/twilio/rest/verify/v2/service/access_token.py index 8c1bc46f8f..8ea618a3a4 100644 --- a/twilio/rest/verify/v2/service/access_token.py +++ b/twilio/rest/verify/v2/service/access_token.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values diff --git a/twilio/rest/verify/v2/service/entity/__init__.py b/twilio/rest/verify/v2/service/entity/__init__.py index 74629d9bb2..e2250d501f 100644 --- a/twilio/rest/verify/v2/service/entity/__init__.py +++ b/twilio/rest/verify/v2/service/entity/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class EntityInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this Entity. :ivar identity: The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. diff --git a/twilio/rest/verify/v2/service/entity/challenge/__init__.py b/twilio/rest/verify/v2/service/entity/challenge/__init__.py index 65aab902b1..791128fd61 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/__init__.py +++ b/twilio/rest/verify/v2/service/entity/challenge/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -96,9 +95,9 @@ def __init__( self.status: Optional["ChallengeInstance.ChallengeStatuses"] = payload.get( "status" ) - self.responded_reason: Optional[ - "ChallengeInstance.ChallengeReasons" - ] = payload.get("responded_reason") + self.responded_reason: Optional["ChallengeInstance.ChallengeReasons"] = ( + payload.get("responded_reason") + ) self.details: Optional[Dict[str, object]] = payload.get("details") self.hidden_details: Optional[Dict[str, object]] = payload.get("hidden_details") self.metadata: Optional[Dict[str, object]] = payload.get("metadata") diff --git a/twilio/rest/verify/v2/service/entity/challenge/notification.py b/twilio/rest/verify/v2/service/entity/challenge/notification.py index a04fea65ed..b4ac882ba1 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/notification.py +++ b/twilio/rest/verify/v2/service/entity/challenge/notification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, values @@ -23,7 +22,6 @@ class NotificationInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this Notification. :ivar account_sid: The unique SID identifier of the Account. diff --git a/twilio/rest/verify/v2/service/entity/factor.py b/twilio/rest/verify/v2/service/entity/factor.py index b46a643717..cf06f184cf 100644 --- a/twilio/rest/verify/v2/service/entity/factor.py +++ b/twilio/rest/verify/v2/service/entity/factor.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/verify/v2/service/entity/new_factor.py b/twilio/rest/verify/v2/service/entity/new_factor.py index 71c793cc65..33cb1eb76f 100644 --- a/twilio/rest/verify/v2/service/entity/new_factor.py +++ b/twilio/rest/verify/v2/service/entity/new_factor.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/verify/v2/service/messaging_configuration.py b/twilio/rest/verify/v2/service/messaging_configuration.py index 51d170ea41..49ae96a119 100644 --- a/twilio/rest/verify/v2/service/messaging_configuration.py +++ b/twilio/rest/verify/v2/service/messaging_configuration.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class MessagingConfigurationInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. :ivar service_sid: The SID of the [Service](https://www.twilio.com/docs/verify/api/service) that the resource is associated with. diff --git a/twilio/rest/verify/v2/service/rate_limit/__init__.py b/twilio/rest/verify/v2/service/rate_limit/__init__.py index f411c57e65..b301b8ef43 100644 --- a/twilio/rest/verify/v2/service/rate_limit/__init__.py +++ b/twilio/rest/verify/v2/service/rate_limit/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -25,7 +24,6 @@ class RateLimitInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this Rate Limit. :ivar service_sid: The SID of the [Service](https://www.twilio.com/docs/verify/api/service) the resource is associated with. diff --git a/twilio/rest/verify/v2/service/rate_limit/bucket.py b/twilio/rest/verify/v2/service/rate_limit/bucket.py index a97b1e0171..55dd7576ae 100644 --- a/twilio/rest/verify/v2/service/rate_limit/bucket.py +++ b/twilio/rest/verify/v2/service/rate_limit/bucket.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class BucketInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies this Bucket. :ivar rate_limit_sid: The Twilio-provided string that uniquely identifies the Rate Limit resource. diff --git a/twilio/rest/verify/v2/service/verification.py b/twilio/rest/verify/v2/service/verification.py index 91acb3d7e0..c4b504506b 100644 --- a/twilio/rest/verify/v2/service/verification.py +++ b/twilio/rest/verify/v2/service/verification.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/verify/v2/service/verification_check.py b/twilio/rest/verify/v2/service/verification_check.py index 05a8399f87..a8c44f51e3 100644 --- a/twilio/rest/verify/v2/service/verification_check.py +++ b/twilio/rest/verify/v2/service/verification_check.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values diff --git a/twilio/rest/verify/v2/service/webhook.py b/twilio/rest/verify/v2/service/webhook.py index c7924db4bf..85e9d2e40c 100644 --- a/twilio/rest/verify/v2/service/webhook.py +++ b/twilio/rest/verify/v2/service/webhook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/verify/v2/template.py b/twilio/rest/verify/v2/template.py index ba9f5bd75e..4f3791bd9a 100644 --- a/twilio/rest/verify/v2/template.py +++ b/twilio/rest/verify/v2/template.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,7 +22,6 @@ class TemplateInstance(InstanceResource): - """ :ivar sid: A 34 character string that uniquely identifies a Verification Template. :ivar account_sid: The unique SID identifier of the Account. diff --git a/twilio/rest/verify/v2/verification_attempt.py b/twilio/rest/verify/v2/verification_attempt.py index 8ed27f6775..a0c18a2ce1 100644 --- a/twilio/rest/verify/v2/verification_attempt.py +++ b/twilio/rest/verify/v2/verification_attempt.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/verify/v2/verification_attempts_summary.py b/twilio/rest/verify/v2/verification_attempts_summary.py index d913c40b9b..a2a1c0a974 100644 --- a/twilio/rest/verify/v2/verification_attempts_summary.py +++ b/twilio/rest/verify/v2/verification_attempts_summary.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional, Union from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/video/v1/composition.py b/twilio/rest/video/v1/composition.py index 2fead14204..ae6a52c9a1 100644 --- a/twilio/rest/video/v1/composition.py +++ b/twilio/rest/video/v1/composition.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/video/v1/composition_hook.py b/twilio/rest/video/v1/composition_hook.py index e15c43c4ac..58f91fec4b 100644 --- a/twilio/rest/video/v1/composition_hook.py +++ b/twilio/rest/video/v1/composition_hook.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/video/v1/composition_settings.py b/twilio/rest/video/v1/composition_settings.py index 42d10368d2..12da95a9dd 100644 --- a/twilio/rest/video/v1/composition_settings.py +++ b/twilio/rest/video/v1/composition_settings.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class CompositionSettingsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CompositionSettings resource. :ivar friendly_name: The string that you assigned to describe the resource and that will be shown in the console diff --git a/twilio/rest/video/v1/recording.py b/twilio/rest/video/v1/recording.py index af0973776f..c72ce8528f 100644 --- a/twilio/rest/video/v1/recording.py +++ b/twilio/rest/video/v1/recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/video/v1/recording_settings.py b/twilio/rest/video/v1/recording_settings.py index 2e3a4750f6..372b070ae3 100644 --- a/twilio/rest/video/v1/recording_settings.py +++ b/twilio/rest/video/v1/recording_settings.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class RecordingSettingsInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RecordingSettings resource. :ivar friendly_name: The string that you assigned to describe the resource and show the user in the console diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index bc87b88e28..71fb8a9e7d 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/video/v1/room/participant/__init__.py b/twilio/rest/video/v1/room/participant/__init__.py index f8a21ba6a1..40c8dff509 100644 --- a/twilio/rest/video/v1/room/participant/__init__.py +++ b/twilio/rest/video/v1/room/participant/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/video/v1/room/participant/anonymize.py b/twilio/rest/video/v1/room/participant/anonymize.py index 415c5b1f20..2f1b29b267 100644 --- a/twilio/rest/video/v1/room/participant/anonymize.py +++ b/twilio/rest/video/v1/room/participant/anonymize.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, Optional from twilio.base import deserialize, values diff --git a/twilio/rest/video/v1/room/participant/published_track.py b/twilio/rest/video/v1/room/participant/published_track.py index a5156fee8f..faedb7f71d 100644 --- a/twilio/rest/video/v1/room/participant/published_track.py +++ b/twilio/rest/video/v1/room/participant/published_track.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/video/v1/room/participant/subscribe_rules.py b/twilio/rest/video/v1/room/participant/subscribe_rules.py index 28e3976d15..cc3a62cb28 100644 --- a/twilio/rest/video/v1/room/participant/subscribe_rules.py +++ b/twilio/rest/video/v1/room/participant/subscribe_rules.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class SubscribeRulesInstance(InstanceResource): - """ :ivar participant_sid: The SID of the Participant resource for the Subscribe Rules. :ivar room_sid: The SID of the Room resource for the Subscribe Rules diff --git a/twilio/rest/video/v1/room/participant/subscribed_track.py b/twilio/rest/video/v1/room/participant/subscribed_track.py index 627015a44a..aaffdf5f9f 100644 --- a/twilio/rest/video/v1/room/participant/subscribed_track.py +++ b/twilio/rest/video/v1/room/participant/subscribed_track.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/video/v1/room/recording_rules.py b/twilio/rest/video/v1/room/recording_rules.py index 68adaed070..9ebbb24083 100644 --- a/twilio/rest/video/v1/room/recording_rules.py +++ b/twilio/rest/video/v1/room/recording_rules.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, serialize, values @@ -23,7 +22,6 @@ class RecordingRulesInstance(InstanceResource): - """ :ivar room_sid: The SID of the Room resource for the Recording Rules :ivar rules: A collection of Recording Rules that describe how to include or exclude matching tracks for recording diff --git a/twilio/rest/video/v1/room/room_recording.py b/twilio/rest/video/v1/room/room_recording.py index 481422eacb..284e2670c6 100644 --- a/twilio/rest/video/v1/room/room_recording.py +++ b/twilio/rest/video/v1/room/room_recording.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values diff --git a/twilio/rest/voice/v1/archived_call.py b/twilio/rest/voice/v1/archived_call.py index de13e682da..a5272513a3 100644 --- a/twilio/rest/voice/v1/archived_call.py +++ b/twilio/rest/voice/v1/archived_call.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import date from twilio.base.instance_context import InstanceContext diff --git a/twilio/rest/voice/v1/byoc_trunk.py b/twilio/rest/voice/v1/byoc_trunk.py index 88ed49dcbc..31e3b6d4ec 100644 --- a/twilio/rest/voice/v1/byoc_trunk.py +++ b/twilio/rest/voice/v1/byoc_trunk.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ByocTrunkInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the BYOC Trunk resource. :ivar sid: The unique string that that we created to identify the BYOC Trunk resource. diff --git a/twilio/rest/voice/v1/connection_policy/__init__.py b/twilio/rest/voice/v1/connection_policy/__init__.py index e1c26dc495..d4e6260713 100644 --- a/twilio/rest/voice/v1/connection_policy/__init__.py +++ b/twilio/rest/voice/v1/connection_policy/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -27,7 +26,6 @@ class ConnectionPolicyInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Connection Policy resource. :ivar sid: The unique string that we created to identify the Connection Policy resource. diff --git a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py index e617072cb2..67b720914c 100644 --- a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py +++ b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class ConnectionPolicyTargetInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Target resource. :ivar connection_policy_sid: The SID of the Connection Policy that owns the Target. diff --git a/twilio/rest/voice/v1/dialing_permissions/__init__.py b/twilio/rest/voice/v1/dialing_permissions/__init__.py index 2de126841e..1439a7ef62 100644 --- a/twilio/rest/voice/v1/dialing_permissions/__init__.py +++ b/twilio/rest/voice/v1/dialing_permissions/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Optional diff --git a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py index 3e4966c72e..d8f2e33eb0 100644 --- a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py +++ b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional from twilio.base import deserialize, values @@ -22,7 +21,6 @@ class BulkCountryUpdateInstance(InstanceResource): - """ :ivar update_count: The number of countries updated :ivar update_request: A bulk update request to change voice dialing country permissions stored as a URL-encoded, JSON array of update objects. For example : `[ { \"iso_code\": \"GB\", \"low_risk_numbers_enabled\": \"true\", \"high_risk_special_numbers_enabled\":\"true\", \"high_risk_tollfraud_numbers_enabled\": \"false\" } ]` diff --git a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py index 424a9828d0..63bf8fa636 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -26,7 +25,6 @@ class CountryInstance(InstanceResource): - """ :ivar iso_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2). :ivar name: The name of the country. diff --git a/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py b/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py index ef46284f20..ce08da28bc 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values @@ -23,7 +22,6 @@ class HighriskSpecialPrefixInstance(InstanceResource): - """ :ivar prefix: A prefix is a contiguous number range for a block of E.164 numbers that includes the E.164 assigned country code. For example, a North American Numbering Plan prefix like `+1510720` written like `+1(510) 720` matches all numbers inclusive from `+1(510) 720-0000` to `+1(510) 720-9999`. """ diff --git a/twilio/rest/voice/v1/dialing_permissions/settings.py b/twilio/rest/voice/v1/dialing_permissions/settings.py index 5b762c742a..eba5fa8017 100644 --- a/twilio/rest/voice/v1/dialing_permissions/settings.py +++ b/twilio/rest/voice/v1/dialing_permissions/settings.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext @@ -22,7 +21,6 @@ class SettingsInstance(InstanceResource): - """ :ivar dialing_permissions_inheritance: `true` if the sub-account will inherit voice dialing permissions from the Master Project; otherwise `false`. :ivar url: The absolute URL of this resource. diff --git a/twilio/rest/voice/v1/ip_record.py b/twilio/rest/voice/v1/ip_record.py index c81322d423..9e8a0f5c01 100644 --- a/twilio/rest/voice/v1/ip_record.py +++ b/twilio/rest/voice/v1/ip_record.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class IpRecordInstance(InstanceResource): - """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IP Record resource. :ivar sid: The unique string that we created to identify the IP Record resource. diff --git a/twilio/rest/voice/v1/source_ip_mapping.py b/twilio/rest/voice/v1/source_ip_mapping.py index b61bee9cc5..7123ca1aa2 100644 --- a/twilio/rest/voice/v1/source_ip_mapping.py +++ b/twilio/rest/voice/v1/source_ip_mapping.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class SourceIpMappingInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the IP Record resource. :ivar ip_record_sid: The Twilio-provided string that uniquely identifies the IP Record resource to map from. diff --git a/twilio/rest/wireless/v1/command.py b/twilio/rest/wireless/v1/command.py index 16d230adbf..b669e287d4 100644 --- a/twilio/rest/wireless/v1/command.py +++ b/twilio/rest/wireless/v1/command.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index 469c8997ea..e6f6b4bcf4 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, serialize, values @@ -24,7 +23,6 @@ class RatePlanInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the RatePlan resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. diff --git a/twilio/rest/wireless/v1/sim/__init__.py b/twilio/rest/wireless/v1/sim/__init__.py index 7c4cf5a423..0060eb6883 100644 --- a/twilio/rest/wireless/v1/sim/__init__.py +++ b/twilio/rest/wireless/v1/sim/__init__.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values diff --git a/twilio/rest/wireless/v1/sim/data_session.py b/twilio/rest/wireless/v1/sim/data_session.py index 75f7bc3bfc..0b94a9836c 100644 --- a/twilio/rest/wireless/v1/sim/data_session.py +++ b/twilio/rest/wireless/v1/sim/data_session.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import deserialize, values @@ -24,7 +23,6 @@ class DataSessionInstance(InstanceResource): - """ :ivar sid: The unique string that we created to identify the DataSession resource. :ivar sim_sid: The SID of the [Sim resource](https://www.twilio.com/docs/iot/wireless/api/sim-resource) that the Data Session is for. diff --git a/twilio/rest/wireless/v1/sim/usage_record.py b/twilio/rest/wireless/v1/sim/usage_record.py index eb15cf228f..a759afe519 100644 --- a/twilio/rest/wireless/v1/sim/usage_record.py +++ b/twilio/rest/wireless/v1/sim/usage_record.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values diff --git a/twilio/rest/wireless/v1/usage_record.py b/twilio/rest/wireless/v1/usage_record.py index 38c96f5d4f..40992a01da 100644 --- a/twilio/rest/wireless/v1/usage_record.py +++ b/twilio/rest/wireless/v1/usage_record.py @@ -12,7 +12,6 @@ Do not edit the class manually. """ - from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import serialize, values From f0a2548f11bcff4fcfcaa557ca3c1aa1f91105e8 Mon Sep 17 00:00:00 2001 From: sbansla <104902068+sbansla@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:52:26 +0530 Subject: [PATCH 002/113] chore: disable cluster test (#758) * chore: disable cluster test * chore: run prettier --- .github/workflows/test-and-deploy.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index e94bc5fd9a..c9d4c023f7 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -33,20 +33,21 @@ jobs: run: | pip install virtualenv --upgrade make install test-install + make prettier - name: Run the tests run: make test-with-coverage - - name: Run Cluster Tests - if: (!github.event.pull_request.head.repo.fork) - env: - TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} - TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} - TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} - TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} - TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} - TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} - run: make cluster-test +# - name: Run Cluster Tests +# if: (!github.event.pull_request.head.repo.fork) +# env: +# TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} +# TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} +# TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} +# TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} +# TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} +# TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} +# run: make cluster-test - name: Verify docs generation run: make docs From 2287a7b9f76e1cd4d1060e9febbbf8c4434e875d Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 9 Feb 2024 15:33:07 +0530 Subject: [PATCH 003/113] fix: added boolean_to_string converter (#753) --- tests/unit/base/test_serialize.py | 22 ++++++++++++++++++++++ twilio/base/serialize.py | 10 ++++++++++ 2 files changed, 32 insertions(+) diff --git a/tests/unit/base/test_serialize.py b/tests/unit/base/test_serialize.py index 204fe2c2a0..57891a65b7 100644 --- a/tests/unit/base/test_serialize.py +++ b/tests/unit/base/test_serialize.py @@ -90,6 +90,28 @@ def test_list(self): self.assertEqual({}, actual) +class BooleanTestCase(unittest.TestCase): + def test_none(self): + value = None + actual = serialize.boolean_to_string(value) + self.assertIsNone(actual) + + def test_string(self): + value = "True" + actual = serialize.boolean_to_string(value) + self.assertEqual("true", actual) + + def test_bool_true(self): + value = True + actual = serialize.boolean_to_string(value) + self.assertEqual("true", actual) + + def test_bool_false(self): + value = False + actual = serialize.boolean_to_string(value) + self.assertEqual("false", actual) + + class ObjectTestCase(unittest.TestCase): def test_object(self): actual = serialize.object({"twilio": "rocks"}) diff --git a/twilio/base/serialize.py b/twilio/base/serialize.py index 3abc0defef..eac2e12c2e 100644 --- a/twilio/base/serialize.py +++ b/twilio/base/serialize.py @@ -61,6 +61,16 @@ def flatten_dict(d, result=None, prv_keys=None): return {} +def boolean_to_string(bool_or_str): + if bool_or_str is None: + return bool_or_str + + if isinstance(bool_or_str, str): + return bool_or_str.lower() + + return "true" if bool_or_str else "false" + + def object(obj): """ Return a jsonified string represenation of obj if obj is jsonifiable else From ced068b4d8f6798f9e41822e8c1f50cf0ebbc6a3 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 9 Feb 2024 12:14:58 +0000 Subject: [PATCH 004/113] [Librarian] Regenerated @ c3db20dd5f24647ef2bd3fb8b955496c59bb22bd --- CHANGES.md | 67 ++ twilio/rest/__init__.py | 30 - twilio/rest/accounts/AccountsBase.py | 1 + twilio/rest/accounts/v1/__init__.py | 1 + .../rest/accounts/v1/auth_token_promotion.py | 2 + .../rest/accounts/v1/credential/__init__.py | 1 + twilio/rest/accounts/v1/credential/aws.py | 5 + .../rest/accounts/v1/credential/public_key.py | 5 + twilio/rest/accounts/v1/safelist.py | 67 +- .../rest/accounts/v1/secondary_auth_token.py | 2 + twilio/rest/api/ApiBase.py | 1 + twilio/rest/api/v2010/__init__.py | 1 + twilio/rest/api/v2010/account/__init__.py | 6 + .../api/v2010/account/address/__init__.py | 5 + .../account/address/dependent_phone_number.py | 3 + twilio/rest/api/v2010/account/application.py | 5 + .../v2010/account/authorized_connect_app.py | 15 +- .../__init__.py | 3 + .../available_phone_number_country/local.py | 2 + .../machine_to_machine.py | 2 + .../available_phone_number_country/mobile.py | 2 + .../national.py | 2 + .../shared_cost.py | 2 + .../toll_free.py | 2 + .../available_phone_number_country/voip.py | 2 + twilio/rest/api/v2010/account/balance.py | 5 + .../rest/api/v2010/account/call/__init__.py | 6 + twilio/rest/api/v2010/account/call/event.py | 2 + .../rest/api/v2010/account/call/feedback.py | 3 + .../v2010/account/call/feedback_summary.py | 7 +- .../api/v2010/account/call/notification.py | 3 + twilio/rest/api/v2010/account/call/payment.py | 5 + .../rest/api/v2010/account/call/recording.py | 6 + twilio/rest/api/v2010/account/call/siprec.py | 5 + twilio/rest/api/v2010/account/call/stream.py | 5 + .../account/call/user_defined_message.py | 3 + .../call/user_defined_message_subscription.py | 4 + .../api/v2010/account/conference/__init__.py | 4 + .../v2010/account/conference/participant.py | 12 + .../api/v2010/account/conference/recording.py | 4 + twilio/rest/api/v2010/account/connect_app.py | 4 + .../account/incoming_phone_number/__init__.py | 6 + .../assigned_add_on/__init__.py | 5 + .../assigned_add_on_extension.py | 3 + .../account/incoming_phone_number/local.py | 5 + .../account/incoming_phone_number/mobile.py | 5 + .../incoming_phone_number/toll_free.py | 5 + twilio/rest/api/v2010/account/key.py | 3 + .../api/v2010/account/message/__init__.py | 20 +- .../api/v2010/account/message/feedback.py | 4 + .../rest/api/v2010/account/message/media.py | 3 + twilio/rest/api/v2010/account/new_key.py | 3 + .../rest/api/v2010/account/new_signing_key.py | 3 + twilio/rest/api/v2010/account/notification.py | 3 + .../api/v2010/account/outgoing_caller_id.py | 3 + .../rest/api/v2010/account/queue/__init__.py | 5 + twilio/rest/api/v2010/account/queue/member.py | 3 + .../api/v2010/account/recording/__init__.py | 4 + .../recording/add_on_result/__init__.py | 4 + .../recording/add_on_result/payload.py | 3 + .../v2010/account/recording/transcription.py | 4 + twilio/rest/api/v2010/account/short_code.py | 3 + twilio/rest/api/v2010/account/signing_key.py | 3 + twilio/rest/api/v2010/account/sip/__init__.py | 1 + .../account/sip/credential_list/__init__.py | 5 + .../account/sip/credential_list/credential.py | 5 + .../api/v2010/account/sip/domain/__init__.py | 5 + .../account/sip/domain/auth_types/__init__.py | 1 + .../auth_types/auth_type_calls/__init__.py | 1 + .../auth_calls_credential_list_mapping.py | 5 + ...th_calls_ip_access_control_list_mapping.py | 5 + .../auth_type_registrations/__init__.py | 1 + ...h_registrations_credential_list_mapping.py | 5 + .../sip/domain/credential_list_mapping.py | 5 + .../domain/ip_access_control_list_mapping.py | 5 + .../sip/ip_access_control_list/__init__.py | 5 + .../sip/ip_access_control_list/ip_address.py | 5 + twilio/rest/api/v2010/account/token.py | 3 + .../rest/api/v2010/account/transcription.py | 4 + .../rest/api/v2010/account/usage/__init__.py | 1 + .../v2010/account/usage/record/__init__.py | 3 + .../v2010/account/usage/record/all_time.py | 3 + .../api/v2010/account/usage/record/daily.py | 3 + .../v2010/account/usage/record/last_month.py | 3 + .../api/v2010/account/usage/record/monthly.py | 3 + .../v2010/account/usage/record/this_month.py | 3 + .../api/v2010/account/usage/record/today.py | 3 + .../api/v2010/account/usage/record/yearly.py | 3 + .../v2010/account/usage/record/yesterday.py | 3 + .../rest/api/v2010/account/usage/trigger.py | 6 + .../api/v2010/account/validation_request.py | 3 + twilio/rest/autopilot/AutopilotBase.py | 43 - twilio/rest/autopilot/v1/__init__.py | 50 - .../rest/autopilot/v1/assistant/__init__.py | 877 ----------------- .../rest/autopilot/v1/assistant/defaults.py | 271 ------ .../rest/autopilot/v1/assistant/dialogue.py | 208 ---- .../v1/assistant/field_type/__init__.py | 650 ------------- .../v1/assistant/field_type/field_value.py | 575 ------------ .../autopilot/v1/assistant/model_build.py | 626 ------------- twilio/rest/autopilot/v1/assistant/query.py | 727 -------------- .../autopilot/v1/assistant/style_sheet.py | 271 ------ .../autopilot/v1/assistant/task/__init__.py | 756 --------------- .../rest/autopilot/v1/assistant/task/field.py | 547 ----------- .../autopilot/v1/assistant/task/sample.py | 695 -------------- .../v1/assistant/task/task_actions.py | 299 ------ .../v1/assistant/task/task_statistics.py | 219 ----- twilio/rest/autopilot/v1/assistant/webhook.py | 669 ------------- twilio/rest/autopilot/v1/restore_assistant.py | 134 --- twilio/rest/bulkexports/BulkexportsBase.py | 1 + twilio/rest/bulkexports/v1/__init__.py | 1 + twilio/rest/bulkexports/v1/export/__init__.py | 2 + twilio/rest/bulkexports/v1/export/day.py | 3 + .../v1/export/export_custom_job.py | 4 + twilio/rest/bulkexports/v1/export/job.py | 2 + .../bulkexports/v1/export_configuration.py | 2 + twilio/rest/chat/ChatBase.py | 1 + twilio/rest/chat/v1/__init__.py | 1 + twilio/rest/chat/v1/credential.py | 6 + twilio/rest/chat/v1/service/__init__.py | 5 + .../rest/chat/v1/service/channel/__init__.py | 6 + twilio/rest/chat/v1/service/channel/invite.py | 5 + twilio/rest/chat/v1/service/channel/member.py | 5 + .../rest/chat/v1/service/channel/message.py | 6 + twilio/rest/chat/v1/service/role.py | 6 + twilio/rest/chat/v1/service/user/__init__.py | 5 + .../rest/chat/v1/service/user/user_channel.py | 3 + twilio/rest/chat/v2/__init__.py | 1 + twilio/rest/chat/v2/credential.py | 6 + twilio/rest/chat/v2/service/__init__.py | 5 + twilio/rest/chat/v2/service/binding.py | 4 + .../rest/chat/v2/service/channel/__init__.py | 8 + twilio/rest/chat/v2/service/channel/invite.py | 5 + twilio/rest/chat/v2/service/channel/member.py | 8 + .../rest/chat/v2/service/channel/message.py | 8 + .../rest/chat/v2/service/channel/webhook.py | 6 + twilio/rest/chat/v2/service/role.py | 6 + twilio/rest/chat/v2/service/user/__init__.py | 8 + .../rest/chat/v2/service/user/user_binding.py | 4 + .../rest/chat/v2/service/user/user_channel.py | 4 + twilio/rest/chat/v3/__init__.py | 1 + twilio/rest/chat/v3/channel.py | 3 + twilio/rest/content/ContentBase.py | 1 + twilio/rest/content/v1/__init__.py | 1 + twilio/rest/content/v1/content/__init__.py | 5 +- .../rest/content/v1/content/approval_fetch.py | 2 + .../rest/content/v1/content_and_approvals.py | 4 +- twilio/rest/content/v1/legacy_content.py | 4 +- .../rest/conversations/ConversationsBase.py | 1 + twilio/rest/conversations/v1/__init__.py | 1 + .../conversations/v1/address_configuration.py | 6 + .../v1/configuration/__init__.py | 2 + .../conversations/v1/configuration/webhook.py | 3 + .../conversations/v1/conversation/__init__.py | 8 + .../v1/conversation/message/__init__.py | 16 +- .../conversation/message/delivery_receipt.py | 4 + .../v1/conversation/participant.py | 8 + .../conversations/v1/conversation/webhook.py | 6 + twilio/rest/conversations/v1/credential.py | 6 + .../v1/participant_conversation.py | 3 + twilio/rest/conversations/v1/role.py | 6 + .../rest/conversations/v1/service/__init__.py | 5 + .../rest/conversations/v1/service/binding.py | 4 + .../v1/service/configuration/__init__.py | 2 + .../v1/service/configuration/notification.py | 2 + .../v1/service/configuration/webhook.py | 3 + .../v1/service/conversation/__init__.py | 8 + .../service/conversation/message/__init__.py | 16 +- .../conversation/message/delivery_receipt.py | 4 + .../v1/service/conversation/participant.py | 8 + .../v1/service/conversation/webhook.py | 6 + .../v1/service/participant_conversation.py | 3 + twilio/rest/conversations/v1/service/role.py | 6 + .../conversations/v1/service/user/__init__.py | 8 + .../v1/service/user/user_conversation.py | 4 + twilio/rest/conversations/v1/user/__init__.py | 8 + .../v1/user/user_conversation.py | 4 + twilio/rest/events/EventsBase.py | 1 + twilio/rest/events/v1/__init__.py | 1 + twilio/rest/events/v1/event_type.py | 3 + twilio/rest/events/v1/schema/__init__.py | 2 + .../rest/events/v1/schema/schema_version.py | 3 + twilio/rest/events/v1/sink/__init__.py | 6 + twilio/rest/events/v1/sink/sink_test.py | 1 + twilio/rest/events/v1/sink/sink_validate.py | 3 + .../rest/events/v1/subscription/__init__.py | 5 + .../v1/subscription/subscribed_event.py | 19 +- twilio/rest/flex_api/FlexApiBase.py | 1 + twilio/rest/flex_api/v1/__init__.py | 35 + twilio/rest/flex_api/v1/assessments.py | 7 + twilio/rest/flex_api/v1/channel.py | 5 + twilio/rest/flex_api/v1/configuration.py | 19 +- twilio/rest/flex_api/v1/flex_flow.py | 6 + .../v1/insights_assessments_comment.py | 6 + .../flex_api/v1/insights_conversational_ai.py | 295 ++++++ ...ights_conversational_ai_report_insights.py | 279 ++++++ .../flex_api/v1/insights_conversations.py | 4 +- .../flex_api/v1/insights_questionnaires.py | 9 +- .../v1/insights_questionnaires_category.py | 7 + .../v1/insights_questionnaires_question.py | 7 + twilio/rest/flex_api/v1/insights_segments.py | 2 + twilio/rest/flex_api/v1/insights_session.py | 2 + .../v1/insights_settings_answer_sets.py | 32 +- .../flex_api/v1/insights_settings_comment.py | 32 +- .../rest/flex_api/v1/insights_user_roles.py | 2 + .../rest/flex_api/v1/interaction/__init__.py | 4 + .../interaction_channel/__init__.py | 4 + .../interaction_channel_invite.py | 4 + .../interaction_channel_participant.py | 6 + .../v1/provisioning_status.py} | 93 +- twilio/rest/flex_api/v1/web_channel.py | 6 + twilio/rest/flex_api/v2/__init__.py | 1 + twilio/rest/flex_api/v2/web_channels.py | 3 + twilio/rest/frontline_api/FrontlineApiBase.py | 1 + twilio/rest/frontline_api/v1/__init__.py | 1 + twilio/rest/frontline_api/v1/user.py | 3 + twilio/rest/insights/InsightsBase.py | 1 + twilio/rest/insights/v1/__init__.py | 1 + twilio/rest/insights/v1/call/__init__.py | 2 + twilio/rest/insights/v1/call/annotation.py | 5 +- twilio/rest/insights/v1/call/call_summary.py | 3 + twilio/rest/insights/v1/call/event.py | 3 + twilio/rest/insights/v1/call/metric.py | 3 + twilio/rest/insights/v1/call_summaries.py | 3 + .../rest/insights/v1/conference/__init__.py | 4 + .../v1/conference/conference_participant.py | 4 + twilio/rest/insights/v1/room/__init__.py | 4 + twilio/rest/insights/v1/room/participant.py | 4 + twilio/rest/insights/v1/setting.py | 2 + twilio/rest/intelligence/IntelligenceBase.py | 1 + twilio/rest/intelligence/v2/__init__.py | 1 + twilio/rest/intelligence/v2/service.py | 20 +- .../intelligence/v2/transcript/__init__.py | 8 +- .../rest/intelligence/v2/transcript/media.py | 2 + .../v2/transcript/operator_result.py | 10 +- .../intelligence/v2/transcript/sentence.py | 2 + twilio/rest/ip_messaging/IpMessagingBase.py | 1 + twilio/rest/ip_messaging/v1/__init__.py | 1 + twilio/rest/ip_messaging/v1/credential.py | 6 + .../rest/ip_messaging/v1/service/__init__.py | 5 + .../v1/service/channel/__init__.py | 6 + .../ip_messaging/v1/service/channel/invite.py | 5 + .../ip_messaging/v1/service/channel/member.py | 5 + .../v1/service/channel/message.py | 6 + twilio/rest/ip_messaging/v1/service/role.py | 6 + .../ip_messaging/v1/service/user/__init__.py | 5 + .../v1/service/user/user_channel.py | 3 + twilio/rest/ip_messaging/v2/__init__.py | 1 + twilio/rest/ip_messaging/v2/credential.py | 6 + .../rest/ip_messaging/v2/service/__init__.py | 5 + .../rest/ip_messaging/v2/service/binding.py | 4 + .../v2/service/channel/__init__.py | 8 + .../ip_messaging/v2/service/channel/invite.py | 5 + .../ip_messaging/v2/service/channel/member.py | 8 + .../v2/service/channel/message.py | 8 + .../v2/service/channel/webhook.py | 6 + twilio/rest/ip_messaging/v2/service/role.py | 6 + .../ip_messaging/v2/service/user/__init__.py | 8 + .../v2/service/user/user_binding.py | 4 + .../v2/service/user/user_channel.py | 4 + twilio/rest/lookups/LookupsBase.py | 1 + twilio/rest/lookups/v1/__init__.py | 1 + twilio/rest/lookups/v1/phone_number.py | 2 + twilio/rest/lookups/v2/__init__.py | 1 + twilio/rest/lookups/v2/phone_number.py | 3 + twilio/rest/media/MediaBase.py | 1 + twilio/rest/media/v1/__init__.py | 1 + twilio/rest/media/v1/media_processor.py | 6 + twilio/rest/media/v1/media_recording.py | 4 + .../rest/media/v1/player_streamer/__init__.py | 6 + .../v1/player_streamer/playback_grant.py | 2 + twilio/rest/messaging/MessagingBase.py | 1 + twilio/rest/messaging/v1/__init__.py | 1 + .../v1/brand_registration/__init__.py | 6 + .../brand_registration_otp.py | 1 + .../v1/brand_registration/brand_vetting.py | 6 + twilio/rest/messaging/v1/deactivations.py | 2 + twilio/rest/messaging/v1/domain_certs.py | 2 + twilio/rest/messaging/v1/domain_config.py | 2 + .../v1/domain_config_messaging_service.py | 2 + twilio/rest/messaging/v1/external_campaign.py | 3 + .../v1/linkshortening_messaging_service.py | 2 + ...ng_messaging_service_domain_association.py | 2 + twilio/rest/messaging/v1/service/__init__.py | 6 + .../rest/messaging/v1/service/alpha_sender.py | 5 + .../messaging/v1/service/channel_sender.py | 5 +- .../rest/messaging/v1/service/phone_number.py | 5 + .../rest/messaging/v1/service/short_code.py | 5 + .../messaging/v1/service/us_app_to_person.py | 201 +++- .../v1/service/us_app_to_person_usecase.py | 34 +- .../messaging/v1/tollfree_verification.py | 62 ++ twilio/rest/messaging/v1/usecase.py | 7 +- twilio/rest/microvisor/MicrovisorBase.py | 1 + twilio/rest/microvisor/v1/__init__.py | 1 + twilio/rest/microvisor/v1/account_config.py | 5 + twilio/rest/microvisor/v1/account_secret.py | 5 + twilio/rest/microvisor/v1/app/__init__.py | 3 + twilio/rest/microvisor/v1/app/app_manifest.py | 2 + twilio/rest/microvisor/v1/device/__init__.py | 3 + .../microvisor/v1/device/device_config.py | 5 + .../microvisor/v1/device/device_secret.py | 5 + twilio/rest/monitor/MonitorBase.py | 1 + twilio/rest/monitor/v1/__init__.py | 1 + twilio/rest/monitor/v1/alert.py | 3 + twilio/rest/monitor/v1/event.py | 3 + twilio/rest/notify/NotifyBase.py | 1 + twilio/rest/notify/v1/__init__.py | 1 + twilio/rest/notify/v1/credential.py | 6 + twilio/rest/notify/v1/service/__init__.py | 19 +- twilio/rest/notify/v1/service/binding.py | 6 + twilio/rest/notify/v1/service/notification.py | 8 +- twilio/rest/numbers/NumbersBase.py | 1 + twilio/rest/numbers/v1/__init__.py | 9 + twilio/rest/numbers/v1/bulk_eligibility.py | 4 +- .../numbers/v1/porting_bulk_portability.py | 9 +- .../rest/numbers/v1/porting_port_in_fetch.py | 219 +++++ twilio/rest/numbers/v1/porting_portability.py | 3 + twilio/rest/numbers/v2/__init__.py | 1 + .../v2/authorization_document/__init__.py | 6 + .../dependent_hosted_number_order.py | 3 + .../numbers/v2/bulk_hosted_number_order.py | 5 +- twilio/rest/numbers/v2/hosted_number_order.py | 6 + .../v2/regulatory_compliance/__init__.py | 1 + .../regulatory_compliance/bundle/__init__.py | 6 + .../bundle/bundle_copy.py | 5 + .../bundle/evaluation.py | 6 +- .../bundle/item_assignment.py | 5 + .../bundle/replace_items.py | 4 + .../v2/regulatory_compliance/end_user.py | 6 + .../v2/regulatory_compliance/end_user_type.py | 5 +- .../v2/regulatory_compliance/regulation.py | 4 + .../supporting_document.py | 6 + .../supporting_document_type.py | 5 +- twilio/rest/oauth/OauthBase.py | 43 - twilio/rest/oauth/v1/__init__.py | 74 -- twilio/rest/oauth/v1/device_code.py | 135 --- twilio/rest/oauth/v1/oauth.py | 165 ---- twilio/rest/oauth/v1/openid_discovery.py | 197 ---- twilio/rest/oauth/v1/token.py | 166 ---- twilio/rest/preview/PreviewBase.py | 12 +- .../rest/preview/deployed_devices/__init__.py | 1 + .../deployed_devices/fleet/__init__.py | 5 + .../deployed_devices/fleet/certificate.py | 5 + .../deployed_devices/fleet/deployment.py | 5 + .../preview/deployed_devices/fleet/device.py | 5 + .../preview/deployed_devices/fleet/key.py | 5 + .../rest/preview/hosted_numbers/__init__.py | 1 + .../authorization_document/__init__.py | 6 + .../dependent_hosted_number_order.py | 3 + .../hosted_numbers/hosted_number_order.py | 6 + twilio/rest/preview/marketplace/__init__.py | 1 + .../marketplace/available_add_on/__init__.py | 3 + .../available_add_on_extension.py | 3 + .../marketplace/installed_add_on/__init__.py | 5 + .../installed_add_on_extension.py | 3 + twilio/rest/preview/sync/__init__.py | 1 + twilio/rest/preview/sync/service/__init__.py | 5 + .../preview/sync/service/document/__init__.py | 5 + .../service/document/document_permission.py | 3 + .../sync/service/sync_list/__init__.py | 5 + .../sync/service/sync_list/sync_list_item.py | 6 + .../service/sync_list/sync_list_permission.py | 3 + .../preview/sync/service/sync_map/__init__.py | 5 + .../sync/service/sync_map/sync_map_item.py | 6 + .../service/sync_map/sync_map_permission.py | 3 + twilio/rest/preview/understand/__init__.py | 42 - .../preview/understand/assistant/__init__.py | 885 ------------------ .../assistant/assistant_fallback_actions.py | 277 ------ .../assistant/assistant_initiation_actions.py | 281 ------ .../preview/understand/assistant/dialogue.py | 208 ---- .../assistant/field_type/__init__.py | 652 ------------- .../assistant/field_type/field_value.py | 575 ------------ .../understand/assistant/model_build.py | 626 ------------- .../preview/understand/assistant/query.py | 713 -------------- .../understand/assistant/style_sheet.py | 271 ------ .../understand/assistant/task/__init__.py | 758 --------------- .../understand/assistant/task/field.py | 547 ----------- .../understand/assistant/task/sample.py | 695 -------------- .../understand/assistant/task/task_actions.py | 299 ------ .../assistant/task/task_statistics.py | 219 ----- twilio/rest/preview/wireless/__init__.py | 1 + twilio/rest/preview/wireless/command.py | 5 + twilio/rest/preview/wireless/rate_plan.py | 5 + twilio/rest/preview/wireless/sim/__init__.py | 3 + twilio/rest/preview/wireless/sim/usage.py | 2 + twilio/rest/pricing/PricingBase.py | 1 + twilio/rest/pricing/v1/__init__.py | 1 + twilio/rest/pricing/v1/messaging/__init__.py | 1 + twilio/rest/pricing/v1/messaging/country.py | 3 + .../rest/pricing/v1/phone_number/__init__.py | 1 + .../rest/pricing/v1/phone_number/country.py | 3 + twilio/rest/pricing/v1/voice/__init__.py | 1 + twilio/rest/pricing/v1/voice/country.py | 3 + twilio/rest/pricing/v1/voice/number.py | 2 + twilio/rest/pricing/v2/__init__.py | 1 + twilio/rest/pricing/v2/country.py | 3 + twilio/rest/pricing/v2/number.py | 2 + twilio/rest/pricing/v2/voice/__init__.py | 1 + twilio/rest/pricing/v2/voice/country.py | 3 + twilio/rest/pricing/v2/voice/number.py | 2 + twilio/rest/proxy/ProxyBase.py | 1 + twilio/rest/proxy/v1/__init__.py | 1 + twilio/rest/proxy/v1/service/__init__.py | 6 + twilio/rest/proxy/v1/service/phone_number.py | 5 + .../rest/proxy/v1/service/session/__init__.py | 6 + .../proxy/v1/service/session/interaction.py | 6 +- .../service/session/participant/__init__.py | 5 + .../participant/message_interaction.py | 6 + twilio/rest/proxy/v1/service/short_code.py | 9 +- twilio/rest/routes/RoutesBase.py | 1 + twilio/rest/routes/v2/__init__.py | 1 + twilio/rest/routes/v2/phone_number.py | 2 + twilio/rest/routes/v2/sip_domain.py | 2 + twilio/rest/routes/v2/trunk.py | 2 + twilio/rest/serverless/ServerlessBase.py | 1 + twilio/rest/serverless/v1/__init__.py | 1 + twilio/rest/serverless/v1/service/__init__.py | 5 + .../serverless/v1/service/asset/__init__.py | 5 + .../v1/service/asset/asset_version.py | 4 + .../serverless/v1/service/build/__init__.py | 13 +- .../v1/service/build/build_status.py | 2 +- .../v1/service/environment/__init__.py | 5 + .../v1/service/environment/deployment.py | 5 + .../serverless/v1/service/environment/log.py | 4 + .../v1/service/environment/variable.py | 5 + .../v1/service/function/__init__.py | 5 + .../function/function_version/__init__.py | 4 + .../function_version_content.py | 2 + twilio/rest/studio/StudioBase.py | 1 + twilio/rest/studio/v1/__init__.py | 1 + twilio/rest/studio/v1/flow/__init__.py | 4 + .../studio/v1/flow/engagement/__init__.py | 6 + .../v1/flow/engagement/engagement_context.py | 2 + .../v1/flow/engagement/step/__init__.py | 3 + .../v1/flow/engagement/step/step_context.py | 2 + .../rest/studio/v1/flow/execution/__init__.py | 6 + .../v1/flow/execution/execution_context.py | 2 + .../flow/execution/execution_step/__init__.py | 3 + .../execution_step/execution_step_context.py | 2 + twilio/rest/studio/v2/__init__.py | 1 + twilio/rest/studio/v2/flow/__init__.py | 10 +- .../rest/studio/v2/flow/execution/__init__.py | 6 + .../v2/flow/execution/execution_context.py | 2 + .../flow/execution/execution_step/__init__.py | 3 + .../execution_step/execution_step_context.py | 2 + twilio/rest/studio/v2/flow/flow_revision.py | 6 +- twilio/rest/studio/v2/flow/flow_test_user.py | 2 + twilio/rest/studio/v2/flow_validate.py | 2 + twilio/rest/supersim/SupersimBase.py | 1 + twilio/rest/supersim/v1/__init__.py | 1 + twilio/rest/supersim/v1/esim_profile.py | 20 +- twilio/rest/supersim/v1/fleet.py | 6 + twilio/rest/supersim/v1/ip_command.py | 6 + twilio/rest/supersim/v1/network.py | 5 +- .../v1/network_access_profile/__init__.py | 5 + .../network_access_profile_network.py | 7 +- twilio/rest/supersim/v1/settings_update.py | 5 +- twilio/rest/supersim/v1/sim/__init__.py | 6 + twilio/rest/supersim/v1/sim/billing_period.py | 3 + twilio/rest/supersim/v1/sim/sim_ip_address.py | 3 + twilio/rest/supersim/v1/sms_command.py | 6 + twilio/rest/supersim/v1/usage_record.py | 3 + twilio/rest/sync/SyncBase.py | 1 + twilio/rest/sync/v1/__init__.py | 1 + twilio/rest/sync/v1/service/__init__.py | 5 + .../rest/sync/v1/service/document/__init__.py | 5 + .../service/document/document_permission.py | 3 + .../sync/v1/service/sync_list/__init__.py | 5 + .../v1/service/sync_list/sync_list_item.py | 6 + .../service/sync_list/sync_list_permission.py | 3 + .../rest/sync/v1/service/sync_map/__init__.py | 5 + .../sync/v1/service/sync_map/sync_map_item.py | 6 + .../service/sync_map/sync_map_permission.py | 3 + .../sync/v1/service/sync_stream/__init__.py | 5 + .../v1/service/sync_stream/stream_message.py | 3 + twilio/rest/taskrouter/TaskrouterBase.py | 1 + twilio/rest/taskrouter/v1/__init__.py | 1 + .../rest/taskrouter/v1/workspace/__init__.py | 6 + .../rest/taskrouter/v1/workspace/activity.py | 5 + twilio/rest/taskrouter/v1/workspace/event.py | 3 + .../taskrouter/v1/workspace/task/__init__.py | 20 +- .../v1/workspace/task/reservation.py | 16 + .../taskrouter/v1/workspace/task_channel.py | 5 + .../v1/workspace/task_queue/__init__.py | 6 + .../task_queue_cumulative_statistics.py | 2 + .../task_queue_real_time_statistics.py | 4 +- .../task_queue/task_queue_statistics.py | 2 + .../task_queue/task_queues_statistics.py | 2 + .../v1/workspace/worker/__init__.py | 5 + .../v1/workspace/worker/reservation.py | 16 + .../v1/workspace/worker/worker_channel.py | 3 + .../v1/workspace/worker/worker_statistics.py | 2 + .../worker/workers_cumulative_statistics.py | 4 +- .../worker/workers_real_time_statistics.py | 4 +- .../v1/workspace/worker/workers_statistics.py | 2 + .../v1/workspace/workflow/__init__.py | 5 + .../workflow_cumulative_statistics.py | 2 + .../workflow/workflow_real_time_statistics.py | 2 + .../workspace/workflow/workflow_statistics.py | 2 + .../workspace_cumulative_statistics.py | 2 + .../workspace_real_time_statistics.py | 4 +- .../v1/workspace/workspace_statistics.py | 2 + twilio/rest/trunking/TrunkingBase.py | 1 + twilio/rest/trunking/v1/__init__.py | 1 + twilio/rest/trunking/v1/trunk/__init__.py | 6 + .../rest/trunking/v1/trunk/credential_list.py | 5 + .../v1/trunk/ip_access_control_list.py | 5 + .../rest/trunking/v1/trunk/origination_url.py | 5 + twilio/rest/trunking/v1/trunk/phone_number.py | 6 + twilio/rest/trunking/v1/trunk/recording.py | 3 + twilio/rest/trusthub/TrusthubBase.py | 1 + twilio/rest/trusthub/v1/__init__.py | 27 + .../rest/trusthub/v1/compliance_inquiries.py | 20 +- .../v1/compliance_registration_inquiries.py | 316 +++++++ .../v1/compliance_tollfree_inquiries.py | 252 +++++ .../trusthub/v1/customer_profiles/__init__.py | 6 + ...er_profiles_channel_endpoint_assignment.py | 5 + .../customer_profiles_entity_assignments.py | 5 + .../customer_profiles_evaluations.py | 8 +- twilio/rest/trusthub/v1/end_user.py | 5 + twilio/rest/trusthub/v1/end_user_type.py | 5 +- twilio/rest/trusthub/v1/policies.py | 3 + .../rest/trusthub/v1/supporting_document.py | 6 + .../trusthub/v1/supporting_document_type.py | 5 +- .../trusthub/v1/trust_products/__init__.py | 6 + ...st_products_channel_endpoint_assignment.py | 5 + .../trust_products_entity_assignments.py | 5 + .../trust_products_evaluations.py | 8 +- twilio/rest/verify/VerifyBase.py | 1 + twilio/rest/verify/v2/__init__.py | 1 + twilio/rest/verify/v2/form.py | 3 + twilio/rest/verify/v2/safelist.py | 4 + twilio/rest/verify/v2/service/__init__.py | 27 + twilio/rest/verify/v2/service/access_token.py | 5 + .../rest/verify/v2/service/entity/__init__.py | 5 + .../v2/service/entity/challenge/__init__.py | 6 + .../service/entity/challenge/notification.py | 3 + .../rest/verify/v2/service/entity/factor.py | 4 + .../verify/v2/service/entity/new_factor.py | 4 + .../v2/service/messaging_configuration.py | 5 + .../verify/v2/service/rate_limit/__init__.py | 5 + .../verify/v2/service/rate_limit/bucket.py | 5 + twilio/rest/verify/v2/service/verification.py | 13 +- .../verify/v2/service/verification_check.py | 6 +- twilio/rest/verify/v2/service/webhook.py | 6 + twilio/rest/verify/v2/template.py | 2 + twilio/rest/verify/v2/verification_attempt.py | 6 +- .../v2/verification_attempts_summary.py | 3 + twilio/rest/video/VideoBase.py | 1 + twilio/rest/video/v1/__init__.py | 1 + twilio/rest/video/v1/composition.py | 6 + twilio/rest/video/v1/composition_hook.py | 6 + twilio/rest/video/v1/composition_settings.py | 12 +- twilio/rest/video/v1/recording.py | 4 + twilio/rest/video/v1/recording_settings.py | 12 +- twilio/rest/video/v1/room/__init__.py | 6 + .../video/v1/room/participant/__init__.py | 4 + .../video/v1/room/participant/anonymize.py | 3 + .../v1/room/participant/published_track.py | 4 + .../v1/room/participant/subscribe_rules.py | 5 + .../v1/room/participant/subscribed_track.py | 4 + twilio/rest/video/v1/room/recording_rules.py | 5 + twilio/rest/video/v1/room/room_recording.py | 4 + twilio/rest/voice/VoiceBase.py | 1 + twilio/rest/voice/v1/__init__.py | 1 + twilio/rest/voice/v1/archived_call.py | 2 + twilio/rest/voice/v1/byoc_trunk.py | 5 + .../voice/v1/connection_policy/__init__.py | 5 + .../connection_policy_target.py | 5 + .../voice/v1/dialing_permissions/__init__.py | 1 + .../bulk_country_update.py | 3 + .../dialing_permissions/country/__init__.py | 3 + .../country/highrisk_special_prefix.py | 2 + .../voice/v1/dialing_permissions/settings.py | 2 + twilio/rest/voice/v1/ip_record.py | 5 + twilio/rest/voice/v1/source_ip_mapping.py | 5 + twilio/rest/wireless/WirelessBase.py | 1 + twilio/rest/wireless/v1/__init__.py | 1 + twilio/rest/wireless/v1/command.py | 6 + twilio/rest/wireless/v1/rate_plan.py | 5 + twilio/rest/wireless/v1/sim/__init__.py | 4 + twilio/rest/wireless/v1/sim/data_session.py | 2 + twilio/rest/wireless/v1/sim/usage_record.py | 3 + twilio/rest/wireless/v1/usage_record.py | 3 + 583 files changed, 4074 insertions(+), 15678 deletions(-) delete mode 100644 twilio/rest/autopilot/AutopilotBase.py delete mode 100644 twilio/rest/autopilot/v1/__init__.py delete mode 100644 twilio/rest/autopilot/v1/assistant/__init__.py delete mode 100644 twilio/rest/autopilot/v1/assistant/defaults.py delete mode 100644 twilio/rest/autopilot/v1/assistant/dialogue.py delete mode 100644 twilio/rest/autopilot/v1/assistant/field_type/__init__.py delete mode 100644 twilio/rest/autopilot/v1/assistant/field_type/field_value.py delete mode 100644 twilio/rest/autopilot/v1/assistant/model_build.py delete mode 100644 twilio/rest/autopilot/v1/assistant/query.py delete mode 100644 twilio/rest/autopilot/v1/assistant/style_sheet.py delete mode 100644 twilio/rest/autopilot/v1/assistant/task/__init__.py delete mode 100644 twilio/rest/autopilot/v1/assistant/task/field.py delete mode 100644 twilio/rest/autopilot/v1/assistant/task/sample.py delete mode 100644 twilio/rest/autopilot/v1/assistant/task/task_actions.py delete mode 100644 twilio/rest/autopilot/v1/assistant/task/task_statistics.py delete mode 100644 twilio/rest/autopilot/v1/assistant/webhook.py delete mode 100644 twilio/rest/autopilot/v1/restore_assistant.py create mode 100644 twilio/rest/flex_api/v1/insights_conversational_ai.py create mode 100644 twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py rename twilio/rest/{oauth/v1/user_info.py => flex_api/v1/provisioning_status.py} (54%) create mode 100644 twilio/rest/numbers/v1/porting_port_in_fetch.py delete mode 100644 twilio/rest/oauth/OauthBase.py delete mode 100644 twilio/rest/oauth/v1/__init__.py delete mode 100644 twilio/rest/oauth/v1/device_code.py delete mode 100644 twilio/rest/oauth/v1/oauth.py delete mode 100644 twilio/rest/oauth/v1/openid_discovery.py delete mode 100644 twilio/rest/oauth/v1/token.py delete mode 100644 twilio/rest/preview/understand/__init__.py delete mode 100644 twilio/rest/preview/understand/assistant/__init__.py delete mode 100644 twilio/rest/preview/understand/assistant/assistant_fallback_actions.py delete mode 100644 twilio/rest/preview/understand/assistant/assistant_initiation_actions.py delete mode 100644 twilio/rest/preview/understand/assistant/dialogue.py delete mode 100644 twilio/rest/preview/understand/assistant/field_type/__init__.py delete mode 100644 twilio/rest/preview/understand/assistant/field_type/field_value.py delete mode 100644 twilio/rest/preview/understand/assistant/model_build.py delete mode 100644 twilio/rest/preview/understand/assistant/query.py delete mode 100644 twilio/rest/preview/understand/assistant/style_sheet.py delete mode 100644 twilio/rest/preview/understand/assistant/task/__init__.py delete mode 100644 twilio/rest/preview/understand/assistant/task/field.py delete mode 100644 twilio/rest/preview/understand/assistant/task/sample.py delete mode 100644 twilio/rest/preview/understand/assistant/task/task_actions.py delete mode 100644 twilio/rest/preview/understand/assistant/task/task_statistics.py create mode 100644 twilio/rest/trusthub/v1/compliance_registration_inquiries.py create mode 100644 twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py diff --git a/CHANGES.md b/CHANGES.md index b9e9c6e477..73bbaa1061 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,73 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-02-09] Version 8.13.0 +--------------------------- +**Library - Fix** +- [PR #753](https://github.com/twilio/twilio-python/pull/753): added boolean_to_string converter. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Library - Chore** +- [PR #758](https://github.com/twilio/twilio-python/pull/758): disable cluster test. Thanks to [@sbansla](https://github.com/sbansla)! +- [PR #760](https://github.com/twilio/twilio-python/pull/760): run make prettier. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Api** +- Updated service base url for connect apps and authorized connect apps APIs **(breaking change)** +- Update documentation to reflect RiskCheck GA +- Added optional parameter `CallToken` for create participant api + +**Events** +- Marked as GA + +**Flex** +- Adding `flex_instance_sid` to Flex Configuration +- Adding `provisioning_status` for Email Manager +- Adding `offline_config` to Flex Configuration + +**Insights** +- add flag to restrict access to unapid customers +- decommission voice-qualitystats-endpoint role + +**Intelligence** +- Add text-generation operator (for example conversation summary) results to existing OperatorResults collection. + +**Lookups** +- Remove `carrier` field from `sms_pumping_risk` and leave `carrier_risk_category` **(breaking change)** +- Remove carrier information from call forwarding package **(breaking change)** + +**Messaging** +- Add update instance endpoints to us_app_to_person api +- Add tollfree edit_allowed and edit_reason fields +- Update Phone Number, Short Code, Alpha Sender, US A2P and Channel Sender documentation +- Add DELETE support to Tollfree Verification resource + +**Numbers** +- Add Get Port In request api + +**Push** +- Migrated to new Push API V4 with Resilient Notification Delivery. + +**Serverless** +- Add node18 as a valid Build runtime + +**Taskrouter** +- Add `jitter_buffer_size` param in update reservation +- Add container attribute to task_queue_bulk_real_time_statistics endpoint +- Remove beta_feature check on task_queue_bulk_real_time_statistics endpoint + +**Trusthub** +- Add optional field NotificationEmail to the POST /v1/ComplianceInquiries/Customers/Initialize API +- Add additional optional fields in compliance_tollfree_inquiry.json +- Rename did to tollfree_phone_number in compliance_tollfree_inquiry.json +- Add new optional field notification_email to compliance_tollfree_inquiry.json + +**Verify** +- `Tags` property added again to Public Docs **(breaking change)** +- Remove `Tags` from Public Docs **(breaking change)** +- Add `VerifyEventSubscriptionEnabled` parameter to service create and update endpoints. +- Add `Tags` optional parameter on Verification creation. +- Update Verify TOTP maturity to GA. + + [2024-01-25] Version 8.12.0 --------------------------- **Oauth** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 9f2d2e9634..3e895271f9 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -16,7 +16,6 @@ if TYPE_CHECKING: from twilio.rest.accounts import Accounts from twilio.rest.api import Api - from twilio.rest.autopilot import Autopilot from twilio.rest.bulkexports import Bulkexports from twilio.rest.chat import Chat from twilio.rest.content import Content @@ -34,7 +33,6 @@ from twilio.rest.monitor import Monitor from twilio.rest.notify import Notify from twilio.rest.numbers import Numbers - from twilio.rest.oauth import Oauth from twilio.rest.preview import Preview from twilio.rest.pricing import Pricing from twilio.rest.proxy import Proxy @@ -125,7 +123,6 @@ def __init__( # Domains self._accounts: Optional["Accounts"] = None self._api: Optional["Api"] = None - self._autopilot: Optional["Autopilot"] = None self._bulkexports: Optional["Bulkexports"] = None self._chat: Optional["Chat"] = None self._content: Optional["Content"] = None @@ -143,7 +140,6 @@ def __init__( self._monitor: Optional["Monitor"] = None self._notify: Optional["Notify"] = None self._numbers: Optional["Numbers"] = None - self._oauth: Optional["Oauth"] = None self._preview: Optional["Preview"] = None self._pricing: Optional["Pricing"] = None self._proxy: Optional["Proxy"] = None @@ -186,19 +182,6 @@ def api(self) -> "Api": self._api = Api(self) return self._api - @property - def autopilot(self) -> "Autopilot": - """ - Access the Autopilot Twilio Domain - - :returns: Autopilot Twilio Domain - """ - if self._autopilot is None: - from twilio.rest.autopilot import Autopilot - - self._autopilot = Autopilot(self) - return self._autopilot - @property def bulkexports(self) -> "Bulkexports": """ @@ -420,19 +403,6 @@ def numbers(self) -> "Numbers": self._numbers = Numbers(self) return self._numbers - @property - def oauth(self) -> "Oauth": - """ - Access the Oauth Twilio Domain - - :returns: Oauth Twilio Domain - """ - if self._oauth is None: - from twilio.rest.oauth import Oauth - - self._oauth = Oauth(self) - return self._oauth - @property def preview(self) -> "Preview": """ diff --git a/twilio/rest/accounts/AccountsBase.py b/twilio/rest/accounts/AccountsBase.py index a89be84161..e9ac0d589d 100644 --- a/twilio/rest/accounts/AccountsBase.py +++ b/twilio/rest/accounts/AccountsBase.py @@ -17,6 +17,7 @@ class AccountsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Accounts Domain diff --git a/twilio/rest/accounts/v1/__init__.py b/twilio/rest/accounts/v1/__init__.py index 4abbf24344..142d5c7a96 100644 --- a/twilio/rest/accounts/v1/__init__.py +++ b/twilio/rest/accounts/v1/__init__.py @@ -22,6 +22,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Accounts diff --git a/twilio/rest/accounts/v1/auth_token_promotion.py b/twilio/rest/accounts/v1/auth_token_promotion.py index 140b5b1809..7ab6c3f39d 100644 --- a/twilio/rest/accounts/v1/auth_token_promotion.py +++ b/twilio/rest/accounts/v1/auth_token_promotion.py @@ -88,6 +88,7 @@ def __repr__(self) -> str: class AuthTokenPromotionContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the AuthTokenPromotionContext @@ -143,6 +144,7 @@ def __repr__(self) -> str: class AuthTokenPromotionList(ListResource): + def __init__(self, version: Version): """ Initialize the AuthTokenPromotionList diff --git a/twilio/rest/accounts/v1/credential/__init__.py b/twilio/rest/accounts/v1/credential/__init__.py index f2ee3c7354..e9c4653f0c 100644 --- a/twilio/rest/accounts/v1/credential/__init__.py +++ b/twilio/rest/accounts/v1/credential/__init__.py @@ -23,6 +23,7 @@ class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList diff --git a/twilio/rest/accounts/v1/credential/aws.py b/twilio/rest/accounts/v1/credential/aws.py index b49b07507c..ab75620920 100644 --- a/twilio/rest/accounts/v1/credential/aws.py +++ b/twilio/rest/accounts/v1/credential/aws.py @@ -141,6 +141,7 @@ def __repr__(self) -> str: class AwsContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AwsContext @@ -275,6 +276,7 @@ def __repr__(self) -> str: class AwsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AwsInstance: """ Build an instance of AwsInstance @@ -293,6 +295,7 @@ def __repr__(self) -> str: class AwsList(ListResource): + def __init__(self, version: Version): """ Initialize the AwsList @@ -319,6 +322,7 @@ def create( :returns: The created AwsInstance """ + data = values.of( { "Credentials": credentials, @@ -350,6 +354,7 @@ async def create_async( :returns: The created AwsInstance """ + data = values.of( { "Credentials": credentials, diff --git a/twilio/rest/accounts/v1/credential/public_key.py b/twilio/rest/accounts/v1/credential/public_key.py index 6ed07b4e48..09018d1d26 100644 --- a/twilio/rest/accounts/v1/credential/public_key.py +++ b/twilio/rest/accounts/v1/credential/public_key.py @@ -143,6 +143,7 @@ def __repr__(self) -> str: class PublicKeyContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the PublicKeyContext @@ -279,6 +280,7 @@ def __repr__(self) -> str: class PublicKeyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PublicKeyInstance: """ Build an instance of PublicKeyInstance @@ -297,6 +299,7 @@ def __repr__(self) -> str: class PublicKeyList(ListResource): + def __init__(self, version: Version): """ Initialize the PublicKeyList @@ -323,6 +326,7 @@ def create( :returns: The created PublicKeyInstance """ + data = values.of( { "PublicKey": public_key, @@ -354,6 +358,7 @@ async def create_async( :returns: The created PublicKeyInstance """ + data = values.of( { "PublicKey": public_key, diff --git a/twilio/rest/accounts/v1/safelist.py b/twilio/rest/accounts/v1/safelist.py index 90b1ee819c..e20855965c 100644 --- a/twilio/rest/accounts/v1/safelist.py +++ b/twilio/rest/accounts/v1/safelist.py @@ -12,7 +12,7 @@ Do not edit the class manually. """ -from typing import Any, Dict, Optional +from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_resource import InstanceResource @@ -43,6 +43,7 @@ def __repr__(self) -> str: class SafelistList(ListResource): + def __init__(self, version: Version): """ Initialize the SafelistList @@ -62,6 +63,7 @@ def create(self, phone_number: str) -> SafelistInstance: :returns: The created SafelistInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -84,6 +86,7 @@ async def create_async(self, phone_number: str) -> SafelistInstance: :returns: The created SafelistInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -98,23 +101,77 @@ async def create_async(self, phone_number: str) -> SafelistInstance: return SafelistInstance(self._version, payload) - def fetch(self) -> SafelistInstance: + def delete(self, phone_number: Union[str, object] = values.unset) -> bool: + """ + Asynchronously delete the SafelistInstance + + :param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + :returns: True if delete succeeds, False otherwise + """ + + params = values.of( + { + "PhoneNumber": phone_number, + } + ) + return self._version.delete(method="DELETE", uri=self._uri, params=params) + + async def delete_async( + self, phone_number: Union[str, object] = values.unset + ) -> bool: + """ + Asynchronously delete the SafelistInstance + + :param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + :returns: True if delete succeeds, False otherwise + """ + + params = values.of( + { + "PhoneNumber": phone_number, + } + ) + return await self._version.delete_async( + method="DELETE", uri=self._uri, params=params + ) + + def fetch( + self, phone_number: Union[str, object] = values.unset + ) -> SafelistInstance: """ Asynchronously fetch the SafelistInstance + :param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: The fetched SafelistInstance """ - payload = self._version.fetch(method="GET", uri=self._uri) + + params = values.of( + { + "PhoneNumber": phone_number, + } + ) + payload = self._version.fetch(method="GET", uri=self._uri, params=params) return SafelistInstance(self._version, payload) - async def fetch_async(self) -> SafelistInstance: + async def fetch_async( + self, phone_number: Union[str, object] = values.unset + ) -> SafelistInstance: """ Asynchronously fetch the SafelistInstance + :param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: The fetched SafelistInstance """ - payload = await self._version.fetch_async(method="GET", uri=self._uri) + + params = values.of( + { + "PhoneNumber": phone_number, + } + ) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=params + ) return SafelistInstance(self._version, payload) diff --git a/twilio/rest/accounts/v1/secondary_auth_token.py b/twilio/rest/accounts/v1/secondary_auth_token.py index 4d2e099473..3735dd876a 100644 --- a/twilio/rest/accounts/v1/secondary_auth_token.py +++ b/twilio/rest/accounts/v1/secondary_auth_token.py @@ -106,6 +106,7 @@ def __repr__(self) -> str: class SecondaryAuthTokenContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the SecondaryAuthTokenContext @@ -179,6 +180,7 @@ def __repr__(self) -> str: class SecondaryAuthTokenList(ListResource): + def __init__(self, version: Version): """ Initialize the SecondaryAuthTokenList diff --git a/twilio/rest/api/ApiBase.py b/twilio/rest/api/ApiBase.py index 417bc0d0df..e53535ab3f 100644 --- a/twilio/rest/api/ApiBase.py +++ b/twilio/rest/api/ApiBase.py @@ -17,6 +17,7 @@ class ApiBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Api Domain diff --git a/twilio/rest/api/v2010/__init__.py b/twilio/rest/api/v2010/__init__.py index fe5c45c51e..2efb4ff3d0 100644 --- a/twilio/rest/api/v2010/__init__.py +++ b/twilio/rest/api/v2010/__init__.py @@ -20,6 +20,7 @@ class V2010(Version): + def __init__(self, domain: Domain): """ Initialize the V2010 version of Api diff --git a/twilio/rest/api/v2010/account/__init__.py b/twilio/rest/api/v2010/account/__init__.py index 97e878526b..adf2458f2a 100644 --- a/twilio/rest/api/v2010/account/__init__.py +++ b/twilio/rest/api/v2010/account/__init__.py @@ -51,6 +51,7 @@ class AccountInstance(InstanceResource): + class Status(object): ACTIVE = "active" SUSPENDED = "suspended" @@ -348,6 +349,7 @@ def __repr__(self) -> str: class AccountContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AccountContext @@ -781,6 +783,7 @@ def __repr__(self) -> str: class AccountPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AccountInstance: """ Build an instance of AccountInstance @@ -799,6 +802,7 @@ def __repr__(self) -> str: class AccountList(ListResource): + def __init__(self, version: Version): """ Initialize the AccountList @@ -820,6 +824,7 @@ def create( :returns: The created AccountInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -844,6 +849,7 @@ async def create_async( :returns: The created AccountInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index 066c493fde..422d7f776c 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -229,6 +229,7 @@ def __repr__(self) -> str: class AddressContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the AddressContext @@ -446,6 +447,7 @@ def __repr__(self) -> str: class AddressPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AddressInstance: """ Build an instance of AddressInstance @@ -466,6 +468,7 @@ def __repr__(self) -> str: class AddressList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the AddressList @@ -511,6 +514,7 @@ def create( :returns: The created AddressInstance """ + data = values.of( { "CustomerName": customer_name, @@ -565,6 +569,7 @@ async def create_async( :returns: The created AddressInstance """ + data = values.of( { "CustomerName": customer_name, diff --git a/twilio/rest/api/v2010/account/address/dependent_phone_number.py b/twilio/rest/api/v2010/account/address/dependent_phone_number.py index 5db5d89b58..738f9baffd 100644 --- a/twilio/rest/api/v2010/account/address/dependent_phone_number.py +++ b/twilio/rest/api/v2010/account/address/dependent_phone_number.py @@ -23,6 +23,7 @@ class DependentPhoneNumberInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -126,6 +127,7 @@ def __repr__(self) -> str: class DependentPhoneNumberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DependentPhoneNumberInstance: """ Build an instance of DependentPhoneNumberInstance @@ -149,6 +151,7 @@ def __repr__(self) -> str: class DependentPhoneNumberList(ListResource): + def __init__(self, version: Version, account_sid: str, address_sid: str): """ Initialize the DependentPhoneNumberList diff --git a/twilio/rest/api/v2010/account/application.py b/twilio/rest/api/v2010/account/application.py index 50f0e4ad7e..3f70417b5e 100644 --- a/twilio/rest/api/v2010/account/application.py +++ b/twilio/rest/api/v2010/account/application.py @@ -279,6 +279,7 @@ def __repr__(self) -> str: class ApplicationContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the ApplicationContext @@ -523,6 +524,7 @@ def __repr__(self) -> str: class ApplicationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ApplicationInstance: """ Build an instance of ApplicationInstance @@ -543,6 +545,7 @@ def __repr__(self) -> str: class ApplicationList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ApplicationList @@ -600,6 +603,7 @@ def create( :returns: The created ApplicationInstance """ + data = values.of( { "ApiVersion": api_version, @@ -672,6 +676,7 @@ async def create_async( :returns: The created ApplicationInstance """ + data = values.of( { "ApiVersion": api_version, diff --git a/twilio/rest/api/v2010/account/authorized_connect_app.py b/twilio/rest/api/v2010/account/authorized_connect_app.py index 1e48d606b1..9359545cdb 100644 --- a/twilio/rest/api/v2010/account/authorized_connect_app.py +++ b/twilio/rest/api/v2010/account/authorized_connect_app.py @@ -12,9 +12,8 @@ Do not edit the class manually. """ -from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -23,6 +22,7 @@ class AuthorizedConnectAppInstance(InstanceResource): + class Permission(object): GET_ALL = "get-all" POST_ALL = "post-all" @@ -34,8 +34,6 @@ class Permission(object): :ivar connect_app_friendly_name: The name of the Connect App. :ivar connect_app_homepage_url: The public URL for the Connect App. :ivar connect_app_sid: The SID that we assigned to the Connect App. - :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar permissions: The set of permissions that you authorized for the Connect App. Can be: `get-all` or `post-all`. :ivar uri: The URI of the resource, relative to `https://api.twilio.com`. """ @@ -63,12 +61,6 @@ def __init__( "connect_app_homepage_url" ) self.connect_app_sid: Optional[str] = payload.get("connect_app_sid") - self.date_created: Optional[datetime] = deserialize.rfc2822_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( - payload.get("date_updated") - ) self.permissions: Optional[List["AuthorizedConnectAppInstance.Permission"]] = ( payload.get("permissions") ) @@ -125,6 +117,7 @@ def __repr__(self) -> str: class AuthorizedConnectAppContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, connect_app_sid: str): """ Initialize the AuthorizedConnectAppContext @@ -195,6 +188,7 @@ def __repr__(self) -> str: class AuthorizedConnectAppPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AuthorizedConnectAppInstance: """ Build an instance of AuthorizedConnectAppInstance @@ -215,6 +209,7 @@ def __repr__(self) -> str: class AuthorizedConnectAppList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the AuthorizedConnectAppList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py b/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py index 32583e778d..14fcfc28df 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py @@ -166,6 +166,7 @@ def __repr__(self) -> str: class AvailablePhoneNumberCountryContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the AvailablePhoneNumberCountryContext @@ -339,6 +340,7 @@ def __repr__(self) -> str: class AvailablePhoneNumberCountryPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> AvailablePhoneNumberCountryInstance: @@ -361,6 +363,7 @@ def __repr__(self) -> str: class AvailablePhoneNumberCountryList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the AvailablePhoneNumberCountryList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/local.py b/twilio/rest/api/v2010/account/available_phone_number_country/local.py index c64739cc88..a3fd567a7f 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/local.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/local.py @@ -77,6 +77,7 @@ def __repr__(self) -> str: class LocalPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> LocalInstance: """ Build an instance of LocalInstance @@ -100,6 +101,7 @@ def __repr__(self) -> str: class LocalList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the LocalList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py index 860983f2ab..04ba514cca 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py @@ -77,6 +77,7 @@ def __repr__(self) -> str: class MachineToMachinePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MachineToMachineInstance: """ Build an instance of MachineToMachineInstance @@ -100,6 +101,7 @@ def __repr__(self) -> str: class MachineToMachineList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the MachineToMachineList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py index 624ccbb302..cd37127017 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py @@ -77,6 +77,7 @@ def __repr__(self) -> str: class MobilePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MobileInstance: """ Build an instance of MobileInstance @@ -100,6 +101,7 @@ def __repr__(self) -> str: class MobileList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the MobileList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/national.py b/twilio/rest/api/v2010/account/available_phone_number_country/national.py index 259603284a..018bef3ac7 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/national.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/national.py @@ -77,6 +77,7 @@ def __repr__(self) -> str: class NationalPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> NationalInstance: """ Build an instance of NationalInstance @@ -100,6 +101,7 @@ def __repr__(self) -> str: class NationalList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the NationalList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py index 75b890592d..3cb7af3eff 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py @@ -77,6 +77,7 @@ def __repr__(self) -> str: class SharedCostPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SharedCostInstance: """ Build an instance of SharedCostInstance @@ -100,6 +101,7 @@ def __repr__(self) -> str: class SharedCostList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the SharedCostList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py index b46af0039c..e9d830c0bb 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py @@ -77,6 +77,7 @@ def __repr__(self) -> str: class TollFreePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TollFreeInstance: """ Build an instance of TollFreeInstance @@ -100,6 +101,7 @@ def __repr__(self) -> str: class TollFreeList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the TollFreeList diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py index b0bb213695..8825843c8f 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py @@ -77,6 +77,7 @@ def __repr__(self) -> str: class VoipPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> VoipInstance: """ Build an instance of VoipInstance @@ -100,6 +101,7 @@ def __repr__(self) -> str: class VoipList(ListResource): + def __init__(self, version: Version, account_sid: str, country_code: str): """ Initialize the VoipList diff --git a/twilio/rest/api/v2010/account/balance.py b/twilio/rest/api/v2010/account/balance.py index 402e25d5f6..0e90cdaae0 100644 --- a/twilio/rest/api/v2010/account/balance.py +++ b/twilio/rest/api/v2010/account/balance.py @@ -48,6 +48,7 @@ def __repr__(self) -> str: class BalanceList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the BalanceList @@ -68,8 +69,10 @@ def fetch(self) -> BalanceInstance: """ Asynchronously fetch the BalanceInstance + :returns: The fetched BalanceInstance """ + payload = self._version.fetch(method="GET", uri=self._uri) return BalanceInstance( @@ -80,8 +83,10 @@ async def fetch_async(self) -> BalanceInstance: """ Asynchronously fetch the BalanceInstance + :returns: The fetched BalanceInstance """ + payload = await self._version.fetch_async(method="GET", uri=self._uri) return BalanceInstance( diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index f35c25f6b7..406db27602 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -37,6 +37,7 @@ class CallInstance(InstanceResource): + class Status(object): QUEUED = "queued" RINGING = "ringing" @@ -336,6 +337,7 @@ def __repr__(self) -> str: class CallContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the CallContext @@ -667,6 +669,7 @@ def __repr__(self) -> str: class CallPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CallInstance: """ Build an instance of CallInstance @@ -687,6 +690,7 @@ def __repr__(self) -> str: class CallList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the CallList @@ -784,6 +788,7 @@ def create( :returns: The created CallInstance """ + data = values.of( { "To": to, @@ -917,6 +922,7 @@ async def create_async( :returns: The created CallInstance """ + data = values.of( { "To": to, diff --git a/twilio/rest/api/v2010/account/call/event.py b/twilio/rest/api/v2010/account/call/event.py index 734d3e6cbd..7993dd00a0 100644 --- a/twilio/rest/api/v2010/account/call/event.py +++ b/twilio/rest/api/v2010/account/call/event.py @@ -51,6 +51,7 @@ def __repr__(self) -> str: class EventPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EventInstance: """ Build an instance of EventInstance @@ -74,6 +75,7 @@ def __repr__(self) -> str: class EventList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the EventList diff --git a/twilio/rest/api/v2010/account/call/feedback.py b/twilio/rest/api/v2010/account/call/feedback.py index 342b032ebd..210a529ac2 100644 --- a/twilio/rest/api/v2010/account/call/feedback.py +++ b/twilio/rest/api/v2010/account/call/feedback.py @@ -22,6 +22,7 @@ class FeedbackInstance(InstanceResource): + class Issues(object): AUDIO_LATENCY = "audio-latency" DIGITS_NOT_CAPTURED = "digits-not-captured" @@ -146,6 +147,7 @@ def __repr__(self) -> str: class FeedbackContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the FeedbackContext @@ -282,6 +284,7 @@ def __repr__(self) -> str: class FeedbackList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the FeedbackList diff --git a/twilio/rest/api/v2010/account/call/feedback_summary.py b/twilio/rest/api/v2010/account/call/feedback_summary.py index 3df1660388..2f26b0b0a4 100644 --- a/twilio/rest/api/v2010/account/call/feedback_summary.py +++ b/twilio/rest/api/v2010/account/call/feedback_summary.py @@ -22,6 +22,7 @@ class FeedbackSummaryInstance(InstanceResource): + class Status(object): QUEUED = "queued" IN_PROGRESS = "in-progress" @@ -69,7 +70,7 @@ def __init__( payload.get("end_date") ) self.include_subaccounts: Optional[bool] = payload.get("include_subaccounts") - self.issues: Optional[List[object]] = payload.get("issues") + self.issues: Optional[List[Dict[str, object]]] = payload.get("issues") self.quality_score_average: Optional[float] = deserialize.decimal( payload.get("quality_score_average") ) @@ -154,6 +155,7 @@ def __repr__(self) -> str: class FeedbackSummaryContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the FeedbackSummaryContext @@ -248,6 +250,7 @@ def __repr__(self) -> str: class FeedbackSummaryList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the FeedbackSummaryList @@ -285,6 +288,7 @@ def create( :returns: The created FeedbackSummaryInstance """ + data = values.of( { "StartDate": serialize.iso8601_date(start_date), @@ -324,6 +328,7 @@ async def create_async( :returns: The created FeedbackSummaryInstance """ + data = values.of( { "StartDate": serialize.iso8601_date(start_date), diff --git a/twilio/rest/api/v2010/account/call/notification.py b/twilio/rest/api/v2010/account/call/notification.py index 2f704e2c41..44291b8448 100644 --- a/twilio/rest/api/v2010/account/call/notification.py +++ b/twilio/rest/api/v2010/account/call/notification.py @@ -130,6 +130,7 @@ def __repr__(self) -> str: class NotificationContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the NotificationContext @@ -206,6 +207,7 @@ def __repr__(self) -> str: class NotificationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> NotificationInstance: """ Build an instance of NotificationInstance @@ -229,6 +231,7 @@ def __repr__(self) -> str: class NotificationList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the NotificationList diff --git a/twilio/rest/api/v2010/account/call/payment.py b/twilio/rest/api/v2010/account/call/payment.py index 229332139e..540baa8435 100644 --- a/twilio/rest/api/v2010/account/call/payment.py +++ b/twilio/rest/api/v2010/account/call/payment.py @@ -22,6 +22,7 @@ class PaymentInstance(InstanceResource): + class BankAccountType(object): CONSUMER_CHECKING = "consumer-checking" CONSUMER_SAVINGS = "consumer-savings" @@ -160,6 +161,7 @@ def __repr__(self) -> str: class PaymentContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the PaymentContext @@ -274,6 +276,7 @@ def __repr__(self) -> str: class PaymentList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the PaymentList @@ -337,6 +340,7 @@ def create( :returns: The created PaymentInstance """ + data = values.of( { "IdempotencyKey": idempotency_key, @@ -414,6 +418,7 @@ async def create_async( :returns: The created PaymentInstance """ + data = values.of( { "IdempotencyKey": idempotency_key, diff --git a/twilio/rest/api/v2010/account/call/recording.py b/twilio/rest/api/v2010/account/call/recording.py index 4a852d67ea..b9653c4b5b 100644 --- a/twilio/rest/api/v2010/account/call/recording.py +++ b/twilio/rest/api/v2010/account/call/recording.py @@ -23,6 +23,7 @@ class RecordingInstance(InstanceResource): + class Source(object): DIALVERB = "DialVerb" CONFERENCE = "Conference" @@ -205,6 +206,7 @@ def __repr__(self) -> str: class RecordingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the RecordingContext @@ -373,6 +375,7 @@ def __repr__(self) -> str: class RecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RecordingInstance: """ Build an instance of RecordingInstance @@ -396,6 +399,7 @@ def __repr__(self) -> str: class RecordingList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the RecordingList @@ -437,6 +441,7 @@ def create( :returns: The created RecordingInstance """ + data = values.of( { "RecordingStatusCallbackEvent": serialize.map( @@ -484,6 +489,7 @@ async def create_async( :returns: The created RecordingInstance """ + data = values.of( { "RecordingStatusCallbackEvent": serialize.map( diff --git a/twilio/rest/api/v2010/account/call/siprec.py b/twilio/rest/api/v2010/account/call/siprec.py index d7742ed397..bcb537071f 100644 --- a/twilio/rest/api/v2010/account/call/siprec.py +++ b/twilio/rest/api/v2010/account/call/siprec.py @@ -22,6 +22,7 @@ class SiprecInstance(InstanceResource): + class Status(object): IN_PROGRESS = "in-progress" STOPPED = "stopped" @@ -125,6 +126,7 @@ def __repr__(self) -> str: class SiprecContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the SiprecContext @@ -215,6 +217,7 @@ def __repr__(self) -> str: class SiprecList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the SiprecList @@ -650,6 +653,7 @@ def create( :returns: The created SiprecInstance """ + data = values.of( { "Name": name, @@ -1286,6 +1290,7 @@ async def create_async( :returns: The created SiprecInstance """ + data = values.of( { "Name": name, diff --git a/twilio/rest/api/v2010/account/call/stream.py b/twilio/rest/api/v2010/account/call/stream.py index 36b6bbe33c..a46d8f9757 100644 --- a/twilio/rest/api/v2010/account/call/stream.py +++ b/twilio/rest/api/v2010/account/call/stream.py @@ -22,6 +22,7 @@ class StreamInstance(InstanceResource): + class Status(object): IN_PROGRESS = "in-progress" STOPPED = "stopped" @@ -125,6 +126,7 @@ def __repr__(self) -> str: class StreamContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the StreamContext @@ -217,6 +219,7 @@ def __repr__(self) -> str: class StreamList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the StreamList @@ -652,6 +655,7 @@ def create( :returns: The created StreamInstance """ + data = values.of( { "Url": url, @@ -1288,6 +1292,7 @@ async def create_async( :returns: The created StreamInstance """ + data = values.of( { "Url": url, diff --git a/twilio/rest/api/v2010/account/call/user_defined_message.py b/twilio/rest/api/v2010/account/call/user_defined_message.py index 7529a50746..0e9d1f0490 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message.py @@ -57,6 +57,7 @@ def __repr__(self) -> str: class UserDefinedMessageList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the UserDefinedMessageList @@ -90,6 +91,7 @@ def create( :returns: The created UserDefinedMessageInstance """ + data = values.of( { "Content": content, @@ -121,6 +123,7 @@ async def create_async( :returns: The created UserDefinedMessageInstance """ + data = values.of( { "Content": content, diff --git a/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py b/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py index 8d9054bc2c..a0b7c18339 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py @@ -103,6 +103,7 @@ def __repr__(self) -> str: class UserDefinedMessageSubscriptionContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): """ Initialize the UserDefinedMessageSubscriptionContext @@ -161,6 +162,7 @@ def __repr__(self) -> str: class UserDefinedMessageSubscriptionList(ListResource): + def __init__(self, version: Version, account_sid: str, call_sid: str): """ Initialize the UserDefinedMessageSubscriptionList @@ -196,6 +198,7 @@ def create( :returns: The created UserDefinedMessageSubscriptionInstance """ + data = values.of( { "Callback": callback, @@ -232,6 +235,7 @@ async def create_async( :returns: The created UserDefinedMessageSubscriptionInstance """ + data = values.of( { "Callback": callback, diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index cd4ec22007..fff75dea5d 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -25,6 +25,7 @@ class ConferenceInstance(InstanceResource): + class ReasonConferenceEnded(object): CONFERENCE_ENDED_VIA_API = "conference-ended-via-api" PARTICIPANT_WITH_END_CONFERENCE_ON_EXIT_LEFT = ( @@ -198,6 +199,7 @@ def __repr__(self) -> str: class ConferenceContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the ConferenceContext @@ -369,6 +371,7 @@ def __repr__(self) -> str: class ConferencePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConferenceInstance: """ Build an instance of ConferenceInstance @@ -389,6 +392,7 @@ def __repr__(self) -> str: class ConferenceList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ConferenceList diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index 5b3d7857e0..3759e4558d 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -23,6 +23,7 @@ class ParticipantInstance(InstanceResource): + class Status(object): QUEUED = "queued" CONNECTING = "connecting" @@ -248,6 +249,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, conference_sid: str, call_sid: str ): @@ -476,6 +478,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -499,6 +502,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, account_sid: str, conference_sid: str): """ Initialize the ParticipantList @@ -570,6 +574,7 @@ def create( amd_status_callback: Union[str, object] = values.unset, amd_status_callback_method: Union[str, object] = values.unset, trim: Union[str, object] = values.unset, + call_token: Union[str, object] = values.unset, ) -> ParticipantInstance: """ Create the ParticipantInstance @@ -621,9 +626,11 @@ def create( :param amd_status_callback: The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. :param amd_status_callback_method: The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. :param trim: Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + :param call_token: A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. :returns: The created ParticipantInstance """ + data = values.of( { "From": from_, @@ -681,6 +688,7 @@ def create( "AmdStatusCallback": amd_status_callback, "AmdStatusCallbackMethod": amd_status_callback_method, "Trim": trim, + "CallToken": call_token, } ) @@ -748,6 +756,7 @@ async def create_async( amd_status_callback: Union[str, object] = values.unset, amd_status_callback_method: Union[str, object] = values.unset, trim: Union[str, object] = values.unset, + call_token: Union[str, object] = values.unset, ) -> ParticipantInstance: """ Asynchronously create the ParticipantInstance @@ -799,9 +808,11 @@ async def create_async( :param amd_status_callback: The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. :param amd_status_callback_method: The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. :param trim: Whether to trim any leading and trailing silence from the participant recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + :param call_token: A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. :returns: The created ParticipantInstance """ + data = values.of( { "From": from_, @@ -859,6 +870,7 @@ async def create_async( "AmdStatusCallback": amd_status_callback, "AmdStatusCallbackMethod": amd_status_callback_method, "Trim": trim, + "CallToken": call_token, } ) diff --git a/twilio/rest/api/v2010/account/conference/recording.py b/twilio/rest/api/v2010/account/conference/recording.py index cd8abd95dd..dfb1d406ee 100644 --- a/twilio/rest/api/v2010/account/conference/recording.py +++ b/twilio/rest/api/v2010/account/conference/recording.py @@ -23,6 +23,7 @@ class RecordingInstance(InstanceResource): + class Source(object): DIALVERB = "DialVerb" CONFERENCE = "Conference" @@ -203,6 +204,7 @@ def __repr__(self) -> str: class RecordingContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, conference_sid: str, sid: str ): @@ -371,6 +373,7 @@ def __repr__(self) -> str: class RecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RecordingInstance: """ Build an instance of RecordingInstance @@ -394,6 +397,7 @@ def __repr__(self) -> str: class RecordingList(ListResource): + def __init__(self, version: Version, account_sid: str, conference_sid: str): """ Initialize the RecordingList diff --git a/twilio/rest/api/v2010/account/connect_app.py b/twilio/rest/api/v2010/account/connect_app.py index 50c4897456..722e4e9b3e 100644 --- a/twilio/rest/api/v2010/account/connect_app.py +++ b/twilio/rest/api/v2010/account/connect_app.py @@ -22,6 +22,7 @@ class ConnectAppInstance(InstanceResource): + class Permission(object): GET_ALL = "get-all" POST_ALL = "post-all" @@ -214,6 +215,7 @@ def __repr__(self) -> str: class ConnectAppContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the ConnectAppContext @@ -414,6 +416,7 @@ def __repr__(self) -> str: class ConnectAppPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConnectAppInstance: """ Build an instance of ConnectAppInstance @@ -434,6 +437,7 @@ def __repr__(self) -> str: class ConnectAppList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ConnectAppList diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py index 805a1b6f02..b1910d5bf6 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py @@ -29,6 +29,7 @@ class IncomingPhoneNumberInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -394,6 +395,7 @@ def __repr__(self) -> str: class IncomingPhoneNumberContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the IncomingPhoneNumberContext @@ -703,6 +705,7 @@ def __repr__(self) -> str: class IncomingPhoneNumberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IncomingPhoneNumberInstance: """ Build an instance of IncomingPhoneNumberInstance @@ -723,6 +726,7 @@ def __repr__(self) -> str: class IncomingPhoneNumberList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the IncomingPhoneNumberList @@ -806,6 +810,7 @@ def create( :returns: The created IncomingPhoneNumberInstance """ + data = values.of( { "ApiVersion": api_version, @@ -906,6 +911,7 @@ async def create_async( :returns: The created IncomingPhoneNumberInstance """ + data = values.of( { "ApiVersion": api_version, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py index a1206eaa96..12c6f961e4 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py @@ -146,6 +146,7 @@ def __repr__(self) -> str: class AssignedAddOnContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, resource_sid: str, sid: str): """ Initialize the AssignedAddOnContext @@ -260,6 +261,7 @@ def __repr__(self) -> str: class AssignedAddOnPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AssignedAddOnInstance: """ Build an instance of AssignedAddOnInstance @@ -283,6 +285,7 @@ def __repr__(self) -> str: class AssignedAddOnList(ListResource): + def __init__(self, version: Version, account_sid: str, resource_sid: str): """ Initialize the AssignedAddOnList @@ -311,6 +314,7 @@ def create(self, installed_add_on_sid: str) -> AssignedAddOnInstance: :returns: The created AssignedAddOnInstance """ + data = values.of( { "InstalledAddOnSid": installed_add_on_sid, @@ -338,6 +342,7 @@ async def create_async(self, installed_add_on_sid: str) -> AssignedAddOnInstance :returns: The created AssignedAddOnInstance """ + data = values.of( { "InstalledAddOnSid": installed_add_on_sid, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py index 1c1e4b55ca..18504cafd8 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py @@ -110,6 +110,7 @@ def __repr__(self) -> str: class AssignedAddOnExtensionContext(InstanceContext): + def __init__( self, version: Version, @@ -195,6 +196,7 @@ def __repr__(self) -> str: class AssignedAddOnExtensionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AssignedAddOnExtensionInstance: """ Build an instance of AssignedAddOnExtensionInstance @@ -219,6 +221,7 @@ def __repr__(self) -> str: class AssignedAddOnExtensionList(ListResource): + def __init__( self, version: Version, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/local.py b/twilio/rest/api/v2010/account/incoming_phone_number/local.py index 0b2bd0341e..6f87f0e94c 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/local.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/local.py @@ -23,6 +23,7 @@ class LocalInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -151,6 +152,7 @@ def __repr__(self) -> str: class LocalPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> LocalInstance: """ Build an instance of LocalInstance @@ -171,6 +173,7 @@ def __repr__(self) -> str: class LocalList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the LocalList @@ -246,6 +249,7 @@ def create( :returns: The created LocalInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -341,6 +345,7 @@ async def create_async( :returns: The created LocalInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py index 09714c6573..59fdda7a90 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py @@ -23,6 +23,7 @@ class MobileInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -151,6 +152,7 @@ def __repr__(self) -> str: class MobilePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MobileInstance: """ Build an instance of MobileInstance @@ -171,6 +173,7 @@ def __repr__(self) -> str: class MobileList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the MobileList @@ -248,6 +251,7 @@ def create( :returns: The created MobileInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -345,6 +349,7 @@ async def create_async( :returns: The created MobileInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py index bb753adc09..e6a197283a 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py @@ -23,6 +23,7 @@ class TollFreeInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -151,6 +152,7 @@ def __repr__(self) -> str: class TollFreePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TollFreeInstance: """ Build an instance of TollFreeInstance @@ -171,6 +173,7 @@ def __repr__(self) -> str: class TollFreeList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the TollFreeList @@ -248,6 +251,7 @@ def create( :returns: The created TollFreeInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -345,6 +349,7 @@ async def create_async( :returns: The created TollFreeInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/api/v2010/account/key.py b/twilio/rest/api/v2010/account/key.py index e4ff85955f..68a9feb0e1 100644 --- a/twilio/rest/api/v2010/account/key.py +++ b/twilio/rest/api/v2010/account/key.py @@ -143,6 +143,7 @@ def __repr__(self) -> str: class KeyContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the KeyContext @@ -291,6 +292,7 @@ def __repr__(self) -> str: class KeyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> KeyInstance: """ Build an instance of KeyInstance @@ -311,6 +313,7 @@ def __repr__(self) -> str: class KeyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the KeyList diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index f84b821fd3..9706e80cf0 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -25,6 +25,7 @@ class MessageInstance(InstanceResource): + class AddressRetention(object): RETAIN = "retain" OBFUSCATE = "obfuscate" @@ -68,7 +69,7 @@ class UpdateStatus(object): :ivar body: The text content of the message :ivar num_segments: The number of segments that make up the complete message. SMS message bodies that exceed the [character limit](https://www.twilio.com/docs/glossary/what-sms-character-limit) are segmented and charged as multiple messages. Note: For messages sent via a Messaging Service, `num_segments` is initially `0`, since a sender hasn't yet been assigned. :ivar direction: - :ivar from_: The sender's phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Twilio phone number, alphanumeric sender ID, short code, or channel address from which the message is sent. + :ivar from_: The sender's phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). For incoming messages, this is the number or channel address of the sender. For outgoing messages, this value is a Twilio phone number, alphanumeric sender ID, short code, or channel address from which the message is sent. :ivar to: The recipient's phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format) or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g. `whatsapp:+15552229999`) :ivar date_updated: The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message resource was last updated :ivar price: The amount billed for the message in the currency specified by `price_unit`. The `price` is populated after the message has been sent/received, and may not be immediately availalble. View the [Pricing page](https://www.twilio.com/en-us/pricing) for more details. @@ -244,6 +245,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the MessageContext @@ -433,6 +435,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -453,6 +456,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the MessageList @@ -514,20 +518,21 @@ def create( :param address_retention: :param smart_encoded: Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. :param persistent_action: Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). - :param shorten_urls: For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/how-to-configure-link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. + :param shorten_urls: For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. :param schedule_type: :param send_at: The time that Twilio will send the message. Must be in ISO 8601 format. :param send_as_mms: If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. :param content_variables: For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. :param risk_check: - :param from_: The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. + :param from_: The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. :param body: The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). - :param media_url: The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. + :param media_url: The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. :param content_sid: For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). :returns: The created MessageInstance """ + data = values.of( { "To": to, @@ -611,20 +616,21 @@ async def create_async( :param address_retention: :param smart_encoded: Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. :param persistent_action: Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). - :param shorten_urls: For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/how-to-configure-link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. + :param shorten_urls: For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. :param schedule_type: :param send_at: The time that Twilio will send the message. Must be in ISO 8601 format. :param send_as_mms: If set to `true`, Twilio delivers the message as a single MMS message, regardless of the presence of media. :param content_variables: For [Content Editor/API](https://www.twilio.com/docs/content) only: Key-value pairs of [Template variables](https://www.twilio.com/docs/content/using-variables-with-content-api) and their substitution values. `content_sid` parameter must also be provided. If values are not defined in the `content_variables` parameter, the [Template's default placeholder values](https://www.twilio.com/docs/content/content-api-resources#create-templates) are used. :param risk_check: - :param from_: The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/docs/sms/api/short-code), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. + :param from_: The sender's Twilio phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format), [alphanumeric sender ID](https://www.twilio.com/docs/sms/quickstart), [Wireless SIM](https://www.twilio.com/docs/iot/wireless/programmable-wireless-send-machine-machine-sms-commands), [short code](https://www.twilio.com/en-us/messaging/channels/sms/short-codes), or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g., `whatsapp:+15554449999`). The value of the `from` parameter must be a sender that is hosted within Twilio and belongs to the Account creating the Message. If you are using `messaging_service_sid`, this parameter can be empty (Twilio assigns a `from` value from the Messaging Service's Sender Pool) or you can provide a specific sender from your Sender Pool. :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) you want to associate with the Message. When this parameter is provided and the `from` parameter is omitted, Twilio selects the optimal sender from the Messaging Service's Sender Pool. You may also provide a `from` parameter if you want to use a specific Sender from the Sender Pool. :param body: The text content of the outgoing message. Can be up to 1,600 characters in length. SMS only: If the `body` contains more than 160 [GSM-7](https://www.twilio.com/docs/glossary/what-is-gsm-7-character-encoding) characters (or 70 [UCS-2](https://www.twilio.com/docs/glossary/what-is-ucs-2-character-encoding) characters), the message is segmented and charged accordingly. For long `body` text, consider using the [send_as_mms parameter](https://www.twilio.com/blog/mms-for-long-text-messages). - :param media_url: The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. + :param media_url: The URL of media to include in the Message content. `jpeg`, `jpg`, `gif`, and `png` file types are fully supported by Twilio and content is formatted for delivery on destination devices. The media size limit is 5 MB for supported file types (`jpeg`, `jpg`, `png`, `gif`) and 500 KB for [other types](https://www.twilio.com/docs/messaging/guides/accepted-mime-types) of accepted media. To send more than one image in the message, provide multiple `media_url` parameters in the POST request. You can include up to ten `media_url` parameters per message. [International](https://support.twilio.com/hc/en-us/articles/223179808-Sending-and-receiving-MMS-messages) and [carrier](https://support.twilio.com/hc/en-us/articles/223133707-Is-MMS-supported-for-all-carriers-in-US-and-Canada-) limits apply. :param content_sid: For [Content Editor/API](https://www.twilio.com/docs/content) only: The SID of the Content Template to be used with the Message, e.g., `HXXXXXXXXXXXXXXXXXXXXXXXXXXXXX`. If this parameter is not provided, a Content Template is not used. Find the SID in the Console on the Content Editor page. For Content API users, the SID is found in Twilio's response when [creating the Template](https://www.twilio.com/docs/content/content-api-resources#create-templates) or by [fetching your Templates](https://www.twilio.com/docs/content/content-api-resources#fetch-all-content-resources). :returns: The created MessageInstance """ + data = values.of( { "To": to, diff --git a/twilio/rest/api/v2010/account/message/feedback.py b/twilio/rest/api/v2010/account/message/feedback.py index 59758491ff..2ccce06a54 100644 --- a/twilio/rest/api/v2010/account/message/feedback.py +++ b/twilio/rest/api/v2010/account/message/feedback.py @@ -22,6 +22,7 @@ class FeedbackInstance(InstanceResource): + class Outcome(object): CONFIRMED = "confirmed" UNCONFIRMED = "unconfirmed" @@ -71,6 +72,7 @@ def __repr__(self) -> str: class FeedbackList(ListResource): + def __init__(self, version: Version, account_sid: str, message_sid: str): """ Initialize the FeedbackList @@ -103,6 +105,7 @@ def create( :returns: The created FeedbackInstance """ + data = values.of( { "Outcome": outcome, @@ -132,6 +135,7 @@ async def create_async( :returns: The created FeedbackInstance """ + data = values.of( { "Outcome": outcome, diff --git a/twilio/rest/api/v2010/account/message/media.py b/twilio/rest/api/v2010/account/message/media.py index 900c73a60d..4068d0c35d 100644 --- a/twilio/rest/api/v2010/account/message/media.py +++ b/twilio/rest/api/v2010/account/message/media.py @@ -126,6 +126,7 @@ def __repr__(self) -> str: class MediaContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, message_sid: str, sid: str): """ Initialize the MediaContext @@ -226,6 +227,7 @@ def __repr__(self) -> str: class MediaPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MediaInstance: """ Build an instance of MediaInstance @@ -249,6 +251,7 @@ def __repr__(self) -> str: class MediaList(ListResource): + def __init__(self, version: Version, account_sid: str, message_sid: str): """ Initialize the MediaList diff --git a/twilio/rest/api/v2010/account/new_key.py b/twilio/rest/api/v2010/account/new_key.py index 51581f4f86..015249ddf8 100644 --- a/twilio/rest/api/v2010/account/new_key.py +++ b/twilio/rest/api/v2010/account/new_key.py @@ -58,6 +58,7 @@ def __repr__(self) -> str: class NewKeyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the NewKeyList @@ -84,6 +85,7 @@ def create( :returns: The created NewKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -110,6 +112,7 @@ async def create_async( :returns: The created NewKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/new_signing_key.py b/twilio/rest/api/v2010/account/new_signing_key.py index 7cc7758397..6bfa32324b 100644 --- a/twilio/rest/api/v2010/account/new_signing_key.py +++ b/twilio/rest/api/v2010/account/new_signing_key.py @@ -58,6 +58,7 @@ def __repr__(self) -> str: class NewSigningKeyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the NewSigningKeyList @@ -84,6 +85,7 @@ def create( :returns: The created NewSigningKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -110,6 +112,7 @@ async def create_async( :returns: The created NewSigningKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/notification.py b/twilio/rest/api/v2010/account/notification.py index 0892b2db65..0a2e13da35 100644 --- a/twilio/rest/api/v2010/account/notification.py +++ b/twilio/rest/api/v2010/account/notification.py @@ -127,6 +127,7 @@ def __repr__(self) -> str: class NotificationContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the NotificationContext @@ -197,6 +198,7 @@ def __repr__(self) -> str: class NotificationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> NotificationInstance: """ Build an instance of NotificationInstance @@ -217,6 +219,7 @@ def __repr__(self) -> str: class NotificationList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the NotificationList diff --git a/twilio/rest/api/v2010/account/outgoing_caller_id.py b/twilio/rest/api/v2010/account/outgoing_caller_id.py index a0504da872..65ddfa1cdb 100644 --- a/twilio/rest/api/v2010/account/outgoing_caller_id.py +++ b/twilio/rest/api/v2010/account/outgoing_caller_id.py @@ -151,6 +151,7 @@ def __repr__(self) -> str: class OutgoingCallerIdContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the OutgoingCallerIdContext @@ -303,6 +304,7 @@ def __repr__(self) -> str: class OutgoingCallerIdPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> OutgoingCallerIdInstance: """ Build an instance of OutgoingCallerIdInstance @@ -323,6 +325,7 @@ def __repr__(self) -> str: class OutgoingCallerIdList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the OutgoingCallerIdList diff --git a/twilio/rest/api/v2010/account/queue/__init__.py b/twilio/rest/api/v2010/account/queue/__init__.py index 5b9d212694..4e6c87baa9 100644 --- a/twilio/rest/api/v2010/account/queue/__init__.py +++ b/twilio/rest/api/v2010/account/queue/__init__.py @@ -175,6 +175,7 @@ def __repr__(self) -> str: class QueueContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the QueueContext @@ -348,6 +349,7 @@ def __repr__(self) -> str: class QueuePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> QueueInstance: """ Build an instance of QueueInstance @@ -368,6 +370,7 @@ def __repr__(self) -> str: class QueueList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the QueueList @@ -395,6 +398,7 @@ def create( :returns: The created QueueInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -423,6 +427,7 @@ async def create_async( :returns: The created QueueInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/queue/member.py b/twilio/rest/api/v2010/account/queue/member.py index 9d8e26ead9..bf092ff283 100644 --- a/twilio/rest/api/v2010/account/queue/member.py +++ b/twilio/rest/api/v2010/account/queue/member.py @@ -136,6 +136,7 @@ def __repr__(self) -> str: class MemberContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, queue_sid: str, call_sid: str ): @@ -278,6 +279,7 @@ def __repr__(self) -> str: class MemberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MemberInstance: """ Build an instance of MemberInstance @@ -301,6 +303,7 @@ def __repr__(self) -> str: class MemberList(ListResource): + def __init__(self, version: Version, account_sid: str, queue_sid: str): """ Initialize the MemberList diff --git a/twilio/rest/api/v2010/account/recording/__init__.py b/twilio/rest/api/v2010/account/recording/__init__.py index c03c48c7a7..b6d7c98273 100644 --- a/twilio/rest/api/v2010/account/recording/__init__.py +++ b/twilio/rest/api/v2010/account/recording/__init__.py @@ -25,6 +25,7 @@ class RecordingInstance(InstanceResource): + class Source(object): DIALVERB = "DialVerb" CONFERENCE = "Conference" @@ -197,6 +198,7 @@ def __repr__(self) -> str: class RecordingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the RecordingContext @@ -334,6 +336,7 @@ def __repr__(self) -> str: class RecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RecordingInstance: """ Build an instance of RecordingInstance @@ -354,6 +357,7 @@ def __repr__(self) -> str: class RecordingList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the RecordingList diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py b/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py index 2e7bab3807..af1e75f4c6 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py @@ -24,6 +24,7 @@ class AddOnResultInstance(InstanceResource): + class Status(object): CANCELED = "canceled" COMPLETED = "completed" @@ -156,6 +157,7 @@ def __repr__(self) -> str: class AddOnResultContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, reference_sid: str, sid: str ): @@ -272,6 +274,7 @@ def __repr__(self) -> str: class AddOnResultPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AddOnResultInstance: """ Build an instance of AddOnResultInstance @@ -295,6 +298,7 @@ def __repr__(self) -> str: class AddOnResultList(ListResource): + def __init__(self, version: Version, account_sid: str, reference_sid: str): """ Initialize the AddOnResultList diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/payload.py b/twilio/rest/api/v2010/account/recording/add_on_result/payload.py index 2b2aa7648a..1dc26e1d7b 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/payload.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/payload.py @@ -141,6 +141,7 @@ def __repr__(self) -> str: class PayloadContext(InstanceContext): + def __init__( self, version: Version, @@ -250,6 +251,7 @@ def __repr__(self) -> str: class PayloadPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PayloadInstance: """ Build an instance of PayloadInstance @@ -274,6 +276,7 @@ def __repr__(self) -> str: class PayloadList(ListResource): + def __init__( self, version: Version, diff --git a/twilio/rest/api/v2010/account/recording/transcription.py b/twilio/rest/api/v2010/account/recording/transcription.py index a89b5e0ca2..bb6e0e405a 100644 --- a/twilio/rest/api/v2010/account/recording/transcription.py +++ b/twilio/rest/api/v2010/account/recording/transcription.py @@ -23,6 +23,7 @@ class TranscriptionInstance(InstanceResource): + class Status(object): IN_PROGRESS = "in-progress" COMPLETED = "completed" @@ -143,6 +144,7 @@ def __repr__(self) -> str: class TranscriptionContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, recording_sid: str, sid: str ): @@ -243,6 +245,7 @@ def __repr__(self) -> str: class TranscriptionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TranscriptionInstance: """ Build an instance of TranscriptionInstance @@ -266,6 +269,7 @@ def __repr__(self) -> str: class TranscriptionList(ListResource): + def __init__(self, version: Version, account_sid: str, recording_sid: str): """ Initialize the TranscriptionList diff --git a/twilio/rest/api/v2010/account/short_code.py b/twilio/rest/api/v2010/account/short_code.py index 5644f9214a..2af049a20b 100644 --- a/twilio/rest/api/v2010/account/short_code.py +++ b/twilio/rest/api/v2010/account/short_code.py @@ -175,6 +175,7 @@ def __repr__(self) -> str: class ShortCodeContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the ShortCodeContext @@ -335,6 +336,7 @@ def __repr__(self) -> str: class ShortCodePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ShortCodeInstance: """ Build an instance of ShortCodeInstance @@ -355,6 +357,7 @@ def __repr__(self) -> str: class ShortCodeList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ShortCodeList diff --git a/twilio/rest/api/v2010/account/signing_key.py b/twilio/rest/api/v2010/account/signing_key.py index 51ee4a409a..6ddc7b92b0 100644 --- a/twilio/rest/api/v2010/account/signing_key.py +++ b/twilio/rest/api/v2010/account/signing_key.py @@ -145,6 +145,7 @@ def __repr__(self) -> str: class SigningKeyContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the SigningKeyContext @@ -297,6 +298,7 @@ def __repr__(self) -> str: class SigningKeyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SigningKeyInstance: """ Build an instance of SigningKeyInstance @@ -317,6 +319,7 @@ def __repr__(self) -> str: class SigningKeyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the SigningKeyList diff --git a/twilio/rest/api/v2010/account/sip/__init__.py b/twilio/rest/api/v2010/account/sip/__init__.py index 49d5a5db4f..12c695ff72 100644 --- a/twilio/rest/api/v2010/account/sip/__init__.py +++ b/twilio/rest/api/v2010/account/sip/__init__.py @@ -26,6 +26,7 @@ class SipList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the SipList diff --git a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py index d56f55a812..634500f8cf 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py @@ -157,6 +157,7 @@ def __repr__(self) -> str: class CredentialListContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the CredentialListContext @@ -320,6 +321,7 @@ def __repr__(self) -> str: class CredentialListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialListInstance: """ Build an instance of CredentialListInstance @@ -340,6 +342,7 @@ def __repr__(self) -> str: class CredentialListList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the CredentialListList @@ -366,6 +369,7 @@ def create(self, friendly_name: str) -> CredentialListInstance: :returns: The created CredentialListInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -390,6 +394,7 @@ async def create_async(self, friendly_name: str) -> CredentialListInstance: :returns: The created CredentialListInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/sip/credential_list/credential.py b/twilio/rest/api/v2010/account/sip/credential_list/credential.py index 5a9dbe60bb..3d2c24b999 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/credential.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/credential.py @@ -154,6 +154,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__( self, version: Version, account_sid: str, credential_list_sid: str, sid: str ): @@ -312,6 +313,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -335,6 +337,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version, account_sid: str, credential_list_sid: str): """ Initialize the CredentialList @@ -364,6 +367,7 @@ def create(self, username: str, password: str) -> CredentialInstance: :returns: The created CredentialInstance """ + data = values.of( { "Username": username, @@ -393,6 +397,7 @@ async def create_async(self, username: str, password: str) -> CredentialInstance :returns: The created CredentialInstance """ + data = values.of( { "Username": username, diff --git a/twilio/rest/api/v2010/account/sip/domain/__init__.py b/twilio/rest/api/v2010/account/sip/domain/__init__.py index e430836416..f59a0c8a27 100644 --- a/twilio/rest/api/v2010/account/sip/domain/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/__init__.py @@ -289,6 +289,7 @@ def __repr__(self) -> str: class DomainContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the DomainContext @@ -560,6 +561,7 @@ def __repr__(self) -> str: class DomainPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DomainInstance: """ Build an instance of DomainInstance @@ -580,6 +582,7 @@ def __repr__(self) -> str: class DomainList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the DomainList @@ -631,6 +634,7 @@ def create( :returns: The created DomainInstance """ + data = values.of( { "DomainName": domain_name, @@ -694,6 +698,7 @@ async def create_async( :returns: The created DomainInstance """ + data = values.of( { "DomainName": domain_name, diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py index 19935cf604..73a81ac90d 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/__init__.py @@ -27,6 +27,7 @@ class AuthTypesList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthTypesList diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py index 8f75485248..79a42fa01d 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/__init__.py @@ -27,6 +27,7 @@ class AuthTypeCallsList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthTypeCallsList diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py index 05935b4173..81bb5b0b0c 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py @@ -124,6 +124,7 @@ def __repr__(self) -> str: class AuthCallsCredentialListMappingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, domain_sid: str, sid: str): """ Initialize the AuthCallsCredentialListMappingContext @@ -224,6 +225,7 @@ def __repr__(self) -> str: class AuthCallsCredentialListMappingPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> AuthCallsCredentialListMappingInstance: @@ -249,6 +251,7 @@ def __repr__(self) -> str: class AuthCallsCredentialListMappingList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthCallsCredentialListMappingList @@ -279,6 +282,7 @@ def create( :returns: The created AuthCallsCredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, @@ -308,6 +312,7 @@ async def create_async( :returns: The created AuthCallsCredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py index b4ad167afe..a690ef4b10 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py @@ -126,6 +126,7 @@ def __repr__(self) -> str: class AuthCallsIpAccessControlListMappingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, domain_sid: str, sid: str): """ Initialize the AuthCallsIpAccessControlListMappingContext @@ -228,6 +229,7 @@ def __repr__(self) -> str: class AuthCallsIpAccessControlListMappingPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> AuthCallsIpAccessControlListMappingInstance: @@ -253,6 +255,7 @@ def __repr__(self) -> str: class AuthCallsIpAccessControlListMappingList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthCallsIpAccessControlListMappingList @@ -283,6 +286,7 @@ def create( :returns: The created AuthCallsIpAccessControlListMappingInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, @@ -312,6 +316,7 @@ async def create_async( :returns: The created AuthCallsIpAccessControlListMappingInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py index 20229d8990..c10c747378 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/__init__.py @@ -24,6 +24,7 @@ class AuthTypeRegistrationsList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthTypeRegistrationsList diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py index 4881459574..2b03bb2998 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py @@ -124,6 +124,7 @@ def __repr__(self) -> str: class AuthRegistrationsCredentialListMappingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, domain_sid: str, sid: str): """ Initialize the AuthRegistrationsCredentialListMappingContext @@ -224,6 +225,7 @@ def __repr__(self) -> str: class AuthRegistrationsCredentialListMappingPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> AuthRegistrationsCredentialListMappingInstance: @@ -249,6 +251,7 @@ def __repr__(self) -> str: class AuthRegistrationsCredentialListMappingList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the AuthRegistrationsCredentialListMappingList @@ -279,6 +282,7 @@ def create( :returns: The created AuthRegistrationsCredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, @@ -308,6 +312,7 @@ async def create_async( :returns: The created AuthRegistrationsCredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, diff --git a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py index d951074aaa..f7838bfc59 100644 --- a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py @@ -126,6 +126,7 @@ def __repr__(self) -> str: class CredentialListMappingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, domain_sid: str, sid: str): """ Initialize the CredentialListMappingContext @@ -224,6 +225,7 @@ def __repr__(self) -> str: class CredentialListMappingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialListMappingInstance: """ Build an instance of CredentialListMappingInstance @@ -247,6 +249,7 @@ def __repr__(self) -> str: class CredentialListMappingList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the CredentialListMappingList @@ -275,6 +278,7 @@ def create(self, credential_list_sid: str) -> CredentialListMappingInstance: :returns: The created CredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, @@ -304,6 +308,7 @@ async def create_async( :returns: The created CredentialListMappingInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, diff --git a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py index b534af960b..c619be386f 100644 --- a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py @@ -128,6 +128,7 @@ def __repr__(self) -> str: class IpAccessControlListMappingContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, domain_sid: str, sid: str): """ Initialize the IpAccessControlListMappingContext @@ -226,6 +227,7 @@ def __repr__(self) -> str: class IpAccessControlListMappingPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> IpAccessControlListMappingInstance: @@ -251,6 +253,7 @@ def __repr__(self) -> str: class IpAccessControlListMappingList(ListResource): + def __init__(self, version: Version, account_sid: str, domain_sid: str): """ Initialize the IpAccessControlListMappingList @@ -281,6 +284,7 @@ def create( :returns: The created IpAccessControlListMappingInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, @@ -310,6 +314,7 @@ async def create_async( :returns: The created IpAccessControlListMappingInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py index 38ea58900d..7c2fd8214a 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py @@ -159,6 +159,7 @@ def __repr__(self) -> str: class IpAccessControlListContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the IpAccessControlListContext @@ -324,6 +325,7 @@ def __repr__(self) -> str: class IpAccessControlListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IpAccessControlListInstance: """ Build an instance of IpAccessControlListInstance @@ -344,6 +346,7 @@ def __repr__(self) -> str: class IpAccessControlListList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the IpAccessControlListList @@ -370,6 +373,7 @@ def create(self, friendly_name: str) -> IpAccessControlListInstance: :returns: The created IpAccessControlListInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -394,6 +398,7 @@ async def create_async(self, friendly_name: str) -> IpAccessControlListInstance: :returns: The created IpAccessControlListInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py index 0f96c154b6..251bae9655 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py @@ -176,6 +176,7 @@ def __repr__(self) -> str: class IpAddressContext(InstanceContext): + def __init__( self, version: Version, @@ -354,6 +355,7 @@ def __repr__(self) -> str: class IpAddressPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IpAddressInstance: """ Build an instance of IpAddressInstance @@ -377,6 +379,7 @@ def __repr__(self) -> str: class IpAddressList(ListResource): + def __init__( self, version: Version, account_sid: str, ip_access_control_list_sid: str ): @@ -414,6 +417,7 @@ def create( :returns: The created IpAddressInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -450,6 +454,7 @@ async def create_async( :returns: The created IpAddressInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/api/v2010/account/token.py b/twilio/rest/api/v2010/account/token.py index d726fe7094..ec5acac97f 100644 --- a/twilio/rest/api/v2010/account/token.py +++ b/twilio/rest/api/v2010/account/token.py @@ -62,6 +62,7 @@ def __repr__(self) -> str: class TokenList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the TokenList @@ -86,6 +87,7 @@ def create(self, ttl: Union[int, object] = values.unset) -> TokenInstance: :returns: The created TokenInstance """ + data = values.of( { "Ttl": ttl, @@ -112,6 +114,7 @@ async def create_async( :returns: The created TokenInstance """ + data = values.of( { "Ttl": ttl, diff --git a/twilio/rest/api/v2010/account/transcription.py b/twilio/rest/api/v2010/account/transcription.py index b757351ae4..a77bc42fb4 100644 --- a/twilio/rest/api/v2010/account/transcription.py +++ b/twilio/rest/api/v2010/account/transcription.py @@ -23,6 +23,7 @@ class TranscriptionInstance(InstanceResource): + class Status(object): IN_PROGRESS = "in-progress" COMPLETED = "completed" @@ -140,6 +141,7 @@ def __repr__(self) -> str: class TranscriptionContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the TranscriptionContext @@ -234,6 +236,7 @@ def __repr__(self) -> str: class TranscriptionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TranscriptionInstance: """ Build an instance of TranscriptionInstance @@ -254,6 +257,7 @@ def __repr__(self) -> str: class TranscriptionList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the TranscriptionList diff --git a/twilio/rest/api/v2010/account/usage/__init__.py b/twilio/rest/api/v2010/account/usage/__init__.py index 0e7d123eeb..8fe80f64ba 100644 --- a/twilio/rest/api/v2010/account/usage/__init__.py +++ b/twilio/rest/api/v2010/account/usage/__init__.py @@ -23,6 +23,7 @@ class UsageList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the UsageList diff --git a/twilio/rest/api/v2010/account/usage/record/__init__.py b/twilio/rest/api/v2010/account/usage/record/__init__.py index dab521ac97..8f8236fa23 100644 --- a/twilio/rest/api/v2010/account/usage/record/__init__.py +++ b/twilio/rest/api/v2010/account/usage/record/__init__.py @@ -31,6 +31,7 @@ class RecordInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -412,6 +413,7 @@ def __repr__(self) -> str: class RecordPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RecordInstance: """ Build an instance of RecordInstance @@ -432,6 +434,7 @@ def __repr__(self) -> str: class RecordList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the RecordList diff --git a/twilio/rest/api/v2010/account/usage/record/all_time.py b/twilio/rest/api/v2010/account/usage/record/all_time.py index a40bdcbb72..5c424bbb80 100644 --- a/twilio/rest/api/v2010/account/usage/record/all_time.py +++ b/twilio/rest/api/v2010/account/usage/record/all_time.py @@ -23,6 +23,7 @@ class AllTimeInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -404,6 +405,7 @@ def __repr__(self) -> str: class AllTimePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AllTimeInstance: """ Build an instance of AllTimeInstance @@ -424,6 +426,7 @@ def __repr__(self) -> str: class AllTimeList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the AllTimeList diff --git a/twilio/rest/api/v2010/account/usage/record/daily.py b/twilio/rest/api/v2010/account/usage/record/daily.py index 5716e1c45e..6ce34da022 100644 --- a/twilio/rest/api/v2010/account/usage/record/daily.py +++ b/twilio/rest/api/v2010/account/usage/record/daily.py @@ -23,6 +23,7 @@ class DailyInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -404,6 +405,7 @@ def __repr__(self) -> str: class DailyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DailyInstance: """ Build an instance of DailyInstance @@ -424,6 +426,7 @@ def __repr__(self) -> str: class DailyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the DailyList diff --git a/twilio/rest/api/v2010/account/usage/record/last_month.py b/twilio/rest/api/v2010/account/usage/record/last_month.py index 2c61b57137..53b6deec6f 100644 --- a/twilio/rest/api/v2010/account/usage/record/last_month.py +++ b/twilio/rest/api/v2010/account/usage/record/last_month.py @@ -23,6 +23,7 @@ class LastMonthInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -404,6 +405,7 @@ def __repr__(self) -> str: class LastMonthPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> LastMonthInstance: """ Build an instance of LastMonthInstance @@ -424,6 +426,7 @@ def __repr__(self) -> str: class LastMonthList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the LastMonthList diff --git a/twilio/rest/api/v2010/account/usage/record/monthly.py b/twilio/rest/api/v2010/account/usage/record/monthly.py index aa397d46b3..baa1164a7d 100644 --- a/twilio/rest/api/v2010/account/usage/record/monthly.py +++ b/twilio/rest/api/v2010/account/usage/record/monthly.py @@ -23,6 +23,7 @@ class MonthlyInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -404,6 +405,7 @@ def __repr__(self) -> str: class MonthlyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MonthlyInstance: """ Build an instance of MonthlyInstance @@ -424,6 +426,7 @@ def __repr__(self) -> str: class MonthlyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the MonthlyList diff --git a/twilio/rest/api/v2010/account/usage/record/this_month.py b/twilio/rest/api/v2010/account/usage/record/this_month.py index 4b11038ca9..5ce2ddc58a 100644 --- a/twilio/rest/api/v2010/account/usage/record/this_month.py +++ b/twilio/rest/api/v2010/account/usage/record/this_month.py @@ -23,6 +23,7 @@ class ThisMonthInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -404,6 +405,7 @@ def __repr__(self) -> str: class ThisMonthPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ThisMonthInstance: """ Build an instance of ThisMonthInstance @@ -424,6 +426,7 @@ def __repr__(self) -> str: class ThisMonthList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ThisMonthList diff --git a/twilio/rest/api/v2010/account/usage/record/today.py b/twilio/rest/api/v2010/account/usage/record/today.py index 32ca2f48ff..cb814db819 100644 --- a/twilio/rest/api/v2010/account/usage/record/today.py +++ b/twilio/rest/api/v2010/account/usage/record/today.py @@ -23,6 +23,7 @@ class TodayInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -404,6 +405,7 @@ def __repr__(self) -> str: class TodayPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TodayInstance: """ Build an instance of TodayInstance @@ -424,6 +426,7 @@ def __repr__(self) -> str: class TodayList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the TodayList diff --git a/twilio/rest/api/v2010/account/usage/record/yearly.py b/twilio/rest/api/v2010/account/usage/record/yearly.py index 3e83d5bc7a..ac757b9eb7 100644 --- a/twilio/rest/api/v2010/account/usage/record/yearly.py +++ b/twilio/rest/api/v2010/account/usage/record/yearly.py @@ -23,6 +23,7 @@ class YearlyInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -404,6 +405,7 @@ def __repr__(self) -> str: class YearlyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> YearlyInstance: """ Build an instance of YearlyInstance @@ -424,6 +426,7 @@ def __repr__(self) -> str: class YearlyList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the YearlyList diff --git a/twilio/rest/api/v2010/account/usage/record/yesterday.py b/twilio/rest/api/v2010/account/usage/record/yesterday.py index f9e7f41e94..ab262b7092 100644 --- a/twilio/rest/api/v2010/account/usage/record/yesterday.py +++ b/twilio/rest/api/v2010/account/usage/record/yesterday.py @@ -23,6 +23,7 @@ class YesterdayInstance(InstanceResource): + class Category(object): A2P_REGISTRATION_FEES = "a2p-registration-fees" AGENT_CONFERENCE = "agent-conference" @@ -404,6 +405,7 @@ def __repr__(self) -> str: class YesterdayPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> YesterdayInstance: """ Build an instance of YesterdayInstance @@ -424,6 +426,7 @@ def __repr__(self) -> str: class YesterdayList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the YesterdayList diff --git a/twilio/rest/api/v2010/account/usage/trigger.py b/twilio/rest/api/v2010/account/usage/trigger.py index fe070c356d..66e86602af 100644 --- a/twilio/rest/api/v2010/account/usage/trigger.py +++ b/twilio/rest/api/v2010/account/usage/trigger.py @@ -23,6 +23,7 @@ class TriggerInstance(InstanceResource): + class Recurring(object): DAILY = "daily" MONTHLY = "monthly" @@ -523,6 +524,7 @@ def __repr__(self) -> str: class TriggerContext(InstanceContext): + def __init__(self, version: Version, account_sid: str, sid: str): """ Initialize the TriggerContext @@ -689,6 +691,7 @@ def __repr__(self) -> str: class TriggerPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TriggerInstance: """ Build an instance of TriggerInstance @@ -709,6 +712,7 @@ def __repr__(self) -> str: class TriggerList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the TriggerList @@ -750,6 +754,7 @@ def create( :returns: The created TriggerInstance """ + data = values.of( { "CallbackUrl": callback_url, @@ -795,6 +800,7 @@ async def create_async( :returns: The created TriggerInstance """ + data = values.of( { "CallbackUrl": callback_url, diff --git a/twilio/rest/api/v2010/account/validation_request.py b/twilio/rest/api/v2010/account/validation_request.py index 922cc25c85..a949df2d0a 100644 --- a/twilio/rest/api/v2010/account/validation_request.py +++ b/twilio/rest/api/v2010/account/validation_request.py @@ -53,6 +53,7 @@ def __repr__(self) -> str: class ValidationRequestList(ListResource): + def __init__(self, version: Version, account_sid: str): """ Initialize the ValidationRequestList @@ -92,6 +93,7 @@ def create( :returns: The created ValidationRequestInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -134,6 +136,7 @@ async def create_async( :returns: The created ValidationRequestInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/autopilot/AutopilotBase.py b/twilio/rest/autopilot/AutopilotBase.py deleted file mode 100644 index 3b1a7f7112..0000000000 --- a/twilio/rest/autopilot/AutopilotBase.py +++ /dev/null @@ -1,43 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional - -from twilio.base.domain import Domain -from twilio.rest import Client -from twilio.rest.autopilot.v1 import V1 - - -class AutopilotBase(Domain): - def __init__(self, twilio: Client): - """ - Initialize the Autopilot Domain - - :returns: Domain for Autopilot - """ - super().__init__(twilio, "https://autopilot.twilio.com") - self._v1: Optional[V1] = None - - @property - def v1(self) -> V1: - """ - :returns: Versions v1 of Autopilot - """ - if self._v1 is None: - self._v1 = V1(self) - return self._v1 - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/__init__.py b/twilio/rest/autopilot/v1/__init__.py deleted file mode 100644 index fd23e47670..0000000000 --- a/twilio/rest/autopilot/v1/__init__.py +++ /dev/null @@ -1,50 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.autopilot.v1.assistant import AssistantList -from twilio.rest.autopilot.v1.restore_assistant import RestoreAssistantList - - -class V1(Version): - def __init__(self, domain: Domain): - """ - Initialize the V1 version of Autopilot - - :param domain: The Twilio.autopilot domain - """ - super().__init__(domain, "v1") - self._assistants: Optional[AssistantList] = None - self._restore_assistant: Optional[RestoreAssistantList] = None - - @property - def assistants(self) -> AssistantList: - if self._assistants is None: - self._assistants = AssistantList(self) - return self._assistants - - @property - def restore_assistant(self) -> RestoreAssistantList: - if self._restore_assistant is None: - self._restore_assistant = RestoreAssistantList(self) - return self._restore_assistant - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/__init__.py b/twilio/rest/autopilot/v1/assistant/__init__.py deleted file mode 100644 index 8ac157ed6e..0000000000 --- a/twilio/rest/autopilot/v1/assistant/__init__.py +++ /dev/null @@ -1,877 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.autopilot.v1.assistant.defaults import DefaultsList -from twilio.rest.autopilot.v1.assistant.dialogue import DialogueList -from twilio.rest.autopilot.v1.assistant.field_type import FieldTypeList -from twilio.rest.autopilot.v1.assistant.model_build import ModelBuildList -from twilio.rest.autopilot.v1.assistant.query import QueryList -from twilio.rest.autopilot.v1.assistant.style_sheet import StyleSheetList -from twilio.rest.autopilot.v1.assistant.task import TaskList -from twilio.rest.autopilot.v1.assistant.webhook import WebhookList - - -class AssistantInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar friendly_name: The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - :ivar latest_model_build_sid: Reserved. - :ivar links: A list of the URLs of the Assistant's related resources. - :ivar log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :ivar development_stage: A string describing the state of the assistant. - :ivar needs_model_build: Whether model needs to be rebuilt. - :ivar sid: The unique string that we created to identify the Assistant resource. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. It can be up to 64 characters long. - :ivar url: The absolute URL of the Assistant resource. - :ivar callback_url: Reserved. - :ivar callback_events: Reserved. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.latest_model_build_sid: Optional[str] = payload.get( - "latest_model_build_sid" - ) - self.links: Optional[Dict[str, object]] = payload.get("links") - self.log_queries: Optional[bool] = payload.get("log_queries") - self.development_stage: Optional[str] = payload.get("development_stage") - self.needs_model_build: Optional[bool] = payload.get("needs_model_build") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - self.callback_url: Optional[str] = payload.get("callback_url") - self.callback_events: Optional[str] = payload.get("callback_events") - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[AssistantContext] = None - - @property - def _proxy(self) -> "AssistantContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AssistantContext for this AssistantInstance - """ - if self._context is None: - self._context = AssistantContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "AssistantInstance": - """ - Fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AssistantInstance": - """ - Asynchronous coroutine to fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - development_stage: Union[str, object] = values.unset, - ) -> "AssistantInstance": - """ - Update the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - :param development_stage: A string describing the state of the assistant. - - :returns: The updated AssistantInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - log_queries=log_queries, - unique_name=unique_name, - callback_url=callback_url, - callback_events=callback_events, - style_sheet=style_sheet, - defaults=defaults, - development_stage=development_stage, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - development_stage: Union[str, object] = values.unset, - ) -> "AssistantInstance": - """ - Asynchronous coroutine to update the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - :param development_stage: A string describing the state of the assistant. - - :returns: The updated AssistantInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - log_queries=log_queries, - unique_name=unique_name, - callback_url=callback_url, - callback_events=callback_events, - style_sheet=style_sheet, - defaults=defaults, - development_stage=development_stage, - ) - - @property - def defaults(self) -> DefaultsList: - """ - Access the defaults - """ - return self._proxy.defaults - - @property - def dialogues(self) -> DialogueList: - """ - Access the dialogues - """ - return self._proxy.dialogues - - @property - def field_types(self) -> FieldTypeList: - """ - Access the field_types - """ - return self._proxy.field_types - - @property - def model_builds(self) -> ModelBuildList: - """ - Access the model_builds - """ - return self._proxy.model_builds - - @property - def queries(self) -> QueryList: - """ - Access the queries - """ - return self._proxy.queries - - @property - def style_sheet(self) -> StyleSheetList: - """ - Access the style_sheet - """ - return self._proxy.style_sheet - - @property - def tasks(self) -> TaskList: - """ - Access the tasks - """ - return self._proxy.tasks - - @property - def webhooks(self) -> WebhookList: - """ - Access the webhooks - """ - return self._proxy.webhooks - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AssistantContext(InstanceContext): - def __init__(self, version: Version, sid: str): - """ - Initialize the AssistantContext - - :param version: Version that contains the resource - :param sid: The Twilio-provided string that uniquely identifies the Assistant resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/Assistants/{sid}".format(**self._solution) - - self._defaults: Optional[DefaultsList] = None - self._dialogues: Optional[DialogueList] = None - self._field_types: Optional[FieldTypeList] = None - self._model_builds: Optional[ModelBuildList] = None - self._queries: Optional[QueryList] = None - self._style_sheet: Optional[StyleSheetList] = None - self._tasks: Optional[TaskList] = None - self._webhooks: Optional[WebhookList] = None - - def delete(self) -> bool: - """ - Deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> AssistantInstance: - """ - Fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return AssistantInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> AssistantInstance: - """ - Asynchronous coroutine to fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return AssistantInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - development_stage: Union[str, object] = values.unset, - ) -> AssistantInstance: - """ - Update the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - :param development_stage: A string describing the state of the assistant. - - :returns: The updated AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "StyleSheet": serialize.object(style_sheet), - "Defaults": serialize.object(defaults), - "DevelopmentStage": development_stage, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload, sid=self._solution["sid"]) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - development_stage: Union[str, object] = values.unset, - ) -> AssistantInstance: - """ - Asynchronous coroutine to update the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - :param development_stage: A string describing the state of the assistant. - - :returns: The updated AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "StyleSheet": serialize.object(style_sheet), - "Defaults": serialize.object(defaults), - "DevelopmentStage": development_stage, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload, sid=self._solution["sid"]) - - @property - def defaults(self) -> DefaultsList: - """ - Access the defaults - """ - if self._defaults is None: - self._defaults = DefaultsList( - self._version, - self._solution["sid"], - ) - return self._defaults - - @property - def dialogues(self) -> DialogueList: - """ - Access the dialogues - """ - if self._dialogues is None: - self._dialogues = DialogueList( - self._version, - self._solution["sid"], - ) - return self._dialogues - - @property - def field_types(self) -> FieldTypeList: - """ - Access the field_types - """ - if self._field_types is None: - self._field_types = FieldTypeList( - self._version, - self._solution["sid"], - ) - return self._field_types - - @property - def model_builds(self) -> ModelBuildList: - """ - Access the model_builds - """ - if self._model_builds is None: - self._model_builds = ModelBuildList( - self._version, - self._solution["sid"], - ) - return self._model_builds - - @property - def queries(self) -> QueryList: - """ - Access the queries - """ - if self._queries is None: - self._queries = QueryList( - self._version, - self._solution["sid"], - ) - return self._queries - - @property - def style_sheet(self) -> StyleSheetList: - """ - Access the style_sheet - """ - if self._style_sheet is None: - self._style_sheet = StyleSheetList( - self._version, - self._solution["sid"], - ) - return self._style_sheet - - @property - def tasks(self) -> TaskList: - """ - Access the tasks - """ - if self._tasks is None: - self._tasks = TaskList( - self._version, - self._solution["sid"], - ) - return self._tasks - - @property - def webhooks(self) -> WebhookList: - """ - Access the webhooks - """ - if self._webhooks is None: - self._webhooks = WebhookList( - self._version, - self._solution["sid"], - ) - return self._webhooks - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AssistantPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> AssistantInstance: - """ - Build an instance of AssistantInstance - - :param payload: Payload response from the API - """ - return AssistantInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class AssistantList(ListResource): - def __init__(self, version: Version): - """ - Initialize the AssistantList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Assistants" - - def create( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Create the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - - :returns: The created AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "StyleSheet": serialize.object(style_sheet), - "Defaults": serialize.object(defaults), - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload) - - async def create_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - defaults: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Asynchronously create the AssistantInstance - - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - :param log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param callback_url: Reserved. - :param callback_events: Reserved. - :param style_sheet: The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) - :param defaults: A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. - - :returns: The created AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "StyleSheet": serialize.object(style_sheet), - "Defaults": serialize.object(defaults), - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[AssistantInstance]: - """ - Streams AssistantInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[AssistantInstance]: - """ - Asynchronously streams AssistantInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AssistantInstance]: - """ - Lists AssistantInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AssistantInstance]: - """ - Asynchronously lists AssistantInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AssistantPage: - """ - Retrieve a single page of AssistantInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AssistantInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return AssistantPage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AssistantPage: - """ - Asynchronously retrieve a single page of AssistantInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AssistantInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return AssistantPage(self._version, response) - - def get_page(self, target_url: str) -> AssistantPage: - """ - Retrieve a specific page of AssistantInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AssistantInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return AssistantPage(self._version, response) - - async def get_page_async(self, target_url: str) -> AssistantPage: - """ - Asynchronously retrieve a specific page of AssistantInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AssistantInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return AssistantPage(self._version, response) - - def get(self, sid: str) -> AssistantContext: - """ - Constructs a AssistantContext - - :param sid: The Twilio-provided string that uniquely identifies the Assistant resource to update. - """ - return AssistantContext(self._version, sid=sid) - - def __call__(self, sid: str) -> AssistantContext: - """ - Constructs a AssistantContext - - :param sid: The Twilio-provided string that uniquely identifies the Assistant resource to update. - """ - return AssistantContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/defaults.py b/twilio/rest/autopilot/v1/assistant/defaults.py deleted file mode 100644 index f460301071..0000000000 --- a/twilio/rest/autopilot/v1/assistant/defaults.py +++ /dev/null @@ -1,271 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional, Union -from twilio.base import serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class DefaultsInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Defaults resource. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar url: The absolute URL of the Defaults resource. - :ivar data: The JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - """ - - def __init__(self, version: Version, payload: Dict[str, Any], assistant_sid: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - } - self._context: Optional[DefaultsContext] = None - - @property - def _proxy(self) -> "DefaultsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DefaultsContext for this DefaultsInstance - """ - if self._context is None: - self._context = DefaultsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - ) - return self._context - - def fetch(self) -> "DefaultsInstance": - """ - Fetch the DefaultsInstance - - - :returns: The fetched DefaultsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DefaultsInstance": - """ - Asynchronous coroutine to fetch the DefaultsInstance - - - :returns: The fetched DefaultsInstance - """ - return await self._proxy.fetch_async() - - def update( - self, defaults: Union[object, object] = values.unset - ) -> "DefaultsInstance": - """ - Update the DefaultsInstance - - :param defaults: A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - - :returns: The updated DefaultsInstance - """ - return self._proxy.update( - defaults=defaults, - ) - - async def update_async( - self, defaults: Union[object, object] = values.unset - ) -> "DefaultsInstance": - """ - Asynchronous coroutine to update the DefaultsInstance - - :param defaults: A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - - :returns: The updated DefaultsInstance - """ - return await self._proxy.update_async( - defaults=defaults, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DefaultsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the DefaultsContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Defaults".format(**self._solution) - - def fetch(self) -> DefaultsInstance: - """ - Fetch the DefaultsInstance - - - :returns: The fetched DefaultsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return DefaultsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - async def fetch_async(self) -> DefaultsInstance: - """ - Asynchronous coroutine to fetch the DefaultsInstance - - - :returns: The fetched DefaultsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return DefaultsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - def update( - self, defaults: Union[object, object] = values.unset - ) -> DefaultsInstance: - """ - Update the DefaultsInstance - - :param defaults: A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - - :returns: The updated DefaultsInstance - """ - data = values.of( - { - "Defaults": serialize.object(defaults), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return DefaultsInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def update_async( - self, defaults: Union[object, object] = values.unset - ) -> DefaultsInstance: - """ - Asynchronous coroutine to update the DefaultsInstance - - :param defaults: A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. - - :returns: The updated DefaultsInstance - """ - data = values.of( - { - "Defaults": serialize.object(defaults), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return DefaultsInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DefaultsList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the DefaultsList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self) -> DefaultsContext: - """ - Constructs a DefaultsContext - - """ - return DefaultsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __call__(self) -> DefaultsContext: - """ - Constructs a DefaultsContext - - """ - return DefaultsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/dialogue.py b/twilio/rest/autopilot/v1/assistant/dialogue.py deleted file mode 100644 index 0630694fb5..0000000000 --- a/twilio/rest/autopilot/v1/assistant/dialogue.py +++ /dev/null @@ -1,208 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class DialogueInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Dialogue resource. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the Dialogue resource. - :ivar data: The JSON string that describes the dialogue session object. - :ivar url: The absolute URL of the Dialogue resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.data: Optional[Dict[str, object]] = payload.get("data") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[DialogueContext] = None - - @property - def _proxy(self) -> "DialogueContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DialogueContext for this DialogueInstance - """ - if self._context is None: - self._context = DialogueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def fetch(self) -> "DialogueInstance": - """ - Fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DialogueInstance": - """ - Asynchronous coroutine to fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DialogueContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the DialogueContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - :param sid: The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Dialogues/{sid}".format( - **self._solution - ) - - def fetch(self) -> DialogueInstance: - """ - Fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return DialogueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> DialogueInstance: - """ - Asynchronous coroutine to fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return DialogueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DialogueList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the DialogueList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self, sid: str) -> DialogueContext: - """ - Constructs a DialogueContext - - :param sid: The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. - """ - return DialogueContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> DialogueContext: - """ - Constructs a DialogueContext - - :param sid: The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. - """ - return DialogueContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/field_type/__init__.py b/twilio/rest/autopilot/v1/assistant/field_type/__init__.py deleted file mode 100644 index ce9f8ba349..0000000000 --- a/twilio/rest/autopilot/v1/assistant/field_type/__init__.py +++ /dev/null @@ -1,650 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.autopilot.v1.assistant.field_type.field_value import FieldValueList - - -class FieldTypeInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the FieldType resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar friendly_name: The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - :ivar links: A list of the URLs of related resources. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the FieldType resource. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - :ivar url: The absolute URL of the FieldType resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldTypeContext] = None - - @property - def _proxy(self) -> "FieldTypeContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldTypeContext for this FieldTypeInstance - """ - if self._context is None: - self._context = FieldTypeContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldTypeInstance": - """ - Fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldTypeInstance": - """ - Asynchronous coroutine to fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> "FieldTypeInstance": - """ - Update the FieldTypeInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - - :returns: The updated FieldTypeInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - unique_name=unique_name, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> "FieldTypeInstance": - """ - Asynchronous coroutine to update the FieldTypeInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - - :returns: The updated FieldTypeInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - unique_name=unique_name, - ) - - @property - def field_values(self) -> FieldValueList: - """ - Access the field_values - """ - return self._proxy.field_values - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldTypeContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the FieldTypeContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the to update. - :param sid: The Twilio-provided string that uniquely identifies the FieldType resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{sid}".format( - **self._solution - ) - - self._field_values: Optional[FieldValueList] = None - - def delete(self) -> bool: - """ - Deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldTypeInstance: - """ - Fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldTypeInstance: - """ - Asynchronous coroutine to fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> FieldTypeInstance: - """ - Update the FieldTypeInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - - :returns: The updated FieldTypeInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> FieldTypeInstance: - """ - Asynchronous coroutine to update the FieldTypeInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - - :returns: The updated FieldTypeInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - @property - def field_values(self) -> FieldValueList: - """ - Access the field_values - """ - if self._field_values is None: - self._field_values = FieldValueList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._field_values - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldTypePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldTypeInstance: - """ - Build an instance of FieldTypeInstance - - :param payload: Payload response from the API - """ - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldTypeList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the FieldTypeList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes".format(**self._solution) - - def create( - self, unique_name: str, friendly_name: Union[str, object] = values.unset - ) -> FieldTypeInstance: - """ - Create the FieldTypeInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - - :returns: The created FieldTypeInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, unique_name: str, friendly_name: Union[str, object] = values.unset - ) -> FieldTypeInstance: - """ - Asynchronously create the FieldTypeInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - - :returns: The created FieldTypeInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldTypeInstance]: - """ - Streams FieldTypeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldTypeInstance]: - """ - Asynchronously streams FieldTypeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldTypeInstance]: - """ - Lists FieldTypeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldTypeInstance]: - """ - Asynchronously lists FieldTypeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldTypePage: - """ - Retrieve a single page of FieldTypeInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldTypeInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldTypePage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldTypePage: - """ - Asynchronously retrieve a single page of FieldTypeInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldTypeInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldTypePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldTypePage: - """ - Retrieve a specific page of FieldTypeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldTypeInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldTypePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldTypePage: - """ - Asynchronously retrieve a specific page of FieldTypeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldTypeInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldTypePage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldTypeContext: - """ - Constructs a FieldTypeContext - - :param sid: The Twilio-provided string that uniquely identifies the FieldType resource to update. - """ - return FieldTypeContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> FieldTypeContext: - """ - Constructs a FieldTypeContext - - :param sid: The Twilio-provided string that uniquely identifies the FieldType resource to update. - """ - return FieldTypeContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/field_type/field_value.py b/twilio/rest/autopilot/v1/assistant/field_type/field_value.py deleted file mode 100644 index 4180f31681..0000000000 --- a/twilio/rest/autopilot/v1/assistant/field_type/field_value.py +++ /dev/null @@ -1,575 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class FieldValueInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the FieldValue resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar field_type_sid: The SID of the Field Type associated with the Field Value. - :ivar language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resource. - :ivar sid: The unique string that we created to identify the FieldValue resource. - :ivar value: The Field Value data. - :ivar url: The absolute URL of the FieldValue resource. - :ivar synonym_of: The word for which the field value is a synonym of. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - field_type_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.field_type_sid: Optional[str] = payload.get("field_type_sid") - self.language: Optional[str] = payload.get("language") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.value: Optional[str] = payload.get("value") - self.url: Optional[str] = payload.get("url") - self.synonym_of: Optional[str] = payload.get("synonym_of") - - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldValueContext] = None - - @property - def _proxy(self) -> "FieldValueContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldValueContext for this FieldValueInstance - """ - if self._context is None: - self._context = FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldValueInstance": - """ - Fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldValueInstance": - """ - Asynchronous coroutine to fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldValueContext(InstanceContext): - def __init__( - self, version: Version, assistant_sid: str, field_type_sid: str, sid: str - ): - """ - Initialize the FieldValueContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resource to fetch. - :param field_type_sid: The SID of the Field Type associated with the Field Value to fetch. - :param sid: The Twilio-provided string that uniquely identifies the FieldValue resource to fetch. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{field_type_sid}/FieldValues/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldValueInstance: - """ - Fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldValueInstance: - """ - Asynchronous coroutine to fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldValuePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldValueInstance: - """ - Build an instance of FieldValueInstance - - :param payload: Payload response from the API - """ - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldValueList(ListResource): - def __init__(self, version: Version, assistant_sid: str, field_type_sid: str): - """ - Initialize the FieldValueList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the FieldType associated with the resources to read. - :param field_type_sid: The SID of the Field Type associated with the Field Value to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{field_type_sid}/FieldValues".format( - **self._solution - ) - - def create( - self, language: str, value: str, synonym_of: Union[str, object] = values.unset - ) -> FieldValueInstance: - """ - Create the FieldValueInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :param value: The Field Value data. - :param synonym_of: The string value that indicates which word the field value is a synonym of. - - :returns: The created FieldValueInstance - """ - data = values.of( - { - "Language": language, - "Value": value, - "SynonymOf": synonym_of, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - async def create_async( - self, language: str, value: str, synonym_of: Union[str, object] = values.unset - ) -> FieldValueInstance: - """ - Asynchronously create the FieldValueInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :param value: The Field Value data. - :param synonym_of: The string value that indicates which word the field value is a synonym of. - - :returns: The created FieldValueInstance - """ - data = values.of( - { - "Language": language, - "Value": value, - "SynonymOf": synonym_of, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - def stream( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldValueInstance]: - """ - Streams FieldValueInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(language=language, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldValueInstance]: - """ - Asynchronously streams FieldValueInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(language=language, page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldValueInstance]: - """ - Lists FieldValueInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldValueInstance]: - """ - Asynchronously lists FieldValueInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldValuePage: - """ - Retrieve a single page of FieldValueInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldValueInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldValuePage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldValuePage: - """ - Asynchronously retrieve a single page of FieldValueInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldValueInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldValuePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldValuePage: - """ - Retrieve a specific page of FieldValueInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldValueInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldValuePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldValuePage: - """ - Asynchronously retrieve a specific page of FieldValueInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldValueInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldValuePage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldValueContext: - """ - Constructs a FieldValueContext - - :param sid: The Twilio-provided string that uniquely identifies the FieldValue resource to fetch. - """ - return FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> FieldValueContext: - """ - Constructs a FieldValueContext - - :param sid: The Twilio-provided string that uniquely identifies the FieldValue resource to fetch. - """ - return FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/model_build.py b/twilio/rest/autopilot/v1/assistant/model_build.py deleted file mode 100644 index f3c4b708af..0000000000 --- a/twilio/rest/autopilot/v1/assistant/model_build.py +++ /dev/null @@ -1,626 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class ModelBuildInstance(InstanceResource): - class Status(object): - ENQUEUED = "enqueued" - BUILDING = "building" - COMPLETED = "completed" - FAILED = "failed" - CANCELED = "canceled" - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ModelBuild resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the ModelBuild resource. - :ivar status: - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. - :ivar url: The absolute URL of the ModelBuild resource. - :ivar build_duration: The time in seconds it took to build the model. - :ivar error_code: If the `status` for the model build is `failed`, this value is a code to more information about the failure. This value will be null for all other statuses. See [error code dictionary](https://www.twilio.com/docs/api/errors) for a description of the error. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.status: Optional["ModelBuildInstance.Status"] = payload.get("status") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - self.build_duration: Optional[int] = deserialize.integer( - payload.get("build_duration") - ) - self.error_code: Optional[int] = deserialize.integer(payload.get("error_code")) - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[ModelBuildContext] = None - - @property - def _proxy(self) -> "ModelBuildContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: ModelBuildContext for this ModelBuildInstance - """ - if self._context is None: - self._context = ModelBuildContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "ModelBuildInstance": - """ - Fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "ModelBuildInstance": - """ - Asynchronous coroutine to fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - return await self._proxy.fetch_async() - - def update( - self, unique_name: Union[str, object] = values.unset - ) -> "ModelBuildInstance": - """ - Update the ModelBuildInstance - - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The updated ModelBuildInstance - """ - return self._proxy.update( - unique_name=unique_name, - ) - - async def update_async( - self, unique_name: Union[str, object] = values.unset - ) -> "ModelBuildInstance": - """ - Asynchronous coroutine to update the ModelBuildInstance - - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The updated ModelBuildInstance - """ - return await self._proxy.update_async( - unique_name=unique_name, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class ModelBuildContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the ModelBuildContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - :param sid: The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/ModelBuilds/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> ModelBuildInstance: - """ - Fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> ModelBuildInstance: - """ - Asynchronous coroutine to fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, unique_name: Union[str, object] = values.unset - ) -> ModelBuildInstance: - """ - Update the ModelBuildInstance - - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The updated ModelBuildInstance - """ - data = values.of( - { - "UniqueName": unique_name, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, unique_name: Union[str, object] = values.unset - ) -> ModelBuildInstance: - """ - Asynchronous coroutine to update the ModelBuildInstance - - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The updated ModelBuildInstance - """ - data = values.of( - { - "UniqueName": unique_name, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class ModelBuildPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> ModelBuildInstance: - """ - Build an instance of ModelBuildInstance - - :param payload: Payload response from the API - """ - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class ModelBuildList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the ModelBuildList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/ModelBuilds".format(**self._solution) - - def create( - self, - status_callback: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> ModelBuildInstance: - """ - Create the ModelBuildInstance - - :param status_callback: The URL we should call using a POST method to send status information to your application. - :param unique_name: An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The created ModelBuildInstance - """ - data = values.of( - { - "StatusCallback": status_callback, - "UniqueName": unique_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - status_callback: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> ModelBuildInstance: - """ - Asynchronously create the ModelBuildInstance - - :param status_callback: The URL we should call using a POST method to send status information to your application. - :param unique_name: An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The created ModelBuildInstance - """ - data = values.of( - { - "StatusCallback": status_callback, - "UniqueName": unique_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[ModelBuildInstance]: - """ - Streams ModelBuildInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[ModelBuildInstance]: - """ - Asynchronously streams ModelBuildInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ModelBuildInstance]: - """ - Lists ModelBuildInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ModelBuildInstance]: - """ - Asynchronously lists ModelBuildInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ModelBuildPage: - """ - Retrieve a single page of ModelBuildInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of ModelBuildInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return ModelBuildPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ModelBuildPage: - """ - Asynchronously retrieve a single page of ModelBuildInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of ModelBuildInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return ModelBuildPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> ModelBuildPage: - """ - Retrieve a specific page of ModelBuildInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ModelBuildInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return ModelBuildPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> ModelBuildPage: - """ - Asynchronously retrieve a specific page of ModelBuildInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ModelBuildInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return ModelBuildPage(self._version, response, self._solution) - - def get(self, sid: str) -> ModelBuildContext: - """ - Constructs a ModelBuildContext - - :param sid: The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - """ - return ModelBuildContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> ModelBuildContext: - """ - Constructs a ModelBuildContext - - :param sid: The Twilio-provided string that uniquely identifies the ModelBuild resource to update. - """ - return ModelBuildContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/query.py b/twilio/rest/autopilot/v1/assistant/query.py deleted file mode 100644 index 0d4286d50d..0000000000 --- a/twilio/rest/autopilot/v1/assistant/query.py +++ /dev/null @@ -1,727 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class QueryInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Query resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar results: The natural language analysis results that include the [Task](https://www.twilio.com/docs/autopilot/api/task) recognized and a list of identified [Fields](https://www.twilio.com/docs/autopilot/api/task-field). - :ivar language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query. For example: `en-US`. - :ivar model_build_sid: The SID of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) queried. - :ivar query: The end-user's natural language input. - :ivar sample_sid: The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the Query resource. - :ivar status: The status of the Query. Can be: `pending-review`, `reviewed`, or `discarded` - :ivar url: The absolute URL of the Query resource. - :ivar source_channel: The communication channel from where the end-user input came. - :ivar dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.results: Optional[Dict[str, object]] = payload.get("results") - self.language: Optional[str] = payload.get("language") - self.model_build_sid: Optional[str] = payload.get("model_build_sid") - self.query: Optional[str] = payload.get("query") - self.sample_sid: Optional[str] = payload.get("sample_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.status: Optional[str] = payload.get("status") - self.url: Optional[str] = payload.get("url") - self.source_channel: Optional[str] = payload.get("source_channel") - self.dialogue_sid: Optional[str] = payload.get("dialogue_sid") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[QueryContext] = None - - @property - def _proxy(self) -> "QueryContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: QueryContext for this QueryInstance - """ - if self._context is None: - self._context = QueryContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "QueryInstance": - """ - Fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "QueryInstance": - """ - Asynchronous coroutine to fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> "QueryInstance": - """ - Update the QueryInstance - - :param sample_sid: The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - :param status: The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - - :returns: The updated QueryInstance - """ - return self._proxy.update( - sample_sid=sample_sid, - status=status, - ) - - async def update_async( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> "QueryInstance": - """ - Asynchronous coroutine to update the QueryInstance - - :param sample_sid: The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - :param status: The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - - :returns: The updated QueryInstance - """ - return await self._proxy.update_async( - sample_sid=sample_sid, - status=status, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class QueryContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the QueryContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - :param sid: The Twilio-provided string that uniquely identifies the Query resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Queries/{sid}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> QueryInstance: - """ - Fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> QueryInstance: - """ - Asynchronous coroutine to fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Update the QueryInstance - - :param sample_sid: The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - :param status: The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - - :returns: The updated QueryInstance - """ - data = values.of( - { - "SampleSid": sample_sid, - "Status": status, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Asynchronous coroutine to update the QueryInstance - - :param sample_sid: The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. - :param status: The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` - - :returns: The updated QueryInstance - """ - data = values.of( - { - "SampleSid": sample_sid, - "Status": status, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class QueryPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> QueryInstance: - """ - Build an instance of QueryInstance - - :param payload: Payload response from the API - """ - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class QueryList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the QueryList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Queries".format(**self._solution) - - def create( - self, - language: str, - query: str, - tasks: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Create the QueryInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`. - :param query: The end-user's natural language input. It can be up to 2048 characters long. - :param tasks: The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. - :param model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - - :returns: The created QueryInstance - """ - data = values.of( - { - "Language": language, - "Query": query, - "Tasks": tasks, - "ModelBuild": model_build, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - language: str, - query: str, - tasks: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Asynchronously create the QueryInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`. - :param query: The end-user's natural language input. It can be up to 2048 characters long. - :param tasks: The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. - :param model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - - :returns: The created QueryInstance - """ - data = values.of( - { - "Language": language, - "Query": query, - "Tasks": tasks, - "ModelBuild": model_build, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[QueryInstance]: - """ - Streams QueryInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param str model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param str status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param str dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page( - language=language, - model_build=model_build, - status=status, - dialogue_sid=dialogue_sid, - page_size=limits["page_size"], - ) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[QueryInstance]: - """ - Asynchronously streams QueryInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param str model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param str status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param str dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - language=language, - model_build=model_build, - status=status, - dialogue_sid=dialogue_sid, - page_size=limits["page_size"], - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[QueryInstance]: - """ - Lists QueryInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param str model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param str status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param str dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - model_build=model_build, - status=status, - dialogue_sid=dialogue_sid, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[QueryInstance]: - """ - Asynchronously lists QueryInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param str model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param str status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param str dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - model_build=model_build, - status=status, - dialogue_sid=dialogue_sid, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> QueryPage: - """ - Retrieve a single page of QueryInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of QueryInstance - """ - data = values.of( - { - "Language": language, - "ModelBuild": model_build, - "Status": status, - "DialogueSid": dialogue_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return QueryPage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - dialogue_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> QueryPage: - """ - Asynchronously retrieve a single page of QueryInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. - :param model_build: The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. - :param status: The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` - :param dialogue_sid: The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of QueryInstance - """ - data = values.of( - { - "Language": language, - "ModelBuild": model_build, - "Status": status, - "DialogueSid": dialogue_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return QueryPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> QueryPage: - """ - Retrieve a specific page of QueryInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of QueryInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return QueryPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> QueryPage: - """ - Asynchronously retrieve a specific page of QueryInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of QueryInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return QueryPage(self._version, response, self._solution) - - def get(self, sid: str) -> QueryContext: - """ - Constructs a QueryContext - - :param sid: The Twilio-provided string that uniquely identifies the Query resource to update. - """ - return QueryContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> QueryContext: - """ - Constructs a QueryContext - - :param sid: The Twilio-provided string that uniquely identifies the Query resource to update. - """ - return QueryContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/style_sheet.py b/twilio/rest/autopilot/v1/assistant/style_sheet.py deleted file mode 100644 index 54a0533e27..0000000000 --- a/twilio/rest/autopilot/v1/assistant/style_sheet.py +++ /dev/null @@ -1,271 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional, Union -from twilio.base import serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class StyleSheetInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the StyleSheet resource. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar url: The absolute URL of the StyleSheet resource. - :ivar data: The JSON string that describes the style sheet object. - """ - - def __init__(self, version: Version, payload: Dict[str, Any], assistant_sid: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - } - self._context: Optional[StyleSheetContext] = None - - @property - def _proxy(self) -> "StyleSheetContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: StyleSheetContext for this StyleSheetInstance - """ - if self._context is None: - self._context = StyleSheetContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - ) - return self._context - - def fetch(self) -> "StyleSheetInstance": - """ - Fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "StyleSheetInstance": - """ - Asynchronous coroutine to fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - return await self._proxy.fetch_async() - - def update( - self, style_sheet: Union[object, object] = values.unset - ) -> "StyleSheetInstance": - """ - Update the StyleSheetInstance - - :param style_sheet: The JSON string that describes the style sheet object. - - :returns: The updated StyleSheetInstance - """ - return self._proxy.update( - style_sheet=style_sheet, - ) - - async def update_async( - self, style_sheet: Union[object, object] = values.unset - ) -> "StyleSheetInstance": - """ - Asynchronous coroutine to update the StyleSheetInstance - - :param style_sheet: The JSON string that describes the style sheet object. - - :returns: The updated StyleSheetInstance - """ - return await self._proxy.update_async( - style_sheet=style_sheet, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class StyleSheetContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the StyleSheetContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/StyleSheet".format(**self._solution) - - def fetch(self) -> StyleSheetInstance: - """ - Fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return StyleSheetInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - async def fetch_async(self) -> StyleSheetInstance: - """ - Asynchronous coroutine to fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return StyleSheetInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - def update( - self, style_sheet: Union[object, object] = values.unset - ) -> StyleSheetInstance: - """ - Update the StyleSheetInstance - - :param style_sheet: The JSON string that describes the style sheet object. - - :returns: The updated StyleSheetInstance - """ - data = values.of( - { - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return StyleSheetInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def update_async( - self, style_sheet: Union[object, object] = values.unset - ) -> StyleSheetInstance: - """ - Asynchronous coroutine to update the StyleSheetInstance - - :param style_sheet: The JSON string that describes the style sheet object. - - :returns: The updated StyleSheetInstance - """ - data = values.of( - { - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return StyleSheetInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class StyleSheetList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the StyleSheetList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self) -> StyleSheetContext: - """ - Constructs a StyleSheetContext - - """ - return StyleSheetContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __call__(self) -> StyleSheetContext: - """ - Constructs a StyleSheetContext - - """ - return StyleSheetContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/task/__init__.py b/twilio/rest/autopilot/v1/assistant/task/__init__.py deleted file mode 100644 index 7efae45947..0000000000 --- a/twilio/rest/autopilot/v1/assistant/task/__init__.py +++ /dev/null @@ -1,756 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.autopilot.v1.assistant.task.field import FieldList -from twilio.rest.autopilot.v1.assistant.task.sample import SampleList -from twilio.rest.autopilot.v1.assistant.task.task_actions import TaskActionsList -from twilio.rest.autopilot.v1.assistant.task.task_statistics import TaskStatisticsList - - -class TaskInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Task resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar friendly_name: The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - :ivar links: A list of the URLs of related resources. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the Task resource. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - :ivar actions_url: The URL from which the Assistant can fetch actions. - :ivar url: The absolute URL of the Task resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.actions_url: Optional[str] = payload.get("actions_url") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[TaskContext] = None - - @property - def _proxy(self) -> "TaskContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskContext for this TaskInstance - """ - if self._context is None: - self._context = TaskContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "TaskInstance": - """ - Fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskInstance": - """ - Asynchronous coroutine to fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> "TaskInstance": - """ - Update the TaskInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The updated TaskInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - unique_name=unique_name, - actions=actions, - actions_url=actions_url, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> "TaskInstance": - """ - Asynchronous coroutine to update the TaskInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The updated TaskInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - unique_name=unique_name, - actions=actions, - actions_url=actions_url, - ) - - @property - def fields(self) -> FieldList: - """ - Access the fields - """ - return self._proxy.fields - - @property - def samples(self) -> SampleList: - """ - Access the samples - """ - return self._proxy.samples - - @property - def task_actions(self) -> TaskActionsList: - """ - Access the task_actions - """ - return self._proxy.task_actions - - @property - def statistics(self) -> TaskStatisticsList: - """ - Access the statistics - """ - return self._proxy.statistics - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the TaskContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - :param sid: The Twilio-provided string that uniquely identifies the Task resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{sid}".format(**self._solution) - - self._fields: Optional[FieldList] = None - self._samples: Optional[SampleList] = None - self._task_actions: Optional[TaskActionsList] = None - self._statistics: Optional[TaskStatisticsList] = None - - def delete(self) -> bool: - """ - Deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> TaskInstance: - """ - Fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> TaskInstance: - """ - Asynchronous coroutine to fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Update the TaskInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The updated TaskInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Asynchronous coroutine to update the TaskInstance - - :param friendly_name: A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. - :param unique_name: An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The updated TaskInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - @property - def fields(self) -> FieldList: - """ - Access the fields - """ - if self._fields is None: - self._fields = FieldList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._fields - - @property - def samples(self) -> SampleList: - """ - Access the samples - """ - if self._samples is None: - self._samples = SampleList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._samples - - @property - def task_actions(self) -> TaskActionsList: - """ - Access the task_actions - """ - if self._task_actions is None: - self._task_actions = TaskActionsList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._task_actions - - @property - def statistics(self) -> TaskStatisticsList: - """ - Access the statistics - """ - if self._statistics is None: - self._statistics = TaskStatisticsList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._statistics - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> TaskInstance: - """ - Build an instance of TaskInstance - - :param payload: Payload response from the API - """ - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class TaskList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the TaskList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks".format(**self._solution) - - def create( - self, - unique_name: str, - friendly_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Create the TaskInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The created TaskInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - unique_name: str, - friendly_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Asynchronously create the TaskInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param friendly_name: A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. - :param actions_url: The URL from which the Assistant can fetch actions. - - :returns: The created TaskInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[TaskInstance]: - """ - Streams TaskInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[TaskInstance]: - """ - Asynchronously streams TaskInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[TaskInstance]: - """ - Lists TaskInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[TaskInstance]: - """ - Asynchronously lists TaskInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> TaskPage: - """ - Retrieve a single page of TaskInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of TaskInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return TaskPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> TaskPage: - """ - Asynchronously retrieve a single page of TaskInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of TaskInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return TaskPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> TaskPage: - """ - Retrieve a specific page of TaskInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of TaskInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return TaskPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> TaskPage: - """ - Asynchronously retrieve a specific page of TaskInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of TaskInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return TaskPage(self._version, response, self._solution) - - def get(self, sid: str) -> TaskContext: - """ - Constructs a TaskContext - - :param sid: The Twilio-provided string that uniquely identifies the Task resource to update. - """ - return TaskContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> TaskContext: - """ - Constructs a TaskContext - - :param sid: The Twilio-provided string that uniquely identifies the Task resource to update. - """ - return TaskContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/task/field.py b/twilio/rest/autopilot/v1/assistant/task/field.py deleted file mode 100644 index bf256ab4d4..0000000000 --- a/twilio/rest/autopilot/v1/assistant/task/field.py +++ /dev/null @@ -1,547 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class FieldInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Field resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar field_type: The Field Type of the field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the unique_name, or the SID of a custom Field Type. - :ivar task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with this Field. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - :ivar sid: The unique string that we created to identify the Field resource. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - :ivar url: The absolute URL of the Field resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.field_type: Optional[str] = payload.get("field_type") - self.task_sid: Optional[str] = payload.get("task_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldContext] = None - - @property - def _proxy(self) -> "FieldContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldContext for this FieldInstance - """ - if self._context is None: - self._context = FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldInstance": - """ - Fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldInstance": - """ - Asynchronous coroutine to fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str, sid: str): - """ - Initialize the FieldContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to fetch. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resource to fetch. - :param sid: The Twilio-provided string that uniquely identifies the Field resource to fetch. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Fields/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldInstance: - """ - Fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldInstance: - """ - Asynchronous coroutine to fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldInstance: - """ - Build an instance of FieldInstance - - :param payload: Payload response from the API - """ - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the FieldList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) resource associated with the Field resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Fields".format( - **self._solution - ) - - def create(self, field_type: str, unique_name: str) -> FieldInstance: - """ - Create the FieldInstance - - :param field_type: The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. - :param unique_name: An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The created FieldInstance - """ - data = values.of( - { - "FieldType": field_type, - "UniqueName": unique_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def create_async(self, field_type: str, unique_name: str) -> FieldInstance: - """ - Asynchronously create the FieldInstance - - :param field_type: The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. - :param unique_name: An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. - - :returns: The created FieldInstance - """ - data = values.of( - { - "FieldType": field_type, - "UniqueName": unique_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldInstance]: - """ - Streams FieldInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldInstance]: - """ - Asynchronously streams FieldInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldInstance]: - """ - Lists FieldInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldInstance]: - """ - Asynchronously lists FieldInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldPage: - """ - Retrieve a single page of FieldInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldPage: - """ - Asynchronously retrieve a single page of FieldInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldPage: - """ - Retrieve a specific page of FieldInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldPage: - """ - Asynchronously retrieve a specific page of FieldInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldPage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldContext: - """ - Constructs a FieldContext - - :param sid: The Twilio-provided string that uniquely identifies the Field resource to fetch. - """ - return FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> FieldContext: - """ - Constructs a FieldContext - - :param sid: The Twilio-provided string that uniquely identifies the Field resource to fetch. - """ - return FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/task/sample.py b/twilio/rest/autopilot/v1/assistant/task/sample.py deleted file mode 100644 index e61906bf23..0000000000 --- a/twilio/rest/autopilot/v1/assistant/task/sample.py +++ /dev/null @@ -1,695 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class SampleInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Sample resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the resource. - :ivar language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - :ivar sid: The unique string that we created to identify the Sample resource. - :ivar tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :ivar url: The absolute URL of the Sample resource. - :ivar source_channel: The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.task_sid: Optional[str] = payload.get("task_sid") - self.language: Optional[str] = payload.get("language") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.tagged_text: Optional[str] = payload.get("tagged_text") - self.url: Optional[str] = payload.get("url") - self.source_channel: Optional[str] = payload.get("source_channel") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid or self.sid, - } - self._context: Optional[SampleContext] = None - - @property - def _proxy(self) -> "SampleContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: SampleContext for this SampleInstance - """ - if self._context is None: - self._context = SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "SampleInstance": - """ - Fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "SampleInstance": - """ - Asynchronous coroutine to fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> "SampleInstance": - """ - Update the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The updated SampleInstance - """ - return self._proxy.update( - language=language, - tagged_text=tagged_text, - source_channel=source_channel, - ) - - async def update_async( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> "SampleInstance": - """ - Asynchronous coroutine to update the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The updated SampleInstance - """ - return await self._proxy.update_async( - language=language, - tagged_text=tagged_text, - source_channel=source_channel, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SampleContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str, sid: str): - """ - Initialize the SampleContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource to update. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resource to update. - :param sid: The Twilio-provided string that uniquely identifies the Sample resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> SampleInstance: - """ - Fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> SampleInstance: - """ - Asynchronous coroutine to fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Update the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The updated SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Asynchronous coroutine to update the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The updated SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SamplePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> SampleInstance: - """ - Build an instance of SampleInstance - - :param payload: Payload response from the API - """ - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class SampleList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the SampleList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resources to read. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the Sample resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples".format( - **self._solution - ) - - def create( - self, - language: str, - tagged_text: str, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Create the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The created SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def create_async( - self, - language: str, - tagged_text: str, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Asynchronously create the SampleInstance - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`. - :param tagged_text: The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). - :param source_channel: The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. - - :returns: The created SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def stream( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[SampleInstance]: - """ - Streams SampleInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(language=language, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[SampleInstance]: - """ - Asynchronously streams SampleInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(language=language, page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SampleInstance]: - """ - Lists SampleInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SampleInstance]: - """ - Asynchronously lists SampleInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SamplePage: - """ - Retrieve a single page of SampleInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SampleInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return SamplePage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SamplePage: - """ - Asynchronously retrieve a single page of SampleInstance records from the API. - Request is executed immediately - - :param language: The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SampleInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return SamplePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> SamplePage: - """ - Retrieve a specific page of SampleInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SampleInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return SamplePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> SamplePage: - """ - Asynchronously retrieve a specific page of SampleInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SampleInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return SamplePage(self._version, response, self._solution) - - def get(self, sid: str) -> SampleContext: - """ - Constructs a SampleContext - - :param sid: The Twilio-provided string that uniquely identifies the Sample resource to update. - """ - return SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> SampleContext: - """ - Constructs a SampleContext - - :param sid: The Twilio-provided string that uniquely identifies the Sample resource to update. - """ - return SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/task/task_actions.py b/twilio/rest/autopilot/v1/assistant/task/task_actions.py deleted file mode 100644 index 46f5f20d8e..0000000000 --- a/twilio/rest/autopilot/v1/assistant/task/task_actions.py +++ /dev/null @@ -1,299 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional, Union -from twilio.base import serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class TaskActionsInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskActions resource. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - :ivar task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) associated with the resource. - :ivar url: The absolute URL of the TaskActions resource. - :ivar data: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.task_sid: Optional[str] = payload.get("task_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._context: Optional[TaskActionsContext] = None - - @property - def _proxy(self) -> "TaskActionsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskActionsContext for this TaskActionsInstance - """ - if self._context is None: - self._context = TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - return self._context - - def fetch(self) -> "TaskActionsInstance": - """ - Fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskActionsInstance": - """ - Asynchronous coroutine to fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - return await self._proxy.fetch_async() - - def update( - self, actions: Union[object, object] = values.unset - ) -> "TaskActionsInstance": - """ - Update the TaskActionsInstance - - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - - :returns: The updated TaskActionsInstance - """ - return self._proxy.update( - actions=actions, - ) - - async def update_async( - self, actions: Union[object, object] = values.unset - ) -> "TaskActionsInstance": - """ - Asynchronous coroutine to update the TaskActionsInstance - - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - - :returns: The updated TaskActionsInstance - """ - return await self._proxy.update_async( - actions=actions, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskActionsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskActionsContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to update were defined. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to update were defined. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Actions".format( - **self._solution - ) - - def fetch(self) -> TaskActionsInstance: - """ - Fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def fetch_async(self) -> TaskActionsInstance: - """ - Asynchronous coroutine to fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def update( - self, actions: Union[object, object] = values.unset - ) -> TaskActionsInstance: - """ - Update the TaskActionsInstance - - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - - :returns: The updated TaskActionsInstance - """ - data = values.of( - { - "Actions": serialize.object(actions), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def update_async( - self, actions: Union[object, object] = values.unset - ) -> TaskActionsInstance: - """ - Asynchronous coroutine to update the TaskActionsInstance - - :param actions: The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. - - :returns: The updated TaskActionsInstance - """ - data = values.of( - { - "Actions": serialize.object(actions), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskActionsList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskActionsList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task for which the task actions to fetch were defined. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the task actions to fetch were defined. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - - def get(self) -> TaskActionsContext: - """ - Constructs a TaskActionsContext - - """ - return TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __call__(self) -> TaskActionsContext: - """ - Constructs a TaskActionsContext - - """ - return TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/task/task_statistics.py b/twilio/rest/autopilot/v1/assistant/task/task_statistics.py deleted file mode 100644 index c0749fabc8..0000000000 --- a/twilio/rest/autopilot/v1/assistant/task/task_statistics.py +++ /dev/null @@ -1,219 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional -from twilio.base import deserialize -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class TaskStatisticsInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskStatistics resource. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the Task associated with the resource. - :ivar task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) for which the statistics were collected. - :ivar samples_count: The total number of [Samples](https://www.twilio.com/docs/autopilot/api/task-sample) associated with the Task. - :ivar fields_count: The total number of [Fields](https://www.twilio.com/docs/autopilot/api/task-field) associated with the Task. - :ivar url: The absolute URL of the TaskStatistics resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.task_sid: Optional[str] = payload.get("task_sid") - self.samples_count: Optional[int] = deserialize.integer( - payload.get("samples_count") - ) - self.fields_count: Optional[int] = deserialize.integer( - payload.get("fields_count") - ) - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._context: Optional[TaskStatisticsContext] = None - - @property - def _proxy(self) -> "TaskStatisticsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskStatisticsContext for this TaskStatisticsInstance - """ - if self._context is None: - self._context = TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - return self._context - - def fetch(self) -> "TaskStatisticsInstance": - """ - Fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskStatisticsInstance": - """ - Asynchronous coroutine to fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskStatisticsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskStatisticsContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) that is associated with the resource to fetch. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Statistics".format( - **self._solution - ) - - def fetch(self) -> TaskStatisticsInstance: - """ - Fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskStatisticsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def fetch_async(self) -> TaskStatisticsInstance: - """ - Asynchronous coroutine to fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskStatisticsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskStatisticsList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskStatisticsList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to fetch. - :param task_sid: The SID of the [Task](https://www.twilio.com/docs/autopilot/api/task) that is associated with the resource to fetch. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - - def get(self) -> TaskStatisticsContext: - """ - Constructs a TaskStatisticsContext - - """ - return TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __call__(self) -> TaskStatisticsContext: - """ - Constructs a TaskStatisticsContext - - """ - return TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/assistant/webhook.py b/twilio/rest/autopilot/v1/assistant/webhook.py deleted file mode 100644 index 13fcadb79d..0000000000 --- a/twilio/rest/autopilot/v1/assistant/webhook.py +++ /dev/null @@ -1,669 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class WebhookInstance(InstanceResource): - """ - :ivar url: The absolute URL of the Webhook resource. - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Webhook resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource. - :ivar sid: The unique string that we created to identify the Webhook resource. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - :ivar events: The list of space-separated events that this Webhook is subscribed to. - :ivar webhook_url: The URL associated with this Webhook. - :ivar webhook_method: The method used when calling the webhook's URL. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.url: Optional[str] = payload.get("url") - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.events: Optional[str] = payload.get("events") - self.webhook_url: Optional[str] = payload.get("webhook_url") - self.webhook_method: Optional[str] = payload.get("webhook_method") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[WebhookContext] = None - - @property - def _proxy(self) -> "WebhookContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: WebhookContext for this WebhookInstance - """ - if self._context is None: - self._context = WebhookContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the WebhookInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the WebhookInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "WebhookInstance": - """ - Fetch the WebhookInstance - - - :returns: The fetched WebhookInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "WebhookInstance": - """ - Asynchronous coroutine to fetch the WebhookInstance - - - :returns: The fetched WebhookInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - unique_name: Union[str, object] = values.unset, - events: Union[str, object] = values.unset, - webhook_url: Union[str, object] = values.unset, - webhook_method: Union[str, object] = values.unset, - ) -> "WebhookInstance": - """ - Update the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The updated WebhookInstance - """ - return self._proxy.update( - unique_name=unique_name, - events=events, - webhook_url=webhook_url, - webhook_method=webhook_method, - ) - - async def update_async( - self, - unique_name: Union[str, object] = values.unset, - events: Union[str, object] = values.unset, - webhook_url: Union[str, object] = values.unset, - webhook_method: Union[str, object] = values.unset, - ) -> "WebhookInstance": - """ - Asynchronous coroutine to update the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The updated WebhookInstance - """ - return await self._proxy.update_async( - unique_name=unique_name, - events=events, - webhook_url=webhook_url, - webhook_method=webhook_method, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class WebhookContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the WebhookContext - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resource to update. - :param sid: The Twilio-provided string that uniquely identifies the Webhook resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Webhooks/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the WebhookInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the WebhookInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> WebhookInstance: - """ - Fetch the WebhookInstance - - - :returns: The fetched WebhookInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return WebhookInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> WebhookInstance: - """ - Asynchronous coroutine to fetch the WebhookInstance - - - :returns: The fetched WebhookInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return WebhookInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - unique_name: Union[str, object] = values.unset, - events: Union[str, object] = values.unset, - webhook_url: Union[str, object] = values.unset, - webhook_method: Union[str, object] = values.unset, - ) -> WebhookInstance: - """ - Update the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The updated WebhookInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "Events": events, - "WebhookUrl": webhook_url, - "WebhookMethod": webhook_method, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return WebhookInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - unique_name: Union[str, object] = values.unset, - events: Union[str, object] = values.unset, - webhook_url: Union[str, object] = values.unset, - webhook_method: Union[str, object] = values.unset, - ) -> WebhookInstance: - """ - Asynchronous coroutine to update the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The updated WebhookInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "Events": events, - "WebhookUrl": webhook_url, - "WebhookMethod": webhook_method, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return WebhookInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class WebhookPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: - """ - Build an instance of WebhookInstance - - :param payload: Payload response from the API - """ - return WebhookInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class WebhookList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the WebhookList - - :param version: Version that contains the resource - :param assistant_sid: The SID of the [Assistant](https://www.twilio.com/docs/autopilot/api/assistant) that is the parent of the resources to read. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Webhooks".format(**self._solution) - - def create( - self, - unique_name: str, - events: str, - webhook_url: str, - webhook_method: Union[str, object] = values.unset, - ) -> WebhookInstance: - """ - Create the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The created WebhookInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "Events": events, - "WebhookUrl": webhook_url, - "WebhookMethod": webhook_method, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return WebhookInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - unique_name: str, - events: str, - webhook_url: str, - webhook_method: Union[str, object] = values.unset, - ) -> WebhookInstance: - """ - Asynchronously create the WebhookInstance - - :param unique_name: An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. - :param events: The list of space-separated events that this Webhook will subscribe to. - :param webhook_url: The URL associated with this Webhook. - :param webhook_method: The method to be used when calling the webhook's URL. - - :returns: The created WebhookInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "Events": events, - "WebhookUrl": webhook_url, - "WebhookMethod": webhook_method, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return WebhookInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[WebhookInstance]: - """ - Streams WebhookInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[WebhookInstance]: - """ - Asynchronously streams WebhookInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[WebhookInstance]: - """ - Lists WebhookInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[WebhookInstance]: - """ - Asynchronously lists WebhookInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> WebhookPage: - """ - Retrieve a single page of WebhookInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of WebhookInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return WebhookPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> WebhookPage: - """ - Asynchronously retrieve a single page of WebhookInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of WebhookInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return WebhookPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> WebhookPage: - """ - Retrieve a specific page of WebhookInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of WebhookInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return WebhookPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> WebhookPage: - """ - Asynchronously retrieve a specific page of WebhookInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of WebhookInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return WebhookPage(self._version, response, self._solution) - - def get(self, sid: str) -> WebhookContext: - """ - Constructs a WebhookContext - - :param sid: The Twilio-provided string that uniquely identifies the Webhook resource to update. - """ - return WebhookContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> WebhookContext: - """ - Constructs a WebhookContext - - :param sid: The Twilio-provided string that uniquely identifies the Webhook resource to update. - """ - return WebhookContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/autopilot/v1/restore_assistant.py b/twilio/rest/autopilot/v1/restore_assistant.py deleted file mode 100644 index 7b6daf8ec1..0000000000 --- a/twilio/rest/autopilot/v1/restore_assistant.py +++ /dev/null @@ -1,134 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Autopilot - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, Optional -from twilio.base import deserialize, values - -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class RestoreAssistantInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. - :ivar sid: The unique string that we created to identify the Assistant resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. - :ivar friendly_name: The string that you assigned to describe the resource. It is not unique and can be up to 255 characters long. - :ivar needs_model_build: Whether model needs to be rebuilt. - :ivar latest_model_build_sid: Reserved. - :ivar log_queries: Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. - :ivar development_stage: A string describing the state of the assistant. - :ivar callback_url: Reserved. - :ivar callback_events: Reserved. - """ - - def __init__(self, version: Version, payload: Dict[str, Any]): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.sid: Optional[str] = payload.get("sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.unique_name: Optional[str] = payload.get("unique_name") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.needs_model_build: Optional[bool] = payload.get("needs_model_build") - self.latest_model_build_sid: Optional[str] = payload.get( - "latest_model_build_sid" - ) - self.log_queries: Optional[bool] = payload.get("log_queries") - self.development_stage: Optional[str] = payload.get("development_stage") - self.callback_url: Optional[str] = payload.get("callback_url") - self.callback_events: Optional[str] = payload.get("callback_events") - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class RestoreAssistantList(ListResource): - def __init__(self, version: Version): - """ - Initialize the RestoreAssistantList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Assistants/Restore" - - def update(self, assistant: str) -> RestoreAssistantInstance: - """ - Update the RestoreAssistantInstance - - :param assistant: The Twilio-provided string that uniquely identifies the Assistant resource to restore. - - :returns: The created RestoreAssistantInstance - """ - data = values.of( - { - "Assistant": assistant, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return RestoreAssistantInstance(self._version, payload) - - async def update_async(self, assistant: str) -> RestoreAssistantInstance: - """ - Asynchronously update the RestoreAssistantInstance - - :param assistant: The Twilio-provided string that uniquely identifies the Assistant resource to restore. - - :returns: The created RestoreAssistantInstance - """ - data = values.of( - { - "Assistant": assistant, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return RestoreAssistantInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/bulkexports/BulkexportsBase.py b/twilio/rest/bulkexports/BulkexportsBase.py index d2efe642b4..cbca4c53e4 100644 --- a/twilio/rest/bulkexports/BulkexportsBase.py +++ b/twilio/rest/bulkexports/BulkexportsBase.py @@ -17,6 +17,7 @@ class BulkexportsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Bulkexports Domain diff --git a/twilio/rest/bulkexports/v1/__init__.py b/twilio/rest/bulkexports/v1/__init__.py index e25eb3afc3..a888fb484f 100644 --- a/twilio/rest/bulkexports/v1/__init__.py +++ b/twilio/rest/bulkexports/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Bulkexports diff --git a/twilio/rest/bulkexports/v1/export/__init__.py b/twilio/rest/bulkexports/v1/export/__init__.py index 938bf8d882..c5c11df086 100644 --- a/twilio/rest/bulkexports/v1/export/__init__.py +++ b/twilio/rest/bulkexports/v1/export/__init__.py @@ -105,6 +105,7 @@ def __repr__(self) -> str: class ExportContext(InstanceContext): + def __init__(self, version: Version, resource_type: str): """ Initialize the ExportContext @@ -196,6 +197,7 @@ def __repr__(self) -> str: class ExportList(ListResource): + def __init__(self, version: Version): """ Initialize the ExportList diff --git a/twilio/rest/bulkexports/v1/export/day.py b/twilio/rest/bulkexports/v1/export/day.py index af03131372..fcbc56e979 100644 --- a/twilio/rest/bulkexports/v1/export/day.py +++ b/twilio/rest/bulkexports/v1/export/day.py @@ -98,6 +98,7 @@ def __repr__(self) -> str: class DayContext(InstanceContext): + def __init__(self, version: Version, resource_type: str, day: str): """ Initialize the DayContext @@ -166,6 +167,7 @@ def __repr__(self) -> str: class DayPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DayInstance: """ Build an instance of DayInstance @@ -186,6 +188,7 @@ def __repr__(self) -> str: class DayList(ListResource): + def __init__(self, version: Version, resource_type: str): """ Initialize the DayList diff --git a/twilio/rest/bulkexports/v1/export/export_custom_job.py b/twilio/rest/bulkexports/v1/export/export_custom_job.py index da66ae08d0..758398eba3 100644 --- a/twilio/rest/bulkexports/v1/export/export_custom_job.py +++ b/twilio/rest/bulkexports/v1/export/export_custom_job.py @@ -68,6 +68,7 @@ def __repr__(self) -> str: class ExportCustomJobPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ExportCustomJobInstance: """ Build an instance of ExportCustomJobInstance @@ -88,6 +89,7 @@ def __repr__(self) -> str: class ExportCustomJobList(ListResource): + def __init__(self, version: Version, resource_type: str): """ Initialize the ExportCustomJobList @@ -125,6 +127,7 @@ def create( :returns: The created ExportCustomJobInstance """ + data = values.of( { "StartDay": start_day, @@ -167,6 +170,7 @@ async def create_async( :returns: The created ExportCustomJobInstance """ + data = values.of( { "StartDay": start_day, diff --git a/twilio/rest/bulkexports/v1/export/job.py b/twilio/rest/bulkexports/v1/export/job.py index 65cebd0e55..48b2df1ab3 100644 --- a/twilio/rest/bulkexports/v1/export/job.py +++ b/twilio/rest/bulkexports/v1/export/job.py @@ -122,6 +122,7 @@ def __repr__(self) -> str: class JobContext(InstanceContext): + def __init__(self, version: Version, job_sid: str): """ Initialize the JobContext @@ -210,6 +211,7 @@ def __repr__(self) -> str: class JobList(ListResource): + def __init__(self, version: Version): """ Initialize the JobList diff --git a/twilio/rest/bulkexports/v1/export_configuration.py b/twilio/rest/bulkexports/v1/export_configuration.py index bfb6307f59..59aee93915 100644 --- a/twilio/rest/bulkexports/v1/export_configuration.py +++ b/twilio/rest/bulkexports/v1/export_configuration.py @@ -134,6 +134,7 @@ def __repr__(self) -> str: class ExportConfigurationContext(InstanceContext): + def __init__(self, version: Version, resource_type: str): """ Initialize the ExportConfigurationContext @@ -264,6 +265,7 @@ def __repr__(self) -> str: class ExportConfigurationList(ListResource): + def __init__(self, version: Version): """ Initialize the ExportConfigurationList diff --git a/twilio/rest/chat/ChatBase.py b/twilio/rest/chat/ChatBase.py index a84b4eb334..6d8656da17 100644 --- a/twilio/rest/chat/ChatBase.py +++ b/twilio/rest/chat/ChatBase.py @@ -19,6 +19,7 @@ class ChatBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Chat Domain diff --git a/twilio/rest/chat/v1/__init__.py b/twilio/rest/chat/v1/__init__.py index f01101f7da..d0ade9eed5 100644 --- a/twilio/rest/chat/v1/__init__.py +++ b/twilio/rest/chat/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Chat diff --git a/twilio/rest/chat/v1/credential.py b/twilio/rest/chat/v1/credential.py index 9e6503f46a..8b477b675d 100644 --- a/twilio/rest/chat/v1/credential.py +++ b/twilio/rest/chat/v1/credential.py @@ -23,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushService(object): GCM = "gcm" APN = "apn" @@ -184,6 +185,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -352,6 +354,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -370,6 +373,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList @@ -404,6 +408,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -447,6 +452,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/chat/v1/service/__init__.py b/twilio/rest/chat/v1/service/__init__.py index b6feae0cc4..2783da6a9a 100644 --- a/twilio/rest/chat/v1/service/__init__.py +++ b/twilio/rest/chat/v1/service/__init__.py @@ -527,6 +527,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -1023,6 +1024,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -1041,6 +1043,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -1060,6 +1063,7 @@ def create(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -1082,6 +1086,7 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v1/service/channel/__init__.py b/twilio/rest/chat/v1/service/channel/__init__.py index fbfe141fce..1585613948 100644 --- a/twilio/rest/chat/v1/service/channel/__init__.py +++ b/twilio/rest/chat/v1/service/channel/__init__.py @@ -26,6 +26,7 @@ class ChannelInstance(InstanceResource): + class ChannelType(object): PUBLIC = "public" PRIVATE = "private" @@ -211,6 +212,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ChannelContext @@ -418,6 +420,7 @@ def __repr__(self) -> str: class ChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelInstance: """ Build an instance of ChannelInstance @@ -438,6 +441,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ChannelList @@ -471,6 +475,7 @@ def create( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -507,6 +512,7 @@ async def create_async( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v1/service/channel/invite.py b/twilio/rest/chat/v1/service/channel/invite.py index 639c4c5091..6beccffae4 100644 --- a/twilio/rest/chat/v1/service/channel/invite.py +++ b/twilio/rest/chat/v1/service/channel/invite.py @@ -132,6 +132,7 @@ def __repr__(self) -> str: class InviteContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the InviteContext @@ -232,6 +233,7 @@ def __repr__(self) -> str: class InvitePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InviteInstance: """ Build an instance of InviteInstance @@ -255,6 +257,7 @@ def __repr__(self) -> str: class InviteList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the InviteList @@ -286,6 +289,7 @@ def create( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, @@ -317,6 +321,7 @@ async def create_async( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/chat/v1/service/channel/member.py b/twilio/rest/chat/v1/service/channel/member.py index 6880f064e8..f0cd21448f 100644 --- a/twilio/rest/chat/v1/service/channel/member.py +++ b/twilio/rest/chat/v1/service/channel/member.py @@ -174,6 +174,7 @@ def __repr__(self) -> str: class MemberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MemberContext @@ -342,6 +343,7 @@ def __repr__(self) -> str: class MemberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MemberInstance: """ Build an instance of MemberInstance @@ -365,6 +367,7 @@ def __repr__(self) -> str: class MemberList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MemberList @@ -396,6 +399,7 @@ def create( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, @@ -427,6 +431,7 @@ async def create_async( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/chat/v1/service/channel/message.py b/twilio/rest/chat/v1/service/channel/message.py index bf4db73dd8..f524c92387 100644 --- a/twilio/rest/chat/v1/service/channel/message.py +++ b/twilio/rest/chat/v1/service/channel/message.py @@ -23,6 +23,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -178,6 +179,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MessageContext @@ -346,6 +348,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -369,6 +372,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MessageList @@ -404,6 +408,7 @@ def create( :returns: The created MessageInstance """ + data = values.of( { "Body": body, @@ -440,6 +445,7 @@ async def create_async( :returns: The created MessageInstance """ + data = values.of( { "Body": body, diff --git a/twilio/rest/chat/v1/service/role.py b/twilio/rest/chat/v1/service/role.py index e83e30fd5b..1913986a4a 100644 --- a/twilio/rest/chat/v1/service/role.py +++ b/twilio/rest/chat/v1/service/role.py @@ -23,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CHANNEL = "channel" DEPLOYMENT = "deployment" @@ -155,6 +156,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the RoleContext @@ -301,6 +303,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -321,6 +324,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the RoleList @@ -349,6 +353,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -379,6 +384,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v1/service/user/__init__.py b/twilio/rest/chat/v1/service/user/__init__.py index ba5d038e2a..b06509668a 100644 --- a/twilio/rest/chat/v1/service/user/__init__.py +++ b/twilio/rest/chat/v1/service/user/__init__.py @@ -189,6 +189,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the UserContext @@ -368,6 +369,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -388,6 +390,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the UserList @@ -421,6 +424,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -457,6 +461,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/chat/v1/service/user/user_channel.py b/twilio/rest/chat/v1/service/user/user_channel.py index 6a781e9ff5..01e639ceab 100644 --- a/twilio/rest/chat/v1/service/user/user_channel.py +++ b/twilio/rest/chat/v1/service/user/user_channel.py @@ -22,6 +22,7 @@ class UserChannelInstance(InstanceResource): + class ChannelStatus(object): JOINED = "joined" INVITED = "invited" @@ -74,6 +75,7 @@ def __repr__(self) -> str: class UserChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserChannelInstance: """ Build an instance of UserChannelInstance @@ -97,6 +99,7 @@ def __repr__(self) -> str: class UserChannelList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserChannelList diff --git a/twilio/rest/chat/v2/__init__.py b/twilio/rest/chat/v2/__init__.py index c433e8543f..e949532d56 100644 --- a/twilio/rest/chat/v2/__init__.py +++ b/twilio/rest/chat/v2/__init__.py @@ -20,6 +20,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Chat diff --git a/twilio/rest/chat/v2/credential.py b/twilio/rest/chat/v2/credential.py index 1c2f8a5cf8..564cd5159f 100644 --- a/twilio/rest/chat/v2/credential.py +++ b/twilio/rest/chat/v2/credential.py @@ -23,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushService(object): GCM = "gcm" APN = "apn" @@ -184,6 +185,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -352,6 +354,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -370,6 +373,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList @@ -404,6 +408,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -447,6 +452,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/chat/v2/service/__init__.py b/twilio/rest/chat/v2/service/__init__.py index d7ba975bd0..66dd200b41 100644 --- a/twilio/rest/chat/v2/service/__init__.py +++ b/twilio/rest/chat/v2/service/__init__.py @@ -409,6 +409,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -784,6 +785,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -802,6 +804,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -821,6 +824,7 @@ def create(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -843,6 +847,7 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v2/service/binding.py b/twilio/rest/chat/v2/service/binding.py index cf792202c3..2f960c5135 100644 --- a/twilio/rest/chat/v2/service/binding.py +++ b/twilio/rest/chat/v2/service/binding.py @@ -23,6 +23,7 @@ class BindingInstance(InstanceResource): + class BindingType(object): GCM = "gcm" APN = "apn" @@ -140,6 +141,7 @@ def __repr__(self) -> str: class BindingContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the BindingContext @@ -232,6 +234,7 @@ def __repr__(self) -> str: class BindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BindingInstance: """ Build an instance of BindingInstance @@ -252,6 +255,7 @@ def __repr__(self) -> str: class BindingList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the BindingList diff --git a/twilio/rest/chat/v2/service/channel/__init__.py b/twilio/rest/chat/v2/service/channel/__init__.py index 421d2a7df8..2b49faf266 100644 --- a/twilio/rest/chat/v2/service/channel/__init__.py +++ b/twilio/rest/chat/v2/service/channel/__init__.py @@ -27,6 +27,7 @@ class ChannelInstance(InstanceResource): + class ChannelType(object): PUBLIC = "public" PRIVATE = "private" @@ -267,6 +268,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ChannelContext @@ -540,6 +542,7 @@ def __repr__(self) -> str: class ChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelInstance: """ Build an instance of ChannelInstance @@ -560,6 +563,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ChannelList @@ -603,6 +607,7 @@ def create( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -619,6 +624,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -654,6 +660,7 @@ async def create_async( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -670,6 +677,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/chat/v2/service/channel/invite.py b/twilio/rest/chat/v2/service/channel/invite.py index 3c6ed82443..2c7333786d 100644 --- a/twilio/rest/chat/v2/service/channel/invite.py +++ b/twilio/rest/chat/v2/service/channel/invite.py @@ -132,6 +132,7 @@ def __repr__(self) -> str: class InviteContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the InviteContext @@ -232,6 +233,7 @@ def __repr__(self) -> str: class InvitePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InviteInstance: """ Build an instance of InviteInstance @@ -255,6 +257,7 @@ def __repr__(self) -> str: class InviteList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the InviteList @@ -286,6 +289,7 @@ def create( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, @@ -317,6 +321,7 @@ async def create_async( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/chat/v2/service/channel/member.py b/twilio/rest/chat/v2/service/channel/member.py index 689233b285..c71d3e3457 100644 --- a/twilio/rest/chat/v2/service/channel/member.py +++ b/twilio/rest/chat/v2/service/channel/member.py @@ -23,6 +23,7 @@ class MemberInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -230,6 +231,7 @@ def __repr__(self) -> str: class MemberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MemberContext @@ -460,6 +462,7 @@ def __repr__(self) -> str: class MemberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MemberInstance: """ Build an instance of MemberInstance @@ -483,6 +486,7 @@ def __repr__(self) -> str: class MemberList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MemberList @@ -530,6 +534,7 @@ def create( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, @@ -548,6 +553,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -586,6 +592,7 @@ async def create_async( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, @@ -604,6 +611,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/chat/v2/service/channel/message.py b/twilio/rest/chat/v2/service/channel/message.py index 847f063dcc..e98f526c74 100644 --- a/twilio/rest/chat/v2/service/channel/message.py +++ b/twilio/rest/chat/v2/service/channel/message.py @@ -23,6 +23,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -238,6 +239,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MessageContext @@ -464,6 +466,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -487,6 +490,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MessageList @@ -534,6 +538,7 @@ def create( :returns: The created MessageInstance """ + data = values.of( { "From": from_, @@ -550,6 +555,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -588,6 +594,7 @@ async def create_async( :returns: The created MessageInstance """ + data = values.of( { "From": from_, @@ -604,6 +611,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/chat/v2/service/channel/webhook.py b/twilio/rest/chat/v2/service/channel/webhook.py index 072fe1cba1..ca738bac4a 100644 --- a/twilio/rest/chat/v2/service/channel/webhook.py +++ b/twilio/rest/chat/v2/service/channel/webhook.py @@ -23,6 +23,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -199,6 +200,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the WebhookContext @@ -399,6 +401,7 @@ def __repr__(self) -> str: class WebhookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: """ Build an instance of WebhookInstance @@ -422,6 +425,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the WebhookList @@ -465,6 +469,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "Type": type, @@ -517,6 +522,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/chat/v2/service/role.py b/twilio/rest/chat/v2/service/role.py index 4fddd4c9ef..5bb373c9a2 100644 --- a/twilio/rest/chat/v2/service/role.py +++ b/twilio/rest/chat/v2/service/role.py @@ -23,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CHANNEL = "channel" DEPLOYMENT = "deployment" @@ -155,6 +156,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the RoleContext @@ -301,6 +303,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -321,6 +324,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the RoleList @@ -349,6 +353,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -379,6 +384,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/chat/v2/service/user/__init__.py b/twilio/rest/chat/v2/service/user/__init__.py index bfb71480c9..2c4ac5a3bd 100644 --- a/twilio/rest/chat/v2/service/user/__init__.py +++ b/twilio/rest/chat/v2/service/user/__init__.py @@ -25,6 +25,7 @@ class UserInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -211,6 +212,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the UserContext @@ -418,6 +420,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -438,6 +441,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the UserList @@ -475,6 +479,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -488,6 +493,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -517,6 +523,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -530,6 +537,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/chat/v2/service/user/user_binding.py b/twilio/rest/chat/v2/service/user/user_binding.py index ef934a6d3e..4170c74fb6 100644 --- a/twilio/rest/chat/v2/service/user/user_binding.py +++ b/twilio/rest/chat/v2/service/user/user_binding.py @@ -23,6 +23,7 @@ class UserBindingInstance(InstanceResource): + class BindingType(object): GCM = "gcm" APN = "apn" @@ -143,6 +144,7 @@ def __repr__(self) -> str: class UserBindingContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, user_sid: str, sid: str): """ Initialize the UserBindingContext @@ -241,6 +243,7 @@ def __repr__(self) -> str: class UserBindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserBindingInstance: """ Build an instance of UserBindingInstance @@ -264,6 +267,7 @@ def __repr__(self) -> str: class UserBindingList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserBindingList diff --git a/twilio/rest/chat/v2/service/user/user_channel.py b/twilio/rest/chat/v2/service/user/user_channel.py index 94b9ddbd70..1fd25254a5 100644 --- a/twilio/rest/chat/v2/service/user/user_channel.py +++ b/twilio/rest/chat/v2/service/user/user_channel.py @@ -23,6 +23,7 @@ class UserChannelInstance(InstanceResource): + class ChannelStatus(object): JOINED = "joined" INVITED = "invited" @@ -213,6 +214,7 @@ def __repr__(self) -> str: class UserChannelContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, user_sid: str, channel_sid: str ): @@ -417,6 +419,7 @@ def __repr__(self) -> str: class UserChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserChannelInstance: """ Build an instance of UserChannelInstance @@ -440,6 +443,7 @@ def __repr__(self) -> str: class UserChannelList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserChannelList diff --git a/twilio/rest/chat/v3/__init__.py b/twilio/rest/chat/v3/__init__.py index 7fdfc8977f..582dc44069 100644 --- a/twilio/rest/chat/v3/__init__.py +++ b/twilio/rest/chat/v3/__init__.py @@ -19,6 +19,7 @@ class V3(Version): + def __init__(self, domain: Domain): """ Initialize the V3 version of Chat diff --git a/twilio/rest/chat/v3/channel.py b/twilio/rest/chat/v3/channel.py index 92ba531edc..e9d10b55bf 100644 --- a/twilio/rest/chat/v3/channel.py +++ b/twilio/rest/chat/v3/channel.py @@ -22,6 +22,7 @@ class ChannelInstance(InstanceResource): + class ChannelType(object): PUBLIC = "public" PRIVATE = "private" @@ -158,6 +159,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ChannelContext @@ -266,6 +268,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version): """ Initialize the ChannelList diff --git a/twilio/rest/content/ContentBase.py b/twilio/rest/content/ContentBase.py index 72dfbad76d..a8511f9fff 100644 --- a/twilio/rest/content/ContentBase.py +++ b/twilio/rest/content/ContentBase.py @@ -17,6 +17,7 @@ class ContentBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Content Domain diff --git a/twilio/rest/content/v1/__init__.py b/twilio/rest/content/v1/__init__.py index 68f3f13a69..1410fe4788 100644 --- a/twilio/rest/content/v1/__init__.py +++ b/twilio/rest/content/v1/__init__.py @@ -21,6 +21,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Content diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 87ed5b58e0..b057cb4f86 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -32,7 +32,7 @@ class ContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar url: The URL of the resource, relative to `https://content.twilio.com`. :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create """ @@ -131,6 +131,7 @@ def __repr__(self) -> str: class ContentContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ContentContext @@ -233,6 +234,7 @@ def __repr__(self) -> str: class ContentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ContentInstance: """ Build an instance of ContentInstance @@ -251,6 +253,7 @@ def __repr__(self) -> str: class ContentList(ListResource): + def __init__(self, version: Version): """ Initialize the ContentList diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index 31466a4e91..f35ef6a48f 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -84,6 +84,7 @@ def __repr__(self) -> str: class ApprovalFetchContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchContext @@ -148,6 +149,7 @@ def __repr__(self) -> str: class ApprovalFetchList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchList diff --git a/twilio/rest/content/v1/content_and_approvals.py b/twilio/rest/content/v1/content_and_approvals.py index b826a1b289..e2d6d72aaf 100644 --- a/twilio/rest/content/v1/content_and_approvals.py +++ b/twilio/rest/content/v1/content_and_approvals.py @@ -31,7 +31,7 @@ class ContentAndApprovalsInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar approval_requests: The submitted information and approval request status of the Content resource. """ @@ -65,6 +65,7 @@ def __repr__(self) -> str: class ContentAndApprovalsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ContentAndApprovalsInstance: """ Build an instance of ContentAndApprovalsInstance @@ -83,6 +84,7 @@ def __repr__(self) -> str: class ContentAndApprovalsList(ListResource): + def __init__(self, version: Version): """ Initialize the ContentAndApprovalsList diff --git a/twilio/rest/content/v1/legacy_content.py b/twilio/rest/content/v1/legacy_content.py index 15ea2f9398..5705c33b0b 100644 --- a/twilio/rest/content/v1/legacy_content.py +++ b/twilio/rest/content/v1/legacy_content.py @@ -31,7 +31,7 @@ class LegacyContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar legacy_template_name: The string name of the legacy content template associated with this Content resource, unique across all template names for its account. Only lowercase letters, numbers and underscores are allowed :ivar legacy_body: The string body field of the legacy content template associated with this Content resource :ivar url: The URL of the resource, relative to `https://content.twilio.com`. @@ -67,6 +67,7 @@ def __repr__(self) -> str: class LegacyContentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> LegacyContentInstance: """ Build an instance of LegacyContentInstance @@ -85,6 +86,7 @@ def __repr__(self) -> str: class LegacyContentList(ListResource): + def __init__(self, version: Version): """ Initialize the LegacyContentList diff --git a/twilio/rest/conversations/ConversationsBase.py b/twilio/rest/conversations/ConversationsBase.py index 06d5533e3e..8904308365 100644 --- a/twilio/rest/conversations/ConversationsBase.py +++ b/twilio/rest/conversations/ConversationsBase.py @@ -17,6 +17,7 @@ class ConversationsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Conversations Domain diff --git a/twilio/rest/conversations/v1/__init__.py b/twilio/rest/conversations/v1/__init__.py index 0fbe314fa2..3296ba2b46 100644 --- a/twilio/rest/conversations/v1/__init__.py +++ b/twilio/rest/conversations/v1/__init__.py @@ -28,6 +28,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Conversations diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index 17310d8e3b..3295eade6c 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -23,6 +23,7 @@ class AddressConfigurationInstance(InstanceResource): + class AutoCreationType(object): WEBHOOK = "webhook" STUDIO = "studio" @@ -227,6 +228,7 @@ def __repr__(self) -> str: class AddressConfigurationContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AddressConfigurationContext @@ -431,6 +433,7 @@ def __repr__(self) -> str: class AddressConfigurationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AddressConfigurationInstance: """ Build an instance of AddressConfigurationInstance @@ -449,6 +452,7 @@ def __repr__(self) -> str: class AddressConfigurationList(ListResource): + def __init__(self, version: Version): """ Initialize the AddressConfigurationList @@ -497,6 +501,7 @@ def create( :returns: The created AddressConfigurationInstance """ + data = values.of( { "Type": type, @@ -561,6 +566,7 @@ async def create_async( :returns: The created AddressConfigurationInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/conversations/v1/configuration/__init__.py b/twilio/rest/conversations/v1/configuration/__init__.py index 64a5a6b1b8..46f511aa1e 100644 --- a/twilio/rest/conversations/v1/configuration/__init__.py +++ b/twilio/rest/conversations/v1/configuration/__init__.py @@ -143,6 +143,7 @@ def __repr__(self) -> str: class ConfigurationContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the ConfigurationContext @@ -268,6 +269,7 @@ def __repr__(self) -> str: class ConfigurationList(ListResource): + def __init__(self, version: Version): """ Initialize the ConfigurationList diff --git a/twilio/rest/conversations/v1/configuration/webhook.py b/twilio/rest/conversations/v1/configuration/webhook.py index d357acbeaf..4ece54232c 100644 --- a/twilio/rest/conversations/v1/configuration/webhook.py +++ b/twilio/rest/conversations/v1/configuration/webhook.py @@ -21,6 +21,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -149,6 +150,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the WebhookContext @@ -280,6 +282,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version): """ Initialize the WebhookList diff --git a/twilio/rest/conversations/v1/conversation/__init__.py b/twilio/rest/conversations/v1/conversation/__init__.py index d3ea6dfb1f..bdb4bda324 100644 --- a/twilio/rest/conversations/v1/conversation/__init__.py +++ b/twilio/rest/conversations/v1/conversation/__init__.py @@ -26,6 +26,7 @@ class ConversationInstance(InstanceResource): + class State(object): INACTIVE = "inactive" ACTIVE = "active" @@ -280,6 +281,7 @@ def __repr__(self) -> str: class ConversationContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ConversationContext @@ -552,6 +554,7 @@ def __repr__(self) -> str: class ConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConversationInstance: """ Build an instance of ConversationInstance @@ -570,6 +573,7 @@ def __repr__(self) -> str: class ConversationList(ListResource): + def __init__(self, version: Version): """ Initialize the ConversationList @@ -616,6 +620,7 @@ def create( :returns: The created ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -636,6 +641,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -677,6 +683,7 @@ async def create_async( :returns: The created ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -697,6 +704,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/conversations/v1/conversation/message/__init__.py b/twilio/rest/conversations/v1/conversation/message/__init__.py index 87b3fd048b..e3e9dea1b2 100644 --- a/twilio/rest/conversations/v1/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/conversation/message/__init__.py @@ -26,6 +26,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -49,7 +50,7 @@ class WebhookEnabledType(object): :ivar url: An absolute API resource API URL for this message. :ivar delivery: An object that contains the summary of delivery statuses for the message to non-chat participants. :ivar links: Contains an absolute API resource URL to access the delivery & read receipts of this message. - :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template. + :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. """ def __init__( @@ -67,7 +68,7 @@ def __init__( self.index: Optional[int] = deserialize.integer(payload.get("index")) self.author: Optional[str] = payload.get("author") self.body: Optional[str] = payload.get("body") - self.media: Optional[List[object]] = payload.get("media") + self.media: Optional[List[Dict[str, object]]] = payload.get("media") self.attributes: Optional[str] = payload.get("attributes") self.participant_sid: Optional[str] = payload.get("participant_sid") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -243,6 +244,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, conversation_sid: str, sid: str): """ Initialize the MessageContext @@ -476,6 +478,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -496,6 +499,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, conversation_sid: str): """ Initialize the MessageList @@ -539,12 +543,13 @@ def create( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. :returns: The created MessageInstance """ + data = values.of( { "Author": author, @@ -563,6 +568,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -596,12 +602,13 @@ async def create_async( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. :returns: The created MessageInstance """ + data = values.of( { "Author": author, @@ -620,6 +627,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py b/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py index f8b74d74bc..16af7892e9 100644 --- a/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py +++ b/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py @@ -23,6 +23,7 @@ class DeliveryReceiptInstance(InstanceResource): + class DeliveryStatus(object): READ = "read" FAILED = "failed" @@ -125,6 +126,7 @@ def __repr__(self) -> str: class DeliveryReceiptContext(InstanceContext): + def __init__( self, version: Version, conversation_sid: str, message_sid: str, sid: str ): @@ -201,6 +203,7 @@ def __repr__(self) -> str: class DeliveryReceiptPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeliveryReceiptInstance: """ Build an instance of DeliveryReceiptInstance @@ -224,6 +227,7 @@ def __repr__(self) -> str: class DeliveryReceiptList(ListResource): + def __init__(self, version: Version, conversation_sid: str, message_sid: str): """ Initialize the DeliveryReceiptList diff --git a/twilio/rest/conversations/v1/conversation/participant.py b/twilio/rest/conversations/v1/conversation/participant.py index 2a9c45a594..499bdbf30a 100644 --- a/twilio/rest/conversations/v1/conversation/participant.py +++ b/twilio/rest/conversations/v1/conversation/participant.py @@ -23,6 +23,7 @@ class ParticipantInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -245,6 +246,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__(self, version: Version, conversation_sid: str, sid: str): """ Initialize the ParticipantContext @@ -481,6 +483,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -501,6 +504,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, conversation_sid: str): """ Initialize the ParticipantList @@ -548,6 +552,7 @@ def create( :returns: The created ParticipantInstance """ + data = values.of( { "Identity": identity, @@ -565,6 +570,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -602,6 +608,7 @@ async def create_async( :returns: The created ParticipantInstance """ + data = values.of( { "Identity": identity, @@ -619,6 +626,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/conversations/v1/conversation/webhook.py b/twilio/rest/conversations/v1/conversation/webhook.py index cb7690cfce..623887986c 100644 --- a/twilio/rest/conversations/v1/conversation/webhook.py +++ b/twilio/rest/conversations/v1/conversation/webhook.py @@ -23,6 +23,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -188,6 +189,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version, conversation_sid: str, sid: str): """ Initialize the WebhookContext @@ -374,6 +376,7 @@ def __repr__(self) -> str: class WebhookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: """ Build an instance of WebhookInstance @@ -394,6 +397,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, conversation_sid: str): """ Initialize the WebhookList @@ -435,6 +439,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "Target": target, @@ -484,6 +489,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "Target": target, diff --git a/twilio/rest/conversations/v1/credential.py b/twilio/rest/conversations/v1/credential.py index 1a5c0fb951..92f26d1f0a 100644 --- a/twilio/rest/conversations/v1/credential.py +++ b/twilio/rest/conversations/v1/credential.py @@ -23,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushType(object): APN = "apn" GCM = "gcm" @@ -190,6 +191,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -364,6 +366,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -382,6 +385,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList @@ -416,6 +420,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -459,6 +464,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/conversations/v1/participant_conversation.py b/twilio/rest/conversations/v1/participant_conversation.py index e61383c32f..7413047152 100644 --- a/twilio/rest/conversations/v1/participant_conversation.py +++ b/twilio/rest/conversations/v1/participant_conversation.py @@ -23,6 +23,7 @@ class ParticipantConversationInstance(InstanceResource): + class State(object): INACTIVE = "inactive" ACTIVE = "active" @@ -96,6 +97,7 @@ def __repr__(self) -> str: class ParticipantConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantConversationInstance: """ Build an instance of ParticipantConversationInstance @@ -114,6 +116,7 @@ def __repr__(self) -> str: class ParticipantConversationList(ListResource): + def __init__(self, version: Version): """ Initialize the ParticipantConversationList diff --git a/twilio/rest/conversations/v1/role.py b/twilio/rest/conversations/v1/role.py index 4a8dccfaab..b5d4d2c6db 100644 --- a/twilio/rest/conversations/v1/role.py +++ b/twilio/rest/conversations/v1/role.py @@ -23,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CONVERSATION = "conversation" SERVICE = "service" @@ -149,6 +150,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RoleContext @@ -281,6 +283,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -299,6 +302,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version): """ Initialize the RoleList @@ -322,6 +326,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -350,6 +355,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/conversations/v1/service/__init__.py b/twilio/rest/conversations/v1/service/__init__.py index e8bf95e970..2a9f12090b 100644 --- a/twilio/rest/conversations/v1/service/__init__.py +++ b/twilio/rest/conversations/v1/service/__init__.py @@ -167,6 +167,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -334,6 +335,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -352,6 +354,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -371,6 +374,7 @@ def create(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -393,6 +397,7 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/conversations/v1/service/binding.py b/twilio/rest/conversations/v1/service/binding.py index 5a9f2d1e2a..6e66844490 100644 --- a/twilio/rest/conversations/v1/service/binding.py +++ b/twilio/rest/conversations/v1/service/binding.py @@ -23,6 +23,7 @@ class BindingInstance(InstanceResource): + class BindingType(object): APN = "apn" GCM = "gcm" @@ -138,6 +139,7 @@ def __repr__(self) -> str: class BindingContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str, sid: str): """ Initialize the BindingContext @@ -232,6 +234,7 @@ def __repr__(self) -> str: class BindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BindingInstance: """ Build an instance of BindingInstance @@ -252,6 +255,7 @@ def __repr__(self) -> str: class BindingList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the BindingList diff --git a/twilio/rest/conversations/v1/service/configuration/__init__.py b/twilio/rest/conversations/v1/service/configuration/__init__.py index 4f21918828..15de8dfda9 100644 --- a/twilio/rest/conversations/v1/service/configuration/__init__.py +++ b/twilio/rest/conversations/v1/service/configuration/__init__.py @@ -152,6 +152,7 @@ def __repr__(self) -> str: class ConfigurationContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the ConfigurationContext @@ -290,6 +291,7 @@ def __repr__(self) -> str: class ConfigurationList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the ConfigurationList diff --git a/twilio/rest/conversations/v1/service/configuration/notification.py b/twilio/rest/conversations/v1/service/configuration/notification.py index cc79c53620..498478fdf7 100644 --- a/twilio/rest/conversations/v1/service/configuration/notification.py +++ b/twilio/rest/conversations/v1/service/configuration/notification.py @@ -199,6 +199,7 @@ def __repr__(self) -> str: class NotificationContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the NotificationContext @@ -391,6 +392,7 @@ def __repr__(self) -> str: class NotificationList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the NotificationList diff --git a/twilio/rest/conversations/v1/service/configuration/webhook.py b/twilio/rest/conversations/v1/service/configuration/webhook.py index 7d6ad0df06..aa4015361f 100644 --- a/twilio/rest/conversations/v1/service/configuration/webhook.py +++ b/twilio/rest/conversations/v1/service/configuration/webhook.py @@ -21,6 +21,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -145,6 +146,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the WebhookContext @@ -283,6 +285,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the WebhookList diff --git a/twilio/rest/conversations/v1/service/conversation/__init__.py b/twilio/rest/conversations/v1/service/conversation/__init__.py index 8f072a653c..c347977a40 100644 --- a/twilio/rest/conversations/v1/service/conversation/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/__init__.py @@ -28,6 +28,7 @@ class ConversationInstance(InstanceResource): + class State(object): INACTIVE = "inactive" ACTIVE = "active" @@ -288,6 +289,7 @@ def __repr__(self) -> str: class ConversationContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str, sid: str): """ Initialize the ConversationContext @@ -579,6 +581,7 @@ def __repr__(self) -> str: class ConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConversationInstance: """ Build an instance of ConversationInstance @@ -599,6 +602,7 @@ def __repr__(self) -> str: class ConversationList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the ConversationList @@ -652,6 +656,7 @@ def create( :returns: The created ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -672,6 +677,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -715,6 +721,7 @@ async def create_async( :returns: The created ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -735,6 +742,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/conversations/v1/service/conversation/message/__init__.py b/twilio/rest/conversations/v1/service/conversation/message/__init__.py index d6bc253b67..753df18352 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/message/__init__.py @@ -26,6 +26,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -50,7 +51,7 @@ class WebhookEnabledType(object): :ivar delivery: An object that contains the summary of delivery statuses for the message to non-chat participants. :ivar url: An absolute API resource URL for this message. :ivar links: Contains an absolute API resource URL to access the delivery & read receipts of this message. - :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template. + :ivar content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template. """ def __init__( @@ -70,7 +71,7 @@ def __init__( self.index: Optional[int] = deserialize.integer(payload.get("index")) self.author: Optional[str] = payload.get("author") self.body: Optional[str] = payload.get("body") - self.media: Optional[List[object]] = payload.get("media") + self.media: Optional[List[Dict[str, object]]] = payload.get("media") self.attributes: Optional[str] = payload.get("attributes") self.participant_sid: Optional[str] = payload.get("participant_sid") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -248,6 +249,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__( self, version: Version, chat_service_sid: str, conversation_sid: str, sid: str ): @@ -490,6 +492,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -513,6 +516,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, chat_service_sid: str, conversation_sid: str): """ Initialize the MessageList @@ -558,12 +562,13 @@ def create( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. :returns: The created MessageInstance """ + data = values.of( { "Author": author, @@ -582,6 +587,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -618,12 +624,13 @@ async def create_async( :param date_updated: The date that this resource was last updated. `null` if the message has not been edited. :param attributes: A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. :param media_sid: The Media SID to be attached to the new Message. - :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + :param content_sid: The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. :param content_variables: A structurally valid JSON string that contains values to resolve Rich Content template variables. :param subject: The subject of the message, can be up to 256 characters long. :returns: The created MessageInstance """ + data = values.of( { "Author": author, @@ -642,6 +649,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py b/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py index 73c197cd72..b9bf8a70c8 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py +++ b/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py @@ -23,6 +23,7 @@ class DeliveryReceiptInstance(InstanceResource): + class DeliveryStatus(object): READ = "read" FAILED = "failed" @@ -130,6 +131,7 @@ def __repr__(self) -> str: class DeliveryReceiptContext(InstanceContext): + def __init__( self, version: Version, @@ -215,6 +217,7 @@ def __repr__(self) -> str: class DeliveryReceiptPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeliveryReceiptInstance: """ Build an instance of DeliveryReceiptInstance @@ -239,6 +242,7 @@ def __repr__(self) -> str: class DeliveryReceiptList(ListResource): + def __init__( self, version: Version, diff --git a/twilio/rest/conversations/v1/service/conversation/participant.py b/twilio/rest/conversations/v1/service/conversation/participant.py index a2f4497dbd..6f6eee61e7 100644 --- a/twilio/rest/conversations/v1/service/conversation/participant.py +++ b/twilio/rest/conversations/v1/service/conversation/participant.py @@ -23,6 +23,7 @@ class ParticipantInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -250,6 +251,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__( self, version: Version, chat_service_sid: str, conversation_sid: str, sid: str ): @@ -494,6 +496,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -517,6 +520,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, chat_service_sid: str, conversation_sid: str): """ Initialize the ParticipantList @@ -566,6 +570,7 @@ def create( :returns: The created ParticipantInstance """ + data = values.of( { "Identity": identity, @@ -583,6 +588,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -623,6 +629,7 @@ async def create_async( :returns: The created ParticipantInstance """ + data = values.of( { "Identity": identity, @@ -640,6 +647,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/conversations/v1/service/conversation/webhook.py b/twilio/rest/conversations/v1/service/conversation/webhook.py index cd3b8a73d7..83b267406e 100644 --- a/twilio/rest/conversations/v1/service/conversation/webhook.py +++ b/twilio/rest/conversations/v1/service/conversation/webhook.py @@ -23,6 +23,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -193,6 +194,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__( self, version: Version, chat_service_sid: str, conversation_sid: str, sid: str ): @@ -387,6 +389,7 @@ def __repr__(self) -> str: class WebhookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: """ Build an instance of WebhookInstance @@ -410,6 +413,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, chat_service_sid: str, conversation_sid: str): """ Initialize the WebhookList @@ -453,6 +457,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "Target": target, @@ -505,6 +510,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "Target": target, diff --git a/twilio/rest/conversations/v1/service/participant_conversation.py b/twilio/rest/conversations/v1/service/participant_conversation.py index 156fc65343..2c3bebcc1e 100644 --- a/twilio/rest/conversations/v1/service/participant_conversation.py +++ b/twilio/rest/conversations/v1/service/participant_conversation.py @@ -23,6 +23,7 @@ class ParticipantConversationInstance(InstanceResource): + class State(object): INACTIVE = "inactive" ACTIVE = "active" @@ -104,6 +105,7 @@ def __repr__(self) -> str: class ParticipantConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantConversationInstance: """ Build an instance of ParticipantConversationInstance @@ -124,6 +126,7 @@ def __repr__(self) -> str: class ParticipantConversationList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the ParticipantConversationList diff --git a/twilio/rest/conversations/v1/service/role.py b/twilio/rest/conversations/v1/service/role.py index dfd7391c69..3c0a0fc909 100644 --- a/twilio/rest/conversations/v1/service/role.py +++ b/twilio/rest/conversations/v1/service/role.py @@ -23,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CONVERSATION = "conversation" SERVICE = "service" @@ -155,6 +156,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str, sid: str): """ Initialize the RoleContext @@ -301,6 +303,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -321,6 +324,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the RoleList @@ -349,6 +353,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -379,6 +384,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/conversations/v1/service/user/__init__.py b/twilio/rest/conversations/v1/service/user/__init__.py index 7d8be91f86..37a8d2e4fb 100644 --- a/twilio/rest/conversations/v1/service/user/__init__.py +++ b/twilio/rest/conversations/v1/service/user/__init__.py @@ -26,6 +26,7 @@ class UserInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -217,6 +218,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, chat_service_sid: str, sid: str): """ Initialize the UserContext @@ -430,6 +432,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -450,6 +453,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version, chat_service_sid: str): """ Initialize the UserList @@ -487,6 +491,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -500,6 +505,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -529,6 +535,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -542,6 +549,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/conversations/v1/service/user/user_conversation.py b/twilio/rest/conversations/v1/service/user/user_conversation.py index 625d219d49..7a836505b9 100644 --- a/twilio/rest/conversations/v1/service/user/user_conversation.py +++ b/twilio/rest/conversations/v1/service/user/user_conversation.py @@ -23,6 +23,7 @@ class UserConversationInstance(InstanceResource): + class NotificationLevel(object): DEFAULT = "default" MUTED = "muted" @@ -211,6 +212,7 @@ def __repr__(self) -> str: class UserConversationContext(InstanceContext): + def __init__( self, version: Version, @@ -393,6 +395,7 @@ def __repr__(self) -> str: class UserConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserConversationInstance: """ Build an instance of UserConversationInstance @@ -416,6 +419,7 @@ def __repr__(self) -> str: class UserConversationList(ListResource): + def __init__(self, version: Version, chat_service_sid: str, user_sid: str): """ Initialize the UserConversationList diff --git a/twilio/rest/conversations/v1/user/__init__.py b/twilio/rest/conversations/v1/user/__init__.py index e983da13a3..d8017c5102 100644 --- a/twilio/rest/conversations/v1/user/__init__.py +++ b/twilio/rest/conversations/v1/user/__init__.py @@ -24,6 +24,7 @@ class UserInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -209,6 +210,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the UserContext @@ -407,6 +409,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -425,6 +428,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version): """ Initialize the UserList @@ -457,6 +461,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -470,6 +475,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -497,6 +503,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -510,6 +517,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/conversations/v1/user/user_conversation.py b/twilio/rest/conversations/v1/user/user_conversation.py index d7d06a6ee6..e162441151 100644 --- a/twilio/rest/conversations/v1/user/user_conversation.py +++ b/twilio/rest/conversations/v1/user/user_conversation.py @@ -23,6 +23,7 @@ class UserConversationInstance(InstanceResource): + class NotificationLevel(object): DEFAULT = "default" MUTED = "muted" @@ -208,6 +209,7 @@ def __repr__(self) -> str: class UserConversationContext(InstanceContext): + def __init__(self, version: Version, user_sid: str, conversation_sid: str): """ Initialize the UserConversationContext @@ -378,6 +380,7 @@ def __repr__(self) -> str: class UserConversationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserConversationInstance: """ Build an instance of UserConversationInstance @@ -398,6 +401,7 @@ def __repr__(self) -> str: class UserConversationList(ListResource): + def __init__(self, version: Version, user_sid: str): """ Initialize the UserConversationList diff --git a/twilio/rest/events/EventsBase.py b/twilio/rest/events/EventsBase.py index 17c087a1d5..eb2251ae4e 100644 --- a/twilio/rest/events/EventsBase.py +++ b/twilio/rest/events/EventsBase.py @@ -17,6 +17,7 @@ class EventsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Events Domain diff --git a/twilio/rest/events/v1/__init__.py b/twilio/rest/events/v1/__init__.py index d62e813d50..6b91355444 100644 --- a/twilio/rest/events/v1/__init__.py +++ b/twilio/rest/events/v1/__init__.py @@ -22,6 +22,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Events diff --git a/twilio/rest/events/v1/event_type.py b/twilio/rest/events/v1/event_type.py index 451c74d2a8..7215df8f24 100644 --- a/twilio/rest/events/v1/event_type.py +++ b/twilio/rest/events/v1/event_type.py @@ -99,6 +99,7 @@ def __repr__(self) -> str: class EventTypeContext(InstanceContext): + def __init__(self, version: Version, type: str): """ Initialize the EventTypeContext @@ -163,6 +164,7 @@ def __repr__(self) -> str: class EventTypePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EventTypeInstance: """ Build an instance of EventTypeInstance @@ -181,6 +183,7 @@ def __repr__(self) -> str: class EventTypeList(ListResource): + def __init__(self, version: Version): """ Initialize the EventTypeList diff --git a/twilio/rest/events/v1/schema/__init__.py b/twilio/rest/events/v1/schema/__init__.py index 22383e76d5..c3b6593c03 100644 --- a/twilio/rest/events/v1/schema/__init__.py +++ b/twilio/rest/events/v1/schema/__init__.py @@ -103,6 +103,7 @@ def __repr__(self) -> str: class SchemaContext(InstanceContext): + def __init__(self, version: Version, id: str): """ Initialize the SchemaContext @@ -181,6 +182,7 @@ def __repr__(self) -> str: class SchemaList(ListResource): + def __init__(self, version: Version): """ Initialize the SchemaList diff --git a/twilio/rest/events/v1/schema/schema_version.py b/twilio/rest/events/v1/schema/schema_version.py index 58c8207cad..3557cb2935 100644 --- a/twilio/rest/events/v1/schema/schema_version.py +++ b/twilio/rest/events/v1/schema/schema_version.py @@ -101,6 +101,7 @@ def __repr__(self) -> str: class SchemaVersionContext(InstanceContext): + def __init__(self, version: Version, id: str, schema_version: int): """ Initialize the SchemaVersionContext @@ -169,6 +170,7 @@ def __repr__(self) -> str: class SchemaVersionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SchemaVersionInstance: """ Build an instance of SchemaVersionInstance @@ -187,6 +189,7 @@ def __repr__(self) -> str: class SchemaVersionList(ListResource): + def __init__(self, version: Version, id: str): """ Initialize the SchemaVersionList diff --git a/twilio/rest/events/v1/sink/__init__.py b/twilio/rest/events/v1/sink/__init__.py index 51d25b800a..67688f296d 100644 --- a/twilio/rest/events/v1/sink/__init__.py +++ b/twilio/rest/events/v1/sink/__init__.py @@ -25,6 +25,7 @@ class SinkInstance(InstanceResource): + class SinkType(object): KINESIS = "kinesis" WEBHOOK = "webhook" @@ -174,6 +175,7 @@ def __repr__(self) -> str: class SinkContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SinkContext @@ -333,6 +335,7 @@ def __repr__(self) -> str: class SinkPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SinkInstance: """ Build an instance of SinkInstance @@ -351,6 +354,7 @@ def __repr__(self) -> str: class SinkList(ListResource): + def __init__(self, version: Version): """ Initialize the SinkList @@ -377,6 +381,7 @@ def create( :returns: The created SinkInstance """ + data = values.of( { "Description": description, @@ -408,6 +413,7 @@ async def create_async( :returns: The created SinkInstance """ + data = values.of( { "Description": description, diff --git a/twilio/rest/events/v1/sink/sink_test.py b/twilio/rest/events/v1/sink/sink_test.py index 3b49a36cfa..adf04f582d 100644 --- a/twilio/rest/events/v1/sink/sink_test.py +++ b/twilio/rest/events/v1/sink/sink_test.py @@ -44,6 +44,7 @@ def __repr__(self) -> str: class SinkTestList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the SinkTestList diff --git a/twilio/rest/events/v1/sink/sink_validate.py b/twilio/rest/events/v1/sink/sink_validate.py index be24c8869c..4c24dd76b3 100644 --- a/twilio/rest/events/v1/sink/sink_validate.py +++ b/twilio/rest/events/v1/sink/sink_validate.py @@ -45,6 +45,7 @@ def __repr__(self) -> str: class SinkValidateList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the SinkValidateList @@ -69,6 +70,7 @@ def create(self, test_id: str) -> SinkValidateInstance: :returns: The created SinkValidateInstance """ + data = values.of( { "TestId": test_id, @@ -91,6 +93,7 @@ async def create_async(self, test_id: str) -> SinkValidateInstance: :returns: The created SinkValidateInstance """ + data = values.of( { "TestId": test_id, diff --git a/twilio/rest/events/v1/subscription/__init__.py b/twilio/rest/events/v1/subscription/__init__.py index 5b0651a011..666b26aa70 100644 --- a/twilio/rest/events/v1/subscription/__init__.py +++ b/twilio/rest/events/v1/subscription/__init__.py @@ -163,6 +163,7 @@ def __repr__(self) -> str: class SubscriptionContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SubscriptionContext @@ -321,6 +322,7 @@ def __repr__(self) -> str: class SubscriptionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SubscriptionInstance: """ Build an instance of SubscriptionInstance @@ -339,6 +341,7 @@ def __repr__(self) -> str: class SubscriptionList(ListResource): + def __init__(self, version: Version): """ Initialize the SubscriptionList @@ -362,6 +365,7 @@ def create( :returns: The created SubscriptionInstance """ + data = values.of( { "Description": description, @@ -390,6 +394,7 @@ async def create_async( :returns: The created SubscriptionInstance """ + data = values.of( { "Description": description, diff --git a/twilio/rest/events/v1/subscription/subscribed_event.py b/twilio/rest/events/v1/subscription/subscribed_event.py index 03017f0dd3..80c9ce1494 100644 --- a/twilio/rest/events/v1/subscription/subscribed_event.py +++ b/twilio/rest/events/v1/subscription/subscribed_event.py @@ -25,7 +25,7 @@ class SubscribedEventInstance(InstanceResource): """ :ivar account_sid: The unique SID identifier of the Account. :ivar type: Type of event being subscribed to. - :ivar schema_version: The schema version that the subscription should use. + :ivar schema_version: The schema version that the Subscription should use. :ivar subscription_sid: The unique SID identifier of the Subscription. :ivar url: The URL of this resource. """ @@ -111,7 +111,7 @@ def update( """ Update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -125,7 +125,7 @@ async def update_async( """ Asynchronous coroutine to update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -144,6 +144,7 @@ def __repr__(self) -> str: class SubscribedEventContext(InstanceContext): + def __init__(self, version: Version, subscription_sid: str, type: str): """ Initialize the SubscribedEventContext @@ -233,7 +234,7 @@ def update( """ Update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -262,7 +263,7 @@ async def update_async( """ Asynchronous coroutine to update the SubscribedEventInstance - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The updated SubscribedEventInstance """ @@ -296,6 +297,7 @@ def __repr__(self) -> str: class SubscribedEventPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SubscribedEventInstance: """ Build an instance of SubscribedEventInstance @@ -316,6 +318,7 @@ def __repr__(self) -> str: class SubscribedEventList(ListResource): + def __init__(self, version: Version, subscription_sid: str): """ Initialize the SubscribedEventList @@ -341,10 +344,11 @@ def create( Create the SubscribedEventInstance :param type: Type of event being subscribed to. - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The created SubscribedEventInstance """ + data = values.of( { "Type": type, @@ -369,10 +373,11 @@ async def create_async( Asynchronously create the SubscribedEventInstance :param type: Type of event being subscribed to. - :param schema_version: The schema version that the subscription should use. + :param schema_version: The schema version that the Subscription should use. :returns: The created SubscribedEventInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/flex_api/FlexApiBase.py b/twilio/rest/flex_api/FlexApiBase.py index afdad47340..3bda5b6b47 100644 --- a/twilio/rest/flex_api/FlexApiBase.py +++ b/twilio/rest/flex_api/FlexApiBase.py @@ -18,6 +18,7 @@ class FlexApiBase(Domain): + def __init__(self, twilio: Client): """ Initialize the FlexApi Domain diff --git a/twilio/rest/flex_api/v1/__init__.py b/twilio/rest/flex_api/v1/__init__.py index 1b895467f0..7ee41b75f0 100644 --- a/twilio/rest/flex_api/v1/__init__.py +++ b/twilio/rest/flex_api/v1/__init__.py @@ -22,6 +22,12 @@ from twilio.rest.flex_api.v1.insights_assessments_comment import ( InsightsAssessmentsCommentList, ) +from twilio.rest.flex_api.v1.insights_conversational_ai import ( + InsightsConversationalAiList, +) +from twilio.rest.flex_api.v1.insights_conversational_ai_report_insights import ( + InsightsConversationalAiReportInsightsList, +) from twilio.rest.flex_api.v1.insights_conversations import InsightsConversationsList from twilio.rest.flex_api.v1.insights_questionnaires import InsightsQuestionnairesList from twilio.rest.flex_api.v1.insights_questionnaires_category import ( @@ -40,10 +46,12 @@ ) from twilio.rest.flex_api.v1.insights_user_roles import InsightsUserRolesList from twilio.rest.flex_api.v1.interaction import InteractionList +from twilio.rest.flex_api.v1.provisioning_status import ProvisioningStatusList from twilio.rest.flex_api.v1.web_channel import WebChannelList class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of FlexApi @@ -58,6 +66,10 @@ def __init__(self, domain: Domain): self._insights_assessments_comment: Optional[InsightsAssessmentsCommentList] = ( None ) + self._insights_conversational_ai: Optional[InsightsConversationalAiList] = None + self._insights_conversational_ai_report_insights: Optional[ + InsightsConversationalAiReportInsightsList + ] = None self._insights_conversations: Optional[InsightsConversationsList] = None self._insights_questionnaires: Optional[InsightsQuestionnairesList] = None self._insights_questionnaires_category: Optional[ @@ -74,6 +86,7 @@ def __init__(self, domain: Domain): self._insights_settings_comment: Optional[InsightsSettingsCommentList] = None self._insights_user_roles: Optional[InsightsUserRolesList] = None self._interaction: Optional[InteractionList] = None + self._provisioning_status: Optional[ProvisioningStatusList] = None self._web_channel: Optional[WebChannelList] = None @property @@ -106,6 +119,22 @@ def insights_assessments_comment(self) -> InsightsAssessmentsCommentList: self._insights_assessments_comment = InsightsAssessmentsCommentList(self) return self._insights_assessments_comment + @property + def insights_conversational_ai(self) -> InsightsConversationalAiList: + if self._insights_conversational_ai is None: + self._insights_conversational_ai = InsightsConversationalAiList(self) + return self._insights_conversational_ai + + @property + def insights_conversational_ai_report_insights( + self, + ) -> InsightsConversationalAiReportInsightsList: + if self._insights_conversational_ai_report_insights is None: + self._insights_conversational_ai_report_insights = ( + InsightsConversationalAiReportInsightsList(self) + ) + return self._insights_conversational_ai_report_insights + @property def insights_conversations(self) -> InsightsConversationsList: if self._insights_conversations is None: @@ -170,6 +199,12 @@ def interaction(self) -> InteractionList: self._interaction = InteractionList(self) return self._interaction + @property + def provisioning_status(self) -> ProvisioningStatusList: + if self._provisioning_status is None: + self._provisioning_status = ProvisioningStatusList(self) + return self._provisioning_status + @property def web_channel(self) -> WebChannelList: if self._web_channel is None: diff --git a/twilio/rest/flex_api/v1/assessments.py b/twilio/rest/flex_api/v1/assessments.py index 1e2030a8fb..23648b1041 100644 --- a/twilio/rest/flex_api/v1/assessments.py +++ b/twilio/rest/flex_api/v1/assessments.py @@ -141,6 +141,7 @@ def __repr__(self) -> str: class AssessmentsContext(InstanceContext): + def __init__(self, version: Version, assessment_sid: str): """ Initialize the AssessmentsContext @@ -245,6 +246,7 @@ def __repr__(self) -> str: class AssessmentsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AssessmentsInstance: """ Build an instance of AssessmentsInstance @@ -263,6 +265,7 @@ def __repr__(self) -> str: class AssessmentsList(ListResource): + def __init__(self, version: Version): """ Initialize the AssessmentsList @@ -305,6 +308,7 @@ def create( :returns: The created AssessmentsInstance """ + data = values.of( { "CategorySid": category_sid, @@ -324,6 +328,7 @@ def create( "Authorization": authorization, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -361,6 +366,7 @@ async def create_async( :returns: The created AssessmentsInstance """ + data = values.of( { "CategorySid": category_sid, @@ -380,6 +386,7 @@ async def create_async( "Authorization": authorization, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/flex_api/v1/channel.py b/twilio/rest/flex_api/v1/channel.py index 5b2300952b..a2f1e1af0f 100644 --- a/twilio/rest/flex_api/v1/channel.py +++ b/twilio/rest/flex_api/v1/channel.py @@ -119,6 +119,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ChannelContext @@ -207,6 +208,7 @@ def __repr__(self) -> str: class ChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelInstance: """ Build an instance of ChannelInstance @@ -225,6 +227,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version): """ Initialize the ChannelList @@ -265,6 +268,7 @@ def create( :returns: The created ChannelInstance """ + data = values.of( { "FlexFlowSid": flex_flow_sid, @@ -317,6 +321,7 @@ async def create_async( :returns: The created ChannelInstance """ + data = values.of( { "FlexFlowSid": flex_flow_sid, diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index fc9a60923d..511321a588 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -22,6 +22,7 @@ class ConfigurationInstance(InstanceResource): + class Status(object): OK = "ok" INPROGRESS = "inprogress" @@ -45,6 +46,7 @@ class Status(object): :ivar messaging_service_instance_sid: The SID of the Messaging service instance. :ivar chat_service_instance_sid: The SID of the chat service this user belongs to. :ivar flex_service_instance_sid: The SID of the Flex service instance. + :ivar flex_instance_sid: The SID of the Flex instance. :ivar ui_language: The primary language of the Flex UI. :ivar ui_attributes: The object that describes Flex UI characteristics and settings. :ivar ui_dependencies: The object that defines the NPM packages and versions to be used in Hosted Flex. @@ -75,6 +77,7 @@ class Status(object): :ivar flex_ui_status_report: Configurable parameters for Flex UI Status report. :ivar agent_conv_end_methods: Agent conversation end methods. :ivar citrix_voice_vdi: Citrix voice vdi configuration and settings. + :ivar offline_config: Presence and presence ttl configuration """ def __init__(self, version: Version, payload: Dict[str, Any]): @@ -98,10 +101,10 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.taskrouter_target_taskqueue_sid: Optional[str] = payload.get( "taskrouter_target_taskqueue_sid" ) - self.taskrouter_taskqueues: Optional[List[object]] = payload.get( + self.taskrouter_taskqueues: Optional[List[Dict[str, object]]] = payload.get( "taskrouter_taskqueues" ) - self.taskrouter_skills: Optional[List[object]] = payload.get( + self.taskrouter_skills: Optional[List[Dict[str, object]]] = payload.get( "taskrouter_skills" ) self.taskrouter_worker_channels: Optional[Dict[str, object]] = payload.get( @@ -123,6 +126,7 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.flex_service_instance_sid: Optional[str] = payload.get( "flex_service_instance_sid" ) + self.flex_instance_sid: Optional[str] = payload.get("flex_instance_sid") self.ui_language: Optional[str] = payload.get("ui_language") self.ui_attributes: Optional[Dict[str, object]] = payload.get("ui_attributes") self.ui_dependencies: Optional[Dict[str, object]] = payload.get( @@ -150,7 +154,9 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.plugin_service_attributes: Optional[Dict[str, object]] = payload.get( "plugin_service_attributes" ) - self.integrations: Optional[List[object]] = payload.get("integrations") + self.integrations: Optional[List[Dict[str, object]]] = payload.get( + "integrations" + ) self.outbound_call_flows: Optional[Dict[str, object]] = payload.get( "outbound_call_flows" ) @@ -170,7 +176,9 @@ def __init__(self, version: Version, payload: Dict[str, Any]): "flex_insights_drilldown" ) self.flex_url: Optional[str] = payload.get("flex_url") - self.channel_configs: Optional[List[object]] = payload.get("channel_configs") + self.channel_configs: Optional[List[Dict[str, object]]] = payload.get( + "channel_configs" + ) self.debugger_integration: Optional[Dict[str, object]] = payload.get( "debugger_integration" ) @@ -183,6 +191,7 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.citrix_voice_vdi: Optional[Dict[str, object]] = payload.get( "citrix_voice_vdi" ) + self.offline_config: Optional[Dict[str, object]] = payload.get("offline_config") self._context: Optional[ConfigurationContext] = None @@ -239,6 +248,7 @@ def __repr__(self) -> str: class ConfigurationContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the ConfigurationContext @@ -310,6 +320,7 @@ def __repr__(self) -> str: class ConfigurationList(ListResource): + def __init__(self, version: Version): """ Initialize the ConfigurationList diff --git a/twilio/rest/flex_api/v1/flex_flow.py b/twilio/rest/flex_api/v1/flex_flow.py index 15e3276501..57c9a8f430 100644 --- a/twilio/rest/flex_api/v1/flex_flow.py +++ b/twilio/rest/flex_api/v1/flex_flow.py @@ -23,6 +23,7 @@ class FlexFlowInstance(InstanceResource): + class ChannelType(object): WEB = "web" SMS = "sms" @@ -278,6 +279,7 @@ def __repr__(self) -> str: class FlexFlowContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FlexFlowContext @@ -516,6 +518,7 @@ def __repr__(self) -> str: class FlexFlowPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FlexFlowInstance: """ Build an instance of FlexFlowInstance @@ -534,6 +537,7 @@ def __repr__(self) -> str: class FlexFlowList(ListResource): + def __init__(self, version: Version): """ Initialize the FlexFlowList @@ -590,6 +594,7 @@ def create( :returns: The created FlexFlowInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -665,6 +670,7 @@ async def create_async( :returns: The created FlexFlowInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/flex_api/v1/insights_assessments_comment.py b/twilio/rest/flex_api/v1/insights_assessments_comment.py index 8ac4a527a7..eed32fefbc 100644 --- a/twilio/rest/flex_api/v1/insights_assessments_comment.py +++ b/twilio/rest/flex_api/v1/insights_assessments_comment.py @@ -64,6 +64,7 @@ def __repr__(self) -> str: class InsightsAssessmentsCommentPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> InsightsAssessmentsCommentInstance: @@ -84,6 +85,7 @@ def __repr__(self) -> str: class InsightsAssessmentsCommentList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsAssessmentsCommentList @@ -118,6 +120,7 @@ def create( :returns: The created InsightsAssessmentsCommentInstance """ + data = values.of( { "CategoryId": category_id, @@ -133,6 +136,7 @@ def create( "Authorization": authorization, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -162,6 +166,7 @@ async def create_async( :returns: The created InsightsAssessmentsCommentInstance """ + data = values.of( { "CategoryId": category_id, @@ -177,6 +182,7 @@ async def create_async( "Authorization": authorization, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/flex_api/v1/insights_conversational_ai.py b/twilio/rest/flex_api/v1/insights_conversational_ai.py new file mode 100644 index 0000000000..0cce79ad9d --- /dev/null +++ b/twilio/rest/flex_api/v1/insights_conversational_ai.py @@ -0,0 +1,295 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class InsightsConversationalAiInstance(InstanceResource): + + class Granularity(object): + DAYS = "days" + WEEKS = "weeks" + MONTHS = "months" + QUARTERS = "quarters" + YEARS = "years" + + """ + :ivar instance_sid: Sid of Flex Service Instance + :ivar report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + :ivar granularity: + :ivar period_start: The start date from which report data is included + :ivar period_end: The end date till report data is included + :ivar updated: Updated time of the report + :ivar total_pages: Represents total number of pages fetched report has + :ivar page: Page offset required for pagination + :ivar rows: List of report breakdown + :ivar url: The URL of this resource. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + instance_sid: Optional[str] = None, + ): + super().__init__(version) + + self.instance_sid: Optional[str] = payload.get("instance_sid") + self.report_id: Optional[str] = payload.get("report_id") + self.granularity: Optional["InsightsConversationalAiInstance.Granularity"] = ( + payload.get("granularity") + ) + self.period_start: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("period_start") + ) + self.period_end: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("period_end") + ) + self.updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("updated") + ) + self.total_pages: Optional[int] = deserialize.integer( + payload.get("total_pages") + ) + self.page: Optional[int] = deserialize.integer(payload.get("page")) + self.rows: Optional[List[Dict[str, object]]] = payload.get("rows") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "instance_sid": instance_sid or self.instance_sid, + } + self._context: Optional[InsightsConversationalAiContext] = None + + @property + def _proxy(self) -> "InsightsConversationalAiContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: InsightsConversationalAiContext for this InsightsConversationalAiInstance + """ + if self._context is None: + self._context = InsightsConversationalAiContext( + self._version, + instance_sid=self._solution["instance_sid"], + ) + return self._context + + def fetch( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[ + "InsightsConversationalAiInstance.Granularity", object + ] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> "InsightsConversationalAiInstance": + """ + Fetch the InsightsConversationalAiInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiInstance + """ + return self._proxy.fetch( + max_rows=max_rows, + report_id=report_id, + granularity=granularity, + include_date=include_date, + ) + + async def fetch_async( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[ + "InsightsConversationalAiInstance.Granularity", object + ] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> "InsightsConversationalAiInstance": + """ + Asynchronous coroutine to fetch the InsightsConversationalAiInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiInstance + """ + return await self._proxy.fetch_async( + max_rows=max_rows, + report_id=report_id, + granularity=granularity, + include_date=include_date, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class InsightsConversationalAiContext(InstanceContext): + + def __init__(self, version: Version, instance_sid: str): + """ + Initialize the InsightsConversationalAiContext + + :param version: Version that contains the resource + :param instance_sid: Sid of Flex Service Instance + """ + super().__init__(version) + + # Path Solution + self._solution = { + "instance_sid": instance_sid, + } + self._uri = "/Insights/Instances/{instance_sid}/AI/Reports".format( + **self._solution + ) + + def fetch( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[ + "InsightsConversationalAiInstance.Granularity", object + ] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> InsightsConversationalAiInstance: + """ + Fetch the InsightsConversationalAiInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiInstance + """ + + data = values.of( + { + "MaxRows": max_rows, + "ReportId": report_id, + "Granularity": granularity, + "IncludeDate": serialize.iso8601_datetime(include_date), + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + + return InsightsConversationalAiInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + ) + + async def fetch_async( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[ + "InsightsConversationalAiInstance.Granularity", object + ] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> InsightsConversationalAiInstance: + """ + Asynchronous coroutine to fetch the InsightsConversationalAiInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiInstance + """ + + data = values.of( + { + "MaxRows": max_rows, + "ReportId": report_id, + "Granularity": granularity, + "IncludeDate": serialize.iso8601_datetime(include_date), + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=data + ) + + return InsightsConversationalAiInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class InsightsConversationalAiList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the InsightsConversationalAiList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, instance_sid: str) -> InsightsConversationalAiContext: + """ + Constructs a InsightsConversationalAiContext + + :param instance_sid: Sid of Flex Service Instance + """ + return InsightsConversationalAiContext(self._version, instance_sid=instance_sid) + + def __call__(self, instance_sid: str) -> InsightsConversationalAiContext: + """ + Constructs a InsightsConversationalAiContext + + :param instance_sid: Sid of Flex Service Instance + """ + return InsightsConversationalAiContext(self._version, instance_sid=instance_sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py b/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py new file mode 100644 index 0000000000..59ac5a04bf --- /dev/null +++ b/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py @@ -0,0 +1,279 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class InsightsConversationalAiReportInsightsInstance(InstanceResource): + """ + :ivar instance_sid: The Instance SID of the instance for which report insights is fetched + :ivar report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + :ivar period_start: The start date from which report insights data is included + :ivar period_end: The end date till report insights data is included + :ivar updated: Updated time of the report insights + :ivar insights: List of report insights breakdown + :ivar url: The URL of this resource + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + instance_sid: Optional[str] = None, + ): + super().__init__(version) + + self.instance_sid: Optional[str] = payload.get("instance_sid") + self.report_id: Optional[str] = payload.get("report_id") + self.period_start: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("period_start") + ) + self.period_end: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("period_end") + ) + self.updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("updated") + ) + self.insights: Optional[List[Dict[str, object]]] = payload.get("insights") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "instance_sid": instance_sid or self.instance_sid, + } + self._context: Optional[InsightsConversationalAiReportInsightsContext] = None + + @property + def _proxy(self) -> "InsightsConversationalAiReportInsightsContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: InsightsConversationalAiReportInsightsContext for this InsightsConversationalAiReportInsightsInstance + """ + if self._context is None: + self._context = InsightsConversationalAiReportInsightsContext( + self._version, + instance_sid=self._solution["instance_sid"], + ) + return self._context + + def fetch( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[str, object] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> "InsightsConversationalAiReportInsightsInstance": + """ + Fetch the InsightsConversationalAiReportInsightsInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report insights is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiReportInsightsInstance + """ + return self._proxy.fetch( + max_rows=max_rows, + report_id=report_id, + granularity=granularity, + include_date=include_date, + ) + + async def fetch_async( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[str, object] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> "InsightsConversationalAiReportInsightsInstance": + """ + Asynchronous coroutine to fetch the InsightsConversationalAiReportInsightsInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report insights is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiReportInsightsInstance + """ + return await self._proxy.fetch_async( + max_rows=max_rows, + report_id=report_id, + granularity=granularity, + include_date=include_date, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class InsightsConversationalAiReportInsightsContext(InstanceContext): + + def __init__(self, version: Version, instance_sid: str): + """ + Initialize the InsightsConversationalAiReportInsightsContext + + :param version: Version that contains the resource + :param instance_sid: The Instance SID of the instance for which report insights will be fetched + """ + super().__init__(version) + + # Path Solution + self._solution = { + "instance_sid": instance_sid, + } + self._uri = "/Insights/Instances/{instance_sid}/AI/ReportInsights".format( + **self._solution + ) + + def fetch( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[str, object] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> InsightsConversationalAiReportInsightsInstance: + """ + Fetch the InsightsConversationalAiReportInsightsInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report insights is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiReportInsightsInstance + """ + + data = values.of( + { + "MaxRows": max_rows, + "ReportId": report_id, + "Granularity": granularity, + "IncludeDate": serialize.iso8601_datetime(include_date), + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + + return InsightsConversationalAiReportInsightsInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + ) + + async def fetch_async( + self, + max_rows: Union[int, object] = values.unset, + report_id: Union[str, object] = values.unset, + granularity: Union[str, object] = values.unset, + include_date: Union[datetime, object] = values.unset, + ) -> InsightsConversationalAiReportInsightsInstance: + """ + Asynchronous coroutine to fetch the InsightsConversationalAiReportInsightsInstance + + :param max_rows: Maximum number of rows to return + :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics + :param granularity: The time period for which report insights is needed + :param include_date: A reference date that should be included in the returned period + + :returns: The fetched InsightsConversationalAiReportInsightsInstance + """ + + data = values.of( + { + "MaxRows": max_rows, + "ReportId": report_id, + "Granularity": granularity, + "IncludeDate": serialize.iso8601_datetime(include_date), + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=data + ) + + return InsightsConversationalAiReportInsightsInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class InsightsConversationalAiReportInsightsList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the InsightsConversationalAiReportInsightsList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, instance_sid: str) -> InsightsConversationalAiReportInsightsContext: + """ + Constructs a InsightsConversationalAiReportInsightsContext + + :param instance_sid: The Instance SID of the instance for which report insights will be fetched + """ + return InsightsConversationalAiReportInsightsContext( + self._version, instance_sid=instance_sid + ) + + def __call__( + self, instance_sid: str + ) -> InsightsConversationalAiReportInsightsContext: + """ + Constructs a InsightsConversationalAiReportInsightsContext + + :param instance_sid: The Instance SID of the instance for which report insights will be fetched + """ + return InsightsConversationalAiReportInsightsContext( + self._version, instance_sid=instance_sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/insights_conversations.py b/twilio/rest/flex_api/v1/insights_conversations.py index 54b33ad8ee..d08608c7e4 100644 --- a/twilio/rest/flex_api/v1/insights_conversations.py +++ b/twilio/rest/flex_api/v1/insights_conversations.py @@ -37,7 +37,7 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.segment_count: Optional[int] = deserialize.integer( payload.get("segment_count") ) - self.segments: Optional[List[object]] = payload.get("segments") + self.segments: Optional[List[Dict[str, object]]] = payload.get("segments") def __repr__(self) -> str: """ @@ -50,6 +50,7 @@ def __repr__(self) -> str: class InsightsConversationsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InsightsConversationsInstance: """ Build an instance of InsightsConversationsInstance @@ -68,6 +69,7 @@ def __repr__(self) -> str: class InsightsConversationsList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsConversationsList diff --git a/twilio/rest/flex_api/v1/insights_questionnaires.py b/twilio/rest/flex_api/v1/insights_questionnaires.py index f4bb0fad03..fe0338a9fe 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires.py @@ -45,7 +45,7 @@ def __init__( self.name: Optional[str] = payload.get("name") self.description: Optional[str] = payload.get("description") self.active: Optional[bool] = payload.get("active") - self.questions: Optional[List[object]] = payload.get("questions") + self.questions: Optional[List[Dict[str, object]]] = payload.get("questions") self.url: Optional[str] = payload.get("url") self._solution = { @@ -187,6 +187,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesContext(InstanceContext): + def __init__(self, version: Version, questionnaire_sid: str): """ Initialize the InsightsQuestionnairesContext @@ -391,6 +392,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InsightsQuestionnairesInstance: """ Build an instance of InsightsQuestionnairesInstance @@ -409,6 +411,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsQuestionnairesList @@ -439,6 +442,7 @@ def create( :returns: The created InsightsQuestionnairesInstance """ + data = values.of( { "Name": name, @@ -452,6 +456,7 @@ def create( "Authorization": authorization, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -477,6 +482,7 @@ async def create_async( :returns: The created InsightsQuestionnairesInstance """ + data = values.of( { "Name": name, @@ -490,6 +496,7 @@ async def create_async( "Authorization": authorization, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_category.py b/twilio/rest/flex_api/v1/insights_questionnaires_category.py index 3f95d9656b..28057dbc00 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_category.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_category.py @@ -133,6 +133,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesCategoryContext(InstanceContext): + def __init__(self, version: Version, category_sid: str): """ Initialize the InsightsQuestionnairesCategoryContext @@ -259,6 +260,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesCategoryPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> InsightsQuestionnairesCategoryInstance: @@ -279,6 +281,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesCategoryList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsQuestionnairesCategoryList @@ -301,6 +304,7 @@ def create( :returns: The created InsightsQuestionnairesCategoryInstance """ + data = values.of( { "Name": name, @@ -311,6 +315,7 @@ def create( "Authorization": authorization, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -328,6 +333,7 @@ async def create_async( :returns: The created InsightsQuestionnairesCategoryInstance """ + data = values.of( { "Name": name, @@ -338,6 +344,7 @@ async def create_async( "Authorization": authorization, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_question.py b/twilio/rest/flex_api/v1/insights_questionnaires_question.py index e68e04e2a3..b796ff6afd 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_question.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_question.py @@ -173,6 +173,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesQuestionContext(InstanceContext): + def __init__(self, version: Version, question_sid: str): """ Initialize the InsightsQuestionnairesQuestionContext @@ -327,6 +328,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesQuestionPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> InsightsQuestionnairesQuestionInstance: @@ -347,6 +349,7 @@ def __repr__(self) -> str: class InsightsQuestionnairesQuestionList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsQuestionnairesQuestionList @@ -379,6 +382,7 @@ def create( :returns: The created InsightsQuestionnairesQuestionInstance """ + data = values.of( { "CategorySid": category_sid, @@ -393,6 +397,7 @@ def create( "Authorization": authorization, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -420,6 +425,7 @@ async def create_async( :returns: The created InsightsQuestionnairesQuestionInstance """ + data = values.of( { "CategorySid": category_sid, @@ -434,6 +440,7 @@ async def create_async( "Authorization": authorization, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/flex_api/v1/insights_segments.py b/twilio/rest/flex_api/v1/insights_segments.py index a0d12d4bf3..2d509802a9 100644 --- a/twilio/rest/flex_api/v1/insights_segments.py +++ b/twilio/rest/flex_api/v1/insights_segments.py @@ -94,6 +94,7 @@ def __repr__(self) -> str: class InsightsSegmentsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InsightsSegmentsInstance: """ Build an instance of InsightsSegmentsInstance @@ -112,6 +113,7 @@ def __repr__(self) -> str: class InsightsSegmentsList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsSegmentsList diff --git a/twilio/rest/flex_api/v1/insights_session.py b/twilio/rest/flex_api/v1/insights_session.py index 32fa5c81e0..b4174aa949 100644 --- a/twilio/rest/flex_api/v1/insights_session.py +++ b/twilio/rest/flex_api/v1/insights_session.py @@ -93,6 +93,7 @@ def __repr__(self) -> str: class InsightsSessionContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the InsightsSessionContext @@ -156,6 +157,7 @@ def __repr__(self) -> str: class InsightsSessionList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsSessionList diff --git a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py index a8be81c914..767737da67 100644 --- a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py +++ b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py @@ -12,7 +12,8 @@ Do not edit the class manually. """ -from typing import Any, Dict, Optional +from typing import Any, Dict, Optional, Union +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -50,6 +51,7 @@ def __repr__(self) -> str: class InsightsSettingsAnswerSetsList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsSettingsAnswerSetsList @@ -61,23 +63,43 @@ def __init__(self, version: Version): self._uri = "/Insights/QualityManagement/Settings/AnswerSets" - def fetch(self) -> InsightsSettingsAnswerSetsInstance: + def fetch( + self, authorization: Union[str, object] = values.unset + ) -> InsightsSettingsAnswerSetsInstance: """ Asynchronously fetch the InsightsSettingsAnswerSetsInstance + :param authorization: The Authorization HTTP request header :returns: The fetched InsightsSettingsAnswerSetsInstance """ - payload = self._version.fetch(method="GET", uri=self._uri) + headers = values.of( + { + "Authorization": authorization, + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InsightsSettingsAnswerSetsInstance(self._version, payload) - async def fetch_async(self) -> InsightsSettingsAnswerSetsInstance: + async def fetch_async( + self, authorization: Union[str, object] = values.unset + ) -> InsightsSettingsAnswerSetsInstance: """ Asynchronously fetch the InsightsSettingsAnswerSetsInstance + :param authorization: The Authorization HTTP request header :returns: The fetched InsightsSettingsAnswerSetsInstance """ - payload = await self._version.fetch_async(method="GET", uri=self._uri) + headers = values.of( + { + "Authorization": authorization, + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return InsightsSettingsAnswerSetsInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v1/insights_settings_comment.py b/twilio/rest/flex_api/v1/insights_settings_comment.py index 1d4c2f19a4..5d41e8d3b3 100644 --- a/twilio/rest/flex_api/v1/insights_settings_comment.py +++ b/twilio/rest/flex_api/v1/insights_settings_comment.py @@ -12,7 +12,8 @@ Do not edit the class manually. """ -from typing import Any, Dict, Optional +from typing import Any, Dict, Optional, Union +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -44,6 +45,7 @@ def __repr__(self) -> str: class InsightsSettingsCommentList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsSettingsCommentList @@ -55,23 +57,43 @@ def __init__(self, version: Version): self._uri = "/Insights/QualityManagement/Settings/CommentTags" - def fetch(self) -> InsightsSettingsCommentInstance: + def fetch( + self, authorization: Union[str, object] = values.unset + ) -> InsightsSettingsCommentInstance: """ Asynchronously fetch the InsightsSettingsCommentInstance + :param authorization: The Authorization HTTP request header :returns: The fetched InsightsSettingsCommentInstance """ - payload = self._version.fetch(method="GET", uri=self._uri) + headers = values.of( + { + "Authorization": authorization, + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InsightsSettingsCommentInstance(self._version, payload) - async def fetch_async(self) -> InsightsSettingsCommentInstance: + async def fetch_async( + self, authorization: Union[str, object] = values.unset + ) -> InsightsSettingsCommentInstance: """ Asynchronously fetch the InsightsSettingsCommentInstance + :param authorization: The Authorization HTTP request header :returns: The fetched InsightsSettingsCommentInstance """ - payload = await self._version.fetch_async(method="GET", uri=self._uri) + headers = values.of( + { + "Authorization": authorization, + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return InsightsSettingsCommentInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v1/insights_user_roles.py b/twilio/rest/flex_api/v1/insights_user_roles.py index 705c0e97d1..9dbea5fa3b 100644 --- a/twilio/rest/flex_api/v1/insights_user_roles.py +++ b/twilio/rest/flex_api/v1/insights_user_roles.py @@ -87,6 +87,7 @@ def __repr__(self) -> str: class InsightsUserRolesContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the InsightsUserRolesContext @@ -158,6 +159,7 @@ def __repr__(self) -> str: class InsightsUserRolesList(ListResource): + def __init__(self, version: Version): """ Initialize the InsightsUserRolesList diff --git a/twilio/rest/flex_api/v1/interaction/__init__.py b/twilio/rest/flex_api/v1/interaction/__init__.py index 90a48bc06a..992cc9b015 100644 --- a/twilio/rest/flex_api/v1/interaction/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/__init__.py @@ -104,6 +104,7 @@ def __repr__(self) -> str: class InteractionContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the InteractionContext @@ -182,6 +183,7 @@ def __repr__(self) -> str: class InteractionList(ListResource): + def __init__(self, version: Version): """ Initialize the InteractionList @@ -208,6 +210,7 @@ def create( :returns: The created InteractionInstance """ + data = values.of( { "Channel": serialize.object(channel), @@ -239,6 +242,7 @@ async def create_async( :returns: The created InteractionInstance """ + data = values.of( { "Channel": serialize.object(channel), diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py index 791ad4d67f..a26dc0425e 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py @@ -28,6 +28,7 @@ class InteractionChannelInstance(InstanceResource): + class ChannelStatus(object): SETUP = "setup" ACTIVE = "active" @@ -181,6 +182,7 @@ def __repr__(self) -> str: class InteractionChannelContext(InstanceContext): + def __init__(self, version: Version, interaction_sid: str, sid: str): """ Initialize the InteractionChannelContext @@ -346,6 +348,7 @@ def __repr__(self) -> str: class InteractionChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InteractionChannelInstance: """ Build an instance of InteractionChannelInstance @@ -366,6 +369,7 @@ def __repr__(self) -> str: class InteractionChannelList(ListResource): + def __init__(self, version: Version, interaction_sid: str): """ Initialize the InteractionChannelList diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py index 9c97a85ce7..5292297b98 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py @@ -61,6 +61,7 @@ def __repr__(self) -> str: class InteractionChannelInvitePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InteractionChannelInviteInstance: """ Build an instance of InteractionChannelInviteInstance @@ -84,6 +85,7 @@ def __repr__(self) -> str: class InteractionChannelInviteList(ListResource): + def __init__(self, version: Version, interaction_sid: str, channel_sid: str): """ Initialize the InteractionChannelInviteList @@ -114,6 +116,7 @@ def create(self, routing: object) -> InteractionChannelInviteInstance: :returns: The created InteractionChannelInviteInstance """ + data = values.of( { "Routing": serialize.object(routing), @@ -141,6 +144,7 @@ async def create_async(self, routing: object) -> InteractionChannelInviteInstanc :returns: The created InteractionChannelInviteInstance """ + data = values.of( { "Routing": serialize.object(routing), diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py index d76a2275a7..649439ba2b 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py @@ -22,6 +22,7 @@ class InteractionChannelParticipantInstance(InstanceResource): + class Status(object): CLOSED = "closed" WRAPUP = "wrapup" @@ -124,6 +125,7 @@ def __repr__(self) -> str: class InteractionChannelParticipantContext(InstanceContext): + def __init__( self, version: Version, interaction_sid: str, channel_sid: str, sid: str ): @@ -220,6 +222,7 @@ def __repr__(self) -> str: class InteractionChannelParticipantPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> InteractionChannelParticipantInstance: @@ -245,6 +248,7 @@ def __repr__(self) -> str: class InteractionChannelParticipantList(ListResource): + def __init__(self, version: Version, interaction_sid: str, channel_sid: str): """ Initialize the InteractionChannelParticipantList @@ -278,6 +282,7 @@ def create( :returns: The created InteractionChannelParticipantInstance """ + data = values.of( { "Type": type, @@ -311,6 +316,7 @@ async def create_async( :returns: The created InteractionChannelParticipantInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/oauth/v1/user_info.py b/twilio/rest/flex_api/v1/provisioning_status.py similarity index 54% rename from twilio/rest/oauth/v1/user_info.py rename to twilio/rest/flex_api/v1/provisioning_status.py index e59ab8b0cc..9cc9144dcc 100644 --- a/twilio/rest/oauth/v1/user_info.py +++ b/twilio/rest/flex_api/v1/provisioning_status.py @@ -4,7 +4,7 @@ | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - Twilio - Oauth + Twilio - Flex This is the public Twilio REST API. NOTE: This class is auto generated by OpenAPI Generator. @@ -19,57 +19,58 @@ from twilio.base.version import Version -class UserInfoInstance(InstanceResource): +class ProvisioningStatusInstance(InstanceResource): + + class Status(object): + ACTIVE = "active" + IN_PROGRESS = "in-progress" + NOT_CONFIGURED = "not-configured" + FAILED = "failed" + """ - :ivar user_sid: The URL of the party that will create the token and sign it with its private key. - :ivar first_name: The first name of the end-user. - :ivar last_name: The last name of the end-user. - :ivar friendly_name: The friendly name of the end-user. - :ivar email: The end-user's preferred email address. - :ivar url: + :ivar status: + :ivar url: The absolute URL of the resource. """ def __init__(self, version: Version, payload: Dict[str, Any]): super().__init__(version) - self.user_sid: Optional[str] = payload.get("user_sid") - self.first_name: Optional[str] = payload.get("first_name") - self.last_name: Optional[str] = payload.get("last_name") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.email: Optional[str] = payload.get("email") + self.status: Optional["ProvisioningStatusInstance.Status"] = payload.get( + "status" + ) self.url: Optional[str] = payload.get("url") - self._context: Optional[UserInfoContext] = None + self._context: Optional[ProvisioningStatusContext] = None @property - def _proxy(self) -> "UserInfoContext": + def _proxy(self) -> "ProvisioningStatusContext": """ Generate an instance context for the instance, the context is capable of performing various actions. All instance actions are proxied to the context - :returns: UserInfoContext for this UserInfoInstance + :returns: ProvisioningStatusContext for this ProvisioningStatusInstance """ if self._context is None: - self._context = UserInfoContext( + self._context = ProvisioningStatusContext( self._version, ) return self._context - def fetch(self) -> "UserInfoInstance": + def fetch(self) -> "ProvisioningStatusInstance": """ - Fetch the UserInfoInstance + Fetch the ProvisioningStatusInstance - :returns: The fetched UserInfoInstance + :returns: The fetched ProvisioningStatusInstance """ return self._proxy.fetch() - async def fetch_async(self) -> "UserInfoInstance": + async def fetch_async(self) -> "ProvisioningStatusInstance": """ - Asynchronous coroutine to fetch the UserInfoInstance + Asynchronous coroutine to fetch the ProvisioningStatusInstance - :returns: The fetched UserInfoInstance + :returns: The fetched ProvisioningStatusInstance """ return await self._proxy.fetch_async() @@ -80,26 +81,27 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class UserInfoContext(InstanceContext): +class ProvisioningStatusContext(InstanceContext): + def __init__(self, version: Version): """ - Initialize the UserInfoContext + Initialize the ProvisioningStatusContext :param version: Version that contains the resource """ super().__init__(version) - self._uri = "/userinfo" + self._uri = "/account/provision/status" - def fetch(self) -> UserInfoInstance: + def fetch(self) -> ProvisioningStatusInstance: """ - Fetch the UserInfoInstance + Fetch the ProvisioningStatusInstance - :returns: The fetched UserInfoInstance + :returns: The fetched ProvisioningStatusInstance """ payload = self._version.fetch( @@ -107,17 +109,17 @@ def fetch(self) -> UserInfoInstance: uri=self._uri, ) - return UserInfoInstance( + return ProvisioningStatusInstance( self._version, payload, ) - async def fetch_async(self) -> UserInfoInstance: + async def fetch_async(self) -> ProvisioningStatusInstance: """ - Asynchronous coroutine to fetch the UserInfoInstance + Asynchronous coroutine to fetch the ProvisioningStatusInstance - :returns: The fetched UserInfoInstance + :returns: The fetched ProvisioningStatusInstance """ payload = await self._version.fetch_async( @@ -125,7 +127,7 @@ async def fetch_async(self) -> UserInfoInstance: uri=self._uri, ) - return UserInfoInstance( + return ProvisioningStatusInstance( self._version, payload, ) @@ -137,32 +139,33 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" + +class ProvisioningStatusList(ListResource): -class UserInfoList(ListResource): def __init__(self, version: Version): """ - Initialize the UserInfoList + Initialize the ProvisioningStatusList :param version: Version that contains the resource """ super().__init__(version) - def get(self) -> UserInfoContext: + def get(self) -> ProvisioningStatusContext: """ - Constructs a UserInfoContext + Constructs a ProvisioningStatusContext """ - return UserInfoContext(self._version) + return ProvisioningStatusContext(self._version) - def __call__(self) -> UserInfoContext: + def __call__(self) -> ProvisioningStatusContext: """ - Constructs a UserInfoContext + Constructs a ProvisioningStatusContext """ - return UserInfoContext(self._version) + return ProvisioningStatusContext(self._version) def __repr__(self) -> str: """ @@ -170,4 +173,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/flex_api/v1/web_channel.py b/twilio/rest/flex_api/v1/web_channel.py index 0ff675533f..ddf9c8f902 100644 --- a/twilio/rest/flex_api/v1/web_channel.py +++ b/twilio/rest/flex_api/v1/web_channel.py @@ -23,6 +23,7 @@ class WebChannelInstance(InstanceResource): + class ChatStatus(object): INACTIVE = "inactive" @@ -154,6 +155,7 @@ def __repr__(self) -> str: class WebChannelContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the WebChannelContext @@ -298,6 +300,7 @@ def __repr__(self) -> str: class WebChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebChannelInstance: """ Build an instance of WebChannelInstance @@ -316,6 +319,7 @@ def __repr__(self) -> str: class WebChannelList(ListResource): + def __init__(self, version: Version): """ Initialize the WebChannelList @@ -348,6 +352,7 @@ def create( :returns: The created WebChannelInstance """ + data = values.of( { "FlexFlowSid": flex_flow_sid, @@ -388,6 +393,7 @@ async def create_async( :returns: The created WebChannelInstance """ + data = values.of( { "FlexFlowSid": flex_flow_sid, diff --git a/twilio/rest/flex_api/v2/__init__.py b/twilio/rest/flex_api/v2/__init__.py index e48012241d..021615e19f 100644 --- a/twilio/rest/flex_api/v2/__init__.py +++ b/twilio/rest/flex_api/v2/__init__.py @@ -19,6 +19,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of FlexApi diff --git a/twilio/rest/flex_api/v2/web_channels.py b/twilio/rest/flex_api/v2/web_channels.py index d4c2e33968..13e5b28d7a 100644 --- a/twilio/rest/flex_api/v2/web_channels.py +++ b/twilio/rest/flex_api/v2/web_channels.py @@ -43,6 +43,7 @@ def __repr__(self) -> str: class WebChannelsList(ListResource): + def __init__(self, version: Version): """ Initialize the WebChannelsList @@ -71,6 +72,7 @@ def create( :returns: The created WebChannelsInstance """ + data = values.of( { "AddressSid": address_sid, @@ -105,6 +107,7 @@ async def create_async( :returns: The created WebChannelsInstance """ + data = values.of( { "AddressSid": address_sid, diff --git a/twilio/rest/frontline_api/FrontlineApiBase.py b/twilio/rest/frontline_api/FrontlineApiBase.py index 302854dc0c..d9dadc16e9 100644 --- a/twilio/rest/frontline_api/FrontlineApiBase.py +++ b/twilio/rest/frontline_api/FrontlineApiBase.py @@ -17,6 +17,7 @@ class FrontlineApiBase(Domain): + def __init__(self, twilio: Client): """ Initialize the FrontlineApi Domain diff --git a/twilio/rest/frontline_api/v1/__init__.py b/twilio/rest/frontline_api/v1/__init__.py index d2629dd5a0..610ed37194 100644 --- a/twilio/rest/frontline_api/v1/__init__.py +++ b/twilio/rest/frontline_api/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of FrontlineApi diff --git a/twilio/rest/frontline_api/v1/user.py b/twilio/rest/frontline_api/v1/user.py index 7c032ac5e1..b14fbd0989 100644 --- a/twilio/rest/frontline_api/v1/user.py +++ b/twilio/rest/frontline_api/v1/user.py @@ -21,6 +21,7 @@ class UserInstance(InstanceResource): + class StateType(object): ACTIVE = "active" DEACTIVATED = "deactivated" @@ -145,6 +146,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the UserContext @@ -277,6 +279,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version): """ Initialize the UserList diff --git a/twilio/rest/insights/InsightsBase.py b/twilio/rest/insights/InsightsBase.py index efe713ba03..458122cec7 100644 --- a/twilio/rest/insights/InsightsBase.py +++ b/twilio/rest/insights/InsightsBase.py @@ -17,6 +17,7 @@ class InsightsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Insights Domain diff --git a/twilio/rest/insights/v1/__init__.py b/twilio/rest/insights/v1/__init__.py index b5b6c44863..8f7d1946f0 100644 --- a/twilio/rest/insights/v1/__init__.py +++ b/twilio/rest/insights/v1/__init__.py @@ -23,6 +23,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Insights diff --git a/twilio/rest/insights/v1/call/__init__.py b/twilio/rest/insights/v1/call/__init__.py index 824793a6ae..ff628b7d06 100644 --- a/twilio/rest/insights/v1/call/__init__.py +++ b/twilio/rest/insights/v1/call/__init__.py @@ -117,6 +117,7 @@ def __repr__(self) -> str: class CallContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CallContext @@ -234,6 +235,7 @@ def __repr__(self) -> str: class CallList(ListResource): + def __init__(self, version: Version): """ Initialize the CallList diff --git a/twilio/rest/insights/v1/call/annotation.py b/twilio/rest/insights/v1/call/annotation.py index ddf1f829fc..0d3f7bb4f4 100644 --- a/twilio/rest/insights/v1/call/annotation.py +++ b/twilio/rest/insights/v1/call/annotation.py @@ -21,6 +21,7 @@ class AnnotationInstance(InstanceResource): + class AnsweredBy(object): UNKNOWN_ANSWERED_BY = "unknown_answered_by" HUMAN = "human" @@ -44,7 +45,7 @@ class ConnectivityIssue(object): :ivar call_score: Specifies the Call Score, if available. This is of type integer. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. :ivar comment: Specifies any comments pertaining to the call. Twilio does not treat this field as PII, so no PII should be included in comments. :ivar incident: Incident or support ticket associated with this call. The `incident` property is of type string with a maximum character limit of 100. Twilio does not treat this field as PII, so no PII should be included in `incident`. - :ivar url: The URL of this resource. + :ivar url: """ def __init__(self, version: Version, payload: Dict[str, Any], call_sid: str): @@ -184,6 +185,7 @@ def __repr__(self) -> str: class AnnotationContext(InstanceContext): + def __init__(self, version: Version, call_sid: str): """ Initialize the AnnotationContext @@ -342,6 +344,7 @@ def __repr__(self) -> str: class AnnotationList(ListResource): + def __init__(self, version: Version, call_sid: str): """ Initialize the AnnotationList diff --git a/twilio/rest/insights/v1/call/call_summary.py b/twilio/rest/insights/v1/call/call_summary.py index ce52583a13..0e256b36c8 100644 --- a/twilio/rest/insights/v1/call/call_summary.py +++ b/twilio/rest/insights/v1/call/call_summary.py @@ -22,6 +22,7 @@ class CallSummaryInstance(InstanceResource): + class AnsweredBy(object): UNKNOWN = "unknown" MACHINE_START = "machine_start" @@ -185,6 +186,7 @@ def __repr__(self) -> str: class CallSummaryContext(InstanceContext): + def __init__(self, version: Version, call_sid: str): """ Initialize the CallSummaryContext @@ -269,6 +271,7 @@ def __repr__(self) -> str: class CallSummaryList(ListResource): + def __init__(self, version: Version, call_sid: str): """ Initialize the CallSummaryList diff --git a/twilio/rest/insights/v1/call/event.py b/twilio/rest/insights/v1/call/event.py index fa118a7266..89734f110a 100644 --- a/twilio/rest/insights/v1/call/event.py +++ b/twilio/rest/insights/v1/call/event.py @@ -22,6 +22,7 @@ class EventInstance(InstanceResource): + class Level(object): UNKNOWN = "UNKNOWN" DEBUG = "DEBUG" @@ -80,6 +81,7 @@ def __repr__(self) -> str: class EventPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EventInstance: """ Build an instance of EventInstance @@ -100,6 +102,7 @@ def __repr__(self) -> str: class EventList(ListResource): + def __init__(self, version: Version, call_sid: str): """ Initialize the EventList diff --git a/twilio/rest/insights/v1/call/metric.py b/twilio/rest/insights/v1/call/metric.py index 5869527732..3cf9decc53 100644 --- a/twilio/rest/insights/v1/call/metric.py +++ b/twilio/rest/insights/v1/call/metric.py @@ -22,6 +22,7 @@ class MetricInstance(InstanceResource): + class StreamDirection(object): UNKNOWN = "unknown" INBOUND = "inbound" @@ -77,6 +78,7 @@ def __repr__(self) -> str: class MetricPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MetricInstance: """ Build an instance of MetricInstance @@ -97,6 +99,7 @@ def __repr__(self) -> str: class MetricList(ListResource): + def __init__(self, version: Version, call_sid: str): """ Initialize the MetricList diff --git a/twilio/rest/insights/v1/call_summaries.py b/twilio/rest/insights/v1/call_summaries.py index e7c27ea73d..78cd5b506e 100644 --- a/twilio/rest/insights/v1/call_summaries.py +++ b/twilio/rest/insights/v1/call_summaries.py @@ -23,6 +23,7 @@ class CallSummariesInstance(InstanceResource): + class AnsweredBy(object): UNKNOWN = "unknown" MACHINE_START = "machine_start" @@ -142,6 +143,7 @@ def __repr__(self) -> str: class CallSummariesPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CallSummariesInstance: """ Build an instance of CallSummariesInstance @@ -160,6 +162,7 @@ def __repr__(self) -> str: class CallSummariesList(ListResource): + def __init__(self, version: Version): """ Initialize the CallSummariesList diff --git a/twilio/rest/insights/v1/conference/__init__.py b/twilio/rest/insights/v1/conference/__init__.py index cd3203aa15..1ee8c09dc8 100644 --- a/twilio/rest/insights/v1/conference/__init__.py +++ b/twilio/rest/insights/v1/conference/__init__.py @@ -26,6 +26,7 @@ class ConferenceInstance(InstanceResource): + class ConferenceEndReason(object): LAST_PARTICIPANT_LEFT = "last_participant_left" CONFERENCE_ENDED_VIA_API = "conference_ended_via_api" @@ -212,6 +213,7 @@ def __repr__(self) -> str: class ConferenceContext(InstanceContext): + def __init__(self, version: Version, conference_sid: str): """ Initialize the ConferenceContext @@ -290,6 +292,7 @@ def __repr__(self) -> str: class ConferencePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConferenceInstance: """ Build an instance of ConferenceInstance @@ -308,6 +311,7 @@ def __repr__(self) -> str: class ConferenceList(ListResource): + def __init__(self, version: Version): """ Initialize the ConferenceList diff --git a/twilio/rest/insights/v1/conference/conference_participant.py b/twilio/rest/insights/v1/conference/conference_participant.py index 6489c50ed0..68faa690b3 100644 --- a/twilio/rest/insights/v1/conference/conference_participant.py +++ b/twilio/rest/insights/v1/conference/conference_participant.py @@ -23,6 +23,7 @@ class ConferenceParticipantInstance(InstanceResource): + class CallDirection(object): INBOUND = "inbound" OUTBOUND = "outbound" @@ -224,6 +225,7 @@ def __repr__(self) -> str: class ConferenceParticipantContext(InstanceContext): + def __init__(self, version: Version, conference_sid: str, participant_sid: str): """ Initialize the ConferenceParticipantContext @@ -318,6 +320,7 @@ def __repr__(self) -> str: class ConferenceParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConferenceParticipantInstance: """ Build an instance of ConferenceParticipantInstance @@ -338,6 +341,7 @@ def __repr__(self) -> str: class ConferenceParticipantList(ListResource): + def __init__(self, version: Version, conference_sid: str): """ Initialize the ConferenceParticipantList diff --git a/twilio/rest/insights/v1/room/__init__.py b/twilio/rest/insights/v1/room/__init__.py index 1730be8b34..7361018e23 100644 --- a/twilio/rest/insights/v1/room/__init__.py +++ b/twilio/rest/insights/v1/room/__init__.py @@ -24,6 +24,7 @@ class RoomInstance(InstanceResource): + class Codec(object): VP8 = "VP8" H264 = "H264" @@ -222,6 +223,7 @@ def __repr__(self) -> str: class RoomContext(InstanceContext): + def __init__(self, version: Version, room_sid: str): """ Initialize the RoomContext @@ -300,6 +302,7 @@ def __repr__(self) -> str: class RoomPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoomInstance: """ Build an instance of RoomInstance @@ -318,6 +321,7 @@ def __repr__(self) -> str: class RoomList(ListResource): + def __init__(self, version: Version): """ Initialize the RoomList diff --git a/twilio/rest/insights/v1/room/participant.py b/twilio/rest/insights/v1/room/participant.py index 7d7103af3a..0f6617f549 100644 --- a/twilio/rest/insights/v1/room/participant.py +++ b/twilio/rest/insights/v1/room/participant.py @@ -23,6 +23,7 @@ class ParticipantInstance(InstanceResource): + class Codec(object): VP8 = "VP8" H264 = "H264" @@ -161,6 +162,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, participant_sid: str): """ Initialize the ParticipantContext @@ -231,6 +233,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -251,6 +254,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, room_sid: str): """ Initialize the ParticipantList diff --git a/twilio/rest/insights/v1/setting.py b/twilio/rest/insights/v1/setting.py index 649fd001ae..f0bb5f60d8 100644 --- a/twilio/rest/insights/v1/setting.py +++ b/twilio/rest/insights/v1/setting.py @@ -133,6 +133,7 @@ def __repr__(self) -> str: class SettingContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the SettingContext @@ -266,6 +267,7 @@ def __repr__(self) -> str: class SettingList(ListResource): + def __init__(self, version: Version): """ Initialize the SettingList diff --git a/twilio/rest/intelligence/IntelligenceBase.py b/twilio/rest/intelligence/IntelligenceBase.py index 2cece972e4..0546bc15ae 100644 --- a/twilio/rest/intelligence/IntelligenceBase.py +++ b/twilio/rest/intelligence/IntelligenceBase.py @@ -17,6 +17,7 @@ class IntelligenceBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Intelligence Domain diff --git a/twilio/rest/intelligence/v2/__init__.py b/twilio/rest/intelligence/v2/__init__.py index 448b323e36..e20b125ced 100644 --- a/twilio/rest/intelligence/v2/__init__.py +++ b/twilio/rest/intelligence/v2/__init__.py @@ -20,6 +20,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Intelligence diff --git a/twilio/rest/intelligence/v2/service.py b/twilio/rest/intelligence/v2/service.py index fa27ee1a99..0761da5445 100644 --- a/twilio/rest/intelligence/v2/service.py +++ b/twilio/rest/intelligence/v2/service.py @@ -23,6 +23,7 @@ class ServiceInstance(InstanceResource): + class HttpMethod(object): GET = "GET" POST = "POST" @@ -33,7 +34,7 @@ class HttpMethod(object): :ivar auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. :ivar media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. :ivar auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :ivar date_created: The date that this Service was created, given in ISO 8601 format. :ivar date_updated: The date that this Service was updated, given in ISO 8601 format. :ivar friendly_name: A human readable description of this resource, up to 64 characters. @@ -147,7 +148,7 @@ def update( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -189,7 +190,7 @@ async def update_async( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -224,6 +225,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -319,7 +321,7 @@ def update( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -373,7 +375,7 @@ async def update_async( :param if_match: The If-Match HTTP request header :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. @@ -420,6 +422,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -438,6 +441,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -466,7 +470,7 @@ def create( :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. @@ -476,6 +480,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -515,7 +520,7 @@ async def create_async( :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. - :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. :param language_code: The default language code of the audio. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. @@ -525,6 +530,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/intelligence/v2/transcript/__init__.py b/twilio/rest/intelligence/v2/transcript/__init__.py index 4f4b3bb588..30b97f89bd 100644 --- a/twilio/rest/intelligence/v2/transcript/__init__.py +++ b/twilio/rest/intelligence/v2/transcript/__init__.py @@ -26,6 +26,7 @@ class TranscriptInstance(InstanceResource): + class Status(object): QUEUED = "queued" IN_PROGRESS = "in-progress" @@ -41,7 +42,7 @@ class Status(object): :ivar date_updated: The date that this Transcript was updated, given in ISO 8601 format. :ivar status: :ivar channel: Media Channel describing Transcript Source and Participant Mapping - :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition through using customer data to refine its speech recognition models. + :ivar data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :ivar language_code: The default language code of the audio. :ivar customer_key: :ivar media_start_time: The date that this Transcript's media was started, given in ISO 8601 format. @@ -166,6 +167,7 @@ def __repr__(self) -> str: class TranscriptContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the TranscriptContext @@ -294,6 +296,7 @@ def __repr__(self) -> str: class TranscriptPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TranscriptInstance: """ Build an instance of TranscriptInstance @@ -312,6 +315,7 @@ def __repr__(self) -> str: class TranscriptList(ListResource): + def __init__(self, version: Version): """ Initialize the TranscriptList @@ -340,6 +344,7 @@ def create( :returns: The created TranscriptInstance """ + data = values.of( { "ServiceSid": service_sid, @@ -374,6 +379,7 @@ async def create_async( :returns: The created TranscriptInstance """ + data = values.of( { "ServiceSid": service_sid, diff --git a/twilio/rest/intelligence/v2/transcript/media.py b/twilio/rest/intelligence/v2/transcript/media.py index 469d4a4f67..cb129b436a 100644 --- a/twilio/rest/intelligence/v2/transcript/media.py +++ b/twilio/rest/intelligence/v2/transcript/media.py @@ -95,6 +95,7 @@ def __repr__(self) -> str: class MediaContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the MediaContext @@ -171,6 +172,7 @@ def __repr__(self) -> str: class MediaList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the MediaList diff --git a/twilio/rest/intelligence/v2/transcript/operator_result.py b/twilio/rest/intelligence/v2/transcript/operator_result.py index 00e9cbae42..0865673329 100644 --- a/twilio/rest/intelligence/v2/transcript/operator_result.py +++ b/twilio/rest/intelligence/v2/transcript/operator_result.py @@ -22,6 +22,7 @@ class OperatorResultInstance(InstanceResource): + class OperatorType(object): CONVERSATION_CLASSIFY = "conversation_classify" UTTERANCE_CLASSIFY = "utterance_classify" @@ -42,6 +43,7 @@ class OperatorType(object): :ivar predicted_probability: Percentage of 'matching' class needed to consider a sentence matches. :ivar label_probabilities: The labels probabilities. This might be available on conversation classify model outputs. :ivar extract_results: List of text extraction results. This might be available on classify-extract model outputs. + :ivar text_generation_results: Output of a text generation operator for example Conversation Sumamary. :ivar transcript_sid: A 34 character string that uniquely identifies this Transcript. :ivar url: The URL of this resource. """ @@ -65,7 +67,7 @@ def __init__( payload.get("match_probability") ) self.normalized_result: Optional[str] = payload.get("normalized_result") - self.utterance_results: Optional[List[object]] = payload.get( + self.utterance_results: Optional[List[Dict[str, object]]] = payload.get( "utterance_results" ) self.utterance_match: Optional[bool] = payload.get("utterance_match") @@ -79,6 +81,9 @@ def __init__( self.extract_results: Optional[Dict[str, object]] = payload.get( "extract_results" ) + self.text_generation_results: Optional[Dict[str, object]] = payload.get( + "text_generation_results" + ) self.transcript_sid: Optional[str] = payload.get("transcript_sid") self.url: Optional[str] = payload.get("url") @@ -143,6 +148,7 @@ def __repr__(self) -> str: class OperatorResultContext(InstanceContext): + def __init__(self, version: Version, transcript_sid: str, operator_sid: str): """ Initialize the OperatorResultContext @@ -229,6 +235,7 @@ def __repr__(self) -> str: class OperatorResultPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> OperatorResultInstance: """ Build an instance of OperatorResultInstance @@ -249,6 +256,7 @@ def __repr__(self) -> str: class OperatorResultList(ListResource): + def __init__(self, version: Version, transcript_sid: str): """ Initialize the OperatorResultList diff --git a/twilio/rest/intelligence/v2/transcript/sentence.py b/twilio/rest/intelligence/v2/transcript/sentence.py index a85953b80e..f419135419 100644 --- a/twilio/rest/intelligence/v2/transcript/sentence.py +++ b/twilio/rest/intelligence/v2/transcript/sentence.py @@ -66,6 +66,7 @@ def __repr__(self) -> str: class SentencePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SentenceInstance: """ Build an instance of SentenceInstance @@ -86,6 +87,7 @@ def __repr__(self) -> str: class SentenceList(ListResource): + def __init__(self, version: Version, transcript_sid: str): """ Initialize the SentenceList diff --git a/twilio/rest/ip_messaging/IpMessagingBase.py b/twilio/rest/ip_messaging/IpMessagingBase.py index d9e063c308..752d41adce 100644 --- a/twilio/rest/ip_messaging/IpMessagingBase.py +++ b/twilio/rest/ip_messaging/IpMessagingBase.py @@ -18,6 +18,7 @@ class IpMessagingBase(Domain): + def __init__(self, twilio: Client): """ Initialize the IpMessaging Domain diff --git a/twilio/rest/ip_messaging/v1/__init__.py b/twilio/rest/ip_messaging/v1/__init__.py index 1fd53b76b1..d1f40c791f 100644 --- a/twilio/rest/ip_messaging/v1/__init__.py +++ b/twilio/rest/ip_messaging/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of IpMessaging diff --git a/twilio/rest/ip_messaging/v1/credential.py b/twilio/rest/ip_messaging/v1/credential.py index f7f847e832..01423f4900 100644 --- a/twilio/rest/ip_messaging/v1/credential.py +++ b/twilio/rest/ip_messaging/v1/credential.py @@ -23,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushService(object): GCM = "gcm" APN = "apn" @@ -184,6 +185,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -352,6 +354,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -370,6 +373,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList @@ -404,6 +408,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -447,6 +452,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/ip_messaging/v1/service/__init__.py b/twilio/rest/ip_messaging/v1/service/__init__.py index f70358dad5..8e080657b5 100644 --- a/twilio/rest/ip_messaging/v1/service/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/__init__.py @@ -527,6 +527,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -1023,6 +1024,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -1041,6 +1043,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -1060,6 +1063,7 @@ def create(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -1082,6 +1086,7 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v1/service/channel/__init__.py b/twilio/rest/ip_messaging/v1/service/channel/__init__.py index 343f744df7..ef469e97f2 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/channel/__init__.py @@ -26,6 +26,7 @@ class ChannelInstance(InstanceResource): + class ChannelType(object): PUBLIC = "public" PRIVATE = "private" @@ -211,6 +212,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ChannelContext @@ -418,6 +420,7 @@ def __repr__(self) -> str: class ChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelInstance: """ Build an instance of ChannelInstance @@ -438,6 +441,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ChannelList @@ -471,6 +475,7 @@ def create( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -507,6 +512,7 @@ async def create_async( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v1/service/channel/invite.py b/twilio/rest/ip_messaging/v1/service/channel/invite.py index b76f91facf..7078058a40 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v1/service/channel/invite.py @@ -132,6 +132,7 @@ def __repr__(self) -> str: class InviteContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the InviteContext @@ -232,6 +233,7 @@ def __repr__(self) -> str: class InvitePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InviteInstance: """ Build an instance of InviteInstance @@ -255,6 +257,7 @@ def __repr__(self) -> str: class InviteList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the InviteList @@ -286,6 +289,7 @@ def create( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, @@ -317,6 +321,7 @@ async def create_async( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/ip_messaging/v1/service/channel/member.py b/twilio/rest/ip_messaging/v1/service/channel/member.py index 4bc3827743..c52fde5a8e 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/member.py +++ b/twilio/rest/ip_messaging/v1/service/channel/member.py @@ -174,6 +174,7 @@ def __repr__(self) -> str: class MemberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MemberContext @@ -342,6 +343,7 @@ def __repr__(self) -> str: class MemberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MemberInstance: """ Build an instance of MemberInstance @@ -365,6 +367,7 @@ def __repr__(self) -> str: class MemberList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MemberList @@ -396,6 +399,7 @@ def create( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, @@ -427,6 +431,7 @@ async def create_async( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/ip_messaging/v1/service/channel/message.py b/twilio/rest/ip_messaging/v1/service/channel/message.py index c5e5973775..f9f2a2b1a6 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/message.py +++ b/twilio/rest/ip_messaging/v1/service/channel/message.py @@ -23,6 +23,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -178,6 +179,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MessageContext @@ -346,6 +348,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -369,6 +372,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MessageList @@ -404,6 +408,7 @@ def create( :returns: The created MessageInstance """ + data = values.of( { "Body": body, @@ -440,6 +445,7 @@ async def create_async( :returns: The created MessageInstance """ + data = values.of( { "Body": body, diff --git a/twilio/rest/ip_messaging/v1/service/role.py b/twilio/rest/ip_messaging/v1/service/role.py index 05234ed2ef..935a99e180 100644 --- a/twilio/rest/ip_messaging/v1/service/role.py +++ b/twilio/rest/ip_messaging/v1/service/role.py @@ -23,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CHANNEL = "channel" DEPLOYMENT = "deployment" @@ -155,6 +156,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the RoleContext @@ -301,6 +303,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -321,6 +324,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the RoleList @@ -349,6 +353,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -379,6 +384,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v1/service/user/__init__.py b/twilio/rest/ip_messaging/v1/service/user/__init__.py index 76888f9125..ef24fa776f 100644 --- a/twilio/rest/ip_messaging/v1/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/user/__init__.py @@ -189,6 +189,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the UserContext @@ -368,6 +369,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -388,6 +390,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the UserList @@ -421,6 +424,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -457,6 +461,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/ip_messaging/v1/service/user/user_channel.py b/twilio/rest/ip_messaging/v1/service/user/user_channel.py index 8286725e69..192aafb380 100644 --- a/twilio/rest/ip_messaging/v1/service/user/user_channel.py +++ b/twilio/rest/ip_messaging/v1/service/user/user_channel.py @@ -22,6 +22,7 @@ class UserChannelInstance(InstanceResource): + class ChannelStatus(object): JOINED = "joined" INVITED = "invited" @@ -74,6 +75,7 @@ def __repr__(self) -> str: class UserChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserChannelInstance: """ Build an instance of UserChannelInstance @@ -97,6 +99,7 @@ def __repr__(self) -> str: class UserChannelList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserChannelList diff --git a/twilio/rest/ip_messaging/v2/__init__.py b/twilio/rest/ip_messaging/v2/__init__.py index 966a35a441..6003c86b12 100644 --- a/twilio/rest/ip_messaging/v2/__init__.py +++ b/twilio/rest/ip_messaging/v2/__init__.py @@ -20,6 +20,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of IpMessaging diff --git a/twilio/rest/ip_messaging/v2/credential.py b/twilio/rest/ip_messaging/v2/credential.py index 93f54df5f1..f81892c742 100644 --- a/twilio/rest/ip_messaging/v2/credential.py +++ b/twilio/rest/ip_messaging/v2/credential.py @@ -23,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushService(object): GCM = "gcm" APN = "apn" @@ -184,6 +185,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -352,6 +354,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -370,6 +373,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList @@ -404,6 +408,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -447,6 +452,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/ip_messaging/v2/service/__init__.py b/twilio/rest/ip_messaging/v2/service/__init__.py index 8bea3947cc..227789bab8 100644 --- a/twilio/rest/ip_messaging/v2/service/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/__init__.py @@ -409,6 +409,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -784,6 +785,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -802,6 +804,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -821,6 +824,7 @@ def create(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -843,6 +847,7 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v2/service/binding.py b/twilio/rest/ip_messaging/v2/service/binding.py index dcc7e93d76..24c4f65a4b 100644 --- a/twilio/rest/ip_messaging/v2/service/binding.py +++ b/twilio/rest/ip_messaging/v2/service/binding.py @@ -23,6 +23,7 @@ class BindingInstance(InstanceResource): + class BindingType(object): GCM = "gcm" APN = "apn" @@ -140,6 +141,7 @@ def __repr__(self) -> str: class BindingContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the BindingContext @@ -232,6 +234,7 @@ def __repr__(self) -> str: class BindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BindingInstance: """ Build an instance of BindingInstance @@ -252,6 +255,7 @@ def __repr__(self) -> str: class BindingList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the BindingList diff --git a/twilio/rest/ip_messaging/v2/service/channel/__init__.py b/twilio/rest/ip_messaging/v2/service/channel/__init__.py index 1eda6522f8..c4e03d4536 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/channel/__init__.py @@ -27,6 +27,7 @@ class ChannelInstance(InstanceResource): + class ChannelType(object): PUBLIC = "public" PRIVATE = "private" @@ -267,6 +268,7 @@ def __repr__(self) -> str: class ChannelContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ChannelContext @@ -540,6 +542,7 @@ def __repr__(self) -> str: class ChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelInstance: """ Build an instance of ChannelInstance @@ -560,6 +563,7 @@ def __repr__(self) -> str: class ChannelList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ChannelList @@ -603,6 +607,7 @@ def create( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -619,6 +624,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -654,6 +660,7 @@ async def create_async( :returns: The created ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -670,6 +677,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/ip_messaging/v2/service/channel/invite.py b/twilio/rest/ip_messaging/v2/service/channel/invite.py index ab862e72cd..0f863d70f0 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v2/service/channel/invite.py @@ -132,6 +132,7 @@ def __repr__(self) -> str: class InviteContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the InviteContext @@ -232,6 +233,7 @@ def __repr__(self) -> str: class InvitePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InviteInstance: """ Build an instance of InviteInstance @@ -255,6 +257,7 @@ def __repr__(self) -> str: class InviteList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the InviteList @@ -286,6 +289,7 @@ def create( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, @@ -317,6 +321,7 @@ async def create_async( :returns: The created InviteInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/ip_messaging/v2/service/channel/member.py b/twilio/rest/ip_messaging/v2/service/channel/member.py index 9c50f8d56a..5de4520ed3 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/member.py +++ b/twilio/rest/ip_messaging/v2/service/channel/member.py @@ -23,6 +23,7 @@ class MemberInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -230,6 +231,7 @@ def __repr__(self) -> str: class MemberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MemberContext @@ -460,6 +462,7 @@ def __repr__(self) -> str: class MemberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MemberInstance: """ Build an instance of MemberInstance @@ -483,6 +486,7 @@ def __repr__(self) -> str: class MemberList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MemberList @@ -530,6 +534,7 @@ def create( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, @@ -548,6 +553,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -586,6 +592,7 @@ async def create_async( :returns: The created MemberInstance """ + data = values.of( { "Identity": identity, @@ -604,6 +611,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/ip_messaging/v2/service/channel/message.py b/twilio/rest/ip_messaging/v2/service/channel/message.py index d0d5ceca73..057571c2ab 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/message.py +++ b/twilio/rest/ip_messaging/v2/service/channel/message.py @@ -23,6 +23,7 @@ class MessageInstance(InstanceResource): + class OrderType(object): ASC = "asc" DESC = "desc" @@ -238,6 +239,7 @@ def __repr__(self) -> str: class MessageContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the MessageContext @@ -464,6 +466,7 @@ def __repr__(self) -> str: class MessagePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: """ Build an instance of MessageInstance @@ -487,6 +490,7 @@ def __repr__(self) -> str: class MessageList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the MessageList @@ -534,6 +538,7 @@ def create( :returns: The created MessageInstance """ + data = values.of( { "From": from_, @@ -550,6 +555,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -588,6 +594,7 @@ async def create_async( :returns: The created MessageInstance """ + data = values.of( { "From": from_, @@ -604,6 +611,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/ip_messaging/v2/service/channel/webhook.py b/twilio/rest/ip_messaging/v2/service/channel/webhook.py index bf02e7c634..633acfd51f 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/webhook.py +++ b/twilio/rest/ip_messaging/v2/service/channel/webhook.py @@ -23,6 +23,7 @@ class WebhookInstance(InstanceResource): + class Method(object): GET = "GET" POST = "POST" @@ -199,6 +200,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, channel_sid: str, sid: str): """ Initialize the WebhookContext @@ -399,6 +401,7 @@ def __repr__(self) -> str: class WebhookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: """ Build an instance of WebhookInstance @@ -422,6 +425,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, service_sid: str, channel_sid: str): """ Initialize the WebhookList @@ -465,6 +469,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "Type": type, @@ -517,6 +522,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/ip_messaging/v2/service/role.py b/twilio/rest/ip_messaging/v2/service/role.py index bb816fd5f0..91fc1af939 100644 --- a/twilio/rest/ip_messaging/v2/service/role.py +++ b/twilio/rest/ip_messaging/v2/service/role.py @@ -23,6 +23,7 @@ class RoleInstance(InstanceResource): + class RoleType(object): CHANNEL = "channel" DEPLOYMENT = "deployment" @@ -155,6 +156,7 @@ def __repr__(self) -> str: class RoleContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the RoleContext @@ -301,6 +303,7 @@ def __repr__(self) -> str: class RolePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoleInstance: """ Build an instance of RoleInstance @@ -321,6 +324,7 @@ def __repr__(self) -> str: class RoleList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the RoleList @@ -349,6 +353,7 @@ def create( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -379,6 +384,7 @@ async def create_async( :returns: The created RoleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/ip_messaging/v2/service/user/__init__.py b/twilio/rest/ip_messaging/v2/service/user/__init__.py index 6d87f2b713..1b3ba1b391 100644 --- a/twilio/rest/ip_messaging/v2/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/user/__init__.py @@ -25,6 +25,7 @@ class UserInstance(InstanceResource): + class WebhookEnabledType(object): TRUE = "true" FALSE = "false" @@ -211,6 +212,7 @@ def __repr__(self) -> str: class UserContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the UserContext @@ -418,6 +420,7 @@ def __repr__(self) -> str: class UserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: """ Build an instance of UserInstance @@ -438,6 +441,7 @@ def __repr__(self) -> str: class UserList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the UserList @@ -475,6 +479,7 @@ def create( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -488,6 +493,7 @@ def create( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -517,6 +523,7 @@ async def create_async( :returns: The created UserInstance """ + data = values.of( { "Identity": identity, @@ -530,6 +537,7 @@ async def create_async( "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, } ) + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/ip_messaging/v2/service/user/user_binding.py b/twilio/rest/ip_messaging/v2/service/user/user_binding.py index 9ff3bb9e04..575a295cbb 100644 --- a/twilio/rest/ip_messaging/v2/service/user/user_binding.py +++ b/twilio/rest/ip_messaging/v2/service/user/user_binding.py @@ -23,6 +23,7 @@ class UserBindingInstance(InstanceResource): + class BindingType(object): GCM = "gcm" APN = "apn" @@ -143,6 +144,7 @@ def __repr__(self) -> str: class UserBindingContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, user_sid: str, sid: str): """ Initialize the UserBindingContext @@ -241,6 +243,7 @@ def __repr__(self) -> str: class UserBindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserBindingInstance: """ Build an instance of UserBindingInstance @@ -264,6 +267,7 @@ def __repr__(self) -> str: class UserBindingList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserBindingList diff --git a/twilio/rest/ip_messaging/v2/service/user/user_channel.py b/twilio/rest/ip_messaging/v2/service/user/user_channel.py index cb7f1a4fcd..d89e6cb80d 100644 --- a/twilio/rest/ip_messaging/v2/service/user/user_channel.py +++ b/twilio/rest/ip_messaging/v2/service/user/user_channel.py @@ -23,6 +23,7 @@ class UserChannelInstance(InstanceResource): + class ChannelStatus(object): JOINED = "joined" INVITED = "invited" @@ -193,6 +194,7 @@ def __repr__(self) -> str: class UserChannelContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, user_sid: str, channel_sid: str ): @@ -377,6 +379,7 @@ def __repr__(self) -> str: class UserChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UserChannelInstance: """ Build an instance of UserChannelInstance @@ -400,6 +403,7 @@ def __repr__(self) -> str: class UserChannelList(ListResource): + def __init__(self, version: Version, service_sid: str, user_sid: str): """ Initialize the UserChannelList diff --git a/twilio/rest/lookups/LookupsBase.py b/twilio/rest/lookups/LookupsBase.py index fe3aa2aa6d..e24f8dc611 100644 --- a/twilio/rest/lookups/LookupsBase.py +++ b/twilio/rest/lookups/LookupsBase.py @@ -18,6 +18,7 @@ class LookupsBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Lookups Domain diff --git a/twilio/rest/lookups/v1/__init__.py b/twilio/rest/lookups/v1/__init__.py index 82f17cc04f..72204da366 100644 --- a/twilio/rest/lookups/v1/__init__.py +++ b/twilio/rest/lookups/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Lookups diff --git a/twilio/rest/lookups/v1/phone_number.py b/twilio/rest/lookups/v1/phone_number.py index b5d8c83515..fe521c73e9 100644 --- a/twilio/rest/lookups/v1/phone_number.py +++ b/twilio/rest/lookups/v1/phone_number.py @@ -126,6 +126,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, phone_number: str): """ Initialize the PhoneNumberContext @@ -224,6 +225,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version): """ Initialize the PhoneNumberList diff --git a/twilio/rest/lookups/v2/__init__.py b/twilio/rest/lookups/v2/__init__.py index 1cea8ab0b2..d795aea168 100644 --- a/twilio/rest/lookups/v2/__init__.py +++ b/twilio/rest/lookups/v2/__init__.py @@ -19,6 +19,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Lookups diff --git a/twilio/rest/lookups/v2/phone_number.py b/twilio/rest/lookups/v2/phone_number.py index f72f112f24..97ef39b940 100644 --- a/twilio/rest/lookups/v2/phone_number.py +++ b/twilio/rest/lookups/v2/phone_number.py @@ -21,6 +21,7 @@ class PhoneNumberInstance(InstanceResource): + class ValidationError(object): TOO_SHORT = "TOO_SHORT" TOO_LONG = "TOO_LONG" @@ -218,6 +219,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, phone_number: str): """ Initialize the PhoneNumberContext @@ -370,6 +372,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version): """ Initialize the PhoneNumberList diff --git a/twilio/rest/media/MediaBase.py b/twilio/rest/media/MediaBase.py index 28c5e37a00..6581eb5d09 100644 --- a/twilio/rest/media/MediaBase.py +++ b/twilio/rest/media/MediaBase.py @@ -17,6 +17,7 @@ class MediaBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Media Domain diff --git a/twilio/rest/media/v1/__init__.py b/twilio/rest/media/v1/__init__.py index cca96fc012..3cef1df9b2 100644 --- a/twilio/rest/media/v1/__init__.py +++ b/twilio/rest/media/v1/__init__.py @@ -21,6 +21,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Media diff --git a/twilio/rest/media/v1/media_processor.py b/twilio/rest/media/v1/media_processor.py index a55c80db96..7f1d2825b1 100644 --- a/twilio/rest/media/v1/media_processor.py +++ b/twilio/rest/media/v1/media_processor.py @@ -23,6 +23,7 @@ class MediaProcessorInstance(InstanceResource): + class Order(object): ASC = "asc" DESC = "desc" @@ -153,6 +154,7 @@ def __repr__(self) -> str: class MediaProcessorContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the MediaProcessorContext @@ -265,6 +267,7 @@ def __repr__(self) -> str: class MediaProcessorPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MediaProcessorInstance: """ Build an instance of MediaProcessorInstance @@ -283,6 +286,7 @@ def __repr__(self) -> str: class MediaProcessorList(ListResource): + def __init__(self, version: Version): """ Initialize the MediaProcessorList @@ -315,6 +319,7 @@ def create( :returns: The created MediaProcessorInstance """ + data = values.of( { "Extension": extension, @@ -355,6 +360,7 @@ async def create_async( :returns: The created MediaProcessorInstance """ + data = values.of( { "Extension": extension, diff --git a/twilio/rest/media/v1/media_recording.py b/twilio/rest/media/v1/media_recording.py index 837845306b..fb916e5278 100644 --- a/twilio/rest/media/v1/media_recording.py +++ b/twilio/rest/media/v1/media_recording.py @@ -23,6 +23,7 @@ class MediaRecordingInstance(InstanceResource): + class Format(object): MP4 = "mp4" WEBM = "webm" @@ -149,6 +150,7 @@ def __repr__(self) -> str: class MediaRecordingContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the MediaRecordingContext @@ -237,6 +239,7 @@ def __repr__(self) -> str: class MediaRecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MediaRecordingInstance: """ Build an instance of MediaRecordingInstance @@ -255,6 +258,7 @@ def __repr__(self) -> str: class MediaRecordingList(ListResource): + def __init__(self, version: Version): """ Initialize the MediaRecordingList diff --git a/twilio/rest/media/v1/player_streamer/__init__.py b/twilio/rest/media/v1/player_streamer/__init__.py index e25fc3f4af..6ea0889fc3 100644 --- a/twilio/rest/media/v1/player_streamer/__init__.py +++ b/twilio/rest/media/v1/player_streamer/__init__.py @@ -24,6 +24,7 @@ class PlayerStreamerInstance(InstanceResource): + class EndedReason(object): ENDED_VIA_API = "ended-via-api" MAX_DURATION_EXCEEDED = "max-duration-exceeded" @@ -170,6 +171,7 @@ def __repr__(self) -> str: class PlayerStreamerContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the PlayerStreamerContext @@ -296,6 +298,7 @@ def __repr__(self) -> str: class PlayerStreamerPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PlayerStreamerInstance: """ Build an instance of PlayerStreamerInstance @@ -314,6 +317,7 @@ def __repr__(self) -> str: class PlayerStreamerList(ListResource): + def __init__(self, version: Version): """ Initialize the PlayerStreamerList @@ -342,6 +346,7 @@ def create( :returns: The created PlayerStreamerInstance """ + data = values.of( { "Video": video, @@ -376,6 +381,7 @@ async def create_async( :returns: The created PlayerStreamerInstance """ + data = values.of( { "Video": video, diff --git a/twilio/rest/media/v1/player_streamer/playback_grant.py b/twilio/rest/media/v1/player_streamer/playback_grant.py index 2aa42efade..a4cdbb4026 100644 --- a/twilio/rest/media/v1/player_streamer/playback_grant.py +++ b/twilio/rest/media/v1/player_streamer/playback_grant.py @@ -126,6 +126,7 @@ def __repr__(self) -> str: class PlaybackGrantContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the PlaybackGrantContext @@ -240,6 +241,7 @@ def __repr__(self) -> str: class PlaybackGrantList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the PlaybackGrantList diff --git a/twilio/rest/messaging/MessagingBase.py b/twilio/rest/messaging/MessagingBase.py index ea6b0dd0a5..4fff74d914 100644 --- a/twilio/rest/messaging/MessagingBase.py +++ b/twilio/rest/messaging/MessagingBase.py @@ -17,6 +17,7 @@ class MessagingBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Messaging Domain diff --git a/twilio/rest/messaging/v1/__init__.py b/twilio/rest/messaging/v1/__init__.py index 20ce090da5..6262dfe938 100644 --- a/twilio/rest/messaging/v1/__init__.py +++ b/twilio/rest/messaging/v1/__init__.py @@ -35,6 +35,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Messaging diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index 54be98b15a..5c6dbc8246 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -27,6 +27,7 @@ class BrandRegistrationInstance(InstanceResource): + class BrandFeedback(object): TAX_ID = "TAX_ID" STOCK_SYMBOL = "STOCK_SYMBOL" @@ -195,6 +196,7 @@ def __repr__(self) -> str: class BrandRegistrationContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the BrandRegistrationContext @@ -324,6 +326,7 @@ def __repr__(self) -> str: class BrandRegistrationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BrandRegistrationInstance: """ Build an instance of BrandRegistrationInstance @@ -342,6 +345,7 @@ def __repr__(self) -> str: class BrandRegistrationList(ListResource): + def __init__(self, version: Version): """ Initialize the BrandRegistrationList @@ -372,6 +376,7 @@ def create( :returns: The created BrandRegistrationInstance """ + data = values.of( { "CustomerProfileBundleSid": customer_profile_bundle_sid, @@ -409,6 +414,7 @@ async def create_async( :returns: The created BrandRegistrationInstance """ + data = values.of( { "CustomerProfileBundleSid": customer_profile_bundle_sid, diff --git a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py index 676d116608..20ce245b37 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py @@ -50,6 +50,7 @@ def __repr__(self) -> str: class BrandRegistrationOtpList(ListResource): + def __init__(self, version: Version, brand_registration_sid: str): """ Initialize the BrandRegistrationOtpList diff --git a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py index 6517d08605..c801cb12b4 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py @@ -23,6 +23,7 @@ class BrandVettingInstance(InstanceResource): + class VettingProvider(object): CAMPAIGN_VERIFY = "campaign-verify" @@ -116,6 +117,7 @@ def __repr__(self) -> str: class BrandVettingContext(InstanceContext): + def __init__(self, version: Version, brand_sid: str, brand_vetting_sid: str): """ Initialize the BrandVettingContext @@ -188,6 +190,7 @@ def __repr__(self) -> str: class BrandVettingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BrandVettingInstance: """ Build an instance of BrandVettingInstance @@ -208,6 +211,7 @@ def __repr__(self) -> str: class BrandVettingList(ListResource): + def __init__(self, version: Version, brand_sid: str): """ Initialize the BrandVettingList @@ -239,6 +243,7 @@ def create( :returns: The created BrandVettingInstance """ + data = values.of( { "VettingProvider": vetting_provider, @@ -269,6 +274,7 @@ async def create_async( :returns: The created BrandVettingInstance """ + data = values.of( { "VettingProvider": vetting_provider, diff --git a/twilio/rest/messaging/v1/deactivations.py b/twilio/rest/messaging/v1/deactivations.py index 9081be42a3..6616d87df5 100644 --- a/twilio/rest/messaging/v1/deactivations.py +++ b/twilio/rest/messaging/v1/deactivations.py @@ -86,6 +86,7 @@ def __repr__(self) -> str: class DeactivationsContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the DeactivationsContext @@ -155,6 +156,7 @@ def __repr__(self) -> str: class DeactivationsList(ListResource): + def __init__(self, version: Version): """ Initialize the DeactivationsList diff --git a/twilio/rest/messaging/v1/domain_certs.py b/twilio/rest/messaging/v1/domain_certs.py index e5586d238c..3acc8a18ff 100644 --- a/twilio/rest/messaging/v1/domain_certs.py +++ b/twilio/rest/messaging/v1/domain_certs.py @@ -149,6 +149,7 @@ def __repr__(self) -> str: class DomainCertsContext(InstanceContext): + def __init__(self, version: Version, domain_sid: str): """ Initialize the DomainCertsContext @@ -287,6 +288,7 @@ def __repr__(self) -> str: class DomainCertsList(ListResource): + def __init__(self, version: Version): """ Initialize the DomainCertsList diff --git a/twilio/rest/messaging/v1/domain_config.py b/twilio/rest/messaging/v1/domain_config.py index 048ad79529..4889827a60 100644 --- a/twilio/rest/messaging/v1/domain_config.py +++ b/twilio/rest/messaging/v1/domain_config.py @@ -153,6 +153,7 @@ def __repr__(self) -> str: class DomainConfigContext(InstanceContext): + def __init__(self, version: Version, domain_sid: str): """ Initialize the DomainConfigContext @@ -291,6 +292,7 @@ def __repr__(self) -> str: class DomainConfigList(ListResource): + def __init__(self, version: Version): """ Initialize the DomainConfigList diff --git a/twilio/rest/messaging/v1/domain_config_messaging_service.py b/twilio/rest/messaging/v1/domain_config_messaging_service.py index 864e487bd4..178ebd544e 100644 --- a/twilio/rest/messaging/v1/domain_config_messaging_service.py +++ b/twilio/rest/messaging/v1/domain_config_messaging_service.py @@ -108,6 +108,7 @@ def __repr__(self) -> str: class DomainConfigMessagingServiceContext(InstanceContext): + def __init__(self, version: Version, messaging_service_sid: str): """ Initialize the DomainConfigMessagingServiceContext @@ -176,6 +177,7 @@ def __repr__(self) -> str: class DomainConfigMessagingServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the DomainConfigMessagingServiceList diff --git a/twilio/rest/messaging/v1/external_campaign.py b/twilio/rest/messaging/v1/external_campaign.py index a57261c5a0..b70d8a4ee1 100644 --- a/twilio/rest/messaging/v1/external_campaign.py +++ b/twilio/rest/messaging/v1/external_campaign.py @@ -52,6 +52,7 @@ def __repr__(self) -> str: class ExternalCampaignList(ListResource): + def __init__(self, version: Version): """ Initialize the ExternalCampaignList @@ -74,6 +75,7 @@ def create( :returns: The created ExternalCampaignInstance """ + data = values.of( { "CampaignId": campaign_id, @@ -100,6 +102,7 @@ async def create_async( :returns: The created ExternalCampaignInstance """ + data = values.of( { "CampaignId": campaign_id, diff --git a/twilio/rest/messaging/v1/linkshortening_messaging_service.py b/twilio/rest/messaging/v1/linkshortening_messaging_service.py index 8c1475da99..94ebfa6173 100644 --- a/twilio/rest/messaging/v1/linkshortening_messaging_service.py +++ b/twilio/rest/messaging/v1/linkshortening_messaging_service.py @@ -112,6 +112,7 @@ def __repr__(self) -> str: class LinkshorteningMessagingServiceContext(InstanceContext): + def __init__(self, version: Version, domain_sid: str, messaging_service_sid: str): """ Initialize the LinkshorteningMessagingServiceContext @@ -206,6 +207,7 @@ def __repr__(self) -> str: class LinkshorteningMessagingServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the LinkshorteningMessagingServiceList diff --git a/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py b/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py index 1ec176e0c6..a1252d2b35 100644 --- a/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py +++ b/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py @@ -94,6 +94,7 @@ def __repr__(self) -> str: class LinkshorteningMessagingServiceDomainAssociationContext(InstanceContext): + def __init__(self, version: Version, messaging_service_sid: str): """ Initialize the LinkshorteningMessagingServiceDomainAssociationContext @@ -166,6 +167,7 @@ def __repr__(self) -> str: class LinkshorteningMessagingServiceDomainAssociationList(ListResource): + def __init__(self, version: Version): """ Initialize the LinkshorteningMessagingServiceDomainAssociationList diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 24d7075794..3695b744f7 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -31,6 +31,7 @@ class ServiceInstance(InstanceResource): + class ScanMessageContent(object): INHERIT = "inherit" ENABLE = "enable" @@ -340,6 +341,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -651,6 +653,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -669,6 +672,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -723,6 +727,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -795,6 +800,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/messaging/v1/service/alpha_sender.py b/twilio/rest/messaging/v1/service/alpha_sender.py index 77a1e4e374..38d2d0d5e9 100644 --- a/twilio/rest/messaging/v1/service/alpha_sender.py +++ b/twilio/rest/messaging/v1/service/alpha_sender.py @@ -125,6 +125,7 @@ def __repr__(self) -> str: class AlphaSenderContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the AlphaSenderContext @@ -219,6 +220,7 @@ def __repr__(self) -> str: class AlphaSenderPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AlphaSenderInstance: """ Build an instance of AlphaSenderInstance @@ -239,6 +241,7 @@ def __repr__(self) -> str: class AlphaSenderList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the AlphaSenderList @@ -263,6 +266,7 @@ def create(self, alpha_sender: str) -> AlphaSenderInstance: :returns: The created AlphaSenderInstance """ + data = values.of( { "AlphaSender": alpha_sender, @@ -287,6 +291,7 @@ async def create_async(self, alpha_sender: str) -> AlphaSenderInstance: :returns: The created AlphaSenderInstance """ + data = values.of( { "AlphaSender": alpha_sender, diff --git a/twilio/rest/messaging/v1/service/channel_sender.py b/twilio/rest/messaging/v1/service/channel_sender.py index c165e64d62..a8de3d0cf6 100644 --- a/twilio/rest/messaging/v1/service/channel_sender.py +++ b/twilio/rest/messaging/v1/service/channel_sender.py @@ -32,7 +32,7 @@ class ChannelSenderInstance(InstanceResource): :ivar country_code: The 2-character [ISO Country Code](https://www.iso.org/iso-3166-country-codes.html) of the number. :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar url: + :ivar url: The absolute URL of the ChannelSender resource. """ def __init__( @@ -109,6 +109,7 @@ def __repr__(self) -> str: class ChannelSenderContext(InstanceContext): + def __init__(self, version: Version, messaging_service_sid: str, sid: str): """ Initialize the ChannelSenderContext @@ -179,6 +180,7 @@ def __repr__(self) -> str: class ChannelSenderPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChannelSenderInstance: """ Build an instance of ChannelSenderInstance @@ -201,6 +203,7 @@ def __repr__(self) -> str: class ChannelSenderList(ListResource): + def __init__(self, version: Version, messaging_service_sid: str): """ Initialize the ChannelSenderList diff --git a/twilio/rest/messaging/v1/service/phone_number.py b/twilio/rest/messaging/v1/service/phone_number.py index 4252b40b17..8b0b4c0900 100644 --- a/twilio/rest/messaging/v1/service/phone_number.py +++ b/twilio/rest/messaging/v1/service/phone_number.py @@ -127,6 +127,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the PhoneNumberContext @@ -221,6 +222,7 @@ def __repr__(self) -> str: class PhoneNumberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PhoneNumberInstance: """ Build an instance of PhoneNumberInstance @@ -241,6 +243,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the PhoneNumberList @@ -265,6 +268,7 @@ def create(self, phone_number_sid: str) -> PhoneNumberInstance: :returns: The created PhoneNumberInstance """ + data = values.of( { "PhoneNumberSid": phone_number_sid, @@ -289,6 +293,7 @@ async def create_async(self, phone_number_sid: str) -> PhoneNumberInstance: :returns: The created PhoneNumberInstance """ + data = values.of( { "PhoneNumberSid": phone_number_sid, diff --git a/twilio/rest/messaging/v1/service/short_code.py b/twilio/rest/messaging/v1/service/short_code.py index ca3b0d749c..6537875891 100644 --- a/twilio/rest/messaging/v1/service/short_code.py +++ b/twilio/rest/messaging/v1/service/short_code.py @@ -127,6 +127,7 @@ def __repr__(self) -> str: class ShortCodeContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ShortCodeContext @@ -219,6 +220,7 @@ def __repr__(self) -> str: class ShortCodePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ShortCodeInstance: """ Build an instance of ShortCodeInstance @@ -239,6 +241,7 @@ def __repr__(self) -> str: class ShortCodeList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ShortCodeList @@ -263,6 +266,7 @@ def create(self, short_code_sid: str) -> ShortCodeInstance: :returns: The created ShortCodeInstance """ + data = values.of( { "ShortCodeSid": short_code_sid, @@ -287,6 +291,7 @@ async def create_async(self, short_code_sid: str) -> ShortCodeInstance: :returns: The created ShortCodeInstance """ + data = values.of( { "ShortCodeSid": short_code_sid, diff --git a/twilio/rest/messaging/v1/service/us_app_to_person.py b/twilio/rest/messaging/v1/service/us_app_to_person.py index 6cae9d709b..cc23f0caf5 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person.py @@ -33,6 +33,9 @@ class UsAppToPersonInstance(InstanceResource): :ivar us_app_to_person_usecase: A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING, SOLE_PROPRIETOR...]. SOLE_PROPRIETOR campaign use cases can only be created by SOLE_PROPRIETOR Brands, and there can only be one SOLE_PROPRIETOR campaign created per SOLE_PROPRIETOR Brand. :ivar has_embedded_links: Indicate that this SMS campaign will send messages that contain links. :ivar has_embedded_phone: Indicates that this SMS campaign will send messages that contain phone numbers. + :ivar subscriber_opt_in: A boolean that specifies whether campaign has Subscriber Optin or not. + :ivar age_gated: A boolean that specifies whether campaign is age gated or not. + :ivar direct_lending: A boolean that specifies whether campaign allows direct lending or not. :ivar campaign_status: Campaign status. Examples: IN_PROGRESS, VERIFIED, FAILED. :ivar campaign_id: The Campaign Registry (TCR) Campaign ID. :ivar is_externally_registered: Indicates whether the campaign was registered externally or not. @@ -73,6 +76,9 @@ def __init__( ) self.has_embedded_links: Optional[bool] = payload.get("has_embedded_links") self.has_embedded_phone: Optional[bool] = payload.get("has_embedded_phone") + self.subscriber_opt_in: Optional[bool] = payload.get("subscriber_opt_in") + self.age_gated: Optional[bool] = payload.get("age_gated") + self.direct_lending: Optional[bool] = payload.get("direct_lending") self.campaign_status: Optional[str] = payload.get("campaign_status") self.campaign_id: Optional[str] = payload.get("campaign_id") self.is_externally_registered: Optional[bool] = payload.get( @@ -94,7 +100,7 @@ def __init__( ) self.url: Optional[str] = payload.get("url") self.mock: Optional[bool] = payload.get("mock") - self.errors: Optional[List[object]] = payload.get("errors") + self.errors: Optional[List[Dict[str, object]]] = payload.get("errors") self._solution = { "messaging_service_sid": messaging_service_sid, @@ -154,6 +160,72 @@ async def fetch_async(self) -> "UsAppToPersonInstance": """ return await self._proxy.fetch_async() + def update( + self, + has_embedded_links: bool, + has_embedded_phone: bool, + message_samples: List[str], + message_flow: str, + description: str, + age_gated: bool, + direct_lending: bool, + ) -> "UsAppToPersonInstance": + """ + Update the UsAppToPersonInstance + + :param has_embedded_links: Indicates that this SMS campaign will send messages that contain links. + :param has_embedded_phone: Indicates that this SMS campaign will send messages that contain phone numbers. + :param message_samples: An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + :param message_flow: Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + :param description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + :param age_gated: A boolean that specifies whether campaign requires age gate for federally legal content. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. + + :returns: The updated UsAppToPersonInstance + """ + return self._proxy.update( + has_embedded_links=has_embedded_links, + has_embedded_phone=has_embedded_phone, + message_samples=message_samples, + message_flow=message_flow, + description=description, + age_gated=age_gated, + direct_lending=direct_lending, + ) + + async def update_async( + self, + has_embedded_links: bool, + has_embedded_phone: bool, + message_samples: List[str], + message_flow: str, + description: str, + age_gated: bool, + direct_lending: bool, + ) -> "UsAppToPersonInstance": + """ + Asynchronous coroutine to update the UsAppToPersonInstance + + :param has_embedded_links: Indicates that this SMS campaign will send messages that contain links. + :param has_embedded_phone: Indicates that this SMS campaign will send messages that contain phone numbers. + :param message_samples: An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + :param message_flow: Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + :param description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + :param age_gated: A boolean that specifies whether campaign requires age gate for federally legal content. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. + + :returns: The updated UsAppToPersonInstance + """ + return await self._proxy.update_async( + has_embedded_links=has_embedded_links, + has_embedded_phone=has_embedded_phone, + message_samples=message_samples, + message_flow=message_flow, + description=description, + age_gated=age_gated, + direct_lending=direct_lending, + ) + def __repr__(self) -> str: """ Provide a friendly representation @@ -165,13 +237,14 @@ def __repr__(self) -> str: class UsAppToPersonContext(InstanceContext): + def __init__(self, version: Version, messaging_service_sid: str, sid: str): """ Initialize the UsAppToPersonContext :param version: Version that contains the resource - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) to fetch the resource from. - :param sid: The SID of the US A2P Compliance resource to fetch `QE2c6890da8086d771620e9b13fadeba0b`. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api) to update the resource from. + :param sid: The SID of the US A2P Compliance resource to update `QE2c6890da8086d771620e9b13fadeba0b`. """ super().__init__(version) @@ -248,6 +321,102 @@ async def fetch_async(self) -> UsAppToPersonInstance: sid=self._solution["sid"], ) + def update( + self, + has_embedded_links: bool, + has_embedded_phone: bool, + message_samples: List[str], + message_flow: str, + description: str, + age_gated: bool, + direct_lending: bool, + ) -> UsAppToPersonInstance: + """ + Update the UsAppToPersonInstance + + :param has_embedded_links: Indicates that this SMS campaign will send messages that contain links. + :param has_embedded_phone: Indicates that this SMS campaign will send messages that contain phone numbers. + :param message_samples: An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + :param message_flow: Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + :param description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + :param age_gated: A boolean that specifies whether campaign requires age gate for federally legal content. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. + + :returns: The updated UsAppToPersonInstance + """ + data = values.of( + { + "HasEmbeddedLinks": has_embedded_links, + "HasEmbeddedPhone": has_embedded_phone, + "MessageSamples": serialize.map(message_samples, lambda e: e), + "MessageFlow": message_flow, + "Description": description, + "AgeGated": age_gated, + "DirectLending": direct_lending, + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return UsAppToPersonInstance( + self._version, + payload, + messaging_service_sid=self._solution["messaging_service_sid"], + sid=self._solution["sid"], + ) + + async def update_async( + self, + has_embedded_links: bool, + has_embedded_phone: bool, + message_samples: List[str], + message_flow: str, + description: str, + age_gated: bool, + direct_lending: bool, + ) -> UsAppToPersonInstance: + """ + Asynchronous coroutine to update the UsAppToPersonInstance + + :param has_embedded_links: Indicates that this SMS campaign will send messages that contain links. + :param has_embedded_phone: Indicates that this SMS campaign will send messages that contain phone numbers. + :param message_samples: An array of sample message strings, min two and max five. Min length for each sample: 20 chars. Max length for each sample: 1024 chars. + :param message_flow: Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + :param description: A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + :param age_gated: A boolean that specifies whether campaign requires age gate for federally legal content. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. + + :returns: The updated UsAppToPersonInstance + """ + data = values.of( + { + "HasEmbeddedLinks": has_embedded_links, + "HasEmbeddedPhone": has_embedded_phone, + "MessageSamples": serialize.map(message_samples, lambda e: e), + "MessageFlow": message_flow, + "Description": description, + "AgeGated": age_gated, + "DirectLending": direct_lending, + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return UsAppToPersonInstance( + self._version, + payload, + messaging_service_sid=self._solution["messaging_service_sid"], + sid=self._solution["sid"], + ) + def __repr__(self) -> str: """ Provide a friendly representation @@ -259,6 +428,7 @@ def __repr__(self) -> str: class UsAppToPersonPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UsAppToPersonInstance: """ Build an instance of UsAppToPersonInstance @@ -281,6 +451,7 @@ def __repr__(self) -> str: class UsAppToPersonList(ListResource): + def __init__(self, version: Version, messaging_service_sid: str): """ Initialize the UsAppToPersonList @@ -314,6 +485,9 @@ def create( opt_in_keywords: Union[List[str], object] = values.unset, opt_out_keywords: Union[List[str], object] = values.unset, help_keywords: Union[List[str], object] = values.unset, + subscriber_opt_in: Union[bool, object] = values.unset, + age_gated: Union[bool, object] = values.unset, + direct_lending: Union[bool, object] = values.unset, ) -> UsAppToPersonInstance: """ Create the UsAppToPersonInstance @@ -331,9 +505,13 @@ def create( :param opt_in_keywords: If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. :param opt_out_keywords: End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. :param help_keywords: End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + :param subscriber_opt_in: A boolean that specifies whether campaign has Subscriber Optin or not. + :param age_gated: A boolean that specifies whether campaign is age gated or not. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. :returns: The created UsAppToPersonInstance """ + data = values.of( { "BrandRegistrationSid": brand_registration_sid, @@ -349,6 +527,9 @@ def create( "OptInKeywords": serialize.map(opt_in_keywords, lambda e: e), "OptOutKeywords": serialize.map(opt_out_keywords, lambda e: e), "HelpKeywords": serialize.map(help_keywords, lambda e: e), + "SubscriberOptIn": subscriber_opt_in, + "AgeGated": age_gated, + "DirectLending": direct_lending, } ) @@ -379,6 +560,9 @@ async def create_async( opt_in_keywords: Union[List[str], object] = values.unset, opt_out_keywords: Union[List[str], object] = values.unset, help_keywords: Union[List[str], object] = values.unset, + subscriber_opt_in: Union[bool, object] = values.unset, + age_gated: Union[bool, object] = values.unset, + direct_lending: Union[bool, object] = values.unset, ) -> UsAppToPersonInstance: """ Asynchronously create the UsAppToPersonInstance @@ -396,9 +580,13 @@ async def create_async( :param opt_in_keywords: If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. :param opt_out_keywords: End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. :param help_keywords: End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + :param subscriber_opt_in: A boolean that specifies whether campaign has Subscriber Optin or not. + :param age_gated: A boolean that specifies whether campaign is age gated or not. + :param direct_lending: A boolean that specifies whether campaign allows direct lending or not. :returns: The created UsAppToPersonInstance """ + data = values.of( { "BrandRegistrationSid": brand_registration_sid, @@ -414,6 +602,9 @@ async def create_async( "OptInKeywords": serialize.map(opt_in_keywords, lambda e: e), "OptOutKeywords": serialize.map(opt_out_keywords, lambda e: e), "HelpKeywords": serialize.map(help_keywords, lambda e: e), + "SubscriberOptIn": subscriber_opt_in, + "AgeGated": age_gated, + "DirectLending": direct_lending, } ) @@ -616,7 +807,7 @@ def get(self, sid: str) -> UsAppToPersonContext: """ Constructs a UsAppToPersonContext - :param sid: The SID of the US A2P Compliance resource to fetch `QE2c6890da8086d771620e9b13fadeba0b`. + :param sid: The SID of the US A2P Compliance resource to update `QE2c6890da8086d771620e9b13fadeba0b`. """ return UsAppToPersonContext( self._version, @@ -628,7 +819,7 @@ def __call__(self, sid: str) -> UsAppToPersonContext: """ Constructs a UsAppToPersonContext - :param sid: The SID of the US A2P Compliance resource to fetch `QE2c6890da8086d771620e9b13fadeba0b`. + :param sid: The SID of the US A2P Compliance resource to update `QE2c6890da8086d771620e9b13fadeba0b`. """ return UsAppToPersonContext( self._version, diff --git a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py index 2d77f51be4..c4f513ab1b 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py @@ -12,7 +12,8 @@ Do not edit the class manually. """ -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Optional, Union +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -29,7 +30,7 @@ def __init__( ): super().__init__(version) - self.us_app_to_person_usecases: Optional[List[object]] = payload.get( + self.us_app_to_person_usecases: Optional[List[Dict[str, object]]] = payload.get( "us_app_to_person_usecases" ) @@ -48,6 +49,7 @@ def __repr__(self) -> str: class UsAppToPersonUsecaseList(ListResource): + def __init__(self, version: Version, messaging_service_sid: str): """ Initialize the UsAppToPersonUsecaseList @@ -68,13 +70,22 @@ def __init__(self, version: Version, messaging_service_sid: str): ) ) - def fetch(self) -> UsAppToPersonUsecaseInstance: + def fetch( + self, brand_registration_sid: Union[str, object] = values.unset + ) -> UsAppToPersonUsecaseInstance: """ Asynchronously fetch the UsAppToPersonUsecaseInstance + :param brand_registration_sid: The unique string to identify the A2P brand. :returns: The fetched UsAppToPersonUsecaseInstance """ - payload = self._version.fetch(method="GET", uri=self._uri) + + params = values.of( + { + "BrandRegistrationSid": brand_registration_sid, + } + ) + payload = self._version.fetch(method="GET", uri=self._uri, params=params) return UsAppToPersonUsecaseInstance( self._version, @@ -82,13 +93,24 @@ def fetch(self) -> UsAppToPersonUsecaseInstance: messaging_service_sid=self._solution["messaging_service_sid"], ) - async def fetch_async(self) -> UsAppToPersonUsecaseInstance: + async def fetch_async( + self, brand_registration_sid: Union[str, object] = values.unset + ) -> UsAppToPersonUsecaseInstance: """ Asynchronously fetch the UsAppToPersonUsecaseInstance + :param brand_registration_sid: The unique string to identify the A2P brand. :returns: The fetched UsAppToPersonUsecaseInstance """ - payload = await self._version.fetch_async(method="GET", uri=self._uri) + + params = values.of( + { + "BrandRegistrationSid": brand_registration_sid, + } + ) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=params + ) return UsAppToPersonUsecaseInstance( self._version, diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index b8ec79f00b..af57cfc5fc 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -23,6 +23,7 @@ class TollfreeVerificationInstance(InstanceResource): + class OptInType(object): VERBAL = "VERBAL" WEB_FORM = "WEB_FORM" @@ -70,6 +71,7 @@ class Status(object): :ivar rejection_reason: The rejection reason given when a Tollfree Verification has been rejected. :ivar error_code: The error code given when a Tollfree Verification has been rejected. :ivar edit_expiration: The date and time when the ability to edit a rejected verification expires. + :ivar edit_allowed: If a rejected verification is allowed to be edited/resubmitted. Some rejection reasons allow editing and some do not. :ivar resource_links: The URLs of the documents associated with the Tollfree Verification resource. :ivar external_reference_id: An optional external reference ID supplied by customer and echoed back on status retrieval. """ @@ -144,6 +146,7 @@ def __init__( self.edit_expiration: Optional[datetime] = deserialize.iso8601_datetime( payload.get("edit_expiration") ) + self.edit_allowed: Optional[bool] = payload.get("edit_allowed") self.resource_links: Optional[Dict[str, object]] = payload.get("resource_links") self.external_reference_id: Optional[str] = payload.get("external_reference_id") @@ -167,6 +170,24 @@ def _proxy(self) -> "TollfreeVerificationContext": ) return self._context + def delete(self) -> bool: + """ + Deletes the TollfreeVerificationInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the TollfreeVerificationInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + def fetch(self) -> "TollfreeVerificationInstance": """ Fetch the TollfreeVerificationInstance @@ -209,6 +230,7 @@ def update( business_contact_last_name: Union[str, object] = values.unset, business_contact_email: Union[str, object] = values.unset, business_contact_phone: Union[str, object] = values.unset, + edit_reason: Union[str, object] = values.unset, ) -> "TollfreeVerificationInstance": """ Update the TollfreeVerificationInstance @@ -233,6 +255,7 @@ def update( :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance """ @@ -257,6 +280,7 @@ def update( business_contact_last_name=business_contact_last_name, business_contact_email=business_contact_email, business_contact_phone=business_contact_phone, + edit_reason=edit_reason, ) async def update_async( @@ -283,6 +307,7 @@ async def update_async( business_contact_last_name: Union[str, object] = values.unset, business_contact_email: Union[str, object] = values.unset, business_contact_phone: Union[str, object] = values.unset, + edit_reason: Union[str, object] = values.unset, ) -> "TollfreeVerificationInstance": """ Asynchronous coroutine to update the TollfreeVerificationInstance @@ -307,6 +332,7 @@ async def update_async( :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance """ @@ -331,6 +357,7 @@ async def update_async( business_contact_last_name=business_contact_last_name, business_contact_email=business_contact_email, business_contact_phone=business_contact_phone, + edit_reason=edit_reason, ) def __repr__(self) -> str: @@ -344,6 +371,7 @@ def __repr__(self) -> str: class TollfreeVerificationContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the TollfreeVerificationContext @@ -359,6 +387,30 @@ def __init__(self, version: Version, sid: str): } self._uri = "/Tollfree/Verifications/{sid}".format(**self._solution) + def delete(self) -> bool: + """ + Deletes the TollfreeVerificationInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the TollfreeVerificationInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + def fetch(self) -> TollfreeVerificationInstance: """ Fetch the TollfreeVerificationInstance @@ -421,6 +473,7 @@ def update( business_contact_last_name: Union[str, object] = values.unset, business_contact_email: Union[str, object] = values.unset, business_contact_phone: Union[str, object] = values.unset, + edit_reason: Union[str, object] = values.unset, ) -> TollfreeVerificationInstance: """ Update the TollfreeVerificationInstance @@ -445,6 +498,7 @@ def update( :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance """ @@ -470,6 +524,7 @@ def update( "BusinessContactLastName": business_contact_last_name, "BusinessContactEmail": business_contact_email, "BusinessContactPhone": business_contact_phone, + "EditReason": edit_reason, } ) @@ -507,6 +562,7 @@ async def update_async( business_contact_last_name: Union[str, object] = values.unset, business_contact_email: Union[str, object] = values.unset, business_contact_phone: Union[str, object] = values.unset, + edit_reason: Union[str, object] = values.unset, ) -> TollfreeVerificationInstance: """ Asynchronous coroutine to update the TollfreeVerificationInstance @@ -531,6 +587,7 @@ async def update_async( :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance """ @@ -556,6 +613,7 @@ async def update_async( "BusinessContactLastName": business_contact_last_name, "BusinessContactEmail": business_contact_email, "BusinessContactPhone": business_contact_phone, + "EditReason": edit_reason, } ) @@ -580,6 +638,7 @@ def __repr__(self) -> str: class TollfreeVerificationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TollfreeVerificationInstance: """ Build an instance of TollfreeVerificationInstance @@ -598,6 +657,7 @@ def __repr__(self) -> str: class TollfreeVerificationList(ListResource): + def __init__(self, version: Version): """ Initialize the TollfreeVerificationList @@ -664,6 +724,7 @@ def create( :returns: The created TollfreeVerificationInstance """ + data = values.of( { "BusinessName": business_name, @@ -755,6 +816,7 @@ async def create_async( :returns: The created TollfreeVerificationInstance """ + data = values.of( { "BusinessName": business_name, diff --git a/twilio/rest/messaging/v1/usecase.py b/twilio/rest/messaging/v1/usecase.py index 0b35400e48..d7223f3632 100644 --- a/twilio/rest/messaging/v1/usecase.py +++ b/twilio/rest/messaging/v1/usecase.py @@ -27,7 +27,7 @@ class UsecaseInstance(InstanceResource): def __init__(self, version: Version, payload: Dict[str, Any]): super().__init__(version) - self.usecases: Optional[List[object]] = payload.get("usecases") + self.usecases: Optional[List[Dict[str, object]]] = payload.get("usecases") def __repr__(self) -> str: """ @@ -40,6 +40,7 @@ def __repr__(self) -> str: class UsecaseList(ListResource): + def __init__(self, version: Version): """ Initialize the UsecaseList @@ -55,8 +56,10 @@ def fetch(self) -> UsecaseInstance: """ Asynchronously fetch the UsecaseInstance + :returns: The fetched UsecaseInstance """ + payload = self._version.fetch(method="GET", uri=self._uri) return UsecaseInstance(self._version, payload) @@ -65,8 +68,10 @@ async def fetch_async(self) -> UsecaseInstance: """ Asynchronously fetch the UsecaseInstance + :returns: The fetched UsecaseInstance """ + payload = await self._version.fetch_async(method="GET", uri=self._uri) return UsecaseInstance(self._version, payload) diff --git a/twilio/rest/microvisor/MicrovisorBase.py b/twilio/rest/microvisor/MicrovisorBase.py index 57a4c50f55..e8c874b920 100644 --- a/twilio/rest/microvisor/MicrovisorBase.py +++ b/twilio/rest/microvisor/MicrovisorBase.py @@ -17,6 +17,7 @@ class MicrovisorBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Microvisor Domain diff --git a/twilio/rest/microvisor/v1/__init__.py b/twilio/rest/microvisor/v1/__init__.py index d47ed845bd..22010d62e5 100644 --- a/twilio/rest/microvisor/v1/__init__.py +++ b/twilio/rest/microvisor/v1/__init__.py @@ -22,6 +22,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Microvisor diff --git a/twilio/rest/microvisor/v1/account_config.py b/twilio/rest/microvisor/v1/account_config.py index 03198f6f6c..3d37b01cd2 100644 --- a/twilio/rest/microvisor/v1/account_config.py +++ b/twilio/rest/microvisor/v1/account_config.py @@ -133,6 +133,7 @@ def __repr__(self) -> str: class AccountConfigContext(InstanceContext): + def __init__(self, version: Version, key: str): """ Initialize the AccountConfigContext @@ -265,6 +266,7 @@ def __repr__(self) -> str: class AccountConfigPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AccountConfigInstance: """ Build an instance of AccountConfigInstance @@ -283,6 +285,7 @@ def __repr__(self) -> str: class AccountConfigList(ListResource): + def __init__(self, version: Version): """ Initialize the AccountConfigList @@ -303,6 +306,7 @@ def create(self, key: str, value: str) -> AccountConfigInstance: :returns: The created AccountConfigInstance """ + data = values.of( { "Key": key, @@ -327,6 +331,7 @@ async def create_async(self, key: str, value: str) -> AccountConfigInstance: :returns: The created AccountConfigInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/microvisor/v1/account_secret.py b/twilio/rest/microvisor/v1/account_secret.py index d4012b3b1c..cca0e1d773 100644 --- a/twilio/rest/microvisor/v1/account_secret.py +++ b/twilio/rest/microvisor/v1/account_secret.py @@ -131,6 +131,7 @@ def __repr__(self) -> str: class AccountSecretContext(InstanceContext): + def __init__(self, version: Version, key: str): """ Initialize the AccountSecretContext @@ -263,6 +264,7 @@ def __repr__(self) -> str: class AccountSecretPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AccountSecretInstance: """ Build an instance of AccountSecretInstance @@ -281,6 +283,7 @@ def __repr__(self) -> str: class AccountSecretList(ListResource): + def __init__(self, version: Version): """ Initialize the AccountSecretList @@ -301,6 +304,7 @@ def create(self, key: str, value: str) -> AccountSecretInstance: :returns: The created AccountSecretInstance """ + data = values.of( { "Key": key, @@ -325,6 +329,7 @@ async def create_async(self, key: str, value: str) -> AccountSecretInstance: :returns: The created AccountSecretInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/microvisor/v1/app/__init__.py b/twilio/rest/microvisor/v1/app/__init__.py index 517e523c7d..0c91fe3c50 100644 --- a/twilio/rest/microvisor/v1/app/__init__.py +++ b/twilio/rest/microvisor/v1/app/__init__.py @@ -127,6 +127,7 @@ def __repr__(self) -> str: class AppContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AppContext @@ -229,6 +230,7 @@ def __repr__(self) -> str: class AppPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AppInstance: """ Build an instance of AppInstance @@ -247,6 +249,7 @@ def __repr__(self) -> str: class AppList(ListResource): + def __init__(self, version: Version): """ Initialize the AppList diff --git a/twilio/rest/microvisor/v1/app/app_manifest.py b/twilio/rest/microvisor/v1/app/app_manifest.py index 143154b32c..4f9eab075e 100644 --- a/twilio/rest/microvisor/v1/app/app_manifest.py +++ b/twilio/rest/microvisor/v1/app/app_manifest.py @@ -84,6 +84,7 @@ def __repr__(self) -> str: class AppManifestContext(InstanceContext): + def __init__(self, version: Version, app_sid: str): """ Initialize the AppManifestContext @@ -148,6 +149,7 @@ def __repr__(self) -> str: class AppManifestList(ListResource): + def __init__(self, version: Version, app_sid: str): """ Initialize the AppManifestList diff --git a/twilio/rest/microvisor/v1/device/__init__.py b/twilio/rest/microvisor/v1/device/__init__.py index 0a6bea2d60..56904ee1f7 100644 --- a/twilio/rest/microvisor/v1/device/__init__.py +++ b/twilio/rest/microvisor/v1/device/__init__.py @@ -167,6 +167,7 @@ def __repr__(self) -> str: class DeviceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the DeviceContext @@ -326,6 +327,7 @@ def __repr__(self) -> str: class DevicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeviceInstance: """ Build an instance of DeviceInstance @@ -344,6 +346,7 @@ def __repr__(self) -> str: class DeviceList(ListResource): + def __init__(self, version: Version): """ Initialize the DeviceList diff --git a/twilio/rest/microvisor/v1/device/device_config.py b/twilio/rest/microvisor/v1/device/device_config.py index 0b027ecb53..3607e971f2 100644 --- a/twilio/rest/microvisor/v1/device/device_config.py +++ b/twilio/rest/microvisor/v1/device/device_config.py @@ -141,6 +141,7 @@ def __repr__(self) -> str: class DeviceConfigContext(InstanceContext): + def __init__(self, version: Version, device_sid: str, key: str): """ Initialize the DeviceConfigContext @@ -287,6 +288,7 @@ def __repr__(self) -> str: class DeviceConfigPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeviceConfigInstance: """ Build an instance of DeviceConfigInstance @@ -307,6 +309,7 @@ def __repr__(self) -> str: class DeviceConfigList(ListResource): + def __init__(self, version: Version, device_sid: str): """ Initialize the DeviceConfigList @@ -332,6 +335,7 @@ def create(self, key: str, value: str) -> DeviceConfigInstance: :returns: The created DeviceConfigInstance """ + data = values.of( { "Key": key, @@ -358,6 +362,7 @@ async def create_async(self, key: str, value: str) -> DeviceConfigInstance: :returns: The created DeviceConfigInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/microvisor/v1/device/device_secret.py b/twilio/rest/microvisor/v1/device/device_secret.py index 2f1f1add74..0ab9b1c721 100644 --- a/twilio/rest/microvisor/v1/device/device_secret.py +++ b/twilio/rest/microvisor/v1/device/device_secret.py @@ -139,6 +139,7 @@ def __repr__(self) -> str: class DeviceSecretContext(InstanceContext): + def __init__(self, version: Version, device_sid: str, key: str): """ Initialize the DeviceSecretContext @@ -285,6 +286,7 @@ def __repr__(self) -> str: class DeviceSecretPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeviceSecretInstance: """ Build an instance of DeviceSecretInstance @@ -305,6 +307,7 @@ def __repr__(self) -> str: class DeviceSecretList(ListResource): + def __init__(self, version: Version, device_sid: str): """ Initialize the DeviceSecretList @@ -330,6 +333,7 @@ def create(self, key: str, value: str) -> DeviceSecretInstance: :returns: The created DeviceSecretInstance """ + data = values.of( { "Key": key, @@ -356,6 +360,7 @@ async def create_async(self, key: str, value: str) -> DeviceSecretInstance: :returns: The created DeviceSecretInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/monitor/MonitorBase.py b/twilio/rest/monitor/MonitorBase.py index d63580761f..4c5c6ebcd6 100644 --- a/twilio/rest/monitor/MonitorBase.py +++ b/twilio/rest/monitor/MonitorBase.py @@ -17,6 +17,7 @@ class MonitorBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Monitor Domain diff --git a/twilio/rest/monitor/v1/__init__.py b/twilio/rest/monitor/v1/__init__.py index fcf06738fa..e892612b3b 100644 --- a/twilio/rest/monitor/v1/__init__.py +++ b/twilio/rest/monitor/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Monitor diff --git a/twilio/rest/monitor/v1/alert.py b/twilio/rest/monitor/v1/alert.py index e531f58e7d..ef8cf39dda 100644 --- a/twilio/rest/monitor/v1/alert.py +++ b/twilio/rest/monitor/v1/alert.py @@ -125,6 +125,7 @@ def __repr__(self) -> str: class AlertContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AlertContext @@ -189,6 +190,7 @@ def __repr__(self) -> str: class AlertPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AlertInstance: """ Build an instance of AlertInstance @@ -207,6 +209,7 @@ def __repr__(self) -> str: class AlertList(ListResource): + def __init__(self, version: Version): """ Initialize the AlertList diff --git a/twilio/rest/monitor/v1/event.py b/twilio/rest/monitor/v1/event.py index 7a810bd6c8..6b67a9c029 100644 --- a/twilio/rest/monitor/v1/event.py +++ b/twilio/rest/monitor/v1/event.py @@ -111,6 +111,7 @@ def __repr__(self) -> str: class EventContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EventContext @@ -175,6 +176,7 @@ def __repr__(self) -> str: class EventPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EventInstance: """ Build an instance of EventInstance @@ -193,6 +195,7 @@ def __repr__(self) -> str: class EventList(ListResource): + def __init__(self, version: Version): """ Initialize the EventList diff --git a/twilio/rest/notify/NotifyBase.py b/twilio/rest/notify/NotifyBase.py index d8a79bed63..2772ed0959 100644 --- a/twilio/rest/notify/NotifyBase.py +++ b/twilio/rest/notify/NotifyBase.py @@ -17,6 +17,7 @@ class NotifyBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Notify Domain diff --git a/twilio/rest/notify/v1/__init__.py b/twilio/rest/notify/v1/__init__.py index 91942a4f73..90cab95028 100644 --- a/twilio/rest/notify/v1/__init__.py +++ b/twilio/rest/notify/v1/__init__.py @@ -20,6 +20,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Notify diff --git a/twilio/rest/notify/v1/credential.py b/twilio/rest/notify/v1/credential.py index bd895da81a..3dd6380cee 100644 --- a/twilio/rest/notify/v1/credential.py +++ b/twilio/rest/notify/v1/credential.py @@ -23,6 +23,7 @@ class CredentialInstance(InstanceResource): + class PushService(object): GCM = "gcm" APN = "apn" @@ -184,6 +185,7 @@ def __repr__(self) -> str: class CredentialContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CredentialContext @@ -352,6 +354,7 @@ def __repr__(self) -> str: class CredentialPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialInstance: """ Build an instance of CredentialInstance @@ -370,6 +373,7 @@ def __repr__(self) -> str: class CredentialList(ListResource): + def __init__(self, version: Version): """ Initialize the CredentialList @@ -404,6 +408,7 @@ def create( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, @@ -447,6 +452,7 @@ async def create_async( :returns: The created CredentialInstance """ + data = values.of( { "Type": type, diff --git a/twilio/rest/notify/v1/service/__init__.py b/twilio/rest/notify/v1/service/__init__.py index 7a9f3f7300..912d6ba9cd 100644 --- a/twilio/rest/notify/v1/service/__init__.py +++ b/twilio/rest/notify/v1/service/__init__.py @@ -34,7 +34,7 @@ class ServiceInstance(InstanceResource): :ivar apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :ivar gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. :ivar fcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. - :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. + :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. In order to send SMS notifications this parameter has to be set. :ivar facebook_messenger_page_id: Deprecated. :ivar default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :ivar default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -169,7 +169,7 @@ def update( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -223,7 +223,7 @@ async def update_async( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -279,6 +279,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -382,7 +383,7 @@ def update( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -446,7 +447,7 @@ async def update_async( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -522,6 +523,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -540,6 +542,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -574,7 +577,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -588,6 +591,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -638,7 +642,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param apn_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. :param gcm_credential_sid: The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. - :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/quickstart#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. :param facebook_messenger_page_id: Deprecated. :param default_apn_notification_protocol_version: The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. :param default_gcm_notification_protocol_version: The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. @@ -652,6 +656,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/notify/v1/service/binding.py b/twilio/rest/notify/v1/service/binding.py index 52a800f33c..a6b1e3f087 100644 --- a/twilio/rest/notify/v1/service/binding.py +++ b/twilio/rest/notify/v1/service/binding.py @@ -23,6 +23,7 @@ class BindingInstance(InstanceResource): + class BindingType(object): APN = "apn" GCM = "gcm" @@ -147,6 +148,7 @@ def __repr__(self) -> str: class BindingContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the BindingContext @@ -239,6 +241,7 @@ def __repr__(self) -> str: class BindingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BindingInstance: """ Build an instance of BindingInstance @@ -259,6 +262,7 @@ def __repr__(self) -> str: class BindingList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the BindingList @@ -298,6 +302,7 @@ def create( :returns: The created BindingInstance """ + data = values.of( { "Identity": identity, @@ -343,6 +348,7 @@ async def create_async( :returns: The created BindingInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/notify/v1/service/notification.py b/twilio/rest/notify/v1/service/notification.py index 5d5106b2c5..e2482be109 100644 --- a/twilio/rest/notify/v1/service/notification.py +++ b/twilio/rest/notify/v1/service/notification.py @@ -22,6 +22,7 @@ class NotificationInstance(InstanceResource): + class Priority(object): HIGH = "high" LOW = "low" @@ -94,6 +95,7 @@ def __repr__(self) -> str: class NotificationList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the NotificationList @@ -143,7 +145,7 @@ def create( :param data: The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. :param apn: The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. :param gcm: The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). - :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. :param facebook_messenger: Deprecated. :param fcm: The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. :param segment: The Segment resource is deprecated. Use the `tag` parameter, instead. @@ -155,6 +157,7 @@ def create( :returns: The created NotificationInstance """ + data = values.of( { "Body": body, @@ -221,7 +224,7 @@ async def create_async( :param data: The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. :param apn: The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. :param gcm: The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). - :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + :param sms: The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/quickstart) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. :param facebook_messenger: Deprecated. :param fcm: The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. :param segment: The Segment resource is deprecated. Use the `tag` parameter, instead. @@ -233,6 +236,7 @@ async def create_async( :returns: The created NotificationInstance """ + data = values.of( { "Body": body, diff --git a/twilio/rest/numbers/NumbersBase.py b/twilio/rest/numbers/NumbersBase.py index b5c1e04328..7b9e08638f 100644 --- a/twilio/rest/numbers/NumbersBase.py +++ b/twilio/rest/numbers/NumbersBase.py @@ -18,6 +18,7 @@ class NumbersBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Numbers Domain diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index e7ee222a47..384b0d95e3 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -17,10 +17,12 @@ from twilio.base.domain import Domain from twilio.rest.numbers.v1.bulk_eligibility import BulkEligibilityList from twilio.rest.numbers.v1.porting_bulk_portability import PortingBulkPortabilityList +from twilio.rest.numbers.v1.porting_port_in_fetch import PortingPortInFetchList from twilio.rest.numbers.v1.porting_portability import PortingPortabilityList class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Numbers @@ -30,6 +32,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._bulk_eligibilities: Optional[BulkEligibilityList] = None self._porting_bulk_portabilities: Optional[PortingBulkPortabilityList] = None + self._porting_port_ins: Optional[PortingPortInFetchList] = None self._porting_portabilities: Optional[PortingPortabilityList] = None @property @@ -44,6 +47,12 @@ def porting_bulk_portabilities(self) -> PortingBulkPortabilityList: self._porting_bulk_portabilities = PortingBulkPortabilityList(self) return self._porting_bulk_portabilities + @property + def porting_port_ins(self) -> PortingPortInFetchList: + if self._porting_port_ins is None: + self._porting_port_ins = PortingPortInFetchList(self) + return self._porting_port_ins + @property def porting_portabilities(self) -> PortingPortabilityList: if self._porting_portabilities is None: diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index acd8d3ecf2..64be314b44 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -42,7 +42,7 @@ def __init__( self.request_id: Optional[str] = payload.get("request_id") self.url: Optional[str] = payload.get("url") - self.results: Optional[List[object]] = payload.get("results") + self.results: Optional[List[Dict[str, object]]] = payload.get("results") self.friendly_name: Optional[str] = payload.get("friendly_name") self.status: Optional[str] = payload.get("status") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -101,6 +101,7 @@ def __repr__(self) -> str: class BulkEligibilityContext(InstanceContext): + def __init__(self, version: Version, request_id: str): """ Initialize the BulkEligibilityContext @@ -167,6 +168,7 @@ def __repr__(self) -> str: class BulkEligibilityList(ListResource): + def __init__(self, version: Version): """ Initialize the BulkEligibilityList diff --git a/twilio/rest/numbers/v1/porting_bulk_portability.py b/twilio/rest/numbers/v1/porting_bulk_portability.py index 20e47ca6d5..c3fedcd5bb 100644 --- a/twilio/rest/numbers/v1/porting_bulk_portability.py +++ b/twilio/rest/numbers/v1/porting_bulk_portability.py @@ -22,6 +22,7 @@ class PortingBulkPortabilityInstance(InstanceResource): + class Status(object): IN_PROGRESS = "in-progress" COMPLETED = "completed" @@ -47,7 +48,9 @@ def __init__( self.datetime_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("datetime_created") ) - self.phone_numbers: Optional[List[object]] = payload.get("phone_numbers") + self.phone_numbers: Optional[List[Dict[str, object]]] = payload.get( + "phone_numbers" + ) self.url: Optional[str] = payload.get("url") self._solution = { @@ -99,6 +102,7 @@ def __repr__(self) -> str: class PortingBulkPortabilityContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the PortingBulkPortabilityContext @@ -163,6 +167,7 @@ def __repr__(self) -> str: class PortingBulkPortabilityList(ListResource): + def __init__(self, version: Version): """ Initialize the PortingBulkPortabilityList @@ -182,6 +187,7 @@ def create(self, phone_numbers: List[str]) -> PortingBulkPortabilityInstance: :returns: The created PortingBulkPortabilityInstance """ + data = values.of( { "PhoneNumbers": serialize.map(phone_numbers, lambda e: e), @@ -206,6 +212,7 @@ async def create_async( :returns: The created PortingBulkPortabilityInstance """ + data = values.of( { "PhoneNumbers": serialize.map(phone_numbers, lambda e: e), diff --git a/twilio/rest/numbers/v1/porting_port_in_fetch.py b/twilio/rest/numbers/v1/porting_port_in_fetch.py new file mode 100644 index 0000000000..78e31afbd8 --- /dev/null +++ b/twilio/rest/numbers/v1/porting_port_in_fetch.py @@ -0,0 +1,219 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import date +from typing import Any, Dict, List, Optional +from twilio.base import deserialize +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PortingPortInFetchInstance(InstanceResource): + """ + :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + :ivar url: The URL of this Port In request + :ivar account_sid: The Account SID that the numbers will be added to after they are ported into Twilio. + :ivar notification_emails: List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. + :ivar target_port_in_date: Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. + :ivar target_port_in_time_range_start: Minimum hour in the future needs to be established with the Ops team for validation. + :ivar target_port_in_time_range_end: Maximum hour in the future needs to be established with the Ops team for validation. + :ivar losing_carrier_information: The information for the losing carrier. + :ivar phone_numbers: The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). + :ivar documents: The list of documents SID referencing a utility bills + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + port_in_request_sid: Optional[str] = None, + ): + super().__init__(version) + + self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") + self.url: Optional[str] = payload.get("url") + self.account_sid: Optional[str] = payload.get("account_sid") + self.notification_emails: Optional[List[str]] = payload.get( + "notification_emails" + ) + self.target_port_in_date: Optional[date] = deserialize.iso8601_date( + payload.get("target_port_in_date") + ) + self.target_port_in_time_range_start: Optional[str] = payload.get( + "target_port_in_time_range_start" + ) + self.target_port_in_time_range_end: Optional[str] = payload.get( + "target_port_in_time_range_end" + ) + self.losing_carrier_information: Optional[Dict[str, object]] = payload.get( + "losing_carrier_information" + ) + self.phone_numbers: Optional[List[Dict[str, object]]] = payload.get( + "phone_numbers" + ) + self.documents: Optional[List[str]] = payload.get("documents") + + self._solution = { + "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, + } + self._context: Optional[PortingPortInFetchContext] = None + + @property + def _proxy(self) -> "PortingPortInFetchContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PortingPortInFetchContext for this PortingPortInFetchInstance + """ + if self._context is None: + self._context = PortingPortInFetchContext( + self._version, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + return self._context + + def fetch(self) -> "PortingPortInFetchInstance": + """ + Fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "PortingPortInFetchInstance": + """ + Asynchronous coroutine to fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PortingPortInFetchContext(InstanceContext): + + def __init__(self, version: Version, port_in_request_sid: str): + """ + Initialize the PortingPortInFetchContext + + :param version: Version that contains the resource + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "port_in_request_sid": port_in_request_sid, + } + self._uri = "/Porting/PortIn/{port_in_request_sid}".format(**self._solution) + + def fetch(self) -> PortingPortInFetchInstance: + """ + Fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return PortingPortInFetchInstance( + self._version, + payload, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + + async def fetch_async(self) -> PortingPortInFetchInstance: + """ + Asynchronous coroutine to fetch the PortingPortInFetchInstance + + + :returns: The fetched PortingPortInFetchInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return PortingPortInFetchInstance( + self._version, + payload, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PortingPortInFetchList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PortingPortInFetchList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, port_in_request_sid: str) -> PortingPortInFetchContext: + """ + Constructs a PortingPortInFetchContext + + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + return PortingPortInFetchContext( + self._version, port_in_request_sid=port_in_request_sid + ) + + def __call__(self, port_in_request_sid: str) -> PortingPortInFetchContext: + """ + Constructs a PortingPortInFetchContext + + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + return PortingPortInFetchContext( + self._version, port_in_request_sid=port_in_request_sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v1/porting_portability.py b/twilio/rest/numbers/v1/porting_portability.py index c2f3398c89..f1cf0cb8c9 100644 --- a/twilio/rest/numbers/v1/porting_portability.py +++ b/twilio/rest/numbers/v1/porting_portability.py @@ -21,6 +21,7 @@ class PortingPortabilityInstance(InstanceResource): + class NumberType(object): LOCAL = "LOCAL" UNKNOWN = "UNKNOWN" @@ -126,6 +127,7 @@ def __repr__(self) -> str: class PortingPortabilityContext(InstanceContext): + def __init__(self, version: Version, phone_number: str): """ Initialize the PortingPortabilityContext @@ -206,6 +208,7 @@ def __repr__(self) -> str: class PortingPortabilityList(ListResource): + def __init__(self, version: Version): """ Initialize the PortingPortabilityList diff --git a/twilio/rest/numbers/v2/__init__.py b/twilio/rest/numbers/v2/__init__.py index 149e7a8697..9b5b50154e 100644 --- a/twilio/rest/numbers/v2/__init__.py +++ b/twilio/rest/numbers/v2/__init__.py @@ -22,6 +22,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Numbers diff --git a/twilio/rest/numbers/v2/authorization_document/__init__.py b/twilio/rest/numbers/v2/authorization_document/__init__.py index 2456debf6d..7e0a4d9184 100644 --- a/twilio/rest/numbers/v2/authorization_document/__init__.py +++ b/twilio/rest/numbers/v2/authorization_document/__init__.py @@ -26,6 +26,7 @@ class AuthorizationDocumentInstance(InstanceResource): + class Status(object): OPENED = "opened" SIGNING = "signing" @@ -140,6 +141,7 @@ def __repr__(self) -> str: class AuthorizationDocumentContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AuthorizationDocumentContext @@ -246,6 +248,7 @@ def __repr__(self) -> str: class AuthorizationDocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AuthorizationDocumentInstance: """ Build an instance of AuthorizationDocumentInstance @@ -264,6 +267,7 @@ def __repr__(self) -> str: class AuthorizationDocumentList(ListResource): + def __init__(self, version: Version): """ Initialize the AuthorizationDocumentList @@ -296,6 +300,7 @@ def create( :returns: The created AuthorizationDocumentInstance """ + data = values.of( { "AddressSid": address_sid, @@ -338,6 +343,7 @@ async def create_async( :returns: The created AuthorizationDocumentInstance """ + data = values.of( { "AddressSid": address_sid, diff --git a/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py b/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py index 013b12874a..7fc558fee2 100644 --- a/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py +++ b/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py @@ -23,6 +23,7 @@ class DependentHostedNumberOrderInstance(InstanceResource): + class Status(object): RECEIVED = "received" VERIFIED = "verified" @@ -104,6 +105,7 @@ def __repr__(self) -> str: class DependentHostedNumberOrderPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> DependentHostedNumberOrderInstance: @@ -128,6 +130,7 @@ def __repr__(self) -> str: class DependentHostedNumberOrderList(ListResource): + def __init__(self, version: Version, signing_document_sid: str): """ Initialize the DependentHostedNumberOrderList diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index 3a7383904b..31f95814f0 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -22,6 +22,7 @@ class BulkHostedNumberOrderInstance(InstanceResource): + class RequestStatus(object): QUEUED = "QUEUED" IN_PROGRESS = "IN_PROGRESS" @@ -63,7 +64,7 @@ def __init__( self.total_count: Optional[int] = deserialize.integer( payload.get("total_count") ) - self.results: Optional[List[object]] = payload.get("results") + self.results: Optional[List[Dict[str, object]]] = payload.get("results") self._solution = { "bulk_hosting_sid": bulk_hosting_sid or self.bulk_hosting_sid, @@ -124,6 +125,7 @@ def __repr__(self) -> str: class BulkHostedNumberOrderContext(InstanceContext): + def __init__(self, version: Version, bulk_hosting_sid: str): """ Initialize the BulkHostedNumberOrderContext @@ -204,6 +206,7 @@ def __repr__(self) -> str: class BulkHostedNumberOrderList(ListResource): + def __init__(self, version: Version): """ Initialize the BulkHostedNumberOrderList diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index 985faa1f12..c20fc517c8 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -23,6 +23,7 @@ class HostedNumberOrderInstance(InstanceResource): + class Status(object): RECEIVED = "received" VERIFIED = "verified" @@ -156,6 +157,7 @@ def __repr__(self) -> str: class HostedNumberOrderContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the HostedNumberOrderContext @@ -244,6 +246,7 @@ def __repr__(self) -> str: class HostedNumberOrderPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> HostedNumberOrderInstance: """ Build an instance of HostedNumberOrderInstance @@ -262,6 +265,7 @@ def __repr__(self) -> str: class HostedNumberOrderList(ListResource): + def __init__(self, version: Version): """ Initialize the HostedNumberOrderList @@ -314,6 +318,7 @@ def create( :returns: The created HostedNumberOrderInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -384,6 +389,7 @@ async def create_async( :returns: The created HostedNumberOrderInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/__init__.py index 10d88d8134..189117d85c 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/__init__.py @@ -31,6 +31,7 @@ class RegulatoryComplianceList(ListResource): + def __init__(self, version: Version): """ Initialize the RegulatoryComplianceList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index 684259fc91..5e1eec5b16 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -35,6 +35,7 @@ class BundleInstance(InstanceResource): + class EndUserType(object): INDIVIDUAL = "individual" BUSINESS = "business" @@ -237,6 +238,7 @@ def __repr__(self) -> str: class BundleContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the BundleContext @@ -446,6 +448,7 @@ def __repr__(self) -> str: class BundlePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BundleInstance: """ Build an instance of BundleInstance @@ -464,6 +467,7 @@ def __repr__(self) -> str: class BundleList(ListResource): + def __init__(self, version: Version): """ Initialize the BundleList @@ -498,6 +502,7 @@ def create( :returns: The created BundleInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -541,6 +546,7 @@ async def create_async( :returns: The created BundleInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py index 9af90f46da..a8cf77fd18 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py @@ -23,6 +23,7 @@ class BundleCopyInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -79,6 +80,7 @@ def __repr__(self) -> str: class BundleCopyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BundleCopyInstance: """ Build an instance of BundleCopyInstance @@ -99,6 +101,7 @@ def __repr__(self) -> str: class BundleCopyList(ListResource): + def __init__(self, version: Version, bundle_sid: str): """ Initialize the BundleCopyList @@ -127,6 +130,7 @@ def create( :returns: The created BundleCopyInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -153,6 +157,7 @@ async def create_async( :returns: The created BundleCopyInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py index 8bfeae12e3..39aae3b6ed 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py @@ -23,6 +23,7 @@ class EvaluationInstance(InstanceResource): + class Status(object): COMPLIANT = "compliant" NONCOMPLIANT = "noncompliant" @@ -52,7 +53,7 @@ def __init__( self.regulation_sid: Optional[str] = payload.get("regulation_sid") self.bundle_sid: Optional[str] = payload.get("bundle_sid") self.status: Optional["EvaluationInstance.Status"] = payload.get("status") - self.results: Optional[List[object]] = payload.get("results") + self.results: Optional[List[Dict[str, object]]] = payload.get("results") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -109,6 +110,7 @@ def __repr__(self) -> str: class EvaluationContext(InstanceContext): + def __init__(self, version: Version, bundle_sid: str, sid: str): """ Initialize the EvaluationContext @@ -181,6 +183,7 @@ def __repr__(self) -> str: class EvaluationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EvaluationInstance: """ Build an instance of EvaluationInstance @@ -201,6 +204,7 @@ def __repr__(self) -> str: class EvaluationList(ListResource): + def __init__(self, version: Version, bundle_sid: str): """ Initialize the EvaluationList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py index 1483cdb363..d22fc31396 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py @@ -119,6 +119,7 @@ def __repr__(self) -> str: class ItemAssignmentContext(InstanceContext): + def __init__(self, version: Version, bundle_sid: str, sid: str): """ Initialize the ItemAssignmentContext @@ -215,6 +216,7 @@ def __repr__(self) -> str: class ItemAssignmentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ItemAssignmentInstance: """ Build an instance of ItemAssignmentInstance @@ -235,6 +237,7 @@ def __repr__(self) -> str: class ItemAssignmentList(ListResource): + def __init__(self, version: Version, bundle_sid: str): """ Initialize the ItemAssignmentList @@ -261,6 +264,7 @@ def create(self, object_sid: str) -> ItemAssignmentInstance: :returns: The created ItemAssignmentInstance """ + data = values.of( { "ObjectSid": object_sid, @@ -285,6 +289,7 @@ async def create_async(self, object_sid: str) -> ItemAssignmentInstance: :returns: The created ItemAssignmentInstance """ + data = values.of( { "ObjectSid": object_sid, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py index fcf31e953b..09e2823ada 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py @@ -22,6 +22,7 @@ class ReplaceItemsInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -78,6 +79,7 @@ def __repr__(self) -> str: class ReplaceItemsList(ListResource): + def __init__(self, version: Version, bundle_sid: str): """ Initialize the ReplaceItemsList @@ -104,6 +106,7 @@ def create(self, from_bundle_sid: str) -> ReplaceItemsInstance: :returns: The created ReplaceItemsInstance """ + data = values.of( { "FromBundleSid": from_bundle_sid, @@ -128,6 +131,7 @@ async def create_async(self, from_bundle_sid: str) -> ReplaceItemsInstance: :returns: The created ReplaceItemsInstance """ + data = values.of( { "FromBundleSid": from_bundle_sid, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py index bbc133b33e..3f9e5ec856 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py @@ -23,6 +23,7 @@ class EndUserInstance(InstanceResource): + class Type(object): INDIVIDUAL = "individual" BUSINESS = "business" @@ -159,6 +160,7 @@ def __repr__(self) -> str: class EndUserContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EndUserContext @@ -303,6 +305,7 @@ def __repr__(self) -> str: class EndUserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EndUserInstance: """ Build an instance of EndUserInstance @@ -321,6 +324,7 @@ def __repr__(self) -> str: class EndUserList(ListResource): + def __init__(self, version: Version): """ Initialize the EndUserList @@ -347,6 +351,7 @@ def create( :returns: The created EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -378,6 +383,7 @@ async def create_async( :returns: The created EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py index f9b8069ee9..ba155575ac 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py @@ -38,7 +38,7 @@ def __init__( self.sid: Optional[str] = payload.get("sid") self.friendly_name: Optional[str] = payload.get("friendly_name") self.machine_name: Optional[str] = payload.get("machine_name") - self.fields: Optional[List[object]] = payload.get("fields") + self.fields: Optional[List[Dict[str, object]]] = payload.get("fields") self.url: Optional[str] = payload.get("url") self._solution = { @@ -90,6 +90,7 @@ def __repr__(self) -> str: class EndUserTypeContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EndUserTypeContext @@ -154,6 +155,7 @@ def __repr__(self) -> str: class EndUserTypePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EndUserTypeInstance: """ Build an instance of EndUserTypeInstance @@ -172,6 +174,7 @@ def __repr__(self) -> str: class EndUserTypeList(ListResource): + def __init__(self, version: Version): """ Initialize the EndUserTypeList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py index 2698bf0b4d..9d9a508810 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py @@ -22,6 +22,7 @@ class RegulationInstance(InstanceResource): + class EndUserType(object): INDIVIDUAL = "individual" BUSINESS = "business" @@ -100,6 +101,7 @@ def __repr__(self) -> str: class RegulationContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RegulationContext @@ -164,6 +166,7 @@ def __repr__(self) -> str: class RegulationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RegulationInstance: """ Build an instance of RegulationInstance @@ -182,6 +185,7 @@ def __repr__(self) -> str: class RegulationList(ListResource): + def __init__(self, version: Version): """ Initialize the RegulationList diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py index 236139eee9..f2cd4e13d2 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py @@ -23,6 +23,7 @@ class SupportingDocumentInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -171,6 +172,7 @@ def __repr__(self) -> str: class SupportingDocumentContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SupportingDocumentContext @@ -321,6 +323,7 @@ def __repr__(self) -> str: class SupportingDocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SupportingDocumentInstance: """ Build an instance of SupportingDocumentInstance @@ -339,6 +342,7 @@ def __repr__(self) -> str: class SupportingDocumentList(ListResource): + def __init__(self, version: Version): """ Initialize the SupportingDocumentList @@ -365,6 +369,7 @@ def create( :returns: The created SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -396,6 +401,7 @@ async def create_async( :returns: The created SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py index 907cc1924b..0c7dc7b302 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py @@ -38,7 +38,7 @@ def __init__( self.sid: Optional[str] = payload.get("sid") self.friendly_name: Optional[str] = payload.get("friendly_name") self.machine_name: Optional[str] = payload.get("machine_name") - self.fields: Optional[List[object]] = payload.get("fields") + self.fields: Optional[List[Dict[str, object]]] = payload.get("fields") self.url: Optional[str] = payload.get("url") self._solution = { @@ -90,6 +90,7 @@ def __repr__(self) -> str: class SupportingDocumentTypeContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SupportingDocumentTypeContext @@ -156,6 +157,7 @@ def __repr__(self) -> str: class SupportingDocumentTypePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SupportingDocumentTypeInstance: """ Build an instance of SupportingDocumentTypeInstance @@ -174,6 +176,7 @@ def __repr__(self) -> str: class SupportingDocumentTypeList(ListResource): + def __init__(self, version: Version): """ Initialize the SupportingDocumentTypeList diff --git a/twilio/rest/oauth/OauthBase.py b/twilio/rest/oauth/OauthBase.py deleted file mode 100644 index 3df051d0fc..0000000000 --- a/twilio/rest/oauth/OauthBase.py +++ /dev/null @@ -1,43 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional - -from twilio.base.domain import Domain -from twilio.rest import Client -from twilio.rest.oauth.v1 import V1 - - -class OauthBase(Domain): - def __init__(self, twilio: Client): - """ - Initialize the Oauth Domain - - :returns: Domain for Oauth - """ - super().__init__(twilio, "https://oauth.twilio.com") - self._v1: Optional[V1] = None - - @property - def v1(self) -> V1: - """ - :returns: Versions v1 of Oauth - """ - if self._v1 is None: - self._v1 = V1(self) - return self._v1 - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/oauth/v1/__init__.py b/twilio/rest/oauth/v1/__init__.py deleted file mode 100644 index 36aaa90ff3..0000000000 --- a/twilio/rest/oauth/v1/__init__.py +++ /dev/null @@ -1,74 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Oauth - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.oauth.v1.device_code import DeviceCodeList -from twilio.rest.oauth.v1.oauth import OauthList -from twilio.rest.oauth.v1.openid_discovery import OpenidDiscoveryList -from twilio.rest.oauth.v1.token import TokenList -from twilio.rest.oauth.v1.user_info import UserInfoList - - -class V1(Version): - def __init__(self, domain: Domain): - """ - Initialize the V1 version of Oauth - - :param domain: The Twilio.oauth domain - """ - super().__init__(domain, "v1") - self._device_code: Optional[DeviceCodeList] = None - self._oauth: Optional[OauthList] = None - self._openid_discovery: Optional[OpenidDiscoveryList] = None - self._token: Optional[TokenList] = None - self._user_info: Optional[UserInfoList] = None - - @property - def device_code(self) -> DeviceCodeList: - if self._device_code is None: - self._device_code = DeviceCodeList(self) - return self._device_code - - @property - def oauth(self) -> OauthList: - if self._oauth is None: - self._oauth = OauthList(self) - return self._oauth - - @property - def openid_discovery(self) -> OpenidDiscoveryList: - if self._openid_discovery is None: - self._openid_discovery = OpenidDiscoveryList(self) - return self._openid_discovery - - @property - def token(self) -> TokenList: - if self._token is None: - self._token = TokenList(self) - return self._token - - @property - def user_info(self) -> UserInfoList: - if self._user_info is None: - self._user_info = UserInfoList(self) - return self._user_info - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/oauth/v1/device_code.py b/twilio/rest/oauth/v1/device_code.py deleted file mode 100644 index a50af2cad2..0000000000 --- a/twilio/rest/oauth/v1/device_code.py +++ /dev/null @@ -1,135 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Oauth - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, serialize, values - -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class DeviceCodeInstance(InstanceResource): - """ - :ivar device_code: The device verification code. - :ivar user_code: The verification code which end user uses to verify authorization request. - :ivar verification_uri: The URI that the end user visits to verify authorization request. - :ivar verification_uri_complete: The URI with user_code that the end-user alternatively visits to verify authorization request. - :ivar expires_in: The expiration time of the device_code and user_code in seconds. - :ivar interval: The minimum amount of time in seconds that the client should wait between polling requests to the token endpoint. - """ - - def __init__(self, version: Version, payload: Dict[str, Any]): - super().__init__(version) - - self.device_code: Optional[str] = payload.get("device_code") - self.user_code: Optional[str] = payload.get("user_code") - self.verification_uri: Optional[str] = payload.get("verification_uri") - self.verification_uri_complete: Optional[str] = payload.get( - "verification_uri_complete" - ) - self.expires_in: Optional[int] = payload.get("expires_in") - self.interval: Optional[int] = deserialize.integer(payload.get("interval")) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class DeviceCodeList(ListResource): - def __init__(self, version: Version): - """ - Initialize the DeviceCodeList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/device/code" - - def create( - self, - client_sid: str, - scopes: List[str], - audiences: Union[List[str], object] = values.unset, - ) -> DeviceCodeInstance: - """ - Create the DeviceCodeInstance - - :param client_sid: A 34 character string that uniquely identifies this OAuth App. - :param scopes: An Array of scopes for authorization request - :param audiences: An array of intended audiences for token requests - - :returns: The created DeviceCodeInstance - """ - data = values.of( - { - "ClientSid": client_sid, - "Scopes": serialize.map(scopes, lambda e: e), - "Audiences": serialize.map(audiences, lambda e: e), - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return DeviceCodeInstance(self._version, payload) - - async def create_async( - self, - client_sid: str, - scopes: List[str], - audiences: Union[List[str], object] = values.unset, - ) -> DeviceCodeInstance: - """ - Asynchronously create the DeviceCodeInstance - - :param client_sid: A 34 character string that uniquely identifies this OAuth App. - :param scopes: An Array of scopes for authorization request - :param audiences: An array of intended audiences for token requests - - :returns: The created DeviceCodeInstance - """ - data = values.of( - { - "ClientSid": client_sid, - "Scopes": serialize.map(scopes, lambda e: e), - "Audiences": serialize.map(audiences, lambda e: e), - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return DeviceCodeInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/oauth/v1/oauth.py b/twilio/rest/oauth/v1/oauth.py deleted file mode 100644 index 5a45ae9d9e..0000000000 --- a/twilio/rest/oauth/v1/oauth.py +++ /dev/null @@ -1,165 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Oauth - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class OauthInstance(InstanceResource): - """ - :ivar keys: A collection of certificates where are signed Twilio-issued tokens. - :ivar url: - """ - - def __init__(self, version: Version, payload: Dict[str, Any]): - super().__init__(version) - - self.keys: Optional[Dict[str, object]] = payload.get("keys") - self.url: Optional[str] = payload.get("url") - - self._context: Optional[OauthContext] = None - - @property - def _proxy(self) -> "OauthContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: OauthContext for this OauthInstance - """ - if self._context is None: - self._context = OauthContext( - self._version, - ) - return self._context - - def fetch(self) -> "OauthInstance": - """ - Fetch the OauthInstance - - - :returns: The fetched OauthInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "OauthInstance": - """ - Asynchronous coroutine to fetch the OauthInstance - - - :returns: The fetched OauthInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class OauthContext(InstanceContext): - def __init__(self, version: Version): - """ - Initialize the OauthContext - - :param version: Version that contains the resource - """ - super().__init__(version) - - self._uri = "/certs" - - def fetch(self) -> OauthInstance: - """ - Fetch the OauthInstance - - - :returns: The fetched OauthInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return OauthInstance( - self._version, - payload, - ) - - async def fetch_async(self) -> OauthInstance: - """ - Asynchronous coroutine to fetch the OauthInstance - - - :returns: The fetched OauthInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return OauthInstance( - self._version, - payload, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class OauthList(ListResource): - def __init__(self, version: Version): - """ - Initialize the OauthList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - def get(self) -> OauthContext: - """ - Constructs a OauthContext - - """ - return OauthContext(self._version) - - def __call__(self) -> OauthContext: - """ - Constructs a OauthContext - - """ - return OauthContext(self._version) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/oauth/v1/openid_discovery.py b/twilio/rest/oauth/v1/openid_discovery.py deleted file mode 100644 index 242f3b6d7e..0000000000 --- a/twilio/rest/oauth/v1/openid_discovery.py +++ /dev/null @@ -1,197 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Oauth - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, List, Optional -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class OpenidDiscoveryInstance(InstanceResource): - """ - :ivar issuer: The URL of the party that will create the token and sign it with its private key. - :ivar authorization_endpoint: The endpoint that validates all authorization requests. - :ivar device_authorization_endpoint: The endpoint that validates all device code related authorization requests. - :ivar token_endpoint: The URL of the token endpoint. After a client has received an authorization code, that code is presented to the token endpoint and exchanged for an identity token, an access token, and a refresh token. - :ivar userinfo_endpoint: The URL of the user info endpoint, which returns user profile information to a client. Keep in mind that the user info endpoint returns only the information that has been requested. - :ivar revocation_endpoint: The endpoint used to revoke access or refresh tokens issued by the authorization server. - :ivar jwk_uri: The URL of your JSON Web Key Set. This set is a collection of JSON Web Keys, a standard method for representing cryptographic keys in a JSON structure. - :ivar response_type_supported: A collection of response type supported by authorization server. - :ivar subject_type_supported: A collection of subject by authorization server. - :ivar id_token_signing_alg_values_supported: A collection of JWS signing algorithms supported by authorization server to sign identity token. - :ivar scopes_supported: A collection of scopes supported by authorization server for identity token - :ivar claims_supported: A collection of claims supported by authorization server for identity token - :ivar url: - """ - - def __init__(self, version: Version, payload: Dict[str, Any]): - super().__init__(version) - - self.issuer: Optional[str] = payload.get("issuer") - self.authorization_endpoint: Optional[str] = payload.get( - "authorization_endpoint" - ) - self.device_authorization_endpoint: Optional[str] = payload.get( - "device_authorization_endpoint" - ) - self.token_endpoint: Optional[str] = payload.get("token_endpoint") - self.userinfo_endpoint: Optional[str] = payload.get("userinfo_endpoint") - self.revocation_endpoint: Optional[str] = payload.get("revocation_endpoint") - self.jwk_uri: Optional[str] = payload.get("jwk_uri") - self.response_type_supported: Optional[List[str]] = payload.get( - "response_type_supported" - ) - self.subject_type_supported: Optional[List[str]] = payload.get( - "subject_type_supported" - ) - self.id_token_signing_alg_values_supported: Optional[List[str]] = payload.get( - "id_token_signing_alg_values_supported" - ) - self.scopes_supported: Optional[List[str]] = payload.get("scopes_supported") - self.claims_supported: Optional[List[str]] = payload.get("claims_supported") - self.url: Optional[str] = payload.get("url") - - self._context: Optional[OpenidDiscoveryContext] = None - - @property - def _proxy(self) -> "OpenidDiscoveryContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: OpenidDiscoveryContext for this OpenidDiscoveryInstance - """ - if self._context is None: - self._context = OpenidDiscoveryContext( - self._version, - ) - return self._context - - def fetch(self) -> "OpenidDiscoveryInstance": - """ - Fetch the OpenidDiscoveryInstance - - - :returns: The fetched OpenidDiscoveryInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "OpenidDiscoveryInstance": - """ - Asynchronous coroutine to fetch the OpenidDiscoveryInstance - - - :returns: The fetched OpenidDiscoveryInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class OpenidDiscoveryContext(InstanceContext): - def __init__(self, version: Version): - """ - Initialize the OpenidDiscoveryContext - - :param version: Version that contains the resource - """ - super().__init__(version) - - self._uri = "/.well-known/openid-configuration" - - def fetch(self) -> OpenidDiscoveryInstance: - """ - Fetch the OpenidDiscoveryInstance - - - :returns: The fetched OpenidDiscoveryInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return OpenidDiscoveryInstance( - self._version, - payload, - ) - - async def fetch_async(self) -> OpenidDiscoveryInstance: - """ - Asynchronous coroutine to fetch the OpenidDiscoveryInstance - - - :returns: The fetched OpenidDiscoveryInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return OpenidDiscoveryInstance( - self._version, - payload, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class OpenidDiscoveryList(ListResource): - def __init__(self, version: Version): - """ - Initialize the OpenidDiscoveryList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - def get(self) -> OpenidDiscoveryContext: - """ - Constructs a OpenidDiscoveryContext - - """ - return OpenidDiscoveryContext(self._version) - - def __call__(self) -> OpenidDiscoveryContext: - """ - Constructs a OpenidDiscoveryContext - - """ - return OpenidDiscoveryContext(self._version) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/oauth/v1/token.py b/twilio/rest/oauth/v1/token.py deleted file mode 100644 index d3fd5888ad..0000000000 --- a/twilio/rest/oauth/v1/token.py +++ /dev/null @@ -1,166 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Oauth - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, Optional, Union -from twilio.base import deserialize, values - -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class TokenInstance(InstanceResource): - """ - :ivar access_token: Token which carries the necessary information to access a Twilio resource directly. - :ivar refresh_token: Token which carries the information necessary to get a new access token. - :ivar id_token: - :ivar refresh_token_expires_at: The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar access_token_expires_at: The date and time in GMT when the refresh token expires in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - """ - - def __init__(self, version: Version, payload: Dict[str, Any]): - super().__init__(version) - - self.access_token: Optional[str] = payload.get("access_token") - self.refresh_token: Optional[str] = payload.get("refresh_token") - self.id_token: Optional[str] = payload.get("id_token") - self.refresh_token_expires_at: Optional[datetime] = ( - deserialize.iso8601_datetime(payload.get("refresh_token_expires_at")) - ) - self.access_token_expires_at: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("access_token_expires_at") - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class TokenList(ListResource): - def __init__(self, version: Version): - """ - Initialize the TokenList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/token" - - def create( - self, - grant_type: str, - client_sid: str, - client_secret: Union[str, object] = values.unset, - code: Union[str, object] = values.unset, - code_verifier: Union[str, object] = values.unset, - device_code: Union[str, object] = values.unset, - refresh_token: Union[str, object] = values.unset, - device_id: Union[str, object] = values.unset, - ) -> TokenInstance: - """ - Create the TokenInstance - - :param grant_type: Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. - :param client_sid: A 34 character string that uniquely identifies this OAuth App. - :param client_secret: The credential for confidential OAuth App. - :param code: JWT token related to the authorization code grant type. - :param code_verifier: A code which is generation cryptographically. - :param device_code: JWT token related to the device code grant type. - :param refresh_token: JWT token related to the refresh token grant type. - :param device_id: The Id of the device associated with the token (refresh token). - - :returns: The created TokenInstance - """ - data = values.of( - { - "GrantType": grant_type, - "ClientSid": client_sid, - "ClientSecret": client_secret, - "Code": code, - "CodeVerifier": code_verifier, - "DeviceCode": device_code, - "RefreshToken": refresh_token, - "DeviceId": device_id, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return TokenInstance(self._version, payload) - - async def create_async( - self, - grant_type: str, - client_sid: str, - client_secret: Union[str, object] = values.unset, - code: Union[str, object] = values.unset, - code_verifier: Union[str, object] = values.unset, - device_code: Union[str, object] = values.unset, - refresh_token: Union[str, object] = values.unset, - device_id: Union[str, object] = values.unset, - ) -> TokenInstance: - """ - Asynchronously create the TokenInstance - - :param grant_type: Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. - :param client_sid: A 34 character string that uniquely identifies this OAuth App. - :param client_secret: The credential for confidential OAuth App. - :param code: JWT token related to the authorization code grant type. - :param code_verifier: A code which is generation cryptographically. - :param device_code: JWT token related to the device code grant type. - :param refresh_token: JWT token related to the refresh token grant type. - :param device_id: The Id of the device associated with the token (refresh token). - - :returns: The created TokenInstance - """ - data = values.of( - { - "GrantType": grant_type, - "ClientSid": client_sid, - "ClientSecret": client_secret, - "Code": code, - "CodeVerifier": code_verifier, - "DeviceCode": device_code, - "RefreshToken": refresh_token, - "DeviceId": device_id, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TokenInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/PreviewBase.py b/twilio/rest/preview/PreviewBase.py index 73d5aac4bd..6608a69a2c 100644 --- a/twilio/rest/preview/PreviewBase.py +++ b/twilio/rest/preview/PreviewBase.py @@ -17,11 +17,11 @@ from twilio.rest.preview.hosted_numbers import HostedNumbers from twilio.rest.preview.sync import Sync from twilio.rest.preview.marketplace import Marketplace -from twilio.rest.preview.understand import Understand from twilio.rest.preview.wireless import Wireless class PreviewBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Preview Domain @@ -33,7 +33,6 @@ def __init__(self, twilio: Client): self._hosted_numbers: Optional[HostedNumbers] = None self._sync: Optional[Sync] = None self._marketplace: Optional[Marketplace] = None - self._understand: Optional[Understand] = None self._wireless: Optional[Wireless] = None @property @@ -72,15 +71,6 @@ def marketplace(self) -> Marketplace: self._marketplace = Marketplace(self) return self._marketplace - @property - def understand(self) -> Understand: - """ - :returns: Versions understand of Preview - """ - if self._understand is None: - self._understand = Understand(self) - return self._understand - @property def wireless(self) -> Wireless: """ diff --git a/twilio/rest/preview/deployed_devices/__init__.py b/twilio/rest/preview/deployed_devices/__init__.py index 30d6288565..795ee96566 100644 --- a/twilio/rest/preview/deployed_devices/__init__.py +++ b/twilio/rest/preview/deployed_devices/__init__.py @@ -19,6 +19,7 @@ class DeployedDevices(Version): + def __init__(self, domain: Domain): """ Initialize the DeployedDevices version of Preview diff --git a/twilio/rest/preview/deployed_devices/fleet/__init__.py b/twilio/rest/preview/deployed_devices/fleet/__init__.py index 1b66879632..0f5c284468 100644 --- a/twilio/rest/preview/deployed_devices/fleet/__init__.py +++ b/twilio/rest/preview/deployed_devices/fleet/__init__.py @@ -191,6 +191,7 @@ def __repr__(self) -> str: class FleetContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FleetContext @@ -388,6 +389,7 @@ def __repr__(self) -> str: class FleetPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FleetInstance: """ Build an instance of FleetInstance @@ -406,6 +408,7 @@ def __repr__(self) -> str: class FleetList(ListResource): + def __init__(self, version: Version): """ Initialize the FleetList @@ -425,6 +428,7 @@ def create(self, friendly_name: Union[str, object] = values.unset) -> FleetInsta :returns: The created FleetInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -449,6 +453,7 @@ async def create_async( :returns: The created FleetInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/preview/deployed_devices/fleet/certificate.py b/twilio/rest/preview/deployed_devices/fleet/certificate.py index 8b3a678d7c..1511a06134 100644 --- a/twilio/rest/preview/deployed_devices/fleet/certificate.py +++ b/twilio/rest/preview/deployed_devices/fleet/certificate.py @@ -163,6 +163,7 @@ def __repr__(self) -> str: class CertificateContext(InstanceContext): + def __init__(self, version: Version, fleet_sid: str, sid: str): """ Initialize the CertificateContext @@ -321,6 +322,7 @@ def __repr__(self) -> str: class CertificatePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CertificateInstance: """ Build an instance of CertificateInstance @@ -341,6 +343,7 @@ def __repr__(self) -> str: class CertificateList(ListResource): + def __init__(self, version: Version, fleet_sid: str): """ Initialize the CertificateList @@ -372,6 +375,7 @@ def create( :returns: The created CertificateInstance """ + data = values.of( { "CertificateData": certificate_data, @@ -405,6 +409,7 @@ async def create_async( :returns: The created CertificateInstance """ + data = values.of( { "CertificateData": certificate_data, diff --git a/twilio/rest/preview/deployed_devices/fleet/deployment.py b/twilio/rest/preview/deployed_devices/fleet/deployment.py index 7448678832..5c0d109eab 100644 --- a/twilio/rest/preview/deployed_devices/fleet/deployment.py +++ b/twilio/rest/preview/deployed_devices/fleet/deployment.py @@ -161,6 +161,7 @@ def __repr__(self) -> str: class DeploymentContext(InstanceContext): + def __init__(self, version: Version, fleet_sid: str, sid: str): """ Initialize the DeploymentContext @@ -319,6 +320,7 @@ def __repr__(self) -> str: class DeploymentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeploymentInstance: """ Build an instance of DeploymentInstance @@ -339,6 +341,7 @@ def __repr__(self) -> str: class DeploymentList(ListResource): + def __init__(self, version: Version, fleet_sid: str): """ Initialize the DeploymentList @@ -368,6 +371,7 @@ def create( :returns: The created DeploymentInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -398,6 +402,7 @@ async def create_async( :returns: The created DeploymentInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/preview/deployed_devices/fleet/device.py b/twilio/rest/preview/deployed_devices/fleet/device.py index 554e257edd..8f20074915 100644 --- a/twilio/rest/preview/deployed_devices/fleet/device.py +++ b/twilio/rest/preview/deployed_devices/fleet/device.py @@ -183,6 +183,7 @@ def __repr__(self) -> str: class DeviceContext(InstanceContext): + def __init__(self, version: Version, fleet_sid: str, sid: str): """ Initialize the DeviceContext @@ -353,6 +354,7 @@ def __repr__(self) -> str: class DevicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeviceInstance: """ Build an instance of DeviceInstance @@ -373,6 +375,7 @@ def __repr__(self) -> str: class DeviceList(ListResource): + def __init__(self, version: Version, fleet_sid: str): """ Initialize the DeviceList @@ -408,6 +411,7 @@ def create( :returns: The created DeviceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -447,6 +451,7 @@ async def create_async( :returns: The created DeviceInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/preview/deployed_devices/fleet/key.py b/twilio/rest/preview/deployed_devices/fleet/key.py index dd96745e9c..eabfc456cc 100644 --- a/twilio/rest/preview/deployed_devices/fleet/key.py +++ b/twilio/rest/preview/deployed_devices/fleet/key.py @@ -163,6 +163,7 @@ def __repr__(self) -> str: class KeyContext(InstanceContext): + def __init__(self, version: Version, fleet_sid: str, sid: str): """ Initialize the KeyContext @@ -321,6 +322,7 @@ def __repr__(self) -> str: class KeyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> KeyInstance: """ Build an instance of KeyInstance @@ -341,6 +343,7 @@ def __repr__(self) -> str: class KeyList(ListResource): + def __init__(self, version: Version, fleet_sid: str): """ Initialize the KeyList @@ -370,6 +373,7 @@ def create( :returns: The created KeyInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -400,6 +404,7 @@ async def create_async( :returns: The created KeyInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/preview/hosted_numbers/__init__.py b/twilio/rest/preview/hosted_numbers/__init__.py index fd46160426..7b3a767eef 100644 --- a/twilio/rest/preview/hosted_numbers/__init__.py +++ b/twilio/rest/preview/hosted_numbers/__init__.py @@ -22,6 +22,7 @@ class HostedNumbers(Version): + def __init__(self, domain: Domain): """ Initialize the HostedNumbers version of Preview diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py index 9eaf9674bf..162d0b11a5 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py @@ -26,6 +26,7 @@ class AuthorizationDocumentInstance(InstanceResource): + class Status(object): OPENED = "opened" SIGNING = "signing" @@ -190,6 +191,7 @@ def __repr__(self) -> str: class AuthorizationDocumentContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AuthorizationDocumentContext @@ -366,6 +368,7 @@ def __repr__(self) -> str: class AuthorizationDocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AuthorizationDocumentInstance: """ Build an instance of AuthorizationDocumentInstance @@ -384,6 +387,7 @@ def __repr__(self) -> str: class AuthorizationDocumentList(ListResource): + def __init__(self, version: Version): """ Initialize the AuthorizationDocumentList @@ -416,6 +420,7 @@ def create( :returns: The created AuthorizationDocumentInstance """ + data = values.of( { "HostedNumberOrderSids": serialize.map( @@ -458,6 +463,7 @@ async def create_async( :returns: The created AuthorizationDocumentInstance """ + data = values.of( { "HostedNumberOrderSids": serialize.map( diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py b/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py index cf9b975777..35b67d71c7 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py @@ -23,6 +23,7 @@ class DependentHostedNumberOrderInstance(InstanceResource): + class Status(object): RECEIVED = "received" PENDING_VERIFICATION = "pending-verification" @@ -124,6 +125,7 @@ def __repr__(self) -> str: class DependentHostedNumberOrderPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> DependentHostedNumberOrderInstance: @@ -148,6 +150,7 @@ def __repr__(self) -> str: class DependentHostedNumberOrderList(ListResource): + def __init__(self, version: Version, signing_document_sid: str): """ Initialize the DependentHostedNumberOrderList diff --git a/twilio/rest/preview/hosted_numbers/hosted_number_order.py b/twilio/rest/preview/hosted_numbers/hosted_number_order.py index d3a32b6849..70b9f309ba 100644 --- a/twilio/rest/preview/hosted_numbers/hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/hosted_number_order.py @@ -23,6 +23,7 @@ class HostedNumberOrderInstance(InstanceResource): + class Status(object): RECEIVED = "received" PENDING_VERIFICATION = "pending-verification" @@ -266,6 +267,7 @@ def __repr__(self) -> str: class HostedNumberOrderContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the HostedNumberOrderContext @@ -468,6 +470,7 @@ def __repr__(self) -> str: class HostedNumberOrderPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> HostedNumberOrderInstance: """ Build an instance of HostedNumberOrderInstance @@ -486,6 +489,7 @@ def __repr__(self) -> str: class HostedNumberOrderList(ListResource): + def __init__(self, version: Version): """ Initialize the HostedNumberOrderList @@ -542,6 +546,7 @@ def create( :returns: The created HostedNumberOrderInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -617,6 +622,7 @@ async def create_async( :returns: The created HostedNumberOrderInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/preview/marketplace/__init__.py b/twilio/rest/preview/marketplace/__init__.py index d12d3ab0a5..fcc99a4112 100644 --- a/twilio/rest/preview/marketplace/__init__.py +++ b/twilio/rest/preview/marketplace/__init__.py @@ -20,6 +20,7 @@ class Marketplace(Version): + def __init__(self, domain: Domain): """ Initialize the Marketplace version of Preview diff --git a/twilio/rest/preview/marketplace/available_add_on/__init__.py b/twilio/rest/preview/marketplace/available_add_on/__init__.py index 520cb0fbd4..7743d8a8c3 100644 --- a/twilio/rest/preview/marketplace/available_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/available_add_on/__init__.py @@ -106,6 +106,7 @@ def __repr__(self) -> str: class AvailableAddOnContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the AvailableAddOnContext @@ -184,6 +185,7 @@ def __repr__(self) -> str: class AvailableAddOnPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AvailableAddOnInstance: """ Build an instance of AvailableAddOnInstance @@ -202,6 +204,7 @@ def __repr__(self) -> str: class AvailableAddOnList(ListResource): + def __init__(self, version: Version): """ Initialize the AvailableAddOnList diff --git a/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py b/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py index 96ed8497c1..d27b74cbfc 100644 --- a/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py +++ b/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py @@ -100,6 +100,7 @@ def __repr__(self) -> str: class AvailableAddOnExtensionContext(InstanceContext): + def __init__(self, version: Version, available_add_on_sid: str, sid: str): """ Initialize the AvailableAddOnExtensionContext @@ -172,6 +173,7 @@ def __repr__(self) -> str: class AvailableAddOnExtensionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AvailableAddOnExtensionInstance: """ Build an instance of AvailableAddOnExtensionInstance @@ -194,6 +196,7 @@ def __repr__(self) -> str: class AvailableAddOnExtensionList(ListResource): + def __init__(self, version: Version, available_add_on_sid: str): """ Initialize the AvailableAddOnExtensionList diff --git a/twilio/rest/preview/marketplace/installed_add_on/__init__.py b/twilio/rest/preview/marketplace/installed_add_on/__init__.py index 019092aac4..5a0530aef4 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/installed_add_on/__init__.py @@ -169,6 +169,7 @@ def __repr__(self) -> str: class InstalledAddOnContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the InstalledAddOnContext @@ -327,6 +328,7 @@ def __repr__(self) -> str: class InstalledAddOnPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InstalledAddOnInstance: """ Build an instance of InstalledAddOnInstance @@ -345,6 +347,7 @@ def __repr__(self) -> str: class InstalledAddOnList(ListResource): + def __init__(self, version: Version): """ Initialize the InstalledAddOnList @@ -373,6 +376,7 @@ def create( :returns: The created InstalledAddOnInstance """ + data = values.of( { "AvailableAddOnSid": available_add_on_sid, @@ -407,6 +411,7 @@ async def create_async( :returns: The created InstalledAddOnInstance """ + data = values.of( { "AvailableAddOnSid": available_add_on_sid, diff --git a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py index 592adf0bf5..a6002fa0d1 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py +++ b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py @@ -126,6 +126,7 @@ def __repr__(self) -> str: class InstalledAddOnExtensionContext(InstanceContext): + def __init__(self, version: Version, installed_add_on_sid: str, sid: str): """ Initialize the InstalledAddOnExtensionContext @@ -252,6 +253,7 @@ def __repr__(self) -> str: class InstalledAddOnExtensionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InstalledAddOnExtensionInstance: """ Build an instance of InstalledAddOnExtensionInstance @@ -274,6 +276,7 @@ def __repr__(self) -> str: class InstalledAddOnExtensionList(ListResource): + def __init__(self, version: Version, installed_add_on_sid: str): """ Initialize the InstalledAddOnExtensionList diff --git a/twilio/rest/preview/sync/__init__.py b/twilio/rest/preview/sync/__init__.py index fad9f85c49..d84c79039b 100644 --- a/twilio/rest/preview/sync/__init__.py +++ b/twilio/rest/preview/sync/__init__.py @@ -19,6 +19,7 @@ class Sync(Version): + def __init__(self, domain: Domain): """ Initialize the Sync version of Preview diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py index 9bf53d7759..e270895fbf 100644 --- a/twilio/rest/preview/sync/service/__init__.py +++ b/twilio/rest/preview/sync/service/__init__.py @@ -197,6 +197,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -393,6 +394,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -411,6 +413,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -439,6 +442,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -473,6 +477,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/preview/sync/service/document/__init__.py b/twilio/rest/preview/sync/service/document/__init__.py index 74e89faadf..e7ab4ae8b8 100644 --- a/twilio/rest/preview/sync/service/document/__init__.py +++ b/twilio/rest/preview/sync/service/document/__init__.py @@ -173,6 +173,7 @@ def __repr__(self) -> str: class DocumentContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the DocumentContext @@ -346,6 +347,7 @@ def __repr__(self) -> str: class DocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DocumentInstance: """ Build an instance of DocumentInstance @@ -366,6 +368,7 @@ def __repr__(self) -> str: class DocumentList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the DocumentList @@ -395,6 +398,7 @@ def create( :returns: The created DocumentInstance """ + data = values.of( { "UniqueName": unique_name, @@ -425,6 +429,7 @@ async def create_async( :returns: The created DocumentInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/preview/sync/service/document/document_permission.py b/twilio/rest/preview/sync/service/document/document_permission.py index a32903c5fc..7439d34341 100644 --- a/twilio/rest/preview/sync/service/document/document_permission.py +++ b/twilio/rest/preview/sync/service/document/document_permission.py @@ -159,6 +159,7 @@ def __repr__(self) -> str: class DocumentPermissionContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, document_sid: str, identity: str ): @@ -327,6 +328,7 @@ def __repr__(self) -> str: class DocumentPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DocumentPermissionInstance: """ Build an instance of DocumentPermissionInstance @@ -350,6 +352,7 @@ def __repr__(self) -> str: class DocumentPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, document_sid: str): """ Initialize the DocumentPermissionList diff --git a/twilio/rest/preview/sync/service/sync_list/__init__.py b/twilio/rest/preview/sync/service/sync_list/__init__.py index 091650c44a..fcd2f28ffe 100644 --- a/twilio/rest/preview/sync/service/sync_list/__init__.py +++ b/twilio/rest/preview/sync/service/sync_list/__init__.py @@ -147,6 +147,7 @@ def __repr__(self) -> str: class SyncListContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SyncListContext @@ -268,6 +269,7 @@ def __repr__(self) -> str: class SyncListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListInstance: """ Build an instance of SyncListInstance @@ -288,6 +290,7 @@ def __repr__(self) -> str: class SyncListList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SyncListList @@ -314,6 +317,7 @@ def create( :returns: The created SyncListInstance """ + data = values.of( { "UniqueName": unique_name, @@ -340,6 +344,7 @@ async def create_async( :returns: The created SyncListInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py index 6308a983eb..0cefd6c66b 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py @@ -23,6 +23,7 @@ class SyncListItemInstance(InstanceResource): + class QueryFromBoundType(object): INCLUSIVE = "inclusive" EXCLUSIVE = "exclusive" @@ -178,6 +179,7 @@ def __repr__(self) -> str: class SyncListItemContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, list_sid: str, index: int): """ Initialize the SyncListItemContext @@ -354,6 +356,7 @@ def __repr__(self) -> str: class SyncListItemPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListItemInstance: """ Build an instance of SyncListItemInstance @@ -377,6 +380,7 @@ def __repr__(self) -> str: class SyncListItemList(ListResource): + def __init__(self, version: Version, service_sid: str, list_sid: str): """ Initialize the SyncListItemList @@ -405,6 +409,7 @@ def create(self, data: object) -> SyncListItemInstance: :returns: The created SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), @@ -432,6 +437,7 @@ async def create_async(self, data: object) -> SyncListItemInstance: :returns: The created SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py index 1752a95378..0f4f9e4b28 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py @@ -159,6 +159,7 @@ def __repr__(self) -> str: class SyncListPermissionContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, list_sid: str, identity: str ): @@ -329,6 +330,7 @@ def __repr__(self) -> str: class SyncListPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListPermissionInstance: """ Build an instance of SyncListPermissionInstance @@ -352,6 +354,7 @@ def __repr__(self) -> str: class SyncListPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, list_sid: str): """ Initialize the SyncListPermissionList diff --git a/twilio/rest/preview/sync/service/sync_map/__init__.py b/twilio/rest/preview/sync/service/sync_map/__init__.py index 93fe825c78..1d79936240 100644 --- a/twilio/rest/preview/sync/service/sync_map/__init__.py +++ b/twilio/rest/preview/sync/service/sync_map/__init__.py @@ -147,6 +147,7 @@ def __repr__(self) -> str: class SyncMapContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SyncMapContext @@ -268,6 +269,7 @@ def __repr__(self) -> str: class SyncMapPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapInstance: """ Build an instance of SyncMapInstance @@ -288,6 +290,7 @@ def __repr__(self) -> str: class SyncMapList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SyncMapList @@ -312,6 +315,7 @@ def create(self, unique_name: Union[str, object] = values.unset) -> SyncMapInsta :returns: The created SyncMapInstance """ + data = values.of( { "UniqueName": unique_name, @@ -338,6 +342,7 @@ async def create_async( :returns: The created SyncMapInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py index 8409fafd19..322c8ed225 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py @@ -23,6 +23,7 @@ class SyncMapItemInstance(InstanceResource): + class QueryFromBoundType(object): INCLUSIVE = "inclusive" EXCLUSIVE = "exclusive" @@ -178,6 +179,7 @@ def __repr__(self) -> str: class SyncMapItemContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, map_sid: str, key: str): """ Initialize the SyncMapItemContext @@ -354,6 +356,7 @@ def __repr__(self) -> str: class SyncMapItemPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapItemInstance: """ Build an instance of SyncMapItemInstance @@ -377,6 +380,7 @@ def __repr__(self) -> str: class SyncMapItemList(ListResource): + def __init__(self, version: Version, service_sid: str, map_sid: str): """ Initialize the SyncMapItemList @@ -406,6 +410,7 @@ def create(self, key: str, data: object) -> SyncMapItemInstance: :returns: The created SyncMapItemInstance """ + data = values.of( { "Key": key, @@ -435,6 +440,7 @@ async def create_async(self, key: str, data: object) -> SyncMapItemInstance: :returns: The created SyncMapItemInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py index 83d4c87d9b..999713e0e9 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py @@ -159,6 +159,7 @@ def __repr__(self) -> str: class SyncMapPermissionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, map_sid: str, identity: str): """ Initialize the SyncMapPermissionContext @@ -327,6 +328,7 @@ def __repr__(self) -> str: class SyncMapPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapPermissionInstance: """ Build an instance of SyncMapPermissionInstance @@ -350,6 +352,7 @@ def __repr__(self) -> str: class SyncMapPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, map_sid: str): """ Initialize the SyncMapPermissionList diff --git a/twilio/rest/preview/understand/__init__.py b/twilio/rest/preview/understand/__init__.py deleted file mode 100644 index da659fd3a6..0000000000 --- a/twilio/rest/preview/understand/__init__.py +++ /dev/null @@ -1,42 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.preview.understand.assistant import AssistantList - - -class Understand(Version): - def __init__(self, domain: Domain): - """ - Initialize the Understand version of Preview - - :param domain: The Twilio.preview domain - """ - super().__init__(domain, "understand") - self._assistants: Optional[AssistantList] = None - - @property - def assistants(self) -> AssistantList: - if self._assistants is None: - self._assistants = AssistantList(self) - return self._assistants - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/__init__.py b/twilio/rest/preview/understand/assistant/__init__.py deleted file mode 100644 index 52235aa204..0000000000 --- a/twilio/rest/preview/understand/assistant/__init__.py +++ /dev/null @@ -1,885 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.preview.understand.assistant.assistant_fallback_actions import ( - AssistantFallbackActionsList, -) -from twilio.rest.preview.understand.assistant.assistant_initiation_actions import ( - AssistantInitiationActionsList, -) -from twilio.rest.preview.understand.assistant.dialogue import DialogueList -from twilio.rest.preview.understand.assistant.field_type import FieldTypeList -from twilio.rest.preview.understand.assistant.model_build import ModelBuildList -from twilio.rest.preview.understand.assistant.query import QueryList -from twilio.rest.preview.understand.assistant.style_sheet import StyleSheetList -from twilio.rest.preview.understand.assistant.task import TaskList - - -class AssistantInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Assistant. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :ivar latest_model_build_sid: The unique ID (Sid) of the latest model build. Null if no model has been built. - :ivar links: - :ivar log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. You can use the unique name in the URL path. Unique up to 64 characters long. - :ivar url: - :ivar callback_url: A user-provided URL to send event callbacks to. - :ivar callback_events: Space-separated list of callback events that will trigger callbacks. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.latest_model_build_sid: Optional[str] = payload.get( - "latest_model_build_sid" - ) - self.links: Optional[Dict[str, object]] = payload.get("links") - self.log_queries: Optional[bool] = payload.get("log_queries") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - self.callback_url: Optional[str] = payload.get("callback_url") - self.callback_events: Optional[str] = payload.get("callback_events") - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[AssistantContext] = None - - @property - def _proxy(self) -> "AssistantContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AssistantContext for this AssistantInstance - """ - if self._context is None: - self._context = AssistantContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "AssistantInstance": - """ - Fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AssistantInstance": - """ - Asynchronous coroutine to fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> "AssistantInstance": - """ - Update the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The updated AssistantInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - log_queries=log_queries, - unique_name=unique_name, - callback_url=callback_url, - callback_events=callback_events, - fallback_actions=fallback_actions, - initiation_actions=initiation_actions, - style_sheet=style_sheet, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> "AssistantInstance": - """ - Asynchronous coroutine to update the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The updated AssistantInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - log_queries=log_queries, - unique_name=unique_name, - callback_url=callback_url, - callback_events=callback_events, - fallback_actions=fallback_actions, - initiation_actions=initiation_actions, - style_sheet=style_sheet, - ) - - @property - def assistant_fallback_actions(self) -> AssistantFallbackActionsList: - """ - Access the assistant_fallback_actions - """ - return self._proxy.assistant_fallback_actions - - @property - def assistant_initiation_actions(self) -> AssistantInitiationActionsList: - """ - Access the assistant_initiation_actions - """ - return self._proxy.assistant_initiation_actions - - @property - def dialogues(self) -> DialogueList: - """ - Access the dialogues - """ - return self._proxy.dialogues - - @property - def field_types(self) -> FieldTypeList: - """ - Access the field_types - """ - return self._proxy.field_types - - @property - def model_builds(self) -> ModelBuildList: - """ - Access the model_builds - """ - return self._proxy.model_builds - - @property - def queries(self) -> QueryList: - """ - Access the queries - """ - return self._proxy.queries - - @property - def style_sheet(self) -> StyleSheetList: - """ - Access the style_sheet - """ - return self._proxy.style_sheet - - @property - def tasks(self) -> TaskList: - """ - Access the tasks - """ - return self._proxy.tasks - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AssistantContext(InstanceContext): - def __init__(self, version: Version, sid: str): - """ - Initialize the AssistantContext - - :param version: Version that contains the resource - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/Assistants/{sid}".format(**self._solution) - - self._assistant_fallback_actions: Optional[AssistantFallbackActionsList] = None - self._assistant_initiation_actions: Optional[AssistantInitiationActionsList] = ( - None - ) - self._dialogues: Optional[DialogueList] = None - self._field_types: Optional[FieldTypeList] = None - self._model_builds: Optional[ModelBuildList] = None - self._queries: Optional[QueryList] = None - self._style_sheet: Optional[StyleSheetList] = None - self._tasks: Optional[TaskList] = None - - def delete(self) -> bool: - """ - Deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AssistantInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> AssistantInstance: - """ - Fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return AssistantInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> AssistantInstance: - """ - Asynchronous coroutine to fetch the AssistantInstance - - - :returns: The fetched AssistantInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return AssistantInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Update the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The updated AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "FallbackActions": serialize.object(fallback_actions), - "InitiationActions": serialize.object(initiation_actions), - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload, sid=self._solution["sid"]) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Asynchronous coroutine to update the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The updated AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "FallbackActions": serialize.object(fallback_actions), - "InitiationActions": serialize.object(initiation_actions), - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload, sid=self._solution["sid"]) - - @property - def assistant_fallback_actions(self) -> AssistantFallbackActionsList: - """ - Access the assistant_fallback_actions - """ - if self._assistant_fallback_actions is None: - self._assistant_fallback_actions = AssistantFallbackActionsList( - self._version, - self._solution["sid"], - ) - return self._assistant_fallback_actions - - @property - def assistant_initiation_actions(self) -> AssistantInitiationActionsList: - """ - Access the assistant_initiation_actions - """ - if self._assistant_initiation_actions is None: - self._assistant_initiation_actions = AssistantInitiationActionsList( - self._version, - self._solution["sid"], - ) - return self._assistant_initiation_actions - - @property - def dialogues(self) -> DialogueList: - """ - Access the dialogues - """ - if self._dialogues is None: - self._dialogues = DialogueList( - self._version, - self._solution["sid"], - ) - return self._dialogues - - @property - def field_types(self) -> FieldTypeList: - """ - Access the field_types - """ - if self._field_types is None: - self._field_types = FieldTypeList( - self._version, - self._solution["sid"], - ) - return self._field_types - - @property - def model_builds(self) -> ModelBuildList: - """ - Access the model_builds - """ - if self._model_builds is None: - self._model_builds = ModelBuildList( - self._version, - self._solution["sid"], - ) - return self._model_builds - - @property - def queries(self) -> QueryList: - """ - Access the queries - """ - if self._queries is None: - self._queries = QueryList( - self._version, - self._solution["sid"], - ) - return self._queries - - @property - def style_sheet(self) -> StyleSheetList: - """ - Access the style_sheet - """ - if self._style_sheet is None: - self._style_sheet = StyleSheetList( - self._version, - self._solution["sid"], - ) - return self._style_sheet - - @property - def tasks(self) -> TaskList: - """ - Access the tasks - """ - if self._tasks is None: - self._tasks = TaskList( - self._version, - self._solution["sid"], - ) - return self._tasks - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AssistantPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> AssistantInstance: - """ - Build an instance of AssistantInstance - - :param payload: Payload response from the API - """ - return AssistantInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class AssistantList(ListResource): - def __init__(self, version: Version): - """ - Initialize the AssistantList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Assistants" - - def create( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Create the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The created AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "FallbackActions": serialize.object(fallback_actions), - "InitiationActions": serialize.object(initiation_actions), - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload) - - async def create_async( - self, - friendly_name: Union[str, object] = values.unset, - log_queries: Union[bool, object] = values.unset, - unique_name: Union[str, object] = values.unset, - callback_url: Union[str, object] = values.unset, - callback_events: Union[str, object] = values.unset, - fallback_actions: Union[object, object] = values.unset, - initiation_actions: Union[object, object] = values.unset, - style_sheet: Union[object, object] = values.unset, - ) -> AssistantInstance: - """ - Asynchronously create the AssistantInstance - - :param friendly_name: A text description for the Assistant. It is non-unique and can up to 255 characters long. - :param log_queries: A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param callback_url: A user-provided URL to send event callbacks to. - :param callback_events: Space-separated list of callback events that will trigger callbacks. - :param fallback_actions: The JSON actions to be executed when the user's input is not recognized as matching any Task. - :param initiation_actions: The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. - :param style_sheet: The JSON object that holds the style sheet for the assistant - - :returns: The created AssistantInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "LogQueries": log_queries, - "UniqueName": unique_name, - "CallbackUrl": callback_url, - "CallbackEvents": callback_events, - "FallbackActions": serialize.object(fallback_actions), - "InitiationActions": serialize.object(initiation_actions), - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInstance(self._version, payload) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[AssistantInstance]: - """ - Streams AssistantInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[AssistantInstance]: - """ - Asynchronously streams AssistantInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AssistantInstance]: - """ - Lists AssistantInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AssistantInstance]: - """ - Asynchronously lists AssistantInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AssistantPage: - """ - Retrieve a single page of AssistantInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AssistantInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return AssistantPage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AssistantPage: - """ - Asynchronously retrieve a single page of AssistantInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AssistantInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return AssistantPage(self._version, response) - - def get_page(self, target_url: str) -> AssistantPage: - """ - Retrieve a specific page of AssistantInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AssistantInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return AssistantPage(self._version, response) - - async def get_page_async(self, target_url: str) -> AssistantPage: - """ - Asynchronously retrieve a specific page of AssistantInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AssistantInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return AssistantPage(self._version, response) - - def get(self, sid: str) -> AssistantContext: - """ - Constructs a AssistantContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return AssistantContext(self._version, sid=sid) - - def __call__(self, sid: str) -> AssistantContext: - """ - Constructs a AssistantContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return AssistantContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py b/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py deleted file mode 100644 index ca696d735d..0000000000 --- a/twilio/rest/preview/understand/assistant/assistant_fallback_actions.py +++ /dev/null @@ -1,277 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional, Union -from twilio.base import serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class AssistantFallbackActionsInstance(InstanceResource): - """ - :ivar account_sid: - :ivar assistant_sid: - :ivar url: - :ivar data: - """ - - def __init__(self, version: Version, payload: Dict[str, Any], assistant_sid: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - } - self._context: Optional[AssistantFallbackActionsContext] = None - - @property - def _proxy(self) -> "AssistantFallbackActionsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AssistantFallbackActionsContext for this AssistantFallbackActionsInstance - """ - if self._context is None: - self._context = AssistantFallbackActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - ) - return self._context - - def fetch(self) -> "AssistantFallbackActionsInstance": - """ - Fetch the AssistantFallbackActionsInstance - - - :returns: The fetched AssistantFallbackActionsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AssistantFallbackActionsInstance": - """ - Asynchronous coroutine to fetch the AssistantFallbackActionsInstance - - - :returns: The fetched AssistantFallbackActionsInstance - """ - return await self._proxy.fetch_async() - - def update( - self, fallback_actions: Union[object, object] = values.unset - ) -> "AssistantFallbackActionsInstance": - """ - Update the AssistantFallbackActionsInstance - - :param fallback_actions: - - :returns: The updated AssistantFallbackActionsInstance - """ - return self._proxy.update( - fallback_actions=fallback_actions, - ) - - async def update_async( - self, fallback_actions: Union[object, object] = values.unset - ) -> "AssistantFallbackActionsInstance": - """ - Asynchronous coroutine to update the AssistantFallbackActionsInstance - - :param fallback_actions: - - :returns: The updated AssistantFallbackActionsInstance - """ - return await self._proxy.update_async( - fallback_actions=fallback_actions, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format( - context - ) - - -class AssistantFallbackActionsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the AssistantFallbackActionsContext - - :param version: Version that contains the resource - :param assistant_sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/FallbackActions".format( - **self._solution - ) - - def fetch(self) -> AssistantFallbackActionsInstance: - """ - Fetch the AssistantFallbackActionsInstance - - - :returns: The fetched AssistantFallbackActionsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return AssistantFallbackActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - async def fetch_async(self) -> AssistantFallbackActionsInstance: - """ - Asynchronous coroutine to fetch the AssistantFallbackActionsInstance - - - :returns: The fetched AssistantFallbackActionsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return AssistantFallbackActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - def update( - self, fallback_actions: Union[object, object] = values.unset - ) -> AssistantFallbackActionsInstance: - """ - Update the AssistantFallbackActionsInstance - - :param fallback_actions: - - :returns: The updated AssistantFallbackActionsInstance - """ - data = values.of( - { - "FallbackActions": serialize.object(fallback_actions), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantFallbackActionsInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def update_async( - self, fallback_actions: Union[object, object] = values.unset - ) -> AssistantFallbackActionsInstance: - """ - Asynchronous coroutine to update the AssistantFallbackActionsInstance - - :param fallback_actions: - - :returns: The updated AssistantFallbackActionsInstance - """ - data = values.of( - { - "FallbackActions": serialize.object(fallback_actions), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantFallbackActionsInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format( - context - ) - - -class AssistantFallbackActionsList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the AssistantFallbackActionsList - - :param version: Version that contains the resource - :param assistant_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self) -> AssistantFallbackActionsContext: - """ - Constructs a AssistantFallbackActionsContext - - """ - return AssistantFallbackActionsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __call__(self) -> AssistantFallbackActionsContext: - """ - Constructs a AssistantFallbackActionsContext - - """ - return AssistantFallbackActionsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py b/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py deleted file mode 100644 index 051925df27..0000000000 --- a/twilio/rest/preview/understand/assistant/assistant_initiation_actions.py +++ /dev/null @@ -1,281 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional, Union -from twilio.base import serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class AssistantInitiationActionsInstance(InstanceResource): - """ - :ivar account_sid: - :ivar assistant_sid: - :ivar url: - :ivar data: - """ - - def __init__(self, version: Version, payload: Dict[str, Any], assistant_sid: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - } - self._context: Optional[AssistantInitiationActionsContext] = None - - @property - def _proxy(self) -> "AssistantInitiationActionsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AssistantInitiationActionsContext for this AssistantInitiationActionsInstance - """ - if self._context is None: - self._context = AssistantInitiationActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - ) - return self._context - - def fetch(self) -> "AssistantInitiationActionsInstance": - """ - Fetch the AssistantInitiationActionsInstance - - - :returns: The fetched AssistantInitiationActionsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AssistantInitiationActionsInstance": - """ - Asynchronous coroutine to fetch the AssistantInitiationActionsInstance - - - :returns: The fetched AssistantInitiationActionsInstance - """ - return await self._proxy.fetch_async() - - def update( - self, initiation_actions: Union[object, object] = values.unset - ) -> "AssistantInitiationActionsInstance": - """ - Update the AssistantInitiationActionsInstance - - :param initiation_actions: - - :returns: The updated AssistantInitiationActionsInstance - """ - return self._proxy.update( - initiation_actions=initiation_actions, - ) - - async def update_async( - self, initiation_actions: Union[object, object] = values.unset - ) -> "AssistantInitiationActionsInstance": - """ - Asynchronous coroutine to update the AssistantInitiationActionsInstance - - :param initiation_actions: - - :returns: The updated AssistantInitiationActionsInstance - """ - return await self._proxy.update_async( - initiation_actions=initiation_actions, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return ( - "".format( - context - ) - ) - - -class AssistantInitiationActionsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the AssistantInitiationActionsContext - - :param version: Version that contains the resource - :param assistant_sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/InitiationActions".format( - **self._solution - ) - - def fetch(self) -> AssistantInitiationActionsInstance: - """ - Fetch the AssistantInitiationActionsInstance - - - :returns: The fetched AssistantInitiationActionsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return AssistantInitiationActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - async def fetch_async(self) -> AssistantInitiationActionsInstance: - """ - Asynchronous coroutine to fetch the AssistantInitiationActionsInstance - - - :returns: The fetched AssistantInitiationActionsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return AssistantInitiationActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - def update( - self, initiation_actions: Union[object, object] = values.unset - ) -> AssistantInitiationActionsInstance: - """ - Update the AssistantInitiationActionsInstance - - :param initiation_actions: - - :returns: The updated AssistantInitiationActionsInstance - """ - data = values.of( - { - "InitiationActions": serialize.object(initiation_actions), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInitiationActionsInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def update_async( - self, initiation_actions: Union[object, object] = values.unset - ) -> AssistantInitiationActionsInstance: - """ - Asynchronous coroutine to update the AssistantInitiationActionsInstance - - :param initiation_actions: - - :returns: The updated AssistantInitiationActionsInstance - """ - data = values.of( - { - "InitiationActions": serialize.object(initiation_actions), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return AssistantInitiationActionsInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return ( - "".format( - context - ) - ) - - -class AssistantInitiationActionsList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the AssistantInitiationActionsList - - :param version: Version that contains the resource - :param assistant_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self) -> AssistantInitiationActionsContext: - """ - Constructs a AssistantInitiationActionsContext - - """ - return AssistantInitiationActionsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __call__(self) -> AssistantInitiationActionsContext: - """ - Constructs a AssistantInitiationActionsContext - - """ - return AssistantInitiationActionsContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/dialogue.py b/twilio/rest/preview/understand/assistant/dialogue.py deleted file mode 100644 index a9cf86a45c..0000000000 --- a/twilio/rest/preview/understand/assistant/dialogue.py +++ /dev/null @@ -1,208 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class DialogueInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Field. - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar sid: The unique ID of the Dialogue - :ivar data: The dialogue memory object as json - :ivar url: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.data: Optional[Dict[str, object]] = payload.get("data") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[DialogueContext] = None - - @property - def _proxy(self) -> "DialogueContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DialogueContext for this DialogueInstance - """ - if self._context is None: - self._context = DialogueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def fetch(self) -> "DialogueInstance": - """ - Fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DialogueInstance": - """ - Asynchronous coroutine to fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DialogueContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the DialogueContext - - :param version: Version that contains the resource - :param assistant_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Dialogues/{sid}".format( - **self._solution - ) - - def fetch(self) -> DialogueInstance: - """ - Fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return DialogueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> DialogueInstance: - """ - Asynchronous coroutine to fetch the DialogueInstance - - - :returns: The fetched DialogueInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return DialogueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DialogueList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the DialogueList - - :param version: Version that contains the resource - :param assistant_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self, sid: str) -> DialogueContext: - """ - Constructs a DialogueContext - - :param sid: - """ - return DialogueContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> DialogueContext: - """ - Constructs a DialogueContext - - :param sid: - """ - return DialogueContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/field_type/__init__.py b/twilio/rest/preview/understand/assistant/field_type/__init__.py deleted file mode 100644 index 18cc0ff735..0000000000 --- a/twilio/rest/preview/understand/assistant/field_type/__init__.py +++ /dev/null @@ -1,652 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.preview.understand.assistant.field_type.field_value import ( - FieldValueList, -) - - -class FieldTypeInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Field Type. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :ivar links: - :ivar assistant_sid: The unique ID of the Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :ivar url: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldTypeContext] = None - - @property - def _proxy(self) -> "FieldTypeContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldTypeContext for this FieldTypeInstance - """ - if self._context is None: - self._context = FieldTypeContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldTypeInstance": - """ - Fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldTypeInstance": - """ - Asynchronous coroutine to fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> "FieldTypeInstance": - """ - Update the FieldTypeInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The updated FieldTypeInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - unique_name=unique_name, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> "FieldTypeInstance": - """ - Asynchronous coroutine to update the FieldTypeInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The updated FieldTypeInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - unique_name=unique_name, - ) - - @property - def field_values(self) -> FieldValueList: - """ - Access the field_values - """ - return self._proxy.field_values - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldTypeContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the FieldTypeContext - - :param version: Version that contains the resource - :param assistant_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{sid}".format( - **self._solution - ) - - self._field_values: Optional[FieldValueList] = None - - def delete(self) -> bool: - """ - Deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldTypeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldTypeInstance: - """ - Fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldTypeInstance: - """ - Asynchronous coroutine to fetch the FieldTypeInstance - - - :returns: The fetched FieldTypeInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> FieldTypeInstance: - """ - Update the FieldTypeInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The updated FieldTypeInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> FieldTypeInstance: - """ - Asynchronous coroutine to update the FieldTypeInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The updated FieldTypeInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - @property - def field_values(self) -> FieldValueList: - """ - Access the field_values - """ - if self._field_values is None: - self._field_values = FieldValueList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._field_values - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldTypePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldTypeInstance: - """ - Build an instance of FieldTypeInstance - - :param payload: Payload response from the API - """ - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldTypeList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the FieldTypeList - - :param version: Version that contains the resource - :param assistant_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes".format(**self._solution) - - def create( - self, unique_name: str, friendly_name: Union[str, object] = values.unset - ) -> FieldTypeInstance: - """ - Create the FieldTypeInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - - :returns: The created FieldTypeInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, unique_name: str, friendly_name: Union[str, object] = values.unset - ) -> FieldTypeInstance: - """ - Asynchronously create the FieldTypeInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - - :returns: The created FieldTypeInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldTypeInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldTypeInstance]: - """ - Streams FieldTypeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldTypeInstance]: - """ - Asynchronously streams FieldTypeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldTypeInstance]: - """ - Lists FieldTypeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldTypeInstance]: - """ - Asynchronously lists FieldTypeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldTypePage: - """ - Retrieve a single page of FieldTypeInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldTypeInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldTypePage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldTypePage: - """ - Asynchronously retrieve a single page of FieldTypeInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldTypeInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldTypePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldTypePage: - """ - Retrieve a specific page of FieldTypeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldTypeInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldTypePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldTypePage: - """ - Asynchronously retrieve a specific page of FieldTypeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldTypeInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldTypePage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldTypeContext: - """ - Constructs a FieldTypeContext - - :param sid: - """ - return FieldTypeContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> FieldTypeContext: - """ - Constructs a FieldTypeContext - - :param sid: - """ - return FieldTypeContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/field_type/field_value.py b/twilio/rest/preview/understand/assistant/field_type/field_value.py deleted file mode 100644 index 58e70c4a7e..0000000000 --- a/twilio/rest/preview/understand/assistant/field_type/field_value.py +++ /dev/null @@ -1,575 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class FieldValueInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Field Value. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar field_type_sid: The unique ID of the Field Type associated with this Field Value. - :ivar language: An ISO language-country string of the value. - :ivar assistant_sid: The unique ID of the Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar value: The Field Value itself. - :ivar url: - :ivar synonym_of: A value that indicates this field value is a synonym of. Empty if the value is not a synonym. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - field_type_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.field_type_sid: Optional[str] = payload.get("field_type_sid") - self.language: Optional[str] = payload.get("language") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.value: Optional[str] = payload.get("value") - self.url: Optional[str] = payload.get("url") - self.synonym_of: Optional[str] = payload.get("synonym_of") - - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldValueContext] = None - - @property - def _proxy(self) -> "FieldValueContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldValueContext for this FieldValueInstance - """ - if self._context is None: - self._context = FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldValueInstance": - """ - Fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldValueInstance": - """ - Asynchronous coroutine to fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldValueContext(InstanceContext): - def __init__( - self, version: Version, assistant_sid: str, field_type_sid: str, sid: str - ): - """ - Initialize the FieldValueContext - - :param version: Version that contains the resource - :param assistant_sid: - :param field_type_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{field_type_sid}/FieldValues/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldValueInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldValueInstance: - """ - Fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldValueInstance: - """ - Asynchronous coroutine to fetch the FieldValueInstance - - - :returns: The fetched FieldValueInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldValuePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldValueInstance: - """ - Build an instance of FieldValueInstance - - :param payload: Payload response from the API - """ - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldValueList(ListResource): - def __init__(self, version: Version, assistant_sid: str, field_type_sid: str): - """ - Initialize the FieldValueList - - :param version: Version that contains the resource - :param assistant_sid: - :param field_type_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "field_type_sid": field_type_sid, - } - self._uri = "/Assistants/{assistant_sid}/FieldTypes/{field_type_sid}/FieldValues".format( - **self._solution - ) - - def create( - self, language: str, value: str, synonym_of: Union[str, object] = values.unset - ) -> FieldValueInstance: - """ - Create the FieldValueInstance - - :param language: An ISO language-country string of the value. - :param value: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param synonym_of: A value that indicates this field value is a synonym of. Empty if the value is not a synonym. - - :returns: The created FieldValueInstance - """ - data = values.of( - { - "Language": language, - "Value": value, - "SynonymOf": synonym_of, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - async def create_async( - self, language: str, value: str, synonym_of: Union[str, object] = values.unset - ) -> FieldValueInstance: - """ - Asynchronously create the FieldValueInstance - - :param language: An ISO language-country string of the value. - :param value: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param synonym_of: A value that indicates this field value is a synonym of. Empty if the value is not a synonym. - - :returns: The created FieldValueInstance - """ - data = values.of( - { - "Language": language, - "Value": value, - "SynonymOf": synonym_of, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldValueInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - ) - - def stream( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldValueInstance]: - """ - Streams FieldValueInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the value. For example: *en-US* - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(language=language, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldValueInstance]: - """ - Asynchronously streams FieldValueInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the value. For example: *en-US* - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(language=language, page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldValueInstance]: - """ - Lists FieldValueInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the value. For example: *en-US* - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldValueInstance]: - """ - Asynchronously lists FieldValueInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the value. For example: *en-US* - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldValuePage: - """ - Retrieve a single page of FieldValueInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the value. For example: *en-US* - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldValueInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldValuePage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldValuePage: - """ - Asynchronously retrieve a single page of FieldValueInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the value. For example: *en-US* - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldValueInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldValuePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldValuePage: - """ - Retrieve a specific page of FieldValueInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldValueInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldValuePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldValuePage: - """ - Asynchronously retrieve a specific page of FieldValueInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldValueInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldValuePage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldValueContext: - """ - Constructs a FieldValueContext - - :param sid: - """ - return FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> FieldValueContext: - """ - Constructs a FieldValueContext - - :param sid: - """ - return FieldValueContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - field_type_sid=self._solution["field_type_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/model_build.py b/twilio/rest/preview/understand/assistant/model_build.py deleted file mode 100644 index bddcf37bac..0000000000 --- a/twilio/rest/preview/understand/assistant/model_build.py +++ /dev/null @@ -1,626 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class ModelBuildInstance(InstanceResource): - class Status(object): - ENQUEUED = "enqueued" - BUILDING = "building" - COMPLETED = "completed" - FAILED = "failed" - CANCELED = "canceled" - - """ - :ivar account_sid: The unique ID of the Account that created this Model Build. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar status: - :ivar unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :ivar url: - :ivar build_duration: The time in seconds it took to build the model. - :ivar error_code: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.status: Optional["ModelBuildInstance.Status"] = payload.get("status") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - self.build_duration: Optional[int] = deserialize.integer( - payload.get("build_duration") - ) - self.error_code: Optional[int] = deserialize.integer(payload.get("error_code")) - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[ModelBuildContext] = None - - @property - def _proxy(self) -> "ModelBuildContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: ModelBuildContext for this ModelBuildInstance - """ - if self._context is None: - self._context = ModelBuildContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "ModelBuildInstance": - """ - Fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "ModelBuildInstance": - """ - Asynchronous coroutine to fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - return await self._proxy.fetch_async() - - def update( - self, unique_name: Union[str, object] = values.unset - ) -> "ModelBuildInstance": - """ - Update the ModelBuildInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The updated ModelBuildInstance - """ - return self._proxy.update( - unique_name=unique_name, - ) - - async def update_async( - self, unique_name: Union[str, object] = values.unset - ) -> "ModelBuildInstance": - """ - Asynchronous coroutine to update the ModelBuildInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The updated ModelBuildInstance - """ - return await self._proxy.update_async( - unique_name=unique_name, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class ModelBuildContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the ModelBuildContext - - :param version: Version that contains the resource - :param assistant_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/ModelBuilds/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the ModelBuildInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> ModelBuildInstance: - """ - Fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> ModelBuildInstance: - """ - Asynchronous coroutine to fetch the ModelBuildInstance - - - :returns: The fetched ModelBuildInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, unique_name: Union[str, object] = values.unset - ) -> ModelBuildInstance: - """ - Update the ModelBuildInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The updated ModelBuildInstance - """ - data = values.of( - { - "UniqueName": unique_name, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, unique_name: Union[str, object] = values.unset - ) -> ModelBuildInstance: - """ - Asynchronous coroutine to update the ModelBuildInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The updated ModelBuildInstance - """ - data = values.of( - { - "UniqueName": unique_name, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class ModelBuildPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> ModelBuildInstance: - """ - Build an instance of ModelBuildInstance - - :param payload: Payload response from the API - """ - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class ModelBuildList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the ModelBuildList - - :param version: Version that contains the resource - :param assistant_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/ModelBuilds".format(**self._solution) - - def create( - self, - status_callback: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> ModelBuildInstance: - """ - Create the ModelBuildInstance - - :param status_callback: - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The created ModelBuildInstance - """ - data = values.of( - { - "StatusCallback": status_callback, - "UniqueName": unique_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - status_callback: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - ) -> ModelBuildInstance: - """ - Asynchronously create the ModelBuildInstance - - :param status_callback: - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 - - :returns: The created ModelBuildInstance - """ - data = values.of( - { - "StatusCallback": status_callback, - "UniqueName": unique_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return ModelBuildInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[ModelBuildInstance]: - """ - Streams ModelBuildInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[ModelBuildInstance]: - """ - Asynchronously streams ModelBuildInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ModelBuildInstance]: - """ - Lists ModelBuildInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ModelBuildInstance]: - """ - Asynchronously lists ModelBuildInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ModelBuildPage: - """ - Retrieve a single page of ModelBuildInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of ModelBuildInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return ModelBuildPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ModelBuildPage: - """ - Asynchronously retrieve a single page of ModelBuildInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of ModelBuildInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return ModelBuildPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> ModelBuildPage: - """ - Retrieve a specific page of ModelBuildInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ModelBuildInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return ModelBuildPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> ModelBuildPage: - """ - Asynchronously retrieve a specific page of ModelBuildInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ModelBuildInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return ModelBuildPage(self._version, response, self._solution) - - def get(self, sid: str) -> ModelBuildContext: - """ - Constructs a ModelBuildContext - - :param sid: - """ - return ModelBuildContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> ModelBuildContext: - """ - Constructs a ModelBuildContext - - :param sid: - """ - return ModelBuildContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/query.py b/twilio/rest/preview/understand/assistant/query.py deleted file mode 100644 index 3fb1b114ab..0000000000 --- a/twilio/rest/preview/understand/assistant/query.py +++ /dev/null @@ -1,713 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class QueryInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Query. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar results: The natural language analysis results which include the Task recognized, the confidence score and a list of identified Fields. - :ivar language: An ISO language-country string of the sample. - :ivar model_build_sid: The unique ID of the Model Build queried. - :ivar query: The end-user's natural language input. - :ivar sample_sid: An optional reference to the Sample created from this query. - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :ivar url: - :ivar source_channel: The communication channel where this end-user input came from - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.results: Optional[Dict[str, object]] = payload.get("results") - self.language: Optional[str] = payload.get("language") - self.model_build_sid: Optional[str] = payload.get("model_build_sid") - self.query: Optional[str] = payload.get("query") - self.sample_sid: Optional[str] = payload.get("sample_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.status: Optional[str] = payload.get("status") - self.url: Optional[str] = payload.get("url") - self.source_channel: Optional[str] = payload.get("source_channel") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[QueryContext] = None - - @property - def _proxy(self) -> "QueryContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: QueryContext for this QueryInstance - """ - if self._context is None: - self._context = QueryContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "QueryInstance": - """ - Fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "QueryInstance": - """ - Asynchronous coroutine to fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> "QueryInstance": - """ - Update the QueryInstance - - :param sample_sid: An optional reference to the Sample created from this query. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - - :returns: The updated QueryInstance - """ - return self._proxy.update( - sample_sid=sample_sid, - status=status, - ) - - async def update_async( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> "QueryInstance": - """ - Asynchronous coroutine to update the QueryInstance - - :param sample_sid: An optional reference to the Sample created from this query. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - - :returns: The updated QueryInstance - """ - return await self._proxy.update_async( - sample_sid=sample_sid, - status=status, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class QueryContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the QueryContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Queries/{sid}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the QueryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> QueryInstance: - """ - Fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> QueryInstance: - """ - Asynchronous coroutine to fetch the QueryInstance - - - :returns: The fetched QueryInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Update the QueryInstance - - :param sample_sid: An optional reference to the Sample created from this query. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - - :returns: The updated QueryInstance - """ - data = values.of( - { - "SampleSid": sample_sid, - "Status": status, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - sample_sid: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Asynchronous coroutine to update the QueryInstance - - :param sample_sid: An optional reference to the Sample created from this query. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - - :returns: The updated QueryInstance - """ - data = values.of( - { - "SampleSid": sample_sid, - "Status": status, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class QueryPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> QueryInstance: - """ - Build an instance of QueryInstance - - :param payload: Payload response from the API - """ - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class QueryList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the QueryList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Queries".format(**self._solution) - - def create( - self, - language: str, - query: str, - tasks: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - field: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Create the QueryInstance - - :param language: An ISO language-country string of the sample. - :param query: A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. - :param tasks: Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* - :param model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param field: Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* - - :returns: The created QueryInstance - """ - data = values.of( - { - "Language": language, - "Query": query, - "Tasks": tasks, - "ModelBuild": model_build, - "Field": field, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - language: str, - query: str, - tasks: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - field: Union[str, object] = values.unset, - ) -> QueryInstance: - """ - Asynchronously create the QueryInstance - - :param language: An ISO language-country string of the sample. - :param query: A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. - :param tasks: Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* - :param model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param field: Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* - - :returns: The created QueryInstance - """ - data = values.of( - { - "Language": language, - "Query": query, - "Tasks": tasks, - "ModelBuild": model_build, - "Field": field, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return QueryInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[QueryInstance]: - """ - Streams QueryInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the sample. - :param str model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page( - language=language, - model_build=model_build, - status=status, - page_size=limits["page_size"], - ) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[QueryInstance]: - """ - Asynchronously streams QueryInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the sample. - :param str model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - language=language, - model_build=model_build, - status=status, - page_size=limits["page_size"], - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[QueryInstance]: - """ - Lists QueryInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the sample. - :param str model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - model_build=model_build, - status=status, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[QueryInstance]: - """ - Asynchronously lists QueryInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the sample. - :param str model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param str status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - model_build=model_build, - status=status, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> QueryPage: - """ - Retrieve a single page of QueryInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the sample. - :param model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of QueryInstance - """ - data = values.of( - { - "Language": language, - "ModelBuild": model_build, - "Status": status, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return QueryPage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - model_build: Union[str, object] = values.unset, - status: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> QueryPage: - """ - Asynchronously retrieve a single page of QueryInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the sample. - :param model_build: The Model Build Sid or unique name of the Model Build to be queried. - :param status: A string that described the query status. The values can be: pending_review, reviewed, discarded - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of QueryInstance - """ - data = values.of( - { - "Language": language, - "ModelBuild": model_build, - "Status": status, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return QueryPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> QueryPage: - """ - Retrieve a specific page of QueryInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of QueryInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return QueryPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> QueryPage: - """ - Asynchronously retrieve a specific page of QueryInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of QueryInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return QueryPage(self._version, response, self._solution) - - def get(self, sid: str) -> QueryContext: - """ - Constructs a QueryContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return QueryContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> QueryContext: - """ - Constructs a QueryContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return QueryContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/style_sheet.py b/twilio/rest/preview/understand/assistant/style_sheet.py deleted file mode 100644 index 881a658a44..0000000000 --- a/twilio/rest/preview/understand/assistant/style_sheet.py +++ /dev/null @@ -1,271 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional, Union -from twilio.base import serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class StyleSheetInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Assistant - :ivar assistant_sid: The unique ID of the Assistant - :ivar url: - :ivar data: The JSON style sheet object - """ - - def __init__(self, version: Version, payload: Dict[str, Any], assistant_sid: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - } - self._context: Optional[StyleSheetContext] = None - - @property - def _proxy(self) -> "StyleSheetContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: StyleSheetContext for this StyleSheetInstance - """ - if self._context is None: - self._context = StyleSheetContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - ) - return self._context - - def fetch(self) -> "StyleSheetInstance": - """ - Fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "StyleSheetInstance": - """ - Asynchronous coroutine to fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - return await self._proxy.fetch_async() - - def update( - self, style_sheet: Union[object, object] = values.unset - ) -> "StyleSheetInstance": - """ - Update the StyleSheetInstance - - :param style_sheet: The JSON Style sheet string - - :returns: The updated StyleSheetInstance - """ - return self._proxy.update( - style_sheet=style_sheet, - ) - - async def update_async( - self, style_sheet: Union[object, object] = values.unset - ) -> "StyleSheetInstance": - """ - Asynchronous coroutine to update the StyleSheetInstance - - :param style_sheet: The JSON Style sheet string - - :returns: The updated StyleSheetInstance - """ - return await self._proxy.update_async( - style_sheet=style_sheet, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class StyleSheetContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the StyleSheetContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/StyleSheet".format(**self._solution) - - def fetch(self) -> StyleSheetInstance: - """ - Fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return StyleSheetInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - async def fetch_async(self) -> StyleSheetInstance: - """ - Asynchronous coroutine to fetch the StyleSheetInstance - - - :returns: The fetched StyleSheetInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return StyleSheetInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - ) - - def update( - self, style_sheet: Union[object, object] = values.unset - ) -> StyleSheetInstance: - """ - Update the StyleSheetInstance - - :param style_sheet: The JSON Style sheet string - - :returns: The updated StyleSheetInstance - """ - data = values.of( - { - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return StyleSheetInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def update_async( - self, style_sheet: Union[object, object] = values.unset - ) -> StyleSheetInstance: - """ - Asynchronous coroutine to update the StyleSheetInstance - - :param style_sheet: The JSON Style sheet string - - :returns: The updated StyleSheetInstance - """ - data = values.of( - { - "StyleSheet": serialize.object(style_sheet), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return StyleSheetInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class StyleSheetList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the StyleSheetList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - - def get(self) -> StyleSheetContext: - """ - Constructs a StyleSheetContext - - """ - return StyleSheetContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __call__(self) -> StyleSheetContext: - """ - Constructs a StyleSheetContext - - """ - return StyleSheetContext( - self._version, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/task/__init__.py b/twilio/rest/preview/understand/assistant/task/__init__.py deleted file mode 100644 index 0447151a01..0000000000 --- a/twilio/rest/preview/understand/assistant/task/__init__.py +++ /dev/null @@ -1,758 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.preview.understand.assistant.task.field import FieldList -from twilio.rest.preview.understand.assistant.task.sample import SampleList -from twilio.rest.preview.understand.assistant.task.task_actions import TaskActionsList -from twilio.rest.preview.understand.assistant.task.task_statistics import ( - TaskStatisticsList, -) - - -class TaskInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Task. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :ivar links: - :ivar assistant_sid: The unique ID of the Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :ivar actions_url: User-provided HTTP endpoint where from the assistant fetches actions - :ivar url: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.actions_url: Optional[str] = payload.get("actions_url") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid or self.sid, - } - self._context: Optional[TaskContext] = None - - @property - def _proxy(self) -> "TaskContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskContext for this TaskInstance - """ - if self._context is None: - self._context = TaskContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "TaskInstance": - """ - Fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskInstance": - """ - Asynchronous coroutine to fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> "TaskInstance": - """ - Update the TaskInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The updated TaskInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - unique_name=unique_name, - actions=actions, - actions_url=actions_url, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> "TaskInstance": - """ - Asynchronous coroutine to update the TaskInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The updated TaskInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - unique_name=unique_name, - actions=actions, - actions_url=actions_url, - ) - - @property - def fields(self) -> FieldList: - """ - Access the fields - """ - return self._proxy.fields - - @property - def samples(self) -> SampleList: - """ - Access the samples - """ - return self._proxy.samples - - @property - def task_actions(self) -> TaskActionsList: - """ - Access the task_actions - """ - return self._proxy.task_actions - - @property - def statistics(self) -> TaskStatisticsList: - """ - Access the statistics - """ - return self._proxy.statistics - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, sid: str): - """ - Initialize the TaskContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{sid}".format(**self._solution) - - self._fields: Optional[FieldList] = None - self._samples: Optional[SampleList] = None - self._task_actions: Optional[TaskActionsList] = None - self._statistics: Optional[TaskStatisticsList] = None - - def delete(self) -> bool: - """ - Deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the TaskInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> TaskInstance: - """ - Fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> TaskInstance: - """ - Asynchronous coroutine to fetch the TaskInstance - - - :returns: The fetched TaskInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Update the TaskInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The updated TaskInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - unique_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Asynchronous coroutine to update the TaskInstance - - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The updated TaskInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "UniqueName": unique_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - sid=self._solution["sid"], - ) - - @property - def fields(self) -> FieldList: - """ - Access the fields - """ - if self._fields is None: - self._fields = FieldList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._fields - - @property - def samples(self) -> SampleList: - """ - Access the samples - """ - if self._samples is None: - self._samples = SampleList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._samples - - @property - def task_actions(self) -> TaskActionsList: - """ - Access the task_actions - """ - if self._task_actions is None: - self._task_actions = TaskActionsList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._task_actions - - @property - def statistics(self) -> TaskStatisticsList: - """ - Access the statistics - """ - if self._statistics is None: - self._statistics = TaskStatisticsList( - self._version, - self._solution["assistant_sid"], - self._solution["sid"], - ) - return self._statistics - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> TaskInstance: - """ - Build an instance of TaskInstance - - :param payload: Payload response from the API - """ - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class TaskList(ListResource): - def __init__(self, version: Version, assistant_sid: str): - """ - Initialize the TaskList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks".format(**self._solution) - - def create( - self, - unique_name: str, - friendly_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Create the TaskInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The created TaskInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - async def create_async( - self, - unique_name: str, - friendly_name: Union[str, object] = values.unset, - actions: Union[object, object] = values.unset, - actions_url: Union[str, object] = values.unset, - ) -> TaskInstance: - """ - Asynchronously create the TaskInstance - - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :param friendly_name: A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. - :param actions: A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. - :param actions_url: User-provided HTTP endpoint where from the assistant fetches actions - - :returns: The created TaskInstance - """ - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - "Actions": serialize.object(actions), - "ActionsUrl": actions_url, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskInstance( - self._version, payload, assistant_sid=self._solution["assistant_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[TaskInstance]: - """ - Streams TaskInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[TaskInstance]: - """ - Asynchronously streams TaskInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[TaskInstance]: - """ - Lists TaskInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[TaskInstance]: - """ - Asynchronously lists TaskInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> TaskPage: - """ - Retrieve a single page of TaskInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of TaskInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return TaskPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> TaskPage: - """ - Asynchronously retrieve a single page of TaskInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of TaskInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return TaskPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> TaskPage: - """ - Retrieve a specific page of TaskInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of TaskInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return TaskPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> TaskPage: - """ - Asynchronously retrieve a specific page of TaskInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of TaskInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return TaskPage(self._version, response, self._solution) - - def get(self, sid: str) -> TaskContext: - """ - Constructs a TaskContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return TaskContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __call__(self, sid: str) -> TaskContext: - """ - Constructs a TaskContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return TaskContext( - self._version, assistant_sid=self._solution["assistant_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/task/field.py b/twilio/rest/preview/understand/assistant/task/field.py deleted file mode 100644 index 2d3ccb83c4..0000000000 --- a/twilio/rest/preview/understand/assistant/task/field.py +++ /dev/null @@ -1,547 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class FieldInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Field. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar field_type: The Field Type of this field. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or sid of a custom Field Type. - :ivar task_sid: The unique ID of the Task associated with this Field. - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - :ivar url: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.field_type: Optional[str] = payload.get("field_type") - self.task_sid: Optional[str] = payload.get("task_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid or self.sid, - } - self._context: Optional[FieldContext] = None - - @property - def _proxy(self) -> "FieldContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FieldContext for this FieldInstance - """ - if self._context is None: - self._context = FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FieldInstance": - """ - Fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FieldInstance": - """ - Asynchronous coroutine to fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str, sid: str): - """ - Initialize the FieldContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - :param task_sid: The unique ID of the Task associated with this Field. - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Fields/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FieldInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FieldInstance: - """ - Fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FieldInstance: - """ - Asynchronous coroutine to fetch the FieldInstance - - - :returns: The fetched FieldInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FieldPage(Page): - def get_instance(self, payload: Dict[str, Any]) -> FieldInstance: - """ - Build an instance of FieldInstance - - :param payload: Payload response from the API - """ - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FieldList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the FieldList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - :param task_sid: The unique ID of the Task associated with this Field. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Fields".format( - **self._solution - ) - - def create(self, field_type: str, unique_name: str) -> FieldInstance: - """ - Create the FieldInstance - - :param field_type: The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type sid of a custom Field Type. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The created FieldInstance - """ - data = values.of( - { - "FieldType": field_type, - "UniqueName": unique_name, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def create_async(self, field_type: str, unique_name: str) -> FieldInstance: - """ - Asynchronously create the FieldInstance - - :param field_type: The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type sid of a custom Field Type. - :param unique_name: A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. - - :returns: The created FieldInstance - """ - data = values.of( - { - "FieldType": field_type, - "UniqueName": unique_name, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FieldInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FieldInstance]: - """ - Streams FieldInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FieldInstance]: - """ - Asynchronously streams FieldInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldInstance]: - """ - Lists FieldInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FieldInstance]: - """ - Asynchronously lists FieldInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldPage: - """ - Retrieve a single page of FieldInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FieldPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FieldPage: - """ - Asynchronously retrieve a single page of FieldInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FieldInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FieldPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> FieldPage: - """ - Retrieve a specific page of FieldInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FieldPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> FieldPage: - """ - Asynchronously retrieve a specific page of FieldInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FieldInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FieldPage(self._version, response, self._solution) - - def get(self, sid: str) -> FieldContext: - """ - Constructs a FieldContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> FieldContext: - """ - Constructs a FieldContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return FieldContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/task/sample.py b/twilio/rest/preview/understand/assistant/task/sample.py deleted file mode 100644 index 3c863c4536..0000000000 --- a/twilio/rest/preview/understand/assistant/task/sample.py +++ /dev/null @@ -1,695 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class SampleInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Sample. - :ivar date_created: The date that this resource was created - :ivar date_updated: The date that this resource was last updated - :ivar task_sid: The unique ID of the Task associated with this Sample. - :ivar language: An ISO language-country string of the sample. - :ivar assistant_sid: The unique ID of the Assistant. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :ivar url: - :ivar source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.task_sid: Optional[str] = payload.get("task_sid") - self.language: Optional[str] = payload.get("language") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.sid: Optional[str] = payload.get("sid") - self.tagged_text: Optional[str] = payload.get("tagged_text") - self.url: Optional[str] = payload.get("url") - self.source_channel: Optional[str] = payload.get("source_channel") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid or self.sid, - } - self._context: Optional[SampleContext] = None - - @property - def _proxy(self) -> "SampleContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: SampleContext for this SampleInstance - """ - if self._context is None: - self._context = SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "SampleInstance": - """ - Fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "SampleInstance": - """ - Asynchronous coroutine to fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> "SampleInstance": - """ - Update the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The updated SampleInstance - """ - return self._proxy.update( - language=language, - tagged_text=tagged_text, - source_channel=source_channel, - ) - - async def update_async( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> "SampleInstance": - """ - Asynchronous coroutine to update the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The updated SampleInstance - """ - return await self._proxy.update_async( - language=language, - tagged_text=tagged_text, - source_channel=source_channel, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SampleContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str, sid: str): - """ - Initialize the SampleContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - :param task_sid: The unique ID of the Task associated with this Sample. - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - "sid": sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples/{sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SampleInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> SampleInstance: - """ - Fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> SampleInstance: - """ - Asynchronous coroutine to fetch the SampleInstance - - - :returns: The fetched SampleInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Update the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The updated SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - language: Union[str, object] = values.unset, - tagged_text: Union[str, object] = values.unset, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Asynchronous coroutine to update the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The updated SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SamplePage(Page): - def get_instance(self, payload: Dict[str, Any]) -> SampleInstance: - """ - Build an instance of SampleInstance - - :param payload: Payload response from the API - """ - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class SampleList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the SampleList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the Assistant. - :param task_sid: The unique ID of the Task associated with this Sample. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Samples".format( - **self._solution - ) - - def create( - self, - language: str, - tagged_text: str, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Create the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The created SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def create_async( - self, - language: str, - tagged_text: str, - source_channel: Union[str, object] = values.unset, - ) -> SampleInstance: - """ - Asynchronously create the SampleInstance - - :param language: An ISO language-country string of the sample. - :param tagged_text: The text example of how end-users may express this task. The sample may contain Field tag blocks. - :param source_channel: The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null - - :returns: The created SampleInstance - """ - data = values.of( - { - "Language": language, - "TaggedText": tagged_text, - "SourceChannel": source_channel, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return SampleInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def stream( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[SampleInstance]: - """ - Streams SampleInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the sample. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(language=language, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[SampleInstance]: - """ - Asynchronously streams SampleInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str language: An ISO language-country string of the sample. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(language=language, page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SampleInstance]: - """ - Lists SampleInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the sample. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - language=language, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - language: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SampleInstance]: - """ - Asynchronously lists SampleInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str language: An ISO language-country string of the sample. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - language=language, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SamplePage: - """ - Retrieve a single page of SampleInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the sample. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SampleInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return SamplePage(self._version, response, self._solution) - - async def page_async( - self, - language: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SamplePage: - """ - Asynchronously retrieve a single page of SampleInstance records from the API. - Request is executed immediately - - :param language: An ISO language-country string of the sample. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SampleInstance - """ - data = values.of( - { - "Language": language, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return SamplePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> SamplePage: - """ - Retrieve a specific page of SampleInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SampleInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return SamplePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> SamplePage: - """ - Asynchronously retrieve a specific page of SampleInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SampleInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return SamplePage(self._version, response, self._solution) - - def get(self, sid: str) -> SampleContext: - """ - Constructs a SampleContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __call__(self, sid: str) -> SampleContext: - """ - Constructs a SampleContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return SampleContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - sid=sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/task/task_actions.py b/twilio/rest/preview/understand/assistant/task/task_actions.py deleted file mode 100644 index 66dd0df4c9..0000000000 --- a/twilio/rest/preview/understand/assistant/task/task_actions.py +++ /dev/null @@ -1,299 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional, Union -from twilio.base import serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class TaskActionsInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Field. - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar task_sid: The unique ID of the Task. - :ivar url: - :ivar data: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.task_sid: Optional[str] = payload.get("task_sid") - self.url: Optional[str] = payload.get("url") - self.data: Optional[Dict[str, object]] = payload.get("data") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._context: Optional[TaskActionsContext] = None - - @property - def _proxy(self) -> "TaskActionsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskActionsContext for this TaskActionsInstance - """ - if self._context is None: - self._context = TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - return self._context - - def fetch(self) -> "TaskActionsInstance": - """ - Fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskActionsInstance": - """ - Asynchronous coroutine to fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - return await self._proxy.fetch_async() - - def update( - self, actions: Union[object, object] = values.unset - ) -> "TaskActionsInstance": - """ - Update the TaskActionsInstance - - :param actions: The JSON actions that instruct the Assistant how to perform this task. - - :returns: The updated TaskActionsInstance - """ - return self._proxy.update( - actions=actions, - ) - - async def update_async( - self, actions: Union[object, object] = values.unset - ) -> "TaskActionsInstance": - """ - Asynchronous coroutine to update the TaskActionsInstance - - :param actions: The JSON actions that instruct the Assistant how to perform this task. - - :returns: The updated TaskActionsInstance - """ - return await self._proxy.update_async( - actions=actions, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskActionsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskActionsContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - :param task_sid: The unique ID of the Task. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Actions".format( - **self._solution - ) - - def fetch(self) -> TaskActionsInstance: - """ - Fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def fetch_async(self) -> TaskActionsInstance: - """ - Asynchronous coroutine to fetch the TaskActionsInstance - - - :returns: The fetched TaskActionsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def update( - self, actions: Union[object, object] = values.unset - ) -> TaskActionsInstance: - """ - Update the TaskActionsInstance - - :param actions: The JSON actions that instruct the Assistant how to perform this task. - - :returns: The updated TaskActionsInstance - """ - data = values.of( - { - "Actions": serialize.object(actions), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def update_async( - self, actions: Union[object, object] = values.unset - ) -> TaskActionsInstance: - """ - Asynchronous coroutine to update the TaskActionsInstance - - :param actions: The JSON actions that instruct the Assistant how to perform this task. - - :returns: The updated TaskActionsInstance - """ - data = values.of( - { - "Actions": serialize.object(actions), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return TaskActionsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskActionsList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskActionsList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - :param task_sid: The unique ID of the Task. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - - def get(self) -> TaskActionsContext: - """ - Constructs a TaskActionsContext - - """ - return TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __call__(self) -> TaskActionsContext: - """ - Constructs a TaskActionsContext - - """ - return TaskActionsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/understand/assistant/task/task_statistics.py b/twilio/rest/preview/understand/assistant/task/task_statistics.py deleted file mode 100644 index 2461406eb7..0000000000 --- a/twilio/rest/preview/understand/assistant/task/task_statistics.py +++ /dev/null @@ -1,219 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional -from twilio.base import deserialize -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class TaskStatisticsInstance(InstanceResource): - """ - :ivar account_sid: The unique ID of the Account that created this Field. - :ivar assistant_sid: The unique ID of the parent Assistant. - :ivar task_sid: The unique ID of the Task associated with this Field. - :ivar samples_count: The total number of Samples associated with this Task. - :ivar fields_count: The total number of Fields associated with this Task. - :ivar url: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - assistant_sid: str, - task_sid: str, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.assistant_sid: Optional[str] = payload.get("assistant_sid") - self.task_sid: Optional[str] = payload.get("task_sid") - self.samples_count: Optional[int] = deserialize.integer( - payload.get("samples_count") - ) - self.fields_count: Optional[int] = deserialize.integer( - payload.get("fields_count") - ) - self.url: Optional[str] = payload.get("url") - - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._context: Optional[TaskStatisticsContext] = None - - @property - def _proxy(self) -> "TaskStatisticsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: TaskStatisticsContext for this TaskStatisticsInstance - """ - if self._context is None: - self._context = TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - return self._context - - def fetch(self) -> "TaskStatisticsInstance": - """ - Fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "TaskStatisticsInstance": - """ - Asynchronous coroutine to fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskStatisticsContext(InstanceContext): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskStatisticsContext - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - :param task_sid: The unique ID of the Task associated with this Field. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - self._uri = "/Assistants/{assistant_sid}/Tasks/{task_sid}/Statistics".format( - **self._solution - ) - - def fetch(self) -> TaskStatisticsInstance: - """ - Fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return TaskStatisticsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - async def fetch_async(self) -> TaskStatisticsInstance: - """ - Asynchronous coroutine to fetch the TaskStatisticsInstance - - - :returns: The fetched TaskStatisticsInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return TaskStatisticsInstance( - self._version, - payload, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class TaskStatisticsList(ListResource): - def __init__(self, version: Version, assistant_sid: str, task_sid: str): - """ - Initialize the TaskStatisticsList - - :param version: Version that contains the resource - :param assistant_sid: The unique ID of the parent Assistant. - :param task_sid: The unique ID of the Task associated with this Field. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "assistant_sid": assistant_sid, - "task_sid": task_sid, - } - - def get(self) -> TaskStatisticsContext: - """ - Constructs a TaskStatisticsContext - - """ - return TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __call__(self) -> TaskStatisticsContext: - """ - Constructs a TaskStatisticsContext - - """ - return TaskStatisticsContext( - self._version, - assistant_sid=self._solution["assistant_sid"], - task_sid=self._solution["task_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/wireless/__init__.py b/twilio/rest/preview/wireless/__init__.py index 24f2ea0f0d..85ed4fb54d 100644 --- a/twilio/rest/preview/wireless/__init__.py +++ b/twilio/rest/preview/wireless/__init__.py @@ -21,6 +21,7 @@ class Wireless(Version): + def __init__(self, domain: Domain): """ Initialize the Wireless version of Preview diff --git a/twilio/rest/preview/wireless/command.py b/twilio/rest/preview/wireless/command.py index 371f38c69e..755256bb6b 100644 --- a/twilio/rest/preview/wireless/command.py +++ b/twilio/rest/preview/wireless/command.py @@ -107,6 +107,7 @@ def __repr__(self) -> str: class CommandContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CommandContext @@ -171,6 +172,7 @@ def __repr__(self) -> str: class CommandPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CommandInstance: """ Build an instance of CommandInstance @@ -189,6 +191,7 @@ def __repr__(self) -> str: class CommandList(ListResource): + def __init__(self, version: Version): """ Initialize the CommandList @@ -223,6 +226,7 @@ def create( :returns: The created CommandInstance """ + data = values.of( { "Command": command, @@ -266,6 +270,7 @@ async def create_async( :returns: The created CommandInstance """ + data = values.of( { "Command": command, diff --git a/twilio/rest/preview/wireless/rate_plan.py b/twilio/rest/preview/wireless/rate_plan.py index 88b29460ef..abd9cbecc2 100644 --- a/twilio/rest/preview/wireless/rate_plan.py +++ b/twilio/rest/preview/wireless/rate_plan.py @@ -171,6 +171,7 @@ def __repr__(self) -> str: class RatePlanContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RatePlanContext @@ -315,6 +316,7 @@ def __repr__(self) -> str: class RatePlanPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RatePlanInstance: """ Build an instance of RatePlanInstance @@ -333,6 +335,7 @@ def __repr__(self) -> str: class RatePlanList(ListResource): + def __init__(self, version: Version): """ Initialize the RatePlanList @@ -373,6 +376,7 @@ def create( :returns: The created RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, @@ -427,6 +431,7 @@ async def create_async( :returns: The created RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/preview/wireless/sim/__init__.py b/twilio/rest/preview/wireless/sim/__init__.py index 79b633cce9..8620c03ba2 100644 --- a/twilio/rest/preview/wireless/sim/__init__.py +++ b/twilio/rest/preview/wireless/sim/__init__.py @@ -259,6 +259,7 @@ def __repr__(self) -> str: class SimContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SimContext @@ -477,6 +478,7 @@ def __repr__(self) -> str: class SimPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SimInstance: """ Build an instance of SimInstance @@ -495,6 +497,7 @@ def __repr__(self) -> str: class SimList(ListResource): + def __init__(self, version: Version): """ Initialize the SimList diff --git a/twilio/rest/preview/wireless/sim/usage.py b/twilio/rest/preview/wireless/sim/usage.py index aa3dd0ac82..d90b5f9e84 100644 --- a/twilio/rest/preview/wireless/sim/usage.py +++ b/twilio/rest/preview/wireless/sim/usage.py @@ -113,6 +113,7 @@ def __repr__(self) -> str: class UsageContext(InstanceContext): + def __init__(self, version: Version, sim_sid: str): """ Initialize the UsageContext @@ -199,6 +200,7 @@ def __repr__(self) -> str: class UsageList(ListResource): + def __init__(self, version: Version, sim_sid: str): """ Initialize the UsageList diff --git a/twilio/rest/pricing/PricingBase.py b/twilio/rest/pricing/PricingBase.py index 35028ee350..cf624e1867 100644 --- a/twilio/rest/pricing/PricingBase.py +++ b/twilio/rest/pricing/PricingBase.py @@ -18,6 +18,7 @@ class PricingBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Pricing Domain diff --git a/twilio/rest/pricing/v1/__init__.py b/twilio/rest/pricing/v1/__init__.py index 2227d163d4..ba8b65885d 100644 --- a/twilio/rest/pricing/v1/__init__.py +++ b/twilio/rest/pricing/v1/__init__.py @@ -21,6 +21,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Pricing diff --git a/twilio/rest/pricing/v1/messaging/__init__.py b/twilio/rest/pricing/v1/messaging/__init__.py index 5b78074052..df5c148b81 100644 --- a/twilio/rest/pricing/v1/messaging/__init__.py +++ b/twilio/rest/pricing/v1/messaging/__init__.py @@ -22,6 +22,7 @@ class MessagingList(ListResource): + def __init__(self, version: Version): """ Initialize the MessagingList diff --git a/twilio/rest/pricing/v1/messaging/country.py b/twilio/rest/pricing/v1/messaging/country.py index 39c6bcfdba..47f5707ce8 100644 --- a/twilio/rest/pricing/v1/messaging/country.py +++ b/twilio/rest/pricing/v1/messaging/country.py @@ -97,6 +97,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_country: str): """ Initialize the CountryContext @@ -161,6 +162,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -179,6 +181,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/pricing/v1/phone_number/__init__.py b/twilio/rest/pricing/v1/phone_number/__init__.py index 34b5ea7576..429ce9b14c 100644 --- a/twilio/rest/pricing/v1/phone_number/__init__.py +++ b/twilio/rest/pricing/v1/phone_number/__init__.py @@ -22,6 +22,7 @@ class PhoneNumberList(ListResource): + def __init__(self, version: Version): """ Initialize the PhoneNumberList diff --git a/twilio/rest/pricing/v1/phone_number/country.py b/twilio/rest/pricing/v1/phone_number/country.py index ac550bfd94..b0822fff23 100644 --- a/twilio/rest/pricing/v1/phone_number/country.py +++ b/twilio/rest/pricing/v1/phone_number/country.py @@ -95,6 +95,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_country: str): """ Initialize the CountryContext @@ -159,6 +160,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -177,6 +179,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/pricing/v1/voice/__init__.py b/twilio/rest/pricing/v1/voice/__init__.py index 62a7acaf24..a801a30089 100644 --- a/twilio/rest/pricing/v1/voice/__init__.py +++ b/twilio/rest/pricing/v1/voice/__init__.py @@ -23,6 +23,7 @@ class VoiceList(ListResource): + def __init__(self, version: Version): """ Initialize the VoiceList diff --git a/twilio/rest/pricing/v1/voice/country.py b/twilio/rest/pricing/v1/voice/country.py index 7f8e48cf99..e3b1496de4 100644 --- a/twilio/rest/pricing/v1/voice/country.py +++ b/twilio/rest/pricing/v1/voice/country.py @@ -99,6 +99,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_country: str): """ Initialize the CountryContext @@ -163,6 +164,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -181,6 +183,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/pricing/v1/voice/number.py b/twilio/rest/pricing/v1/voice/number.py index 3e47c4888e..910919707e 100644 --- a/twilio/rest/pricing/v1/voice/number.py +++ b/twilio/rest/pricing/v1/voice/number.py @@ -92,6 +92,7 @@ def __repr__(self) -> str: class NumberContext(InstanceContext): + def __init__(self, version: Version, number: str): """ Initialize the NumberContext @@ -156,6 +157,7 @@ def __repr__(self) -> str: class NumberList(ListResource): + def __init__(self, version: Version): """ Initialize the NumberList diff --git a/twilio/rest/pricing/v2/__init__.py b/twilio/rest/pricing/v2/__init__.py index f034595cb2..d0fd67f737 100644 --- a/twilio/rest/pricing/v2/__init__.py +++ b/twilio/rest/pricing/v2/__init__.py @@ -21,6 +21,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Pricing diff --git a/twilio/rest/pricing/v2/country.py b/twilio/rest/pricing/v2/country.py index f94b6f1cb4..a058c071b5 100644 --- a/twilio/rest/pricing/v2/country.py +++ b/twilio/rest/pricing/v2/country.py @@ -99,6 +99,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_country: str): """ Initialize the CountryContext @@ -163,6 +164,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -181,6 +183,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/pricing/v2/number.py b/twilio/rest/pricing/v2/number.py index 8165f88702..6c4cd9fe9d 100644 --- a/twilio/rest/pricing/v2/number.py +++ b/twilio/rest/pricing/v2/number.py @@ -112,6 +112,7 @@ def __repr__(self) -> str: class NumberContext(InstanceContext): + def __init__(self, version: Version, destination_number: str): """ Initialize the NumberContext @@ -190,6 +191,7 @@ def __repr__(self) -> str: class NumberList(ListResource): + def __init__(self, version: Version): """ Initialize the NumberList diff --git a/twilio/rest/pricing/v2/voice/__init__.py b/twilio/rest/pricing/v2/voice/__init__.py index 62279bebed..1ebbcbb644 100644 --- a/twilio/rest/pricing/v2/voice/__init__.py +++ b/twilio/rest/pricing/v2/voice/__init__.py @@ -23,6 +23,7 @@ class VoiceList(ListResource): + def __init__(self, version: Version): """ Initialize the VoiceList diff --git a/twilio/rest/pricing/v2/voice/country.py b/twilio/rest/pricing/v2/voice/country.py index 9364c7df35..4a84bbd734 100644 --- a/twilio/rest/pricing/v2/voice/country.py +++ b/twilio/rest/pricing/v2/voice/country.py @@ -99,6 +99,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_country: str): """ Initialize the CountryContext @@ -163,6 +164,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -181,6 +183,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/pricing/v2/voice/number.py b/twilio/rest/pricing/v2/voice/number.py index e0fea643fc..6dd8764821 100644 --- a/twilio/rest/pricing/v2/voice/number.py +++ b/twilio/rest/pricing/v2/voice/number.py @@ -110,6 +110,7 @@ def __repr__(self) -> str: class NumberContext(InstanceContext): + def __init__(self, version: Version, destination_number: str): """ Initialize the NumberContext @@ -188,6 +189,7 @@ def __repr__(self) -> str: class NumberList(ListResource): + def __init__(self, version: Version): """ Initialize the NumberList diff --git a/twilio/rest/proxy/ProxyBase.py b/twilio/rest/proxy/ProxyBase.py index b4d4d0e84d..da1baec178 100644 --- a/twilio/rest/proxy/ProxyBase.py +++ b/twilio/rest/proxy/ProxyBase.py @@ -17,6 +17,7 @@ class ProxyBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Proxy Domain diff --git a/twilio/rest/proxy/v1/__init__.py b/twilio/rest/proxy/v1/__init__.py index 87a58d3ff2..83737dc0fb 100644 --- a/twilio/rest/proxy/v1/__init__.py +++ b/twilio/rest/proxy/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Proxy diff --git a/twilio/rest/proxy/v1/service/__init__.py b/twilio/rest/proxy/v1/service/__init__.py index 7074161065..6be2def24c 100644 --- a/twilio/rest/proxy/v1/service/__init__.py +++ b/twilio/rest/proxy/v1/service/__init__.py @@ -26,6 +26,7 @@ class ServiceInstance(InstanceResource): + class GeoMatchLevel(object): AREA_CODE = "area-code" OVERLAY = "overlay" @@ -251,6 +252,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -475,6 +477,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -493,6 +496,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -531,6 +535,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -579,6 +584,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/proxy/v1/service/phone_number.py b/twilio/rest/proxy/v1/service/phone_number.py index 8158a72c50..c4252b3980 100644 --- a/twilio/rest/proxy/v1/service/phone_number.py +++ b/twilio/rest/proxy/v1/service/phone_number.py @@ -161,6 +161,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the PhoneNumberContext @@ -313,6 +314,7 @@ def __repr__(self) -> str: class PhoneNumberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PhoneNumberInstance: """ Build an instance of PhoneNumberInstance @@ -333,6 +335,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the PhoneNumberList @@ -364,6 +367,7 @@ def create( :returns: The created PhoneNumberInstance """ + data = values.of( { "Sid": sid, @@ -397,6 +401,7 @@ async def create_async( :returns: The created PhoneNumberInstance """ + data = values.of( { "Sid": sid, diff --git a/twilio/rest/proxy/v1/service/session/__init__.py b/twilio/rest/proxy/v1/service/session/__init__.py index 7244fae89c..26ff177889 100644 --- a/twilio/rest/proxy/v1/service/session/__init__.py +++ b/twilio/rest/proxy/v1/service/session/__init__.py @@ -25,6 +25,7 @@ class SessionInstance(InstanceResource): + class Mode(object): MESSAGE_ONLY = "message-only" VOICE_ONLY = "voice-only" @@ -219,6 +220,7 @@ def __repr__(self) -> str: class SessionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SessionContext @@ -412,6 +414,7 @@ def __repr__(self) -> str: class SessionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SessionInstance: """ Build an instance of SessionInstance @@ -432,6 +435,7 @@ def __repr__(self) -> str: class SessionList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SessionList @@ -469,6 +473,7 @@ def create( :returns: The created SessionInstance """ + data = values.of( { "UniqueName": unique_name, @@ -513,6 +518,7 @@ async def create_async( :returns: The created SessionInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/proxy/v1/service/session/interaction.py b/twilio/rest/proxy/v1/service/session/interaction.py index 9e681c176d..6e4cac7c14 100644 --- a/twilio/rest/proxy/v1/service/session/interaction.py +++ b/twilio/rest/proxy/v1/service/session/interaction.py @@ -23,6 +23,7 @@ class InteractionInstance(InstanceResource): + class ResourceStatus(object): ACCEPTED = "accepted" ANSWERED = "answered" @@ -59,7 +60,7 @@ class Type(object): :ivar data: A JSON string that includes the message body of message interactions (e.g. `{\"body\": \"hello\"}`) or the call duration (when available) of a call (e.g. `{\"duration\": \"5\"}`). :ivar type: :ivar inbound_participant_sid: The SID of the inbound [Participant](https://www.twilio.com/docs/proxy/api/participant) resource. - :ivar inbound_resource_sid: The SID of the inbound resource; either the [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message. + :ivar inbound_resource_sid: The SID of the inbound resource; either the [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message-resource). :ivar inbound_resource_status: :ivar inbound_resource_type: The inbound resource type. Can be [Call](https://www.twilio.com/docs/voice/api/call-resource) or [Message](https://www.twilio.com/docs/sms/api/message-resource). :ivar inbound_resource_url: The URL of the Twilio inbound resource @@ -188,6 +189,7 @@ def __repr__(self) -> str: class InteractionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, session_sid: str, sid: str): """ Initialize the InteractionContext @@ -288,6 +290,7 @@ def __repr__(self) -> str: class InteractionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> InteractionInstance: """ Build an instance of InteractionInstance @@ -311,6 +314,7 @@ def __repr__(self) -> str: class InteractionList(ListResource): + def __init__(self, version: Version, service_sid: str, session_sid: str): """ Initialize the InteractionList diff --git a/twilio/rest/proxy/v1/service/session/participant/__init__.py b/twilio/rest/proxy/v1/service/session/participant/__init__.py index 35f2c622bd..266396f08f 100644 --- a/twilio/rest/proxy/v1/service/session/participant/__init__.py +++ b/twilio/rest/proxy/v1/service/session/participant/__init__.py @@ -150,6 +150,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, session_sid: str, sid: str): """ Initialize the ParticipantContext @@ -266,6 +267,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -289,6 +291,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, service_sid: str, session_sid: str): """ Initialize the ParticipantList @@ -328,6 +331,7 @@ def create( :returns: The created ParticipantInstance """ + data = values.of( { "Identifier": identifier, @@ -367,6 +371,7 @@ async def create_async( :returns: The created ParticipantInstance """ + data = values.of( { "Identifier": identifier, diff --git a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py index 1f6ff22814..b260b4693f 100644 --- a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py +++ b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py @@ -23,6 +23,7 @@ class MessageInteractionInstance(InstanceResource): + class ResourceStatus(object): ACCEPTED = "accepted" ANSWERED = "answered" @@ -175,6 +176,7 @@ def __repr__(self) -> str: class MessageInteractionContext(InstanceContext): + def __init__( self, version: Version, @@ -260,6 +262,7 @@ def __repr__(self) -> str: class MessageInteractionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessageInteractionInstance: """ Build an instance of MessageInteractionInstance @@ -284,6 +287,7 @@ def __repr__(self) -> str: class MessageInteractionList(ListResource): + def __init__( self, version: Version, service_sid: str, session_sid: str, participant_sid: str ): @@ -321,6 +325,7 @@ def create( :returns: The created MessageInteractionInstance """ + data = values.of( { "Body": body, @@ -355,6 +360,7 @@ async def create_async( :returns: The created MessageInteractionInstance """ + data = values.of( { "Body": body, diff --git a/twilio/rest/proxy/v1/service/short_code.py b/twilio/rest/proxy/v1/service/short_code.py index 83a0a6c1b3..7fc108e673 100644 --- a/twilio/rest/proxy/v1/service/short_code.py +++ b/twilio/rest/proxy/v1/service/short_code.py @@ -157,6 +157,7 @@ def __repr__(self) -> str: class ShortCodeContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the ShortCodeContext @@ -307,6 +308,7 @@ def __repr__(self) -> str: class ShortCodePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ShortCodeInstance: """ Build an instance of ShortCodeInstance @@ -327,6 +329,7 @@ def __repr__(self) -> str: class ShortCodeList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the ShortCodeList @@ -347,10 +350,11 @@ def create(self, sid: str) -> ShortCodeInstance: """ Create the ShortCodeInstance - :param sid: The SID of a Twilio [ShortCode](https://www.twilio.com/docs/sms/api/short-code) resource that represents the short code you would like to assign to your Proxy Service. + :param sid: The SID of a Twilio [ShortCode](https://www.twilio.com/en-us/messaging/channels/sms/short-codes) resource that represents the short code you would like to assign to your Proxy Service. :returns: The created ShortCodeInstance """ + data = values.of( { "Sid": sid, @@ -371,10 +375,11 @@ async def create_async(self, sid: str) -> ShortCodeInstance: """ Asynchronously create the ShortCodeInstance - :param sid: The SID of a Twilio [ShortCode](https://www.twilio.com/docs/sms/api/short-code) resource that represents the short code you would like to assign to your Proxy Service. + :param sid: The SID of a Twilio [ShortCode](https://www.twilio.com/en-us/messaging/channels/sms/short-codes) resource that represents the short code you would like to assign to your Proxy Service. :returns: The created ShortCodeInstance """ + data = values.of( { "Sid": sid, diff --git a/twilio/rest/routes/RoutesBase.py b/twilio/rest/routes/RoutesBase.py index 86a85dd3da..a47d67f093 100644 --- a/twilio/rest/routes/RoutesBase.py +++ b/twilio/rest/routes/RoutesBase.py @@ -17,6 +17,7 @@ class RoutesBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Routes Domain diff --git a/twilio/rest/routes/v2/__init__.py b/twilio/rest/routes/v2/__init__.py index b3852c1a6d..56a140efc3 100644 --- a/twilio/rest/routes/v2/__init__.py +++ b/twilio/rest/routes/v2/__init__.py @@ -21,6 +21,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Routes diff --git a/twilio/rest/routes/v2/phone_number.py b/twilio/rest/routes/v2/phone_number.py index 4b9de1a97d..4f452e3616 100644 --- a/twilio/rest/routes/v2/phone_number.py +++ b/twilio/rest/routes/v2/phone_number.py @@ -139,6 +139,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, phone_number: str): """ Initialize the PhoneNumberContext @@ -263,6 +264,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version): """ Initialize the PhoneNumberList diff --git a/twilio/rest/routes/v2/sip_domain.py b/twilio/rest/routes/v2/sip_domain.py index eac3d643f6..cad3a4922c 100644 --- a/twilio/rest/routes/v2/sip_domain.py +++ b/twilio/rest/routes/v2/sip_domain.py @@ -139,6 +139,7 @@ def __repr__(self) -> str: class SipDomainContext(InstanceContext): + def __init__(self, version: Version, sip_domain: str): """ Initialize the SipDomainContext @@ -263,6 +264,7 @@ def __repr__(self) -> str: class SipDomainList(ListResource): + def __init__(self, version: Version): """ Initialize the SipDomainList diff --git a/twilio/rest/routes/v2/trunk.py b/twilio/rest/routes/v2/trunk.py index 0addd96fdf..2baf2788ae 100644 --- a/twilio/rest/routes/v2/trunk.py +++ b/twilio/rest/routes/v2/trunk.py @@ -139,6 +139,7 @@ def __repr__(self) -> str: class TrunkContext(InstanceContext): + def __init__(self, version: Version, sip_trunk_domain: str): """ Initialize the TrunkContext @@ -263,6 +264,7 @@ def __repr__(self) -> str: class TrunkList(ListResource): + def __init__(self, version: Version): """ Initialize the TrunkList diff --git a/twilio/rest/serverless/ServerlessBase.py b/twilio/rest/serverless/ServerlessBase.py index 803c63dece..d6e227c0b7 100644 --- a/twilio/rest/serverless/ServerlessBase.py +++ b/twilio/rest/serverless/ServerlessBase.py @@ -17,6 +17,7 @@ class ServerlessBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Serverless Domain diff --git a/twilio/rest/serverless/v1/__init__.py b/twilio/rest/serverless/v1/__init__.py index ea6b4e9db2..e494615caf 100644 --- a/twilio/rest/serverless/v1/__init__.py +++ b/twilio/rest/serverless/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Serverless diff --git a/twilio/rest/serverless/v1/service/__init__.py b/twilio/rest/serverless/v1/service/__init__.py index 271e399df1..493b1a2e05 100644 --- a/twilio/rest/serverless/v1/service/__init__.py +++ b/twilio/rest/serverless/v1/service/__init__.py @@ -199,6 +199,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -402,6 +403,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -420,6 +422,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -448,6 +451,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -482,6 +486,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/serverless/v1/service/asset/__init__.py b/twilio/rest/serverless/v1/service/asset/__init__.py index 17e5ecc38d..2049c9d46b 100644 --- a/twilio/rest/serverless/v1/service/asset/__init__.py +++ b/twilio/rest/serverless/v1/service/asset/__init__.py @@ -157,6 +157,7 @@ def __repr__(self) -> str: class AssetContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the AssetContext @@ -318,6 +319,7 @@ def __repr__(self) -> str: class AssetPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AssetInstance: """ Build an instance of AssetInstance @@ -338,6 +340,7 @@ def __repr__(self) -> str: class AssetList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the AssetList @@ -362,6 +365,7 @@ def create(self, friendly_name: str) -> AssetInstance: :returns: The created AssetInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -386,6 +390,7 @@ async def create_async(self, friendly_name: str) -> AssetInstance: :returns: The created AssetInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/serverless/v1/service/asset/asset_version.py b/twilio/rest/serverless/v1/service/asset/asset_version.py index a8fa462d22..fbe7b30800 100644 --- a/twilio/rest/serverless/v1/service/asset/asset_version.py +++ b/twilio/rest/serverless/v1/service/asset/asset_version.py @@ -23,6 +23,7 @@ class AssetVersionInstance(InstanceResource): + class Visibility(object): PUBLIC = "public" PRIVATE = "private" @@ -115,6 +116,7 @@ def __repr__(self) -> str: class AssetVersionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, asset_sid: str, sid: str): """ Initialize the AssetVersionContext @@ -189,6 +191,7 @@ def __repr__(self) -> str: class AssetVersionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> AssetVersionInstance: """ Build an instance of AssetVersionInstance @@ -212,6 +215,7 @@ def __repr__(self) -> str: class AssetVersionList(ListResource): + def __init__(self, version: Version, service_sid: str, asset_sid: str): """ Initialize the AssetVersionList diff --git a/twilio/rest/serverless/v1/service/build/__init__.py b/twilio/rest/serverless/v1/service/build/__init__.py index 0fe3b8f923..25997bec2e 100644 --- a/twilio/rest/serverless/v1/service/build/__init__.py +++ b/twilio/rest/serverless/v1/service/build/__init__.py @@ -32,6 +32,7 @@ class Runtime(object): NODE12 = "node12" NODE14 = "node14" NODE16 = "node16" + NODE18 = "node18" class Status(object): BUILDING = "building" @@ -61,9 +62,9 @@ def __init__(self, version: Version, payload: Dict[str, Any], service_sid: str, self.account_sid: Optional[str] = payload.get("account_sid") self.service_sid: Optional[str] = payload.get("service_sid") self.status: Optional["BuildInstance.Status"] = payload.get("status") - self.asset_versions: Optional[List[object]] = payload.get("asset_versions") - self.function_versions: Optional[List[object]] = payload.get("function_versions") - self.dependencies: Optional[List[object]] = payload.get("dependencies") + self.asset_versions: Optional[List[Dict[str, object]]] = payload.get("asset_versions") + self.function_versions: Optional[List[Dict[str, object]]] = payload.get("function_versions") + self.dependencies: Optional[List[Dict[str, object]]] = payload.get("dependencies") self.runtime: Optional["BuildInstance.Runtime"] = payload.get("runtime") self.date_created: Optional[datetime] = deserialize.iso8601_datetime(payload.get("date_created")) self.date_updated: Optional[datetime] = deserialize.iso8601_datetime(payload.get("date_updated")) @@ -274,7 +275,7 @@ def __repr__(self) -> str: class BuildList(ListResource): - + def __init__(self, version: Version, service_sid: str): """ Initialize the BuildList @@ -305,6 +306,7 @@ def create(self, asset_versions: Union[List[str], object]=values.unset, function :returns: The created BuildInstance """ + data = values.of({ 'AssetVersions': serialize.map(asset_versions, lambda e: e), 'FunctionVersions': serialize.map(function_versions, lambda e: e), @@ -312,6 +314,7 @@ def create(self, asset_versions: Union[List[str], object]=values.unset, function 'Runtime': runtime, }) + payload = self._version.create(method='POST', uri=self._uri, data=data,) return BuildInstance(self._version, payload, service_sid=self._solution['service_sid']) @@ -327,6 +330,7 @@ async def create_async(self, asset_versions: Union[List[str], object]=values.uns :returns: The created BuildInstance """ + data = values.of({ 'AssetVersions': serialize.map(asset_versions, lambda e: e), 'FunctionVersions': serialize.map(function_versions, lambda e: e), @@ -334,6 +338,7 @@ async def create_async(self, asset_versions: Union[List[str], object]=values.uns 'Runtime': runtime, }) + payload = await self._version.create_async(method='POST', uri=self._uri, data=data,) return BuildInstance(self._version, payload, service_sid=self._solution['service_sid']) diff --git a/twilio/rest/serverless/v1/service/build/build_status.py b/twilio/rest/serverless/v1/service/build/build_status.py index c127f89a4f..2613ae3cb6 100644 --- a/twilio/rest/serverless/v1/service/build/build_status.py +++ b/twilio/rest/serverless/v1/service/build/build_status.py @@ -164,7 +164,7 @@ def __repr__(self) -> str: class BuildStatusList(ListResource): - + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the BuildStatusList diff --git a/twilio/rest/serverless/v1/service/environment/__init__.py b/twilio/rest/serverless/v1/service/environment/__init__.py index a072d8ffa9..46b7ddacf4 100644 --- a/twilio/rest/serverless/v1/service/environment/__init__.py +++ b/twilio/rest/serverless/v1/service/environment/__init__.py @@ -155,6 +155,7 @@ def __repr__(self) -> str: class EnvironmentContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the EnvironmentContext @@ -292,6 +293,7 @@ def __repr__(self) -> str: class EnvironmentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EnvironmentInstance: """ Build an instance of EnvironmentInstance @@ -312,6 +314,7 @@ def __repr__(self) -> str: class EnvironmentList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the EnvironmentList @@ -339,6 +342,7 @@ def create( :returns: The created EnvironmentInstance """ + data = values.of( { "UniqueName": unique_name, @@ -367,6 +371,7 @@ async def create_async( :returns: The created EnvironmentInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/serverless/v1/service/environment/deployment.py b/twilio/rest/serverless/v1/service/environment/deployment.py index 2738d967ce..1ff896f93a 100644 --- a/twilio/rest/serverless/v1/service/environment/deployment.py +++ b/twilio/rest/serverless/v1/service/environment/deployment.py @@ -110,6 +110,7 @@ def __repr__(self) -> str: class DeploymentContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, environment_sid: str, sid: str ): @@ -186,6 +187,7 @@ def __repr__(self) -> str: class DeploymentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DeploymentInstance: """ Build an instance of DeploymentInstance @@ -209,6 +211,7 @@ def __repr__(self) -> str: class DeploymentList(ListResource): + def __init__(self, version: Version, service_sid: str, environment_sid: str): """ Initialize the DeploymentList @@ -241,6 +244,7 @@ def create( :returns: The created DeploymentInstance """ + data = values.of( { "BuildSid": build_sid, @@ -270,6 +274,7 @@ async def create_async( :returns: The created DeploymentInstance """ + data = values.of( { "BuildSid": build_sid, diff --git a/twilio/rest/serverless/v1/service/environment/log.py b/twilio/rest/serverless/v1/service/environment/log.py index 0249ee4ebd..e1aff5214f 100644 --- a/twilio/rest/serverless/v1/service/environment/log.py +++ b/twilio/rest/serverless/v1/service/environment/log.py @@ -23,6 +23,7 @@ class LogInstance(InstanceResource): + class Level(object): INFO = "info" WARN = "warn" @@ -121,6 +122,7 @@ def __repr__(self) -> str: class LogContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, environment_sid: str, sid: str ): @@ -199,6 +201,7 @@ def __repr__(self) -> str: class LogPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> LogInstance: """ Build an instance of LogInstance @@ -222,6 +225,7 @@ def __repr__(self) -> str: class LogList(ListResource): + def __init__(self, version: Version, service_sid: str, environment_sid: str): """ Initialize the LogList diff --git a/twilio/rest/serverless/v1/service/environment/variable.py b/twilio/rest/serverless/v1/service/environment/variable.py index 35447b75cd..f69c129f81 100644 --- a/twilio/rest/serverless/v1/service/environment/variable.py +++ b/twilio/rest/serverless/v1/service/environment/variable.py @@ -166,6 +166,7 @@ def __repr__(self) -> str: class VariableContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, environment_sid: str, sid: str ): @@ -334,6 +335,7 @@ def __repr__(self) -> str: class VariablePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> VariableInstance: """ Build an instance of VariableInstance @@ -357,6 +359,7 @@ def __repr__(self) -> str: class VariableList(ListResource): + def __init__(self, version: Version, service_sid: str, environment_sid: str): """ Initialize the VariableList @@ -388,6 +391,7 @@ def create(self, key: str, value: str) -> VariableInstance: :returns: The created VariableInstance """ + data = values.of( { "Key": key, @@ -417,6 +421,7 @@ async def create_async(self, key: str, value: str) -> VariableInstance: :returns: The created VariableInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/serverless/v1/service/function/__init__.py b/twilio/rest/serverless/v1/service/function/__init__.py index a18444d392..71bbad8466 100644 --- a/twilio/rest/serverless/v1/service/function/__init__.py +++ b/twilio/rest/serverless/v1/service/function/__init__.py @@ -159,6 +159,7 @@ def __repr__(self) -> str: class FunctionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the FunctionContext @@ -320,6 +321,7 @@ def __repr__(self) -> str: class FunctionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FunctionInstance: """ Build an instance of FunctionInstance @@ -340,6 +342,7 @@ def __repr__(self) -> str: class FunctionList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the FunctionList @@ -364,6 +367,7 @@ def create(self, friendly_name: str) -> FunctionInstance: :returns: The created FunctionInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -388,6 +392,7 @@ async def create_async(self, friendly_name: str) -> FunctionInstance: :returns: The created FunctionInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/serverless/v1/service/function/function_version/__init__.py b/twilio/rest/serverless/v1/service/function/function_version/__init__.py index 0b551904ea..e915894f11 100644 --- a/twilio/rest/serverless/v1/service/function/function_version/__init__.py +++ b/twilio/rest/serverless/v1/service/function/function_version/__init__.py @@ -26,6 +26,7 @@ class FunctionVersionInstance(InstanceResource): + class Visibility(object): PUBLIC = "public" PRIVATE = "private" @@ -127,6 +128,7 @@ def __repr__(self) -> str: class FunctionVersionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, function_sid: str, sid: str): """ Initialize the FunctionVersionContext @@ -219,6 +221,7 @@ def __repr__(self) -> str: class FunctionVersionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FunctionVersionInstance: """ Build an instance of FunctionVersionInstance @@ -242,6 +245,7 @@ def __repr__(self) -> str: class FunctionVersionList(ListResource): + def __init__(self, version: Version, service_sid: str, function_sid: str): """ Initialize the FunctionVersionList diff --git a/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py b/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py index 0b99cf8774..c58fa574e7 100644 --- a/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py +++ b/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py @@ -101,6 +101,7 @@ def __repr__(self) -> str: class FunctionVersionContentContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, function_sid: str, sid: str): """ Initialize the FunctionVersionContentContext @@ -175,6 +176,7 @@ def __repr__(self) -> str: class FunctionVersionContentList(ListResource): + def __init__(self, version: Version, service_sid: str, function_sid: str, sid: str): """ Initialize the FunctionVersionContentList diff --git a/twilio/rest/studio/StudioBase.py b/twilio/rest/studio/StudioBase.py index e1b2374226..3b218775c8 100644 --- a/twilio/rest/studio/StudioBase.py +++ b/twilio/rest/studio/StudioBase.py @@ -18,6 +18,7 @@ class StudioBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Studio Domain diff --git a/twilio/rest/studio/v1/__init__.py b/twilio/rest/studio/v1/__init__.py index d5ca90bb68..8ab7d71b6c 100644 --- a/twilio/rest/studio/v1/__init__.py +++ b/twilio/rest/studio/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Studio diff --git a/twilio/rest/studio/v1/flow/__init__.py b/twilio/rest/studio/v1/flow/__init__.py index a950be3cc6..bb0f78658b 100644 --- a/twilio/rest/studio/v1/flow/__init__.py +++ b/twilio/rest/studio/v1/flow/__init__.py @@ -25,6 +25,7 @@ class FlowInstance(InstanceResource): + class Status(object): DRAFT = "draft" PUBLISHED = "published" @@ -141,6 +142,7 @@ def __repr__(self) -> str: class FlowContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FlowContext @@ -256,6 +258,7 @@ def __repr__(self) -> str: class FlowPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FlowInstance: """ Build an instance of FlowInstance @@ -274,6 +277,7 @@ def __repr__(self) -> str: class FlowList(ListResource): + def __init__(self, version: Version): """ Initialize the FlowList diff --git a/twilio/rest/studio/v1/flow/engagement/__init__.py b/twilio/rest/studio/v1/flow/engagement/__init__.py index 7962f7ae04..f6d95abd5f 100644 --- a/twilio/rest/studio/v1/flow/engagement/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/__init__.py @@ -27,6 +27,7 @@ class EngagementInstance(InstanceResource): + class Status(object): ACTIVE = "active" ENDED = "ended" @@ -155,6 +156,7 @@ def __repr__(self) -> str: class EngagementContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, sid: str): """ Initialize the EngagementContext @@ -276,6 +278,7 @@ def __repr__(self) -> str: class EngagementPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EngagementInstance: """ Build an instance of EngagementInstance @@ -296,6 +299,7 @@ def __repr__(self) -> str: class EngagementList(ListResource): + def __init__(self, version: Version, flow_sid: str): """ Initialize the EngagementList @@ -324,6 +328,7 @@ def create( :returns: The created EngagementInstance """ + data = values.of( { "To": to, @@ -354,6 +359,7 @@ async def create_async( :returns: The created EngagementInstance """ + data = values.of( { "To": to, diff --git a/twilio/rest/studio/v1/flow/engagement/engagement_context.py b/twilio/rest/studio/v1/flow/engagement/engagement_context.py index 8dc0d1c511..f534db6922 100644 --- a/twilio/rest/studio/v1/flow/engagement/engagement_context.py +++ b/twilio/rest/studio/v1/flow/engagement/engagement_context.py @@ -94,6 +94,7 @@ def __repr__(self) -> str: class EngagementContextContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, engagement_sid: str): """ Initialize the EngagementContextContext @@ -164,6 +165,7 @@ def __repr__(self) -> str: class EngagementContextList(ListResource): + def __init__(self, version: Version, flow_sid: str, engagement_sid: str): """ Initialize the EngagementContextList diff --git a/twilio/rest/studio/v1/flow/engagement/step/__init__.py b/twilio/rest/studio/v1/flow/engagement/step/__init__.py index 8e87942d00..1a2d8570c9 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/step/__init__.py @@ -126,6 +126,7 @@ def __repr__(self) -> str: class StepContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, engagement_sid: str, sid: str): """ Initialize the StepContext @@ -216,6 +217,7 @@ def __repr__(self) -> str: class StepPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> StepInstance: """ Build an instance of StepInstance @@ -239,6 +241,7 @@ def __repr__(self) -> str: class StepList(ListResource): + def __init__(self, version: Version, flow_sid: str, engagement_sid: str): """ Initialize the StepList diff --git a/twilio/rest/studio/v1/flow/engagement/step/step_context.py b/twilio/rest/studio/v1/flow/engagement/step/step_context.py index a32c82c6d0..69c4c22465 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/step_context.py +++ b/twilio/rest/studio/v1/flow/engagement/step/step_context.py @@ -99,6 +99,7 @@ def __repr__(self) -> str: class StepContextContext(InstanceContext): + def __init__( self, version: Version, flow_sid: str, engagement_sid: str, step_sid: str ): @@ -175,6 +176,7 @@ def __repr__(self) -> str: class StepContextList(ListResource): + def __init__( self, version: Version, flow_sid: str, engagement_sid: str, step_sid: str ): diff --git a/twilio/rest/studio/v1/flow/execution/__init__.py b/twilio/rest/studio/v1/flow/execution/__init__.py index 5cfa28cd28..57239e5154 100644 --- a/twilio/rest/studio/v1/flow/execution/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/__init__.py @@ -25,6 +25,7 @@ class ExecutionInstance(InstanceResource): + class Status(object): ACTIVE = "active" ENDED = "ended" @@ -179,6 +180,7 @@ def __repr__(self) -> str: class ExecutionContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, sid: str): """ Initialize the ExecutionContext @@ -356,6 +358,7 @@ def __repr__(self) -> str: class ExecutionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ExecutionInstance: """ Build an instance of ExecutionInstance @@ -376,6 +379,7 @@ def __repr__(self) -> str: class ExecutionList(ListResource): + def __init__(self, version: Version, flow_sid: str): """ Initialize the ExecutionList @@ -404,6 +408,7 @@ def create( :returns: The created ExecutionInstance """ + data = values.of( { "To": to, @@ -434,6 +439,7 @@ async def create_async( :returns: The created ExecutionInstance """ + data = values.of( { "To": to, diff --git a/twilio/rest/studio/v1/flow/execution/execution_context.py b/twilio/rest/studio/v1/flow/execution/execution_context.py index e36b21e1e1..a2765bbc9b 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_context.py +++ b/twilio/rest/studio/v1/flow/execution/execution_context.py @@ -94,6 +94,7 @@ def __repr__(self) -> str: class ExecutionContextContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionContextContext @@ -164,6 +165,7 @@ def __repr__(self) -> str: class ExecutionContextList(ListResource): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionContextList diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py index 0eb15e1253..6e19ca4453 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py @@ -128,6 +128,7 @@ def __repr__(self) -> str: class ExecutionStepContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, execution_sid: str, sid: str): """ Initialize the ExecutionStepContext @@ -218,6 +219,7 @@ def __repr__(self) -> str: class ExecutionStepPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ExecutionStepInstance: """ Build an instance of ExecutionStepInstance @@ -241,6 +243,7 @@ def __repr__(self) -> str: class ExecutionStepList(ListResource): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionStepList diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py b/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py index b33c0c6356..224f92d0f5 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py @@ -99,6 +99,7 @@ def __repr__(self) -> str: class ExecutionStepContextContext(InstanceContext): + def __init__( self, version: Version, flow_sid: str, execution_sid: str, step_sid: str ): @@ -175,6 +176,7 @@ def __repr__(self) -> str: class ExecutionStepContextList(ListResource): + def __init__( self, version: Version, flow_sid: str, execution_sid: str, step_sid: str ): diff --git a/twilio/rest/studio/v2/__init__.py b/twilio/rest/studio/v2/__init__.py index 2ad61768ad..83ccc8e0a9 100644 --- a/twilio/rest/studio/v2/__init__.py +++ b/twilio/rest/studio/v2/__init__.py @@ -20,6 +20,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Studio diff --git a/twilio/rest/studio/v2/flow/__init__.py b/twilio/rest/studio/v2/flow/__init__.py index f4e24626bf..21138d29cc 100644 --- a/twilio/rest/studio/v2/flow/__init__.py +++ b/twilio/rest/studio/v2/flow/__init__.py @@ -26,6 +26,7 @@ class FlowInstance(InstanceResource): + class Status(object): DRAFT = "draft" PUBLISHED = "published" @@ -61,8 +62,8 @@ def __init__( self.revision: Optional[int] = deserialize.integer(payload.get("revision")) self.commit_message: Optional[str] = payload.get("commit_message") self.valid: Optional[bool] = payload.get("valid") - self.errors: Optional[List[object]] = payload.get("errors") - self.warnings: Optional[List[object]] = payload.get("warnings") + self.errors: Optional[List[Dict[str, object]]] = payload.get("errors") + self.warnings: Optional[List[Dict[str, object]]] = payload.get("warnings") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -209,6 +210,7 @@ def __repr__(self) -> str: class FlowContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FlowContext @@ -405,6 +407,7 @@ def __repr__(self) -> str: class FlowPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FlowInstance: """ Build an instance of FlowInstance @@ -423,6 +426,7 @@ def __repr__(self) -> str: class FlowList(ListResource): + def __init__(self, version: Version): """ Initialize the FlowList @@ -451,6 +455,7 @@ def create( :returns: The created FlowInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -485,6 +490,7 @@ async def create_async( :returns: The created FlowInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/studio/v2/flow/execution/__init__.py b/twilio/rest/studio/v2/flow/execution/__init__.py index 4056a5d3d5..38d3b2b539 100644 --- a/twilio/rest/studio/v2/flow/execution/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/__init__.py @@ -25,6 +25,7 @@ class ExecutionInstance(InstanceResource): + class Status(object): ACTIVE = "active" ENDED = "ended" @@ -177,6 +178,7 @@ def __repr__(self) -> str: class ExecutionContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, sid: str): """ Initialize the ExecutionContext @@ -354,6 +356,7 @@ def __repr__(self) -> str: class ExecutionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ExecutionInstance: """ Build an instance of ExecutionInstance @@ -374,6 +377,7 @@ def __repr__(self) -> str: class ExecutionList(ListResource): + def __init__(self, version: Version, flow_sid: str): """ Initialize the ExecutionList @@ -402,6 +406,7 @@ def create( :returns: The created ExecutionInstance """ + data = values.of( { "To": to, @@ -432,6 +437,7 @@ async def create_async( :returns: The created ExecutionInstance """ + data = values.of( { "To": to, diff --git a/twilio/rest/studio/v2/flow/execution/execution_context.py b/twilio/rest/studio/v2/flow/execution/execution_context.py index eb432cafbd..facb52eed7 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_context.py +++ b/twilio/rest/studio/v2/flow/execution/execution_context.py @@ -94,6 +94,7 @@ def __repr__(self) -> str: class ExecutionContextContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionContextContext @@ -164,6 +165,7 @@ def __repr__(self) -> str: class ExecutionContextList(ListResource): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionContextList diff --git a/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py index 83682a53ea..257e16b1df 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py @@ -128,6 +128,7 @@ def __repr__(self) -> str: class ExecutionStepContext(InstanceContext): + def __init__(self, version: Version, flow_sid: str, execution_sid: str, sid: str): """ Initialize the ExecutionStepContext @@ -218,6 +219,7 @@ def __repr__(self) -> str: class ExecutionStepPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ExecutionStepInstance: """ Build an instance of ExecutionStepInstance @@ -241,6 +243,7 @@ def __repr__(self) -> str: class ExecutionStepList(ListResource): + def __init__(self, version: Version, flow_sid: str, execution_sid: str): """ Initialize the ExecutionStepList diff --git a/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py b/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py index c89d9f1edd..41661238b5 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py +++ b/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py @@ -99,6 +99,7 @@ def __repr__(self) -> str: class ExecutionStepContextContext(InstanceContext): + def __init__( self, version: Version, flow_sid: str, execution_sid: str, step_sid: str ): @@ -175,6 +176,7 @@ def __repr__(self) -> str: class ExecutionStepContextList(ListResource): + def __init__( self, version: Version, flow_sid: str, execution_sid: str, step_sid: str ): diff --git a/twilio/rest/studio/v2/flow/flow_revision.py b/twilio/rest/studio/v2/flow/flow_revision.py index bf9efc6d54..0de91513ed 100644 --- a/twilio/rest/studio/v2/flow/flow_revision.py +++ b/twilio/rest/studio/v2/flow/flow_revision.py @@ -23,6 +23,7 @@ class FlowRevisionInstance(InstanceResource): + class Status(object): DRAFT = "draft" PUBLISHED = "published" @@ -59,7 +60,7 @@ def __init__( self.revision: Optional[int] = deserialize.integer(payload.get("revision")) self.commit_message: Optional[str] = payload.get("commit_message") self.valid: Optional[bool] = payload.get("valid") - self.errors: Optional[List[object]] = payload.get("errors") + self.errors: Optional[List[Dict[str, object]]] = payload.get("errors") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -119,6 +120,7 @@ def __repr__(self) -> str: class FlowRevisionContext(InstanceContext): + def __init__(self, version: Version, sid: str, revision: str): """ Initialize the FlowRevisionContext @@ -187,6 +189,7 @@ def __repr__(self) -> str: class FlowRevisionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FlowRevisionInstance: """ Build an instance of FlowRevisionInstance @@ -205,6 +208,7 @@ def __repr__(self) -> str: class FlowRevisionList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the FlowRevisionList diff --git a/twilio/rest/studio/v2/flow/flow_test_user.py b/twilio/rest/studio/v2/flow/flow_test_user.py index 81bee7ed98..3465632353 100644 --- a/twilio/rest/studio/v2/flow/flow_test_user.py +++ b/twilio/rest/studio/v2/flow/flow_test_user.py @@ -107,6 +107,7 @@ def __repr__(self) -> str: class FlowTestUserContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FlowTestUserContext @@ -215,6 +216,7 @@ def __repr__(self) -> str: class FlowTestUserList(ListResource): + def __init__(self, version: Version, sid: str): """ Initialize the FlowTestUserList diff --git a/twilio/rest/studio/v2/flow_validate.py b/twilio/rest/studio/v2/flow_validate.py index 63ebb7623c..6994e6af14 100644 --- a/twilio/rest/studio/v2/flow_validate.py +++ b/twilio/rest/studio/v2/flow_validate.py @@ -21,6 +21,7 @@ class FlowValidateInstance(InstanceResource): + class Status(object): DRAFT = "draft" PUBLISHED = "published" @@ -45,6 +46,7 @@ def __repr__(self) -> str: class FlowValidateList(ListResource): + def __init__(self, version: Version): """ Initialize the FlowValidateList diff --git a/twilio/rest/supersim/SupersimBase.py b/twilio/rest/supersim/SupersimBase.py index d85c382641..dd73d12223 100644 --- a/twilio/rest/supersim/SupersimBase.py +++ b/twilio/rest/supersim/SupersimBase.py @@ -17,6 +17,7 @@ class SupersimBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Supersim Domain diff --git a/twilio/rest/supersim/v1/__init__.py b/twilio/rest/supersim/v1/__init__.py index 480787bcab..2336da2616 100644 --- a/twilio/rest/supersim/v1/__init__.py +++ b/twilio/rest/supersim/v1/__init__.py @@ -27,6 +27,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Supersim diff --git a/twilio/rest/supersim/v1/esim_profile.py b/twilio/rest/supersim/v1/esim_profile.py index 4477dda2fa..c8ecb02ae0 100644 --- a/twilio/rest/supersim/v1/esim_profile.py +++ b/twilio/rest/supersim/v1/esim_profile.py @@ -23,6 +23,7 @@ class EsimProfileInstance(InstanceResource): + class Status(object): NEW = "new" RESERVING = "reserving" @@ -35,7 +36,7 @@ class Status(object): :ivar sid: The unique string that we created to identify the eSIM Profile resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the eSIM Profile resource belongs. :ivar iccid: The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with the Sim resource. - :ivar sim_sid: The SID of the [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource that this eSIM Profile controls. + :ivar sim_sid: The SID of the [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource that this eSIM Profile controls. :ivar status: :ivar eid: Identifier of the eUICC that can claim the eSIM Profile. :ivar smdp_plus_address: Address of the SM-DP+ server from which the Profile will be downloaded. The URL will appear once the eSIM Profile reaches the status `available`. @@ -121,6 +122,7 @@ def __repr__(self) -> str: class EsimProfileContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EsimProfileContext @@ -185,6 +187,7 @@ def __repr__(self) -> str: class EsimProfilePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EsimProfileInstance: """ Build an instance of EsimProfileInstance @@ -203,6 +206,7 @@ def __repr__(self) -> str: class EsimProfileList(ListResource): + def __init__(self, version: Version): """ Initialize the EsimProfileList @@ -231,6 +235,7 @@ def create( :returns: The created EsimProfileInstance """ + data = values.of( { "CallbackUrl": callback_url, @@ -265,6 +270,7 @@ async def create_async( :returns: The created EsimProfileInstance """ + data = values.of( { "CallbackUrl": callback_url, @@ -297,7 +303,7 @@ def stream( The results are returned as a generator, so this operation is memory efficient. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -330,7 +336,7 @@ async def stream_async( The results are returned as a generator, so this operation is memory efficient. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -362,7 +368,7 @@ def list( memory before returning. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -397,7 +403,7 @@ async def list_async( memory before returning. :param str eid: List the eSIM Profiles that have been associated with an EId. - :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param str sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param "EsimProfileInstance.Status" status: List the eSIM Profiles that are in a given status. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -433,7 +439,7 @@ def page( Request is executed immediately :param eid: List the eSIM Profiles that have been associated with an EId. - :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param status: List the eSIM Profiles that are in a given status. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state @@ -469,7 +475,7 @@ async def page_async( Request is executed immediately :param eid: List the eSIM Profiles that have been associated with an EId. - :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + :param sim_sid: Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/iot/supersim/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. :param status: List the eSIM Profiles that are in a given status. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state diff --git a/twilio/rest/supersim/v1/fleet.py b/twilio/rest/supersim/v1/fleet.py index 05058744c2..2447057a7f 100644 --- a/twilio/rest/supersim/v1/fleet.py +++ b/twilio/rest/supersim/v1/fleet.py @@ -23,6 +23,7 @@ class FleetInstance(InstanceResource): + class DataMetering(object): PAYG = "payg" @@ -188,6 +189,7 @@ def __repr__(self) -> str: class FleetContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the FleetContext @@ -338,6 +340,7 @@ def __repr__(self) -> str: class FleetPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FleetInstance: """ Build an instance of FleetInstance @@ -356,6 +359,7 @@ def __repr__(self) -> str: class FleetList(ListResource): + def __init__(self, version: Version): """ Initialize the FleetList @@ -394,6 +398,7 @@ def create( :returns: The created FleetInstance """ + data = values.of( { "NetworkAccessProfile": network_access_profile, @@ -443,6 +448,7 @@ async def create_async( :returns: The created FleetInstance """ + data = values.of( { "NetworkAccessProfile": network_access_profile, diff --git a/twilio/rest/supersim/v1/ip_command.py b/twilio/rest/supersim/v1/ip_command.py index aab4470af1..b7610efec6 100644 --- a/twilio/rest/supersim/v1/ip_command.py +++ b/twilio/rest/supersim/v1/ip_command.py @@ -23,6 +23,7 @@ class IpCommandInstance(InstanceResource): + class Direction(object): TO_SIM = "to_sim" FROM_SIM = "from_sim" @@ -131,6 +132,7 @@ def __repr__(self) -> str: class IpCommandContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the IpCommandContext @@ -195,6 +197,7 @@ def __repr__(self) -> str: class IpCommandPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IpCommandInstance: """ Build an instance of IpCommandInstance @@ -213,6 +216,7 @@ def __repr__(self) -> str: class IpCommandList(ListResource): + def __init__(self, version: Version): """ Initialize the IpCommandList @@ -245,6 +249,7 @@ def create( :returns: The created IpCommandInstance """ + data = values.of( { "Sim": sim, @@ -285,6 +290,7 @@ async def create_async( :returns: The created IpCommandInstance """ + data = values.of( { "Sim": sim, diff --git a/twilio/rest/supersim/v1/network.py b/twilio/rest/supersim/v1/network.py index 5ea9a8e4ab..0d4f6a94fd 100644 --- a/twilio/rest/supersim/v1/network.py +++ b/twilio/rest/supersim/v1/network.py @@ -39,7 +39,7 @@ def __init__( self.friendly_name: Optional[str] = payload.get("friendly_name") self.url: Optional[str] = payload.get("url") self.iso_country: Optional[str] = payload.get("iso_country") - self.identifiers: Optional[List[object]] = payload.get("identifiers") + self.identifiers: Optional[List[Dict[str, object]]] = payload.get("identifiers") self._solution = { "sid": sid or self.sid, @@ -90,6 +90,7 @@ def __repr__(self) -> str: class NetworkContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the NetworkContext @@ -154,6 +155,7 @@ def __repr__(self) -> str: class NetworkPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> NetworkInstance: """ Build an instance of NetworkInstance @@ -172,6 +174,7 @@ def __repr__(self) -> str: class NetworkList(ListResource): + def __init__(self, version: Version): """ Initialize the NetworkList diff --git a/twilio/rest/supersim/v1/network_access_profile/__init__.py b/twilio/rest/supersim/v1/network_access_profile/__init__.py index a355b746b4..d0b5374699 100644 --- a/twilio/rest/supersim/v1/network_access_profile/__init__.py +++ b/twilio/rest/supersim/v1/network_access_profile/__init__.py @@ -137,6 +137,7 @@ def __repr__(self) -> str: class NetworkAccessProfileContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the NetworkAccessProfileContext @@ -267,6 +268,7 @@ def __repr__(self) -> str: class NetworkAccessProfilePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> NetworkAccessProfileInstance: """ Build an instance of NetworkAccessProfileInstance @@ -285,6 +287,7 @@ def __repr__(self) -> str: class NetworkAccessProfileList(ListResource): + def __init__(self, version: Version): """ Initialize the NetworkAccessProfileList @@ -309,6 +312,7 @@ def create( :returns: The created NetworkAccessProfileInstance """ + data = values.of( { "UniqueName": unique_name, @@ -337,6 +341,7 @@ async def create_async( :returns: The created NetworkAccessProfileInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py b/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py index eeacec1e73..50a259550d 100644 --- a/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py +++ b/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py @@ -46,7 +46,7 @@ def __init__( ) self.friendly_name: Optional[str] = payload.get("friendly_name") self.iso_country: Optional[str] = payload.get("iso_country") - self.identifiers: Optional[List[object]] = payload.get("identifiers") + self.identifiers: Optional[List[Dict[str, object]]] = payload.get("identifiers") self.url: Optional[str] = payload.get("url") self._solution = { @@ -120,6 +120,7 @@ def __repr__(self) -> str: class NetworkAccessProfileNetworkContext(InstanceContext): + def __init__(self, version: Version, network_access_profile_sid: str, sid: str): """ Initialize the NetworkAccessProfileNetworkContext @@ -218,6 +219,7 @@ def __repr__(self) -> str: class NetworkAccessProfileNetworkPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> NetworkAccessProfileNetworkInstance: @@ -242,6 +244,7 @@ def __repr__(self) -> str: class NetworkAccessProfileNetworkList(ListResource): + def __init__(self, version: Version, network_access_profile_sid: str): """ Initialize the NetworkAccessProfileNetworkList @@ -270,6 +273,7 @@ def create(self, network: str) -> NetworkAccessProfileNetworkInstance: :returns: The created NetworkAccessProfileNetworkInstance """ + data = values.of( { "Network": network, @@ -296,6 +300,7 @@ async def create_async(self, network: str) -> NetworkAccessProfileNetworkInstanc :returns: The created NetworkAccessProfileNetworkInstance """ + data = values.of( { "Network": network, diff --git a/twilio/rest/supersim/v1/settings_update.py b/twilio/rest/supersim/v1/settings_update.py index ea13986d0b..f946150287 100644 --- a/twilio/rest/supersim/v1/settings_update.py +++ b/twilio/rest/supersim/v1/settings_update.py @@ -23,6 +23,7 @@ class SettingsUpdateInstance(InstanceResource): + class Status(object): SCHEDULED = "scheduled" IN_PROGRESS = "in-progress" @@ -47,7 +48,7 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.iccid: Optional[str] = payload.get("iccid") self.sim_sid: Optional[str] = payload.get("sim_sid") self.status: Optional["SettingsUpdateInstance.Status"] = payload.get("status") - self.packages: Optional[List[object]] = payload.get("packages") + self.packages: Optional[List[Dict[str, object]]] = payload.get("packages") self.date_completed: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_completed") ) @@ -69,6 +70,7 @@ def __repr__(self) -> str: class SettingsUpdatePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SettingsUpdateInstance: """ Build an instance of SettingsUpdateInstance @@ -87,6 +89,7 @@ def __repr__(self) -> str: class SettingsUpdateList(ListResource): + def __init__(self, version: Version): """ Initialize the SettingsUpdateList diff --git a/twilio/rest/supersim/v1/sim/__init__.py b/twilio/rest/supersim/v1/sim/__init__.py index 735e8fadcd..b1ba647336 100644 --- a/twilio/rest/supersim/v1/sim/__init__.py +++ b/twilio/rest/supersim/v1/sim/__init__.py @@ -25,6 +25,7 @@ class SimInstance(InstanceResource): + class Status(object): NEW = "new" READY = "ready" @@ -193,6 +194,7 @@ def __repr__(self) -> str: class SimContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SimContext @@ -364,6 +366,7 @@ def __repr__(self) -> str: class SimPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SimInstance: """ Build an instance of SimInstance @@ -382,6 +385,7 @@ def __repr__(self) -> str: class SimList(ListResource): + def __init__(self, version: Version): """ Initialize the SimList @@ -402,6 +406,7 @@ def create(self, iccid: str, registration_code: str) -> SimInstance: :returns: The created SimInstance """ + data = values.of( { "Iccid": iccid, @@ -426,6 +431,7 @@ async def create_async(self, iccid: str, registration_code: str) -> SimInstance: :returns: The created SimInstance """ + data = values.of( { "Iccid": iccid, diff --git a/twilio/rest/supersim/v1/sim/billing_period.py b/twilio/rest/supersim/v1/sim/billing_period.py index 082622ecee..e6fb961835 100644 --- a/twilio/rest/supersim/v1/sim/billing_period.py +++ b/twilio/rest/supersim/v1/sim/billing_period.py @@ -23,6 +23,7 @@ class BillingPeriodInstance(InstanceResource): + class BpType(object): READY = "ready" ACTIVE = "active" @@ -75,6 +76,7 @@ def __repr__(self) -> str: class BillingPeriodPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BillingPeriodInstance: """ Build an instance of BillingPeriodInstance @@ -95,6 +97,7 @@ def __repr__(self) -> str: class BillingPeriodList(ListResource): + def __init__(self, version: Version, sim_sid: str): """ Initialize the BillingPeriodList diff --git a/twilio/rest/supersim/v1/sim/sim_ip_address.py b/twilio/rest/supersim/v1/sim/sim_ip_address.py index e0b5a5756d..7c2b70e50f 100644 --- a/twilio/rest/supersim/v1/sim/sim_ip_address.py +++ b/twilio/rest/supersim/v1/sim/sim_ip_address.py @@ -22,6 +22,7 @@ class SimIpAddressInstance(InstanceResource): + class IpAddressVersion(object): IPV4 = "IPv4" IPV6 = "IPv6" @@ -54,6 +55,7 @@ def __repr__(self) -> str: class SimIpAddressPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SimIpAddressInstance: """ Build an instance of SimIpAddressInstance @@ -74,6 +76,7 @@ def __repr__(self) -> str: class SimIpAddressList(ListResource): + def __init__(self, version: Version, sim_sid: str): """ Initialize the SimIpAddressList diff --git a/twilio/rest/supersim/v1/sms_command.py b/twilio/rest/supersim/v1/sms_command.py index 18e496c718..0eb2094103 100644 --- a/twilio/rest/supersim/v1/sms_command.py +++ b/twilio/rest/supersim/v1/sms_command.py @@ -23,6 +23,7 @@ class SmsCommandInstance(InstanceResource): + class Direction(object): TO_SIM = "to_sim" FROM_SIM = "from_sim" @@ -116,6 +117,7 @@ def __repr__(self) -> str: class SmsCommandContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SmsCommandContext @@ -180,6 +182,7 @@ def __repr__(self) -> str: class SmsCommandPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SmsCommandInstance: """ Build an instance of SmsCommandInstance @@ -198,6 +201,7 @@ def __repr__(self) -> str: class SmsCommandList(ListResource): + def __init__(self, version: Version): """ Initialize the SmsCommandList @@ -226,6 +230,7 @@ def create( :returns: The created SmsCommandInstance """ + data = values.of( { "Sim": sim, @@ -260,6 +265,7 @@ async def create_async( :returns: The created SmsCommandInstance """ + data = values.of( { "Sim": sim, diff --git a/twilio/rest/supersim/v1/usage_record.py b/twilio/rest/supersim/v1/usage_record.py index 19ba4989de..86a335d0de 100644 --- a/twilio/rest/supersim/v1/usage_record.py +++ b/twilio/rest/supersim/v1/usage_record.py @@ -23,6 +23,7 @@ class UsageRecordInstance(InstanceResource): + class Granularity(object): HOUR = "hour" DAY = "day" @@ -76,6 +77,7 @@ def __repr__(self) -> str: class UsageRecordPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UsageRecordInstance: """ Build an instance of UsageRecordInstance @@ -94,6 +96,7 @@ def __repr__(self) -> str: class UsageRecordList(ListResource): + def __init__(self, version: Version): """ Initialize the UsageRecordList diff --git a/twilio/rest/sync/SyncBase.py b/twilio/rest/sync/SyncBase.py index 35c4fa9846..113cac0390 100644 --- a/twilio/rest/sync/SyncBase.py +++ b/twilio/rest/sync/SyncBase.py @@ -17,6 +17,7 @@ class SyncBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Sync Domain diff --git a/twilio/rest/sync/v1/__init__.py b/twilio/rest/sync/v1/__init__.py index db6c478992..e98201bd41 100644 --- a/twilio/rest/sync/v1/__init__.py +++ b/twilio/rest/sync/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Sync diff --git a/twilio/rest/sync/v1/service/__init__.py b/twilio/rest/sync/v1/service/__init__.py index 08434aec32..9fd7c22e30 100644 --- a/twilio/rest/sync/v1/service/__init__.py +++ b/twilio/rest/sync/v1/service/__init__.py @@ -237,6 +237,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -464,6 +465,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -482,6 +484,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -516,6 +519,7 @@ def create( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -559,6 +563,7 @@ async def create_async( :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/sync/v1/service/document/__init__.py b/twilio/rest/sync/v1/service/document/__init__.py index 0cd5c918db..f3b89cfe67 100644 --- a/twilio/rest/sync/v1/service/document/__init__.py +++ b/twilio/rest/sync/v1/service/document/__init__.py @@ -187,6 +187,7 @@ def __repr__(self) -> str: class DocumentContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the DocumentContext @@ -370,6 +371,7 @@ def __repr__(self) -> str: class DocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DocumentInstance: """ Build an instance of DocumentInstance @@ -390,6 +392,7 @@ def __repr__(self) -> str: class DocumentList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the DocumentList @@ -421,6 +424,7 @@ def create( :returns: The created DocumentInstance """ + data = values.of( { "UniqueName": unique_name, @@ -454,6 +458,7 @@ async def create_async( :returns: The created DocumentInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/sync/v1/service/document/document_permission.py b/twilio/rest/sync/v1/service/document/document_permission.py index 0e9a3e29ec..d8f157fb4e 100644 --- a/twilio/rest/sync/v1/service/document/document_permission.py +++ b/twilio/rest/sync/v1/service/document/document_permission.py @@ -159,6 +159,7 @@ def __repr__(self) -> str: class DocumentPermissionContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, document_sid: str, identity: str ): @@ -327,6 +328,7 @@ def __repr__(self) -> str: class DocumentPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DocumentPermissionInstance: """ Build an instance of DocumentPermissionInstance @@ -350,6 +352,7 @@ def __repr__(self) -> str: class DocumentPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, document_sid: str): """ Initialize the DocumentPermissionList diff --git a/twilio/rest/sync/v1/service/sync_list/__init__.py b/twilio/rest/sync/v1/service/sync_list/__init__.py index da694eb36a..7e9ca672c4 100644 --- a/twilio/rest/sync/v1/service/sync_list/__init__.py +++ b/twilio/rest/sync/v1/service/sync_list/__init__.py @@ -187,6 +187,7 @@ def __repr__(self) -> str: class SyncListContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SyncListContext @@ -374,6 +375,7 @@ def __repr__(self) -> str: class SyncListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListInstance: """ Build an instance of SyncListInstance @@ -394,6 +396,7 @@ def __repr__(self) -> str: class SyncListList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SyncListList @@ -425,6 +428,7 @@ def create( :returns: The created SyncListInstance """ + data = values.of( { "UniqueName": unique_name, @@ -458,6 +462,7 @@ async def create_async( :returns: The created SyncListInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py index 8597395916..02dafcd49b 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py @@ -23,6 +23,7 @@ class SyncListItemInstance(InstanceResource): + class QueryFromBoundType(object): INCLUSIVE = "inclusive" EXCLUSIVE = "exclusive" @@ -204,6 +205,7 @@ def __repr__(self) -> str: class SyncListItemContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, list_sid: str, index: int): """ Initialize the SyncListItemContext @@ -402,6 +404,7 @@ def __repr__(self) -> str: class SyncListItemPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListItemInstance: """ Build an instance of SyncListItemInstance @@ -425,6 +428,7 @@ def __repr__(self) -> str: class SyncListItemList(ListResource): + def __init__(self, version: Version, service_sid: str, list_sid: str): """ Initialize the SyncListItemList @@ -462,6 +466,7 @@ def create( :returns: The created SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), @@ -501,6 +506,7 @@ async def create_async( :returns: The created SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py index 9b94b7fb5e..228ab0d192 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py @@ -159,6 +159,7 @@ def __repr__(self) -> str: class SyncListPermissionContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, list_sid: str, identity: str ): @@ -329,6 +330,7 @@ def __repr__(self) -> str: class SyncListPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncListPermissionInstance: """ Build an instance of SyncListPermissionInstance @@ -352,6 +354,7 @@ def __repr__(self) -> str: class SyncListPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, list_sid: str): """ Initialize the SyncListPermissionList diff --git a/twilio/rest/sync/v1/service/sync_map/__init__.py b/twilio/rest/sync/v1/service/sync_map/__init__.py index 3147e502d7..1a68e8ef4d 100644 --- a/twilio/rest/sync/v1/service/sync_map/__init__.py +++ b/twilio/rest/sync/v1/service/sync_map/__init__.py @@ -187,6 +187,7 @@ def __repr__(self) -> str: class SyncMapContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SyncMapContext @@ -374,6 +375,7 @@ def __repr__(self) -> str: class SyncMapPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapInstance: """ Build an instance of SyncMapInstance @@ -394,6 +396,7 @@ def __repr__(self) -> str: class SyncMapList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SyncMapList @@ -425,6 +428,7 @@ def create( :returns: The created SyncMapInstance """ + data = values.of( { "UniqueName": unique_name, @@ -458,6 +462,7 @@ async def create_async( :returns: The created SyncMapInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py index 0f7681600b..7c621f8adc 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py @@ -23,6 +23,7 @@ class SyncMapItemInstance(InstanceResource): + class QueryFromBoundType(object): INCLUSIVE = "inclusive" EXCLUSIVE = "exclusive" @@ -204,6 +205,7 @@ def __repr__(self) -> str: class SyncMapItemContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, map_sid: str, key: str): """ Initialize the SyncMapItemContext @@ -402,6 +404,7 @@ def __repr__(self) -> str: class SyncMapItemPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapItemInstance: """ Build an instance of SyncMapItemInstance @@ -425,6 +428,7 @@ def __repr__(self) -> str: class SyncMapItemList(ListResource): + def __init__(self, version: Version, service_sid: str, map_sid: str): """ Initialize the SyncMapItemList @@ -464,6 +468,7 @@ def create( :returns: The created SyncMapItemInstance """ + data = values.of( { "Key": key, @@ -506,6 +511,7 @@ async def create_async( :returns: The created SyncMapItemInstance """ + data = values.of( { "Key": key, diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py index b983a77bb5..3f204d65ba 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py @@ -159,6 +159,7 @@ def __repr__(self) -> str: class SyncMapPermissionContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, map_sid: str, identity: str): """ Initialize the SyncMapPermissionContext @@ -327,6 +328,7 @@ def __repr__(self) -> str: class SyncMapPermissionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncMapPermissionInstance: """ Build an instance of SyncMapPermissionInstance @@ -350,6 +352,7 @@ def __repr__(self) -> str: class SyncMapPermissionList(ListResource): + def __init__(self, version: Version, service_sid: str, map_sid: str): """ Initialize the SyncMapPermissionList diff --git a/twilio/rest/sync/v1/service/sync_stream/__init__.py b/twilio/rest/sync/v1/service/sync_stream/__init__.py index f1146e9a83..aa10d164a6 100644 --- a/twilio/rest/sync/v1/service/sync_stream/__init__.py +++ b/twilio/rest/sync/v1/service/sync_stream/__init__.py @@ -165,6 +165,7 @@ def __repr__(self) -> str: class SyncStreamContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the SyncStreamContext @@ -328,6 +329,7 @@ def __repr__(self) -> str: class SyncStreamPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SyncStreamInstance: """ Build an instance of SyncStreamInstance @@ -348,6 +350,7 @@ def __repr__(self) -> str: class SyncStreamList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the SyncStreamList @@ -377,6 +380,7 @@ def create( :returns: The created SyncStreamInstance """ + data = values.of( { "UniqueName": unique_name, @@ -407,6 +411,7 @@ async def create_async( :returns: The created SyncStreamInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/sync/v1/service/sync_stream/stream_message.py b/twilio/rest/sync/v1/service/sync_stream/stream_message.py index d525b8e2c9..88a7604a7a 100644 --- a/twilio/rest/sync/v1/service/sync_stream/stream_message.py +++ b/twilio/rest/sync/v1/service/sync_stream/stream_message.py @@ -54,6 +54,7 @@ def __repr__(self) -> str: class StreamMessageList(ListResource): + def __init__(self, version: Version, service_sid: str, stream_sid: str): """ Initialize the StreamMessageList @@ -82,6 +83,7 @@ def create(self, data: object) -> StreamMessageInstance: :returns: The created StreamMessageInstance """ + data = values.of( { "Data": serialize.object(data), @@ -109,6 +111,7 @@ async def create_async(self, data: object) -> StreamMessageInstance: :returns: The created StreamMessageInstance """ + data = values.of( { "Data": serialize.object(data), diff --git a/twilio/rest/taskrouter/TaskrouterBase.py b/twilio/rest/taskrouter/TaskrouterBase.py index ee7fbfd7e8..4bbbdb602e 100644 --- a/twilio/rest/taskrouter/TaskrouterBase.py +++ b/twilio/rest/taskrouter/TaskrouterBase.py @@ -17,6 +17,7 @@ class TaskrouterBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Taskrouter Domain diff --git a/twilio/rest/taskrouter/v1/__init__.py b/twilio/rest/taskrouter/v1/__init__.py index a331fb3497..a17eeccc2a 100644 --- a/twilio/rest/taskrouter/v1/__init__.py +++ b/twilio/rest/taskrouter/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Taskrouter diff --git a/twilio/rest/taskrouter/v1/workspace/__init__.py b/twilio/rest/taskrouter/v1/workspace/__init__.py index fcdea4c373..0b0136fedc 100644 --- a/twilio/rest/taskrouter/v1/workspace/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/__init__.py @@ -39,6 +39,7 @@ class WorkspaceInstance(InstanceResource): + class QueueOrder(object): FIFO = "FIFO" LIFO = "LIFO" @@ -295,6 +296,7 @@ def __repr__(self) -> str: class WorkspaceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the WorkspaceContext @@ -604,6 +606,7 @@ def __repr__(self) -> str: class WorkspacePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WorkspaceInstance: """ Build an instance of WorkspaceInstance @@ -622,6 +625,7 @@ def __repr__(self) -> str: class WorkspaceList(ListResource): + def __init__(self, version: Version): """ Initialize the WorkspaceList @@ -656,6 +660,7 @@ def create( :returns: The created WorkspaceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -698,6 +703,7 @@ async def create_async( :returns: The created WorkspaceInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/activity.py b/twilio/rest/taskrouter/v1/workspace/activity.py index 79b4504fdd..3ab15acf8e 100644 --- a/twilio/rest/taskrouter/v1/workspace/activity.py +++ b/twilio/rest/taskrouter/v1/workspace/activity.py @@ -155,6 +155,7 @@ def __repr__(self) -> str: class ActivityContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the ActivityContext @@ -307,6 +308,7 @@ def __repr__(self) -> str: class ActivityPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ActivityInstance: """ Build an instance of ActivityInstance @@ -327,6 +329,7 @@ def __repr__(self) -> str: class ActivityList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the ActivityList @@ -354,6 +357,7 @@ def create( :returns: The created ActivityInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -382,6 +386,7 @@ async def create_async( :returns: The created ActivityInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/event.py b/twilio/rest/taskrouter/v1/workspace/event.py index 1e55f2e9aa..534d9cd120 100644 --- a/twilio/rest/taskrouter/v1/workspace/event.py +++ b/twilio/rest/taskrouter/v1/workspace/event.py @@ -123,6 +123,7 @@ def __repr__(self) -> str: class EventContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the EventContext @@ -191,6 +192,7 @@ def __repr__(self) -> str: class EventPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EventInstance: """ Build an instance of EventInstance @@ -211,6 +213,7 @@ def __repr__(self) -> str: class EventList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the EventList diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index 49b3af73e4..708db25105 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -24,6 +24,7 @@ class TaskInstance(InstanceResource): + class Status(object): PENDING = "pending" RESERVED = "reserved" @@ -37,7 +38,7 @@ class Status(object): :ivar age: The number of seconds since the Task was created. :ivar assignment_status: :ivar attributes: The JSON string with custom attributes of the work. **Note** If this property has been assigned a value, it will only be displayed in FETCH action that returns a single resource. Otherwise, it will be null. - :ivar addons: An object that contains the [addon](https://www.twilio.com/docs/taskrouter/marketplace) data for all installed addons. + :ivar addons: An object that contains the [Add-on](https://www.twilio.com/docs/add-ons) data for all installed Add-ons. :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar task_queue_entered_date: The date and time in GMT when the Task entered the TaskQueue, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. @@ -253,6 +254,7 @@ def __repr__(self) -> str: class TaskContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the TaskContext @@ -470,6 +472,7 @@ def __repr__(self) -> str: class TaskPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TaskInstance: """ Build an instance of TaskInstance @@ -490,6 +493,7 @@ def __repr__(self) -> str: class TaskList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the TaskList @@ -527,6 +531,7 @@ def create( :returns: The created TaskInstance """ + data = values.of( { "Timeout": timeout, @@ -569,6 +574,7 @@ async def create_async( :returns: The created TaskInstance """ + data = values.of( { "Timeout": timeout, @@ -618,7 +624,7 @@ def stream( :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. - :param bool has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + :param bool has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -672,7 +678,7 @@ async def stream_async( :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. - :param bool has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + :param bool has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -725,7 +731,7 @@ def list( :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. - :param bool has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + :param bool has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -778,7 +784,7 @@ async def list_async( :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. - :param bool has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + :param bool has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -832,7 +838,7 @@ def page( :param task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. :param ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. - :param has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + :param has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -886,7 +892,7 @@ async def page_async( :param task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. :param ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. - :param has_addons: Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + :param has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 diff --git a/twilio/rest/taskrouter/v1/workspace/task/reservation.py b/twilio/rest/taskrouter/v1/workspace/task/reservation.py index e053ec8016..7ac7807c0e 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/task/reservation.py @@ -23,6 +23,7 @@ class ReservationInstance(InstanceResource): + class CallStatus(object): INITIATED = "initiated" RINGING = "ringing" @@ -199,6 +200,7 @@ def update( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Update the ReservationInstance @@ -257,6 +259,7 @@ def update( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -315,6 +318,7 @@ def update( supervisor=supervisor, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) async def update_async( @@ -379,6 +383,7 @@ async def update_async( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Asynchronous coroutine to update the ReservationInstance @@ -437,6 +442,7 @@ async def update_async( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -495,6 +501,7 @@ async def update_async( supervisor=supervisor, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) def __repr__(self) -> str: @@ -508,6 +515,7 @@ def __repr__(self) -> str: class ReservationContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, task_sid: str, sid: str): """ Initialize the ReservationContext @@ -635,6 +643,7 @@ def update( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Update the ReservationInstance @@ -693,6 +702,7 @@ def update( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -757,6 +767,7 @@ def update( "Supervisor": supervisor, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -839,6 +850,7 @@ async def update_async( supervisor: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Asynchronous coroutine to update the ReservationInstance @@ -897,6 +909,7 @@ async def update_async( :param supervisor: The Supervisor SID/URI when executing the Supervise instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -961,6 +974,7 @@ async def update_async( "Supervisor": supervisor, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -992,6 +1006,7 @@ def __repr__(self) -> str: class ReservationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ReservationInstance: """ Build an instance of ReservationInstance @@ -1015,6 +1030,7 @@ def __repr__(self) -> str: class ReservationList(ListResource): + def __init__(self, version: Version, workspace_sid: str, task_sid: str): """ Initialize the ReservationList diff --git a/twilio/rest/taskrouter/v1/workspace/task_channel.py b/twilio/rest/taskrouter/v1/workspace/task_channel.py index 6fd6f24f41..780c4ef9fa 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/task_channel.py @@ -167,6 +167,7 @@ def __repr__(self) -> str: class TaskChannelContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the TaskChannelContext @@ -327,6 +328,7 @@ def __repr__(self) -> str: class TaskChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TaskChannelInstance: """ Build an instance of TaskChannelInstance @@ -347,6 +349,7 @@ def __repr__(self) -> str: class TaskChannelList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the TaskChannelList @@ -378,6 +381,7 @@ def create( :returns: The created TaskChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -411,6 +415,7 @@ async def create_async( :returns: The created TaskChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py index d4ab32eb54..5c750d94cb 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py @@ -35,6 +35,7 @@ class TaskQueueInstance(InstanceResource): + class TaskOrder(object): FIFO = "FIFO" LIFO = "LIFO" @@ -248,6 +249,7 @@ def __repr__(self) -> str: class TaskQueueContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the TaskQueueContext @@ -475,6 +477,7 @@ def __repr__(self) -> str: class TaskQueuePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TaskQueueInstance: """ Build an instance of TaskQueueInstance @@ -495,6 +498,7 @@ def __repr__(self) -> str: class TaskQueueList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the TaskQueueList @@ -534,6 +538,7 @@ def create( :returns: The created TaskQueueInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -576,6 +581,7 @@ async def create_async( :returns: The created TaskQueueInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py index f910aa4329..acb8b79a29 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py @@ -204,6 +204,7 @@ def __repr__(self) -> str: class TaskQueueCumulativeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueCumulativeStatisticsContext @@ -316,6 +317,7 @@ def __repr__(self) -> str: class TaskQueueCumulativeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueCumulativeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py index f8786d42be..faca804702 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py @@ -48,7 +48,7 @@ def __init__( super().__init__(version) self.account_sid: Optional[str] = payload.get("account_sid") - self.activity_statistics: Optional[List[object]] = payload.get( + self.activity_statistics: Optional[List[Dict[str, object]]] = payload.get( "activity_statistics" ) self.longest_task_waiting_age: Optional[int] = deserialize.integer( @@ -145,6 +145,7 @@ def __repr__(self) -> str: class TaskQueueRealTimeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueRealTimeStatisticsContext @@ -231,6 +232,7 @@ def __repr__(self) -> str: class TaskQueueRealTimeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueRealTimeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py index 53543ec1dc..2a09f62a68 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py @@ -134,6 +134,7 @@ def __repr__(self) -> str: class TaskQueueStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueStatisticsContext @@ -246,6 +247,7 @@ def __repr__(self) -> str: class TaskQueueStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, task_queue_sid: str): """ Initialize the TaskQueueStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py index 74768da3f9..bec2d81b40 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py @@ -55,6 +55,7 @@ def __repr__(self) -> str: class TaskQueuesStatisticsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TaskQueuesStatisticsInstance: """ Build an instance of TaskQueuesStatisticsInstance @@ -75,6 +76,7 @@ def __repr__(self) -> str: class TaskQueuesStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the TaskQueuesStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py index 851b303467..a3ce2db7d4 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py @@ -232,6 +232,7 @@ def __repr__(self) -> str: class WorkerContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the WorkerContext @@ -465,6 +466,7 @@ def __repr__(self) -> str: class WorkerPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WorkerInstance: """ Build an instance of WorkerInstance @@ -485,6 +487,7 @@ def __repr__(self) -> str: class WorkerList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkerList @@ -520,6 +523,7 @@ def create( :returns: The created WorkerInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -553,6 +557,7 @@ async def create_async( :returns: The created WorkerInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py index f95c2ad143..2f62c433ef 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py @@ -23,6 +23,7 @@ class ReservationInstance(InstanceResource): + class CallStatus(object): INITIATED = "initiated" RINGING = "ringing" @@ -190,6 +191,7 @@ def update( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Update the ReservationInstance @@ -246,6 +248,7 @@ def update( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -302,6 +305,7 @@ def update( post_work_activity_sid=post_work_activity_sid, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) async def update_async( @@ -362,6 +366,7 @@ async def update_async( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> "ReservationInstance": """ Asynchronous coroutine to update the ReservationInstance @@ -418,6 +423,7 @@ async def update_async( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -474,6 +480,7 @@ async def update_async( post_work_activity_sid=post_work_activity_sid, end_conference_on_customer_exit=end_conference_on_customer_exit, beep_on_customer_entrance=beep_on_customer_entrance, + jitter_buffer_size=jitter_buffer_size, ) def __repr__(self) -> str: @@ -487,6 +494,7 @@ def __repr__(self) -> str: class ReservationContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str, sid: str): """ Initialize the ReservationContext @@ -608,6 +616,7 @@ def update( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Update the ReservationInstance @@ -664,6 +673,7 @@ def update( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -726,6 +736,7 @@ def update( "PostWorkActivitySid": post_work_activity_sid, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -804,6 +815,7 @@ async def update_async( post_work_activity_sid: Union[str, object] = values.unset, end_conference_on_customer_exit: Union[bool, object] = values.unset, beep_on_customer_entrance: Union[bool, object] = values.unset, + jitter_buffer_size: Union[str, object] = values.unset, ) -> ReservationInstance: """ Asynchronous coroutine to update the ReservationInstance @@ -860,6 +872,7 @@ async def update_async( :param post_work_activity_sid: The new worker activity SID after executing a Conference instruction. :param end_conference_on_customer_exit: Whether to end the conference when the customer leaves. :param beep_on_customer_entrance: Whether to play a notification beep when the customer joins. + :param jitter_buffer_size: The jitter buffer size for conference. Can be: `small`, `medium`, `large`, `off`. :returns: The updated ReservationInstance """ @@ -922,6 +935,7 @@ async def update_async( "PostWorkActivitySid": post_work_activity_sid, "EndConferenceOnCustomerExit": end_conference_on_customer_exit, "BeepOnCustomerEntrance": beep_on_customer_entrance, + "JitterBufferSize": jitter_buffer_size, } ) headers = values.of( @@ -953,6 +967,7 @@ def __repr__(self) -> str: class ReservationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ReservationInstance: """ Build an instance of ReservationInstance @@ -976,6 +991,7 @@ def __repr__(self) -> str: class ReservationList(ListResource): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str): """ Initialize the ReservationList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py index d75955d5ad..64f0c3afe9 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py @@ -164,6 +164,7 @@ def __repr__(self) -> str: class WorkerChannelContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str, sid: str): """ Initialize the WorkerChannelContext @@ -308,6 +309,7 @@ def __repr__(self) -> str: class WorkerChannelPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WorkerChannelInstance: """ Build an instance of WorkerChannelInstance @@ -331,6 +333,7 @@ def __repr__(self) -> str: class WorkerChannelList(ListResource): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str): """ Initialize the WorkerChannelList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py index 591d72fb70..61618d2961 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py @@ -126,6 +126,7 @@ def __repr__(self) -> str: class WorkerStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str): """ Initialize the WorkerStatisticsContext @@ -232,6 +233,7 @@ def __repr__(self) -> str: class WorkerStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, worker_sid: str): """ Initialize the WorkerStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py index ecb5fe9a01..b18e7f123b 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py @@ -47,7 +47,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], workspace_sid: str self.end_time: Optional[datetime] = deserialize.iso8601_datetime( payload.get("end_time") ) - self.activity_durations: Optional[List[object]] = payload.get( + self.activity_durations: Optional[List[Dict[str, object]]] = payload.get( "activity_durations" ) self.reservations_created: Optional[int] = deserialize.integer( @@ -152,6 +152,7 @@ def __repr__(self) -> str: class WorkersCumulativeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersCumulativeStatisticsContext @@ -254,6 +255,7 @@ def __repr__(self) -> str: class WorkersCumulativeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersCumulativeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py index 5fb8ce12cb..277889ae7a 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py @@ -33,7 +33,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], workspace_sid: str super().__init__(version) self.account_sid: Optional[str] = payload.get("account_sid") - self.activity_statistics: Optional[List[object]] = payload.get( + self.activity_statistics: Optional[List[Dict[str, object]]] = payload.get( "activity_statistics" ) self.total_workers: Optional[int] = deserialize.integer( @@ -103,6 +103,7 @@ def __repr__(self) -> str: class WorkersRealTimeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersRealTimeStatisticsContext @@ -185,6 +186,7 @@ def __repr__(self) -> str: class WorkersRealTimeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersRealTimeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py index 78feeda3f9..0cd09ec124 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py @@ -136,6 +136,7 @@ def __repr__(self) -> str: class WorkersStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersStatisticsContext @@ -254,6 +255,7 @@ def __repr__(self) -> str: class WorkersStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkersStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py index e12a42748b..f01e76d379 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py @@ -231,6 +231,7 @@ def __repr__(self) -> str: class WorkflowContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, sid: str): """ Initialize the WorkflowContext @@ -458,6 +459,7 @@ def __repr__(self) -> str: class WorkflowPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WorkflowInstance: """ Build an instance of WorkflowInstance @@ -478,6 +480,7 @@ def __repr__(self) -> str: class WorkflowList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkflowList @@ -513,6 +516,7 @@ def create( :returns: The created WorkflowInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -552,6 +556,7 @@ async def create_async( :returns: The created WorkflowInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py index 3fa89fdf0c..e06cab0114 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py @@ -204,6 +204,7 @@ def __repr__(self) -> str: class WorkflowCumulativeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowCumulativeStatisticsContext @@ -316,6 +317,7 @@ def __repr__(self) -> str: class WorkflowCumulativeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowCumulativeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py index 9c21c0e47f..415d4223e4 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py @@ -125,6 +125,7 @@ def __repr__(self) -> str: class WorkflowRealTimeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowRealTimeStatisticsContext @@ -211,6 +212,7 @@ def __repr__(self) -> str: class WorkflowRealTimeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowRealTimeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py index 087ed816ea..f86590e40f 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py @@ -134,6 +134,7 @@ def __repr__(self) -> str: class WorkflowStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowStatisticsContext @@ -246,6 +247,7 @@ def __repr__(self) -> str: class WorkflowStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str, workflow_sid: str): """ Initialize the WorkflowStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py index b13c11d006..2b223641ae 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py @@ -194,6 +194,7 @@ def __repr__(self) -> str: class WorkspaceCumulativeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceCumulativeStatisticsContext @@ -302,6 +303,7 @@ def __repr__(self) -> str: class WorkspaceCumulativeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceCumulativeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py index 92e2b50753..35b50c0b21 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py @@ -38,7 +38,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], workspace_sid: str super().__init__(version) self.account_sid: Optional[str] = payload.get("account_sid") - self.activity_statistics: Optional[List[object]] = payload.get( + self.activity_statistics: Optional[List[Dict[str, object]]] = payload.get( "activity_statistics" ) self.longest_task_waiting_age: Optional[int] = deserialize.integer( @@ -123,6 +123,7 @@ def __repr__(self) -> str: class WorkspaceRealTimeStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceRealTimeStatisticsContext @@ -205,6 +206,7 @@ def __repr__(self) -> str: class WorkspaceRealTimeStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceRealTimeStatisticsList diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py index 5dd18d9281..19eb885675 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py @@ -124,6 +124,7 @@ def __repr__(self) -> str: class WorkspaceStatisticsContext(InstanceContext): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceStatisticsContext @@ -228,6 +229,7 @@ def __repr__(self) -> str: class WorkspaceStatisticsList(ListResource): + def __init__(self, version: Version, workspace_sid: str): """ Initialize the WorkspaceStatisticsList diff --git a/twilio/rest/trunking/TrunkingBase.py b/twilio/rest/trunking/TrunkingBase.py index 627790454d..bed8f9a2a9 100644 --- a/twilio/rest/trunking/TrunkingBase.py +++ b/twilio/rest/trunking/TrunkingBase.py @@ -17,6 +17,7 @@ class TrunkingBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Trunking Domain diff --git a/twilio/rest/trunking/v1/__init__.py b/twilio/rest/trunking/v1/__init__.py index 89dc5c1087..af530b97c7 100644 --- a/twilio/rest/trunking/v1/__init__.py +++ b/twilio/rest/trunking/v1/__init__.py @@ -19,6 +19,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Trunking diff --git a/twilio/rest/trunking/v1/trunk/__init__.py b/twilio/rest/trunking/v1/trunk/__init__.py index 954290932e..935ce2718d 100644 --- a/twilio/rest/trunking/v1/trunk/__init__.py +++ b/twilio/rest/trunking/v1/trunk/__init__.py @@ -28,6 +28,7 @@ class TrunkInstance(InstanceResource): + class TransferCallerId(object): FROM_TRANSFEREE = "from-transferee" FROM_TRANSFEROR = "from-transferor" @@ -268,6 +269,7 @@ def __repr__(self) -> str: class TrunkContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the TrunkContext @@ -518,6 +520,7 @@ def __repr__(self) -> str: class TrunkPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TrunkInstance: """ Build an instance of TrunkInstance @@ -536,6 +539,7 @@ def __repr__(self) -> str: class TrunkList(ListResource): + def __init__(self, version: Version): """ Initialize the TrunkList @@ -574,6 +578,7 @@ def create( :returns: The created TrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -622,6 +627,7 @@ async def create_async( :returns: The created TrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/trunking/v1/trunk/credential_list.py b/twilio/rest/trunking/v1/trunk/credential_list.py index cdfb5de7b7..7dc043d286 100644 --- a/twilio/rest/trunking/v1/trunk/credential_list.py +++ b/twilio/rest/trunking/v1/trunk/credential_list.py @@ -123,6 +123,7 @@ def __repr__(self) -> str: class CredentialListContext(InstanceContext): + def __init__(self, version: Version, trunk_sid: str, sid: str): """ Initialize the CredentialListContext @@ -215,6 +216,7 @@ def __repr__(self) -> str: class CredentialListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CredentialListInstance: """ Build an instance of CredentialListInstance @@ -235,6 +237,7 @@ def __repr__(self) -> str: class CredentialListList(ListResource): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the CredentialListList @@ -259,6 +262,7 @@ def create(self, credential_list_sid: str) -> CredentialListInstance: :returns: The created CredentialListInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, @@ -283,6 +287,7 @@ async def create_async(self, credential_list_sid: str) -> CredentialListInstance :returns: The created CredentialListInstance """ + data = values.of( { "CredentialListSid": credential_list_sid, diff --git a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py index 7f9b51a7a7..b361e7fe9f 100644 --- a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py +++ b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py @@ -123,6 +123,7 @@ def __repr__(self) -> str: class IpAccessControlListContext(InstanceContext): + def __init__(self, version: Version, trunk_sid: str, sid: str): """ Initialize the IpAccessControlListContext @@ -217,6 +218,7 @@ def __repr__(self) -> str: class IpAccessControlListPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IpAccessControlListInstance: """ Build an instance of IpAccessControlListInstance @@ -237,6 +239,7 @@ def __repr__(self) -> str: class IpAccessControlListList(ListResource): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the IpAccessControlListList @@ -261,6 +264,7 @@ def create(self, ip_access_control_list_sid: str) -> IpAccessControlListInstance :returns: The created IpAccessControlListInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, @@ -287,6 +291,7 @@ async def create_async( :returns: The created IpAccessControlListInstance """ + data = values.of( { "IpAccessControlListSid": ip_access_control_list_sid, diff --git a/twilio/rest/trunking/v1/trunk/origination_url.py b/twilio/rest/trunking/v1/trunk/origination_url.py index 27f451d2d5..426938995e 100644 --- a/twilio/rest/trunking/v1/trunk/origination_url.py +++ b/twilio/rest/trunking/v1/trunk/origination_url.py @@ -185,6 +185,7 @@ def __repr__(self) -> str: class OriginationUrlContext(InstanceContext): + def __init__(self, version: Version, trunk_sid: str, sid: str): """ Initialize the OriginationUrlContext @@ -361,6 +362,7 @@ def __repr__(self) -> str: class OriginationUrlPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> OriginationUrlInstance: """ Build an instance of OriginationUrlInstance @@ -381,6 +383,7 @@ def __repr__(self) -> str: class OriginationUrlList(ListResource): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the OriginationUrlList @@ -416,6 +419,7 @@ def create( :returns: The created OriginationUrlInstance """ + data = values.of( { "Weight": weight, @@ -455,6 +459,7 @@ async def create_async( :returns: The created OriginationUrlInstance """ + data = values.of( { "Weight": weight, diff --git a/twilio/rest/trunking/v1/trunk/phone_number.py b/twilio/rest/trunking/v1/trunk/phone_number.py index 06f9ded10c..7f0adbeef1 100644 --- a/twilio/rest/trunking/v1/trunk/phone_number.py +++ b/twilio/rest/trunking/v1/trunk/phone_number.py @@ -23,6 +23,7 @@ class PhoneNumberInstance(InstanceResource): + class AddressRequirement(object): NONE = "none" ANY = "any" @@ -173,6 +174,7 @@ def __repr__(self) -> str: class PhoneNumberContext(InstanceContext): + def __init__(self, version: Version, trunk_sid: str, sid: str): """ Initialize the PhoneNumberContext @@ -265,6 +267,7 @@ def __repr__(self) -> str: class PhoneNumberPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PhoneNumberInstance: """ Build an instance of PhoneNumberInstance @@ -285,6 +288,7 @@ def __repr__(self) -> str: class PhoneNumberList(ListResource): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the PhoneNumberList @@ -309,6 +313,7 @@ def create(self, phone_number_sid: str) -> PhoneNumberInstance: :returns: The created PhoneNumberInstance """ + data = values.of( { "PhoneNumberSid": phone_number_sid, @@ -333,6 +338,7 @@ async def create_async(self, phone_number_sid: str) -> PhoneNumberInstance: :returns: The created PhoneNumberInstance """ + data = values.of( { "PhoneNumberSid": phone_number_sid, diff --git a/twilio/rest/trunking/v1/trunk/recording.py b/twilio/rest/trunking/v1/trunk/recording.py index 7d03f6cda1..1a431b496b 100644 --- a/twilio/rest/trunking/v1/trunk/recording.py +++ b/twilio/rest/trunking/v1/trunk/recording.py @@ -21,6 +21,7 @@ class RecordingInstance(InstanceResource): + class RecordingMode(object): DO_NOT_RECORD = "do-not-record" RECORD_FROM_RINGING = "record-from-ringing" @@ -128,6 +129,7 @@ def __repr__(self) -> str: class RecordingContext(InstanceContext): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the RecordingContext @@ -252,6 +254,7 @@ def __repr__(self) -> str: class RecordingList(ListResource): + def __init__(self, version: Version, trunk_sid: str): """ Initialize the RecordingList diff --git a/twilio/rest/trusthub/TrusthubBase.py b/twilio/rest/trusthub/TrusthubBase.py index f58cc7cfec..97fd32f9b7 100644 --- a/twilio/rest/trusthub/TrusthubBase.py +++ b/twilio/rest/trusthub/TrusthubBase.py @@ -17,6 +17,7 @@ class TrusthubBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Trusthub Domain diff --git a/twilio/rest/trusthub/v1/__init__.py b/twilio/rest/trusthub/v1/__init__.py index 10c3fd825b..596c5ea758 100644 --- a/twilio/rest/trusthub/v1/__init__.py +++ b/twilio/rest/trusthub/v1/__init__.py @@ -16,6 +16,12 @@ from twilio.base.version import Version from twilio.base.domain import Domain from twilio.rest.trusthub.v1.compliance_inquiries import ComplianceInquiriesList +from twilio.rest.trusthub.v1.compliance_registration_inquiries import ( + ComplianceRegistrationInquiriesList, +) +from twilio.rest.trusthub.v1.compliance_tollfree_inquiries import ( + ComplianceTollfreeInquiriesList, +) from twilio.rest.trusthub.v1.customer_profiles import CustomerProfilesList from twilio.rest.trusthub.v1.end_user import EndUserList from twilio.rest.trusthub.v1.end_user_type import EndUserTypeList @@ -26,6 +32,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Trusthub @@ -34,6 +41,12 @@ def __init__(self, domain: Domain): """ super().__init__(domain, "v1") self._compliance_inquiries: Optional[ComplianceInquiriesList] = None + self._compliance_registration_inquiries: Optional[ + ComplianceRegistrationInquiriesList + ] = None + self._compliance_tollfree_inquiries: Optional[ + ComplianceTollfreeInquiriesList + ] = None self._customer_profiles: Optional[CustomerProfilesList] = None self._end_users: Optional[EndUserList] = None self._end_user_types: Optional[EndUserTypeList] = None @@ -48,6 +61,20 @@ def compliance_inquiries(self) -> ComplianceInquiriesList: self._compliance_inquiries = ComplianceInquiriesList(self) return self._compliance_inquiries + @property + def compliance_registration_inquiries(self) -> ComplianceRegistrationInquiriesList: + if self._compliance_registration_inquiries is None: + self._compliance_registration_inquiries = ( + ComplianceRegistrationInquiriesList(self) + ) + return self._compliance_registration_inquiries + + @property + def compliance_tollfree_inquiries(self) -> ComplianceTollfreeInquiriesList: + if self._compliance_tollfree_inquiries is None: + self._compliance_tollfree_inquiries = ComplianceTollfreeInquiriesList(self) + return self._compliance_tollfree_inquiries + @property def customer_profiles(self) -> CustomerProfilesList: if self._customer_profiles is None: diff --git a/twilio/rest/trusthub/v1/compliance_inquiries.py b/twilio/rest/trusthub/v1/compliance_inquiries.py index 41d061bdbe..b1b52a4f78 100644 --- a/twilio/rest/trusthub/v1/compliance_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_inquiries.py @@ -12,7 +12,7 @@ Do not edit the class manually. """ -from typing import Any, Dict, Optional +from typing import Any, Dict, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -98,6 +98,7 @@ def __repr__(self) -> str: class ComplianceInquiriesContext(InstanceContext): + def __init__(self, version: Version, customer_id: str): """ Initialize the ComplianceInquiriesContext @@ -176,6 +177,7 @@ def __repr__(self) -> str: class ComplianceInquiriesList(ListResource): + def __init__(self, version: Version): """ Initialize the ComplianceInquiriesList @@ -187,17 +189,24 @@ def __init__(self, version: Version): self._uri = "/ComplianceInquiries/Customers/Initialize" - def create(self, primary_profile_sid: str) -> ComplianceInquiriesInstance: + def create( + self, + primary_profile_sid: str, + notification_email: Union[str, object] = values.unset, + ) -> ComplianceInquiriesInstance: """ Create the ComplianceInquiriesInstance :param primary_profile_sid: The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + :param notification_email: The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. :returns: The created ComplianceInquiriesInstance """ + data = values.of( { "PrimaryProfileSid": primary_profile_sid, + "NotificationEmail": notification_email, } ) @@ -210,18 +219,23 @@ def create(self, primary_profile_sid: str) -> ComplianceInquiriesInstance: return ComplianceInquiriesInstance(self._version, payload) async def create_async( - self, primary_profile_sid: str + self, + primary_profile_sid: str, + notification_email: Union[str, object] = values.unset, ) -> ComplianceInquiriesInstance: """ Asynchronously create the ComplianceInquiriesInstance :param primary_profile_sid: The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + :param notification_email: The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. :returns: The created ComplianceInquiriesInstance """ + data = values.of( { "PrimaryProfileSid": primary_profile_sid, + "NotificationEmail": notification_email, } ) diff --git a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py new file mode 100644 index 0000000000..264dd4ae31 --- /dev/null +++ b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py @@ -0,0 +1,316 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Trusthub + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional, Union +from twilio.base import values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ComplianceRegistrationInquiriesInstance(InstanceResource): + + class BusinessIdentityType(object): + DIRECT_CUSTOMER = "direct_customer" + ISV_RESELLER_OR_PARTNER = "isv_reseller_or_partner" + UNKNOWN = "unknown" + + class EndUserType(object): + INDIVIDUAL = "Individual" + BUSINESS = "Business" + + class PhoneNumberType(object): + LOCAL = "local" + NATIONAL = "national" + MOBILE = "mobile" + TOLL_FREE = "toll-free" + + """ + :ivar inquiry_id: The unique ID used to start an embedded compliance registration session. + :ivar inquiry_session_token: The session token used to start an embedded compliance registration session. + :ivar registration_id: The RegistrationId matching the Registration Profile that should be resumed or resubmitted for editing. + :ivar url: The URL of this resource. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.inquiry_id: Optional[str] = payload.get("inquiry_id") + self.inquiry_session_token: Optional[str] = payload.get("inquiry_session_token") + self.registration_id: Optional[str] = payload.get("registration_id") + self.url: Optional[str] = payload.get("url") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ComplianceRegistrationInquiriesList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the ComplianceRegistrationInquiriesList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = ( + "/ComplianceInquiries/Registration/RegulatoryCompliance/GB/Initialize" + ) + + def create( + self, + end_user_type: "ComplianceRegistrationInquiriesInstance.EndUserType", + phone_number_type: "ComplianceRegistrationInquiriesInstance.PhoneNumberType", + business_identity_type: Union[ + "ComplianceRegistrationInquiriesInstance.BusinessIdentityType", object + ] = values.unset, + business_registration_authority: Union[str, object] = values.unset, + business_legal_name: Union[str, object] = values.unset, + notification_email: Union[str, object] = values.unset, + accepted_notification_receipt: Union[bool, object] = values.unset, + business_registration_number: Union[str, object] = values.unset, + business_website_url: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + authorized_representative1_first_name: Union[str, object] = values.unset, + authorized_representative1_last_name: Union[str, object] = values.unset, + authorized_representative1_phone: Union[str, object] = values.unset, + authorized_representative1_email: Union[str, object] = values.unset, + authorized_representative1_date_of_birth: Union[str, object] = values.unset, + address_street: Union[str, object] = values.unset, + address_street_secondary: Union[str, object] = values.unset, + address_city: Union[str, object] = values.unset, + address_subdivision: Union[str, object] = values.unset, + address_postal_code: Union[str, object] = values.unset, + address_country_code: Union[str, object] = values.unset, + emergency_address_street: Union[str, object] = values.unset, + emergency_address_street_secondary: Union[str, object] = values.unset, + emergency_address_city: Union[str, object] = values.unset, + emergency_address_subdivision: Union[str, object] = values.unset, + emergency_address_postal_code: Union[str, object] = values.unset, + emergency_address_country_code: Union[str, object] = values.unset, + use_address_as_emergency_address: Union[bool, object] = values.unset, + file_name: Union[str, object] = values.unset, + file: Union[str, object] = values.unset, + ) -> ComplianceRegistrationInquiriesInstance: + """ + Create the ComplianceRegistrationInquiriesInstance + + :param end_user_type: + :param phone_number_type: + :param business_identity_type: + :param business_registration_authority: The authority that registered the business + :param business_legal_name: he name of the business or organization using the Tollfree number. + :param notification_email: he email address to receive the notification about the verification result. + :param accepted_notification_receipt: The email address to receive the notification about the verification result. + :param business_registration_number: Business registration number of the business + :param business_website_url: The URL of the business website + :param friendly_name: Friendly name for your business information + :param authorized_representative1_first_name: First name of the authorized representative + :param authorized_representative1_last_name: Last name of the authorized representative + :param authorized_representative1_phone: Phone number of the authorized representative + :param authorized_representative1_email: Email address of the authorized representative + :param authorized_representative1_date_of_birth: Birthdate of the authorized representative + :param address_street: Street address of the business + :param address_street_secondary: Street address of the business + :param address_city: City of the business + :param address_subdivision: State or province of the business + :param address_postal_code: Postal code of the business + :param address_country_code: Country code of the business + :param emergency_address_street: Street address of the business + :param emergency_address_street_secondary: Street address of the business + :param emergency_address_city: City of the business + :param emergency_address_subdivision: State or province of the business + :param emergency_address_postal_code: Postal code of the business + :param emergency_address_country_code: Country code of the business + :param use_address_as_emergency_address: Use the business address as the emergency address + :param file_name: The name of the verification document to upload + :param file: The verification document to upload + + :returns: The created ComplianceRegistrationInquiriesInstance + """ + + data = values.of( + { + "EndUserType": end_user_type, + "PhoneNumberType": phone_number_type, + "BusinessIdentityType": business_identity_type, + "BusinessRegistrationAuthority": business_registration_authority, + "BusinessLegalName": business_legal_name, + "NotificationEmail": notification_email, + "AcceptedNotificationReceipt": accepted_notification_receipt, + "BusinessRegistrationNumber": business_registration_number, + "BusinessWebsiteUrl": business_website_url, + "FriendlyName": friendly_name, + "AuthorizedRepresentative1FirstName": authorized_representative1_first_name, + "AuthorizedRepresentative1LastName": authorized_representative1_last_name, + "AuthorizedRepresentative1Phone": authorized_representative1_phone, + "AuthorizedRepresentative1Email": authorized_representative1_email, + "AuthorizedRepresentative1DateOfBirth": authorized_representative1_date_of_birth, + "AddressStreet": address_street, + "AddressStreetSecondary": address_street_secondary, + "AddressCity": address_city, + "AddressSubdivision": address_subdivision, + "AddressPostalCode": address_postal_code, + "AddressCountryCode": address_country_code, + "EmergencyAddressStreet": emergency_address_street, + "EmergencyAddressStreetSecondary": emergency_address_street_secondary, + "EmergencyAddressCity": emergency_address_city, + "EmergencyAddressSubdivision": emergency_address_subdivision, + "EmergencyAddressPostalCode": emergency_address_postal_code, + "EmergencyAddressCountryCode": emergency_address_country_code, + "UseAddressAsEmergencyAddress": use_address_as_emergency_address, + "FileName": file_name, + "File": file, + } + ) + + payload = self._version.create( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceRegistrationInquiriesInstance(self._version, payload) + + async def create_async( + self, + end_user_type: "ComplianceRegistrationInquiriesInstance.EndUserType", + phone_number_type: "ComplianceRegistrationInquiriesInstance.PhoneNumberType", + business_identity_type: Union[ + "ComplianceRegistrationInquiriesInstance.BusinessIdentityType", object + ] = values.unset, + business_registration_authority: Union[str, object] = values.unset, + business_legal_name: Union[str, object] = values.unset, + notification_email: Union[str, object] = values.unset, + accepted_notification_receipt: Union[bool, object] = values.unset, + business_registration_number: Union[str, object] = values.unset, + business_website_url: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + authorized_representative1_first_name: Union[str, object] = values.unset, + authorized_representative1_last_name: Union[str, object] = values.unset, + authorized_representative1_phone: Union[str, object] = values.unset, + authorized_representative1_email: Union[str, object] = values.unset, + authorized_representative1_date_of_birth: Union[str, object] = values.unset, + address_street: Union[str, object] = values.unset, + address_street_secondary: Union[str, object] = values.unset, + address_city: Union[str, object] = values.unset, + address_subdivision: Union[str, object] = values.unset, + address_postal_code: Union[str, object] = values.unset, + address_country_code: Union[str, object] = values.unset, + emergency_address_street: Union[str, object] = values.unset, + emergency_address_street_secondary: Union[str, object] = values.unset, + emergency_address_city: Union[str, object] = values.unset, + emergency_address_subdivision: Union[str, object] = values.unset, + emergency_address_postal_code: Union[str, object] = values.unset, + emergency_address_country_code: Union[str, object] = values.unset, + use_address_as_emergency_address: Union[bool, object] = values.unset, + file_name: Union[str, object] = values.unset, + file: Union[str, object] = values.unset, + ) -> ComplianceRegistrationInquiriesInstance: + """ + Asynchronously create the ComplianceRegistrationInquiriesInstance + + :param end_user_type: + :param phone_number_type: + :param business_identity_type: + :param business_registration_authority: The authority that registered the business + :param business_legal_name: he name of the business or organization using the Tollfree number. + :param notification_email: he email address to receive the notification about the verification result. + :param accepted_notification_receipt: The email address to receive the notification about the verification result. + :param business_registration_number: Business registration number of the business + :param business_website_url: The URL of the business website + :param friendly_name: Friendly name for your business information + :param authorized_representative1_first_name: First name of the authorized representative + :param authorized_representative1_last_name: Last name of the authorized representative + :param authorized_representative1_phone: Phone number of the authorized representative + :param authorized_representative1_email: Email address of the authorized representative + :param authorized_representative1_date_of_birth: Birthdate of the authorized representative + :param address_street: Street address of the business + :param address_street_secondary: Street address of the business + :param address_city: City of the business + :param address_subdivision: State or province of the business + :param address_postal_code: Postal code of the business + :param address_country_code: Country code of the business + :param emergency_address_street: Street address of the business + :param emergency_address_street_secondary: Street address of the business + :param emergency_address_city: City of the business + :param emergency_address_subdivision: State or province of the business + :param emergency_address_postal_code: Postal code of the business + :param emergency_address_country_code: Country code of the business + :param use_address_as_emergency_address: Use the business address as the emergency address + :param file_name: The name of the verification document to upload + :param file: The verification document to upload + + :returns: The created ComplianceRegistrationInquiriesInstance + """ + + data = values.of( + { + "EndUserType": end_user_type, + "PhoneNumberType": phone_number_type, + "BusinessIdentityType": business_identity_type, + "BusinessRegistrationAuthority": business_registration_authority, + "BusinessLegalName": business_legal_name, + "NotificationEmail": notification_email, + "AcceptedNotificationReceipt": accepted_notification_receipt, + "BusinessRegistrationNumber": business_registration_number, + "BusinessWebsiteUrl": business_website_url, + "FriendlyName": friendly_name, + "AuthorizedRepresentative1FirstName": authorized_representative1_first_name, + "AuthorizedRepresentative1LastName": authorized_representative1_last_name, + "AuthorizedRepresentative1Phone": authorized_representative1_phone, + "AuthorizedRepresentative1Email": authorized_representative1_email, + "AuthorizedRepresentative1DateOfBirth": authorized_representative1_date_of_birth, + "AddressStreet": address_street, + "AddressStreetSecondary": address_street_secondary, + "AddressCity": address_city, + "AddressSubdivision": address_subdivision, + "AddressPostalCode": address_postal_code, + "AddressCountryCode": address_country_code, + "EmergencyAddressStreet": emergency_address_street, + "EmergencyAddressStreetSecondary": emergency_address_street_secondary, + "EmergencyAddressCity": emergency_address_city, + "EmergencyAddressSubdivision": emergency_address_subdivision, + "EmergencyAddressPostalCode": emergency_address_postal_code, + "EmergencyAddressCountryCode": emergency_address_country_code, + "UseAddressAsEmergencyAddress": use_address_as_emergency_address, + "FileName": file_name, + "File": file, + } + ) + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceRegistrationInquiriesInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py new file mode 100644 index 0000000000..6c9d5b3d9b --- /dev/null +++ b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py @@ -0,0 +1,252 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Trusthub + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional, Union +from twilio.base import serialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ComplianceTollfreeInquiriesInstance(InstanceResource): + + class OptInType(object): + VERBAL = "VERBAL" + WEB_FORM = "WEB_FORM" + PAPER_FORM = "PAPER_FORM" + VIA_TEXT = "VIA_TEXT" + MOBILE_QR_CODE = "MOBILE_QR_CODE" + + """ + :ivar inquiry_id: The unique ID used to start an embedded compliance registration session. + :ivar inquiry_session_token: The session token used to start an embedded compliance registration session. + :ivar registration_id: The TolfreeId matching the Tollfree Profile that should be resumed or resubmitted for editing. + :ivar url: The URL of this resource. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.inquiry_id: Optional[str] = payload.get("inquiry_id") + self.inquiry_session_token: Optional[str] = payload.get("inquiry_session_token") + self.registration_id: Optional[str] = payload.get("registration_id") + self.url: Optional[str] = payload.get("url") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ComplianceTollfreeInquiriesList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the ComplianceTollfreeInquiriesList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/ComplianceInquiries/Tollfree/Initialize" + + def create( + self, + tollfree_phone_number: str, + notification_email: str, + business_name: Union[str, object] = values.unset, + business_website: Union[str, object] = values.unset, + use_case_categories: Union[List[str], object] = values.unset, + use_case_summary: Union[str, object] = values.unset, + production_message_sample: Union[str, object] = values.unset, + opt_in_image_urls: Union[List[str], object] = values.unset, + opt_in_type: Union[ + "ComplianceTollfreeInquiriesInstance.OptInType", object + ] = values.unset, + message_volume: Union[str, object] = values.unset, + business_street_address: Union[str, object] = values.unset, + business_street_address2: Union[str, object] = values.unset, + business_city: Union[str, object] = values.unset, + business_state_province_region: Union[str, object] = values.unset, + business_postal_code: Union[str, object] = values.unset, + business_country: Union[str, object] = values.unset, + additional_information: Union[str, object] = values.unset, + business_contact_first_name: Union[str, object] = values.unset, + business_contact_last_name: Union[str, object] = values.unset, + business_contact_email: Union[str, object] = values.unset, + business_contact_phone: Union[str, object] = values.unset, + ) -> ComplianceTollfreeInquiriesInstance: + """ + Create the ComplianceTollfreeInquiriesInstance + + :param tollfree_phone_number: The Tollfree phone number to be verified + :param notification_email: The email address to receive the notification about the verification result. + :param business_name: The name of the business or organization using the Tollfree number. + :param business_website: The website of the business or organization using the Tollfree number. + :param use_case_categories: The category of the use case for the Tollfree Number. List as many are applicable.. + :param use_case_summary: Use this to further explain how messaging is used by the business or organization. + :param production_message_sample: An example of message content, i.e. a sample message. + :param opt_in_image_urls: Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + :param opt_in_type: + :param message_volume: Estimate monthly volume of messages from the Tollfree Number. + :param business_street_address: The address of the business or organization using the Tollfree number. + :param business_street_address2: The address of the business or organization using the Tollfree number. + :param business_city: The city of the business or organization using the Tollfree number. + :param business_state_province_region: The state/province/region of the business or organization using the Tollfree number. + :param business_postal_code: The postal code of the business or organization using the Tollfree number. + :param business_country: The country of the business or organization using the Tollfree number. + :param additional_information: Additional information to be provided for verification. + :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. + :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. + :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + + :returns: The created ComplianceTollfreeInquiriesInstance + """ + + data = values.of( + { + "TollfreePhoneNumber": tollfree_phone_number, + "NotificationEmail": notification_email, + "BusinessName": business_name, + "BusinessWebsite": business_website, + "UseCaseCategories": serialize.map(use_case_categories, lambda e: e), + "UseCaseSummary": use_case_summary, + "ProductionMessageSample": production_message_sample, + "OptInImageUrls": serialize.map(opt_in_image_urls, lambda e: e), + "OptInType": opt_in_type, + "MessageVolume": message_volume, + "BusinessStreetAddress": business_street_address, + "BusinessStreetAddress2": business_street_address2, + "BusinessCity": business_city, + "BusinessStateProvinceRegion": business_state_province_region, + "BusinessPostalCode": business_postal_code, + "BusinessCountry": business_country, + "AdditionalInformation": additional_information, + "BusinessContactFirstName": business_contact_first_name, + "BusinessContactLastName": business_contact_last_name, + "BusinessContactEmail": business_contact_email, + "BusinessContactPhone": business_contact_phone, + } + ) + + payload = self._version.create( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceTollfreeInquiriesInstance(self._version, payload) + + async def create_async( + self, + tollfree_phone_number: str, + notification_email: str, + business_name: Union[str, object] = values.unset, + business_website: Union[str, object] = values.unset, + use_case_categories: Union[List[str], object] = values.unset, + use_case_summary: Union[str, object] = values.unset, + production_message_sample: Union[str, object] = values.unset, + opt_in_image_urls: Union[List[str], object] = values.unset, + opt_in_type: Union[ + "ComplianceTollfreeInquiriesInstance.OptInType", object + ] = values.unset, + message_volume: Union[str, object] = values.unset, + business_street_address: Union[str, object] = values.unset, + business_street_address2: Union[str, object] = values.unset, + business_city: Union[str, object] = values.unset, + business_state_province_region: Union[str, object] = values.unset, + business_postal_code: Union[str, object] = values.unset, + business_country: Union[str, object] = values.unset, + additional_information: Union[str, object] = values.unset, + business_contact_first_name: Union[str, object] = values.unset, + business_contact_last_name: Union[str, object] = values.unset, + business_contact_email: Union[str, object] = values.unset, + business_contact_phone: Union[str, object] = values.unset, + ) -> ComplianceTollfreeInquiriesInstance: + """ + Asynchronously create the ComplianceTollfreeInquiriesInstance + + :param tollfree_phone_number: The Tollfree phone number to be verified + :param notification_email: The email address to receive the notification about the verification result. + :param business_name: The name of the business or organization using the Tollfree number. + :param business_website: The website of the business or organization using the Tollfree number. + :param use_case_categories: The category of the use case for the Tollfree Number. List as many are applicable.. + :param use_case_summary: Use this to further explain how messaging is used by the business or organization. + :param production_message_sample: An example of message content, i.e. a sample message. + :param opt_in_image_urls: Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + :param opt_in_type: + :param message_volume: Estimate monthly volume of messages from the Tollfree Number. + :param business_street_address: The address of the business or organization using the Tollfree number. + :param business_street_address2: The address of the business or organization using the Tollfree number. + :param business_city: The city of the business or organization using the Tollfree number. + :param business_state_province_region: The state/province/region of the business or organization using the Tollfree number. + :param business_postal_code: The postal code of the business or organization using the Tollfree number. + :param business_country: The country of the business or organization using the Tollfree number. + :param additional_information: Additional information to be provided for verification. + :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. + :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. + :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + + :returns: The created ComplianceTollfreeInquiriesInstance + """ + + data = values.of( + { + "TollfreePhoneNumber": tollfree_phone_number, + "NotificationEmail": notification_email, + "BusinessName": business_name, + "BusinessWebsite": business_website, + "UseCaseCategories": serialize.map(use_case_categories, lambda e: e), + "UseCaseSummary": use_case_summary, + "ProductionMessageSample": production_message_sample, + "OptInImageUrls": serialize.map(opt_in_image_urls, lambda e: e), + "OptInType": opt_in_type, + "MessageVolume": message_volume, + "BusinessStreetAddress": business_street_address, + "BusinessStreetAddress2": business_street_address2, + "BusinessCity": business_city, + "BusinessStateProvinceRegion": business_state_province_region, + "BusinessPostalCode": business_postal_code, + "BusinessCountry": business_country, + "AdditionalInformation": additional_information, + "BusinessContactFirstName": business_contact_first_name, + "BusinessContactLastName": business_contact_last_name, + "BusinessContactEmail": business_contact_email, + "BusinessContactPhone": business_contact_phone, + } + ) + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceTollfreeInquiriesInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/trusthub/v1/customer_profiles/__init__.py b/twilio/rest/trusthub/v1/customer_profiles/__init__.py index 5158206782..a16ae0e73b 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/__init__.py +++ b/twilio/rest/trusthub/v1/customer_profiles/__init__.py @@ -32,6 +32,7 @@ class CustomerProfilesInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -218,6 +219,7 @@ def __repr__(self) -> str: class CustomerProfilesContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CustomerProfilesContext @@ -432,6 +434,7 @@ def __repr__(self) -> str: class CustomerProfilesPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CustomerProfilesInstance: """ Build an instance of CustomerProfilesInstance @@ -450,6 +453,7 @@ def __repr__(self) -> str: class CustomerProfilesList(ListResource): + def __init__(self, version: Version): """ Initialize the CustomerProfilesList @@ -478,6 +482,7 @@ def create( :returns: The created CustomerProfilesInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -512,6 +517,7 @@ async def create_async( :returns: The created CustomerProfilesInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py index 36005dc32e..4cb14c5ccd 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py @@ -123,6 +123,7 @@ def __repr__(self) -> str: class CustomerProfilesChannelEndpointAssignmentContext(InstanceContext): + def __init__(self, version: Version, customer_profile_sid: str, sid: str): """ Initialize the CustomerProfilesChannelEndpointAssignmentContext @@ -219,6 +220,7 @@ def __repr__(self) -> str: class CustomerProfilesChannelEndpointAssignmentPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> CustomerProfilesChannelEndpointAssignmentInstance: @@ -243,6 +245,7 @@ def __repr__(self) -> str: class CustomerProfilesChannelEndpointAssignmentList(ListResource): + def __init__(self, version: Version, customer_profile_sid: str): """ Initialize the CustomerProfilesChannelEndpointAssignmentList @@ -272,6 +275,7 @@ def create( :returns: The created CustomerProfilesChannelEndpointAssignmentInstance """ + data = values.of( { "ChannelEndpointType": channel_endpoint_type, @@ -302,6 +306,7 @@ async def create_async( :returns: The created CustomerProfilesChannelEndpointAssignmentInstance """ + data = values.of( { "ChannelEndpointType": channel_endpoint_type, diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py index 18579c0473..40f0d6a07d 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py @@ -123,6 +123,7 @@ def __repr__(self) -> str: class CustomerProfilesEntityAssignmentsContext(InstanceContext): + def __init__(self, version: Version, customer_profile_sid: str, sid: str): """ Initialize the CustomerProfilesEntityAssignmentsContext @@ -223,6 +224,7 @@ def __repr__(self) -> str: class CustomerProfilesEntityAssignmentsPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> CustomerProfilesEntityAssignmentsInstance: @@ -247,6 +249,7 @@ def __repr__(self) -> str: class CustomerProfilesEntityAssignmentsList(ListResource): + def __init__(self, version: Version, customer_profile_sid: str): """ Initialize the CustomerProfilesEntityAssignmentsList @@ -273,6 +276,7 @@ def create(self, object_sid: str) -> CustomerProfilesEntityAssignmentsInstance: :returns: The created CustomerProfilesEntityAssignmentsInstance """ + data = values.of( { "ObjectSid": object_sid, @@ -301,6 +305,7 @@ async def create_async( :returns: The created CustomerProfilesEntityAssignmentsInstance """ + data = values.of( { "ObjectSid": object_sid, diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py index 5c158ee0c2..60538ee22e 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py @@ -23,6 +23,7 @@ class CustomerProfilesEvaluationsInstance(InstanceResource): + class Status(object): COMPLIANT = "compliant" NONCOMPLIANT = "noncompliant" @@ -54,7 +55,7 @@ def __init__( self.status: Optional["CustomerProfilesEvaluationsInstance.Status"] = ( payload.get("status") ) - self.results: Optional[List[object]] = payload.get("results") + self.results: Optional[List[Dict[str, object]]] = payload.get("results") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -113,6 +114,7 @@ def __repr__(self) -> str: class CustomerProfilesEvaluationsContext(InstanceContext): + def __init__(self, version: Version, customer_profile_sid: str, sid: str): """ Initialize the CustomerProfilesEvaluationsContext @@ -185,6 +187,7 @@ def __repr__(self) -> str: class CustomerProfilesEvaluationsPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> CustomerProfilesEvaluationsInstance: @@ -209,6 +212,7 @@ def __repr__(self) -> str: class CustomerProfilesEvaluationsList(ListResource): + def __init__(self, version: Version, customer_profile_sid: str): """ Initialize the CustomerProfilesEvaluationsList @@ -235,6 +239,7 @@ def create(self, policy_sid: str) -> CustomerProfilesEvaluationsInstance: :returns: The created CustomerProfilesEvaluationsInstance """ + data = values.of( { "PolicySid": policy_sid, @@ -263,6 +268,7 @@ async def create_async( :returns: The created CustomerProfilesEvaluationsInstance """ + data = values.of( { "PolicySid": policy_sid, diff --git a/twilio/rest/trusthub/v1/end_user.py b/twilio/rest/trusthub/v1/end_user.py index 09c84f2923..b8b08d65ca 100644 --- a/twilio/rest/trusthub/v1/end_user.py +++ b/twilio/rest/trusthub/v1/end_user.py @@ -155,6 +155,7 @@ def __repr__(self) -> str: class EndUserContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EndUserContext @@ -299,6 +300,7 @@ def __repr__(self) -> str: class EndUserPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EndUserInstance: """ Build an instance of EndUserInstance @@ -317,6 +319,7 @@ def __repr__(self) -> str: class EndUserList(ListResource): + def __init__(self, version: Version): """ Initialize the EndUserList @@ -343,6 +346,7 @@ def create( :returns: The created EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -374,6 +378,7 @@ async def create_async( :returns: The created EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/trusthub/v1/end_user_type.py b/twilio/rest/trusthub/v1/end_user_type.py index 997408b331..d336385b25 100644 --- a/twilio/rest/trusthub/v1/end_user_type.py +++ b/twilio/rest/trusthub/v1/end_user_type.py @@ -38,7 +38,7 @@ def __init__( self.sid: Optional[str] = payload.get("sid") self.friendly_name: Optional[str] = payload.get("friendly_name") self.machine_name: Optional[str] = payload.get("machine_name") - self.fields: Optional[List[object]] = payload.get("fields") + self.fields: Optional[List[Dict[str, object]]] = payload.get("fields") self.url: Optional[str] = payload.get("url") self._solution = { @@ -90,6 +90,7 @@ def __repr__(self) -> str: class EndUserTypeContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the EndUserTypeContext @@ -154,6 +155,7 @@ def __repr__(self) -> str: class EndUserTypePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EndUserTypeInstance: """ Build an instance of EndUserTypeInstance @@ -172,6 +174,7 @@ def __repr__(self) -> str: class EndUserTypeList(ListResource): + def __init__(self, version: Version): """ Initialize the EndUserTypeList diff --git a/twilio/rest/trusthub/v1/policies.py b/twilio/rest/trusthub/v1/policies.py index 82a501554d..a39b1e0e65 100644 --- a/twilio/rest/trusthub/v1/policies.py +++ b/twilio/rest/trusthub/v1/policies.py @@ -88,6 +88,7 @@ def __repr__(self) -> str: class PoliciesContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the PoliciesContext @@ -152,6 +153,7 @@ def __repr__(self) -> str: class PoliciesPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PoliciesInstance: """ Build an instance of PoliciesInstance @@ -170,6 +172,7 @@ def __repr__(self) -> str: class PoliciesList(ListResource): + def __init__(self, version: Version): """ Initialize the PoliciesList diff --git a/twilio/rest/trusthub/v1/supporting_document.py b/twilio/rest/trusthub/v1/supporting_document.py index b8bf6805f5..a18293fd8e 100644 --- a/twilio/rest/trusthub/v1/supporting_document.py +++ b/twilio/rest/trusthub/v1/supporting_document.py @@ -23,6 +23,7 @@ class SupportingDocumentInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -169,6 +170,7 @@ def __repr__(self) -> str: class SupportingDocumentContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SupportingDocumentContext @@ -317,6 +319,7 @@ def __repr__(self) -> str: class SupportingDocumentPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SupportingDocumentInstance: """ Build an instance of SupportingDocumentInstance @@ -335,6 +338,7 @@ def __repr__(self) -> str: class SupportingDocumentList(ListResource): + def __init__(self, version: Version): """ Initialize the SupportingDocumentList @@ -361,6 +365,7 @@ def create( :returns: The created SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -392,6 +397,7 @@ async def create_async( :returns: The created SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/trusthub/v1/supporting_document_type.py b/twilio/rest/trusthub/v1/supporting_document_type.py index b6a91e24ac..f1a93c59b7 100644 --- a/twilio/rest/trusthub/v1/supporting_document_type.py +++ b/twilio/rest/trusthub/v1/supporting_document_type.py @@ -38,7 +38,7 @@ def __init__( self.sid: Optional[str] = payload.get("sid") self.friendly_name: Optional[str] = payload.get("friendly_name") self.machine_name: Optional[str] = payload.get("machine_name") - self.fields: Optional[List[object]] = payload.get("fields") + self.fields: Optional[List[Dict[str, object]]] = payload.get("fields") self.url: Optional[str] = payload.get("url") self._solution = { @@ -90,6 +90,7 @@ def __repr__(self) -> str: class SupportingDocumentTypeContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SupportingDocumentTypeContext @@ -154,6 +155,7 @@ def __repr__(self) -> str: class SupportingDocumentTypePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SupportingDocumentTypeInstance: """ Build an instance of SupportingDocumentTypeInstance @@ -172,6 +174,7 @@ def __repr__(self) -> str: class SupportingDocumentTypeList(ListResource): + def __init__(self, version: Version): """ Initialize the SupportingDocumentTypeList diff --git a/twilio/rest/trusthub/v1/trust_products/__init__.py b/twilio/rest/trusthub/v1/trust_products/__init__.py index 6c25207874..a638f680f0 100644 --- a/twilio/rest/trusthub/v1/trust_products/__init__.py +++ b/twilio/rest/trusthub/v1/trust_products/__init__.py @@ -32,6 +32,7 @@ class TrustProductsInstance(InstanceResource): + class Status(object): DRAFT = "draft" PENDING_REVIEW = "pending-review" @@ -216,6 +217,7 @@ def __repr__(self) -> str: class TrustProductsContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the TrustProductsContext @@ -422,6 +424,7 @@ def __repr__(self) -> str: class TrustProductsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TrustProductsInstance: """ Build an instance of TrustProductsInstance @@ -440,6 +443,7 @@ def __repr__(self) -> str: class TrustProductsList(ListResource): + def __init__(self, version: Version): """ Initialize the TrustProductsList @@ -468,6 +472,7 @@ def create( :returns: The created TrustProductsInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -502,6 +507,7 @@ async def create_async( :returns: The created TrustProductsInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py b/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py index 21c52f5a57..ef2b589ffb 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py @@ -123,6 +123,7 @@ def __repr__(self) -> str: class TrustProductsChannelEndpointAssignmentContext(InstanceContext): + def __init__(self, version: Version, trust_product_sid: str, sid: str): """ Initialize the TrustProductsChannelEndpointAssignmentContext @@ -219,6 +220,7 @@ def __repr__(self) -> str: class TrustProductsChannelEndpointAssignmentPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> TrustProductsChannelEndpointAssignmentInstance: @@ -243,6 +245,7 @@ def __repr__(self) -> str: class TrustProductsChannelEndpointAssignmentList(ListResource): + def __init__(self, version: Version, trust_product_sid: str): """ Initialize the TrustProductsChannelEndpointAssignmentList @@ -274,6 +277,7 @@ def create( :returns: The created TrustProductsChannelEndpointAssignmentInstance """ + data = values.of( { "ChannelEndpointType": channel_endpoint_type, @@ -304,6 +308,7 @@ async def create_async( :returns: The created TrustProductsChannelEndpointAssignmentInstance """ + data = values.of( { "ChannelEndpointType": channel_endpoint_type, diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py index 4de853f054..68854b9c5e 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py @@ -121,6 +121,7 @@ def __repr__(self) -> str: class TrustProductsEntityAssignmentsContext(InstanceContext): + def __init__(self, version: Version, trust_product_sid: str, sid: str): """ Initialize the TrustProductsEntityAssignmentsContext @@ -217,6 +218,7 @@ def __repr__(self) -> str: class TrustProductsEntityAssignmentsPage(Page): + def get_instance( self, payload: Dict[str, Any] ) -> TrustProductsEntityAssignmentsInstance: @@ -241,6 +243,7 @@ def __repr__(self) -> str: class TrustProductsEntityAssignmentsList(ListResource): + def __init__(self, version: Version, trust_product_sid: str): """ Initialize the TrustProductsEntityAssignmentsList @@ -267,6 +270,7 @@ def create(self, object_sid: str) -> TrustProductsEntityAssignmentsInstance: :returns: The created TrustProductsEntityAssignmentsInstance """ + data = values.of( { "ObjectSid": object_sid, @@ -295,6 +299,7 @@ async def create_async( :returns: The created TrustProductsEntityAssignmentsInstance """ + data = values.of( { "ObjectSid": object_sid, diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py index 1263d7296a..dfb929bac0 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py @@ -23,6 +23,7 @@ class TrustProductsEvaluationsInstance(InstanceResource): + class Status(object): COMPLIANT = "compliant" NONCOMPLIANT = "noncompliant" @@ -54,7 +55,7 @@ def __init__( self.status: Optional["TrustProductsEvaluationsInstance.Status"] = payload.get( "status" ) - self.results: Optional[List[object]] = payload.get("results") + self.results: Optional[List[Dict[str, object]]] = payload.get("results") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -113,6 +114,7 @@ def __repr__(self) -> str: class TrustProductsEvaluationsContext(InstanceContext): + def __init__(self, version: Version, trust_product_sid: str, sid: str): """ Initialize the TrustProductsEvaluationsContext @@ -183,6 +185,7 @@ def __repr__(self) -> str: class TrustProductsEvaluationsPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TrustProductsEvaluationsInstance: """ Build an instance of TrustProductsEvaluationsInstance @@ -205,6 +208,7 @@ def __repr__(self) -> str: class TrustProductsEvaluationsList(ListResource): + def __init__(self, version: Version, trust_product_sid: str): """ Initialize the TrustProductsEvaluationsList @@ -231,6 +235,7 @@ def create(self, policy_sid: str) -> TrustProductsEvaluationsInstance: :returns: The created TrustProductsEvaluationsInstance """ + data = values.of( { "PolicySid": policy_sid, @@ -257,6 +262,7 @@ async def create_async(self, policy_sid: str) -> TrustProductsEvaluationsInstanc :returns: The created TrustProductsEvaluationsInstance """ + data = values.of( { "PolicySid": policy_sid, diff --git a/twilio/rest/verify/VerifyBase.py b/twilio/rest/verify/VerifyBase.py index 8977a50430..076f063147 100644 --- a/twilio/rest/verify/VerifyBase.py +++ b/twilio/rest/verify/VerifyBase.py @@ -17,6 +17,7 @@ class VerifyBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Verify Domain diff --git a/twilio/rest/verify/v2/__init__.py b/twilio/rest/verify/v2/__init__.py index c4f94aea30..01bee13b0d 100644 --- a/twilio/rest/verify/v2/__init__.py +++ b/twilio/rest/verify/v2/__init__.py @@ -26,6 +26,7 @@ class V2(Version): + def __init__(self, domain: Domain): """ Initialize the V2 version of Verify diff --git a/twilio/rest/verify/v2/form.py b/twilio/rest/verify/v2/form.py index 915eab3bdc..6e3231fcda 100644 --- a/twilio/rest/verify/v2/form.py +++ b/twilio/rest/verify/v2/form.py @@ -20,6 +20,7 @@ class FormInstance(InstanceResource): + class FormTypes(object): FORM_PUSH = "form-push" @@ -92,6 +93,7 @@ def __repr__(self) -> str: class FormContext(InstanceContext): + def __init__(self, version: Version, form_type: "FormInstance.FormTypes"): """ Initialize the FormContext @@ -156,6 +158,7 @@ def __repr__(self) -> str: class FormList(ListResource): + def __init__(self, version: Version): """ Initialize the FormList diff --git a/twilio/rest/verify/v2/safelist.py b/twilio/rest/verify/v2/safelist.py index 1bd1d8c0b4..fb71369fb1 100644 --- a/twilio/rest/verify/v2/safelist.py +++ b/twilio/rest/verify/v2/safelist.py @@ -106,6 +106,7 @@ def __repr__(self) -> str: class SafelistContext(InstanceContext): + def __init__(self, version: Version, phone_number: str): """ Initialize the SafelistContext @@ -194,6 +195,7 @@ def __repr__(self) -> str: class SafelistList(ListResource): + def __init__(self, version: Version): """ Initialize the SafelistList @@ -213,6 +215,7 @@ def create(self, phone_number: str) -> SafelistInstance: :returns: The created SafelistInstance """ + data = values.of( { "PhoneNumber": phone_number, @@ -235,6 +238,7 @@ async def create_async(self, phone_number: str) -> SafelistInstance: :returns: The created SafelistInstance """ + data = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 7429a3528a..374ecb3ef1 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -47,6 +47,7 @@ class ServiceInstance(InstanceResource): :ivar push: Configurations for the Push factors (channel) created under this Service. :ivar totp: Configurations for the TOTP factors (channel) created under this Service. :ivar default_template_sid: + :ivar verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar url: The absolute URL of the resource. @@ -78,6 +79,9 @@ def __init__( self.push: Optional[Dict[str, object]] = payload.get("push") self.totp: Optional[Dict[str, object]] = payload.get("totp") self.default_template_sid: Optional[str] = payload.get("default_template_sid") + self.verify_event_subscription_enabled: Optional[bool] = payload.get( + "verify_event_subscription_enabled" + ) self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -162,6 +166,7 @@ def update( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> "ServiceInstance": """ Update the ServiceInstance @@ -183,6 +188,7 @@ def update( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -204,6 +210,7 @@ def update( totp_code_length=totp_code_length, totp_skew=totp_skew, default_template_sid=default_template_sid, + verify_event_subscription_enabled=verify_event_subscription_enabled, ) async def update_async( @@ -225,6 +232,7 @@ async def update_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> "ServiceInstance": """ Asynchronous coroutine to update the ServiceInstance @@ -246,6 +254,7 @@ async def update_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -267,6 +276,7 @@ async def update_async( totp_code_length=totp_code_length, totp_skew=totp_skew, default_template_sid=default_template_sid, + verify_event_subscription_enabled=verify_event_subscription_enabled, ) @property @@ -329,6 +339,7 @@ def __repr__(self) -> str: class ServiceContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ServiceContext @@ -433,6 +444,7 @@ def update( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Update the ServiceInstance @@ -454,6 +466,7 @@ def update( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -476,6 +489,7 @@ def update( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) @@ -506,6 +520,7 @@ async def update_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Asynchronous coroutine to update the ServiceInstance @@ -527,6 +542,7 @@ async def update_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance """ @@ -549,6 +565,7 @@ async def update_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) @@ -655,6 +672,7 @@ def __repr__(self) -> str: class ServicePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: """ Build an instance of ServiceInstance @@ -673,6 +691,7 @@ def __repr__(self) -> str: class ServiceList(ListResource): + def __init__(self, version: Version): """ Initialize the ServiceList @@ -703,6 +722,7 @@ def create( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Create the ServiceInstance @@ -724,9 +744,11 @@ def create( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -746,6 +768,7 @@ def create( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) @@ -776,6 +799,7 @@ async def create_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ Asynchronously create the ServiceInstance @@ -797,9 +821,11 @@ async def create_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The created ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -819,6 +845,7 @@ async def create_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, } ) diff --git a/twilio/rest/verify/v2/service/access_token.py b/twilio/rest/verify/v2/service/access_token.py index 8ea618a3a4..0bb888a08f 100644 --- a/twilio/rest/verify/v2/service/access_token.py +++ b/twilio/rest/verify/v2/service/access_token.py @@ -22,6 +22,7 @@ class AccessTokenInstance(InstanceResource): + class FactorTypes(object): PUSH = "push" @@ -113,6 +114,7 @@ def __repr__(self) -> str: class AccessTokenContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the AccessTokenContext @@ -183,6 +185,7 @@ def __repr__(self) -> str: class AccessTokenList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the AccessTokenList @@ -216,6 +219,7 @@ def create( :returns: The created AccessTokenInstance """ + data = values.of( { "Identity": identity, @@ -252,6 +256,7 @@ async def create_async( :returns: The created AccessTokenInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/verify/v2/service/entity/__init__.py b/twilio/rest/verify/v2/service/entity/__init__.py index e2250d501f..41541a4ca6 100644 --- a/twilio/rest/verify/v2/service/entity/__init__.py +++ b/twilio/rest/verify/v2/service/entity/__init__.py @@ -149,6 +149,7 @@ def __repr__(self) -> str: class EntityContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, identity: str): """ Initialize the EntityContext @@ -286,6 +287,7 @@ def __repr__(self) -> str: class EntityPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> EntityInstance: """ Build an instance of EntityInstance @@ -306,6 +308,7 @@ def __repr__(self) -> str: class EntityList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the EntityList @@ -330,6 +333,7 @@ def create(self, identity: str) -> EntityInstance: :returns: The created EntityInstance """ + data = values.of( { "Identity": identity, @@ -354,6 +358,7 @@ async def create_async(self, identity: str) -> EntityInstance: :returns: The created EntityInstance """ + data = values.of( { "Identity": identity, diff --git a/twilio/rest/verify/v2/service/entity/challenge/__init__.py b/twilio/rest/verify/v2/service/entity/challenge/__init__.py index 791128fd61..ab8c7f8d11 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/__init__.py +++ b/twilio/rest/verify/v2/service/entity/challenge/__init__.py @@ -24,6 +24,7 @@ class ChallengeInstance(InstanceResource): + class ChallengeReasons(object): NONE = "none" NOT_NEEDED = "not_needed" @@ -203,6 +204,7 @@ def __repr__(self) -> str: class ChallengeContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, identity: str, sid: str): """ Initialize the ChallengeContext @@ -363,6 +365,7 @@ def __repr__(self) -> str: class ChallengePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ChallengeInstance: """ Build an instance of ChallengeInstance @@ -386,6 +389,7 @@ def __repr__(self) -> str: class ChallengeList(ListResource): + def __init__(self, version: Version, service_sid: str, identity: str): """ Initialize the ChallengeList @@ -427,6 +431,7 @@ def create( :returns: The created ChallengeInstance """ + data = values.of( { "FactorSid": factor_sid, @@ -474,6 +479,7 @@ async def create_async( :returns: The created ChallengeInstance """ + data = values.of( { "FactorSid": factor_sid, diff --git a/twilio/rest/verify/v2/service/entity/challenge/notification.py b/twilio/rest/verify/v2/service/entity/challenge/notification.py index b4ac882ba1..0cfae0a60f 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/notification.py +++ b/twilio/rest/verify/v2/service/entity/challenge/notification.py @@ -73,6 +73,7 @@ def __repr__(self) -> str: class NotificationList(ListResource): + def __init__( self, version: Version, service_sid: str, identity: str, challenge_sid: str ): @@ -105,6 +106,7 @@ def create(self, ttl: Union[int, object] = values.unset) -> NotificationInstance :returns: The created NotificationInstance """ + data = values.of( { "Ttl": ttl, @@ -135,6 +137,7 @@ async def create_async( :returns: The created NotificationInstance """ + data = values.of( { "Ttl": ttl, diff --git a/twilio/rest/verify/v2/service/entity/factor.py b/twilio/rest/verify/v2/service/entity/factor.py index cf06f184cf..8900fcbfc2 100644 --- a/twilio/rest/verify/v2/service/entity/factor.py +++ b/twilio/rest/verify/v2/service/entity/factor.py @@ -23,6 +23,7 @@ class FactorInstance(InstanceResource): + class FactorStatuses(object): UNVERIFIED = "unverified" VERIFIED = "verified" @@ -231,6 +232,7 @@ def __repr__(self) -> str: class FactorContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, identity: str, sid: str): """ Initialize the FactorContext @@ -439,6 +441,7 @@ def __repr__(self) -> str: class FactorPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> FactorInstance: """ Build an instance of FactorInstance @@ -462,6 +465,7 @@ def __repr__(self) -> str: class FactorList(ListResource): + def __init__(self, version: Version, service_sid: str, identity: str): """ Initialize the FactorList diff --git a/twilio/rest/verify/v2/service/entity/new_factor.py b/twilio/rest/verify/v2/service/entity/new_factor.py index 33cb1eb76f..7b260a4a3d 100644 --- a/twilio/rest/verify/v2/service/entity/new_factor.py +++ b/twilio/rest/verify/v2/service/entity/new_factor.py @@ -22,6 +22,7 @@ class NewFactorInstance(InstanceResource): + class FactorStatuses(object): UNVERIFIED = "unverified" VERIFIED = "verified" @@ -101,6 +102,7 @@ def __repr__(self) -> str: class NewFactorList(ListResource): + def __init__(self, version: Version, service_sid: str, identity: str): """ Initialize the NewFactorList @@ -160,6 +162,7 @@ def create( :returns: The created NewFactorInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -231,6 +234,7 @@ async def create_async( :returns: The created NewFactorInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/verify/v2/service/messaging_configuration.py b/twilio/rest/verify/v2/service/messaging_configuration.py index 49ae96a119..f412aba1ee 100644 --- a/twilio/rest/verify/v2/service/messaging_configuration.py +++ b/twilio/rest/verify/v2/service/messaging_configuration.py @@ -149,6 +149,7 @@ def __repr__(self) -> str: class MessagingConfigurationContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, country: str): """ Initialize the MessagingConfigurationContext @@ -299,6 +300,7 @@ def __repr__(self) -> str: class MessagingConfigurationPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> MessagingConfigurationInstance: """ Build an instance of MessagingConfigurationInstance @@ -319,6 +321,7 @@ def __repr__(self) -> str: class MessagingConfigurationList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the MessagingConfigurationList @@ -348,6 +351,7 @@ def create( :returns: The created MessagingConfigurationInstance """ + data = values.of( { "Country": country, @@ -376,6 +380,7 @@ async def create_async( :returns: The created MessagingConfigurationInstance """ + data = values.of( { "Country": country, diff --git a/twilio/rest/verify/v2/service/rate_limit/__init__.py b/twilio/rest/verify/v2/service/rate_limit/__init__.py index b301b8ef43..2d4a18bf0f 100644 --- a/twilio/rest/verify/v2/service/rate_limit/__init__.py +++ b/twilio/rest/verify/v2/service/rate_limit/__init__.py @@ -163,6 +163,7 @@ def __repr__(self) -> str: class RateLimitContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the RateLimitContext @@ -328,6 +329,7 @@ def __repr__(self) -> str: class RateLimitPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RateLimitInstance: """ Build an instance of RateLimitInstance @@ -348,6 +350,7 @@ def __repr__(self) -> str: class RateLimitList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the RateLimitList @@ -375,6 +378,7 @@ def create( :returns: The created RateLimitInstance """ + data = values.of( { "UniqueName": unique_name, @@ -403,6 +407,7 @@ async def create_async( :returns: The created RateLimitInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/verify/v2/service/rate_limit/bucket.py b/twilio/rest/verify/v2/service/rate_limit/bucket.py index 55dd7576ae..ca4ffaf775 100644 --- a/twilio/rest/verify/v2/service/rate_limit/bucket.py +++ b/twilio/rest/verify/v2/service/rate_limit/bucket.py @@ -166,6 +166,7 @@ def __repr__(self) -> str: class BucketContext(InstanceContext): + def __init__( self, version: Version, service_sid: str, rate_limit_sid: str, sid: str ): @@ -336,6 +337,7 @@ def __repr__(self) -> str: class BucketPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> BucketInstance: """ Build an instance of BucketInstance @@ -359,6 +361,7 @@ def __repr__(self) -> str: class BucketList(ListResource): + def __init__(self, version: Version, service_sid: str, rate_limit_sid: str): """ Initialize the BucketList @@ -390,6 +393,7 @@ def create(self, max: int, interval: int) -> BucketInstance: :returns: The created BucketInstance """ + data = values.of( { "Max": max, @@ -419,6 +423,7 @@ async def create_async(self, max: int, interval: int) -> BucketInstance: :returns: The created BucketInstance """ + data = values.of( { "Max": max, diff --git a/twilio/rest/verify/v2/service/verification.py b/twilio/rest/verify/v2/service/verification.py index c4b504506b..1c42043a3d 100644 --- a/twilio/rest/verify/v2/service/verification.py +++ b/twilio/rest/verify/v2/service/verification.py @@ -22,6 +22,7 @@ class VerificationInstance(InstanceResource): + class Channel(object): SMS = "sms" CALL = "call" @@ -74,7 +75,7 @@ def __init__( self.lookup: Optional[Dict[str, object]] = payload.get("lookup") self.amount: Optional[str] = payload.get("amount") self.payee: Optional[str] = payload.get("payee") - self.send_code_attempts: Optional[List[object]] = payload.get( + self.send_code_attempts: Optional[List[Dict[str, object]]] = payload.get( "send_code_attempts" ) self.date_created: Optional[datetime] = deserialize.iso8601_datetime( @@ -163,6 +164,7 @@ def __repr__(self) -> str: class VerificationContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the VerificationContext @@ -289,6 +291,7 @@ def __repr__(self) -> str: class VerificationList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the VerificationList @@ -323,6 +326,7 @@ def create( template_custom_substitutions: Union[str, object] = values.unset, device_ip: Union[str, object] = values.unset, risk_check: Union["VerificationInstance.RiskCheck", object] = values.unset, + tags: Union[str, object] = values.unset, ) -> VerificationInstance: """ Create the VerificationInstance @@ -343,9 +347,11 @@ def create( :param template_custom_substitutions: A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. :param device_ip: Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. :param risk_check: + :param tags: A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. :returns: The created VerificationInstance """ + data = values.of( { "To": to, @@ -364,6 +370,7 @@ def create( "TemplateCustomSubstitutions": template_custom_substitutions, "DeviceIp": device_ip, "RiskCheck": risk_check, + "Tags": tags, } ) @@ -395,6 +402,7 @@ async def create_async( template_custom_substitutions: Union[str, object] = values.unset, device_ip: Union[str, object] = values.unset, risk_check: Union["VerificationInstance.RiskCheck", object] = values.unset, + tags: Union[str, object] = values.unset, ) -> VerificationInstance: """ Asynchronously create the VerificationInstance @@ -415,9 +423,11 @@ async def create_async( :param template_custom_substitutions: A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. :param device_ip: Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. :param risk_check: + :param tags: A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. :returns: The created VerificationInstance """ + data = values.of( { "To": to, @@ -436,6 +446,7 @@ async def create_async( "TemplateCustomSubstitutions": template_custom_substitutions, "DeviceIp": device_ip, "RiskCheck": risk_check, + "Tags": tags, } ) diff --git a/twilio/rest/verify/v2/service/verification_check.py b/twilio/rest/verify/v2/service/verification_check.py index a8c44f51e3..9cd92487e4 100644 --- a/twilio/rest/verify/v2/service/verification_check.py +++ b/twilio/rest/verify/v2/service/verification_check.py @@ -22,6 +22,7 @@ class VerificationCheckInstance(InstanceResource): + class Channel(object): SMS = "sms" CALL = "call" @@ -64,7 +65,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], service_sid: str): self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_updated") ) - self.sna_attempts_error_codes: Optional[List[object]] = payload.get( + self.sna_attempts_error_codes: Optional[List[Dict[str, object]]] = payload.get( "sna_attempts_error_codes" ) @@ -83,6 +84,7 @@ def __repr__(self) -> str: class VerificationCheckList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the VerificationCheckList @@ -118,6 +120,7 @@ def create( :returns: The created VerificationCheckInstance """ + data = values.of( { "Code": code, @@ -157,6 +160,7 @@ async def create_async( :returns: The created VerificationCheckInstance """ + data = values.of( { "Code": code, diff --git a/twilio/rest/verify/v2/service/webhook.py b/twilio/rest/verify/v2/service/webhook.py index 85e9d2e40c..4f8772574c 100644 --- a/twilio/rest/verify/v2/service/webhook.py +++ b/twilio/rest/verify/v2/service/webhook.py @@ -23,6 +23,7 @@ class WebhookInstance(InstanceResource): + class Methods(object): GET = "GET" POST = "POST" @@ -201,6 +202,7 @@ def __repr__(self) -> str: class WebhookContext(InstanceContext): + def __init__(self, version: Version, service_sid: str, sid: str): """ Initialize the WebhookContext @@ -377,6 +379,7 @@ def __repr__(self) -> str: class WebhookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> WebhookInstance: """ Build an instance of WebhookInstance @@ -397,6 +400,7 @@ def __repr__(self) -> str: class WebhookList(ListResource): + def __init__(self, version: Version, service_sid: str): """ Initialize the WebhookList @@ -432,6 +436,7 @@ def create( :returns: The created WebhookInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -471,6 +476,7 @@ async def create_async( :returns: The created WebhookInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/verify/v2/template.py b/twilio/rest/verify/v2/template.py index 4f3791bd9a..b9968eec87 100644 --- a/twilio/rest/verify/v2/template.py +++ b/twilio/rest/verify/v2/template.py @@ -50,6 +50,7 @@ def __repr__(self) -> str: class TemplatePage(Page): + def get_instance(self, payload: Dict[str, Any]) -> TemplateInstance: """ Build an instance of TemplateInstance @@ -68,6 +69,7 @@ def __repr__(self) -> str: class TemplateList(ListResource): + def __init__(self, version: Version): """ Initialize the TemplateList diff --git a/twilio/rest/verify/v2/verification_attempt.py b/twilio/rest/verify/v2/verification_attempt.py index a0c18a2ce1..2c1f914d32 100644 --- a/twilio/rest/verify/v2/verification_attempt.py +++ b/twilio/rest/verify/v2/verification_attempt.py @@ -23,6 +23,7 @@ class VerificationAttemptInstance(InstanceResource): + class Channels(object): SMS = "sms" CALL = "call" @@ -42,7 +43,7 @@ class ConversionStatus(object): :ivar date_updated: The date that this Attempt was updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar conversion_status: :ivar channel: - :ivar price: An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available [here](https://www.twilio.com/verify/pricing). + :ivar price: An object containing the charge for this verification attempt related to the channel costs and the currency used. The costs related to the succeeded verifications are not included. May not be immediately available. More information on pricing is available [here](https://www.twilio.com/en-us/verify/pricing). :ivar channel_data: An object containing the channel specific information for an attempt. :ivar url: """ @@ -121,6 +122,7 @@ def __repr__(self) -> str: class VerificationAttemptContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the VerificationAttemptContext @@ -185,6 +187,7 @@ def __repr__(self) -> str: class VerificationAttemptPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> VerificationAttemptInstance: """ Build an instance of VerificationAttemptInstance @@ -203,6 +206,7 @@ def __repr__(self) -> str: class VerificationAttemptList(ListResource): + def __init__(self, version: Version): """ Initialize the VerificationAttemptList diff --git a/twilio/rest/verify/v2/verification_attempts_summary.py b/twilio/rest/verify/v2/verification_attempts_summary.py index a2a1c0a974..1f2d3d3955 100644 --- a/twilio/rest/verify/v2/verification_attempts_summary.py +++ b/twilio/rest/verify/v2/verification_attempts_summary.py @@ -22,6 +22,7 @@ class VerificationAttemptsSummaryInstance(InstanceResource): + class Channels(object): SMS = "sms" CALL = "call" @@ -144,6 +145,7 @@ def __repr__(self) -> str: class VerificationAttemptsSummaryContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the VerificationAttemptsSummaryContext @@ -251,6 +253,7 @@ def __repr__(self) -> str: class VerificationAttemptsSummaryList(ListResource): + def __init__(self, version: Version): """ Initialize the VerificationAttemptsSummaryList diff --git a/twilio/rest/video/VideoBase.py b/twilio/rest/video/VideoBase.py index 2a25345662..0d2cf7e364 100644 --- a/twilio/rest/video/VideoBase.py +++ b/twilio/rest/video/VideoBase.py @@ -17,6 +17,7 @@ class VideoBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Video Domain diff --git a/twilio/rest/video/v1/__init__.py b/twilio/rest/video/v1/__init__.py index 9cd9fcf352..0667596a3f 100644 --- a/twilio/rest/video/v1/__init__.py +++ b/twilio/rest/video/v1/__init__.py @@ -24,6 +24,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Video diff --git a/twilio/rest/video/v1/composition.py b/twilio/rest/video/v1/composition.py index ae6a52c9a1..64ee0b2ce8 100644 --- a/twilio/rest/video/v1/composition.py +++ b/twilio/rest/video/v1/composition.py @@ -23,6 +23,7 @@ class CompositionInstance(InstanceResource): + class Format(object): MP4 = "mp4" WEBM = "webm" @@ -164,6 +165,7 @@ def __repr__(self) -> str: class CompositionContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CompositionContext @@ -252,6 +254,7 @@ def __repr__(self) -> str: class CompositionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CompositionInstance: """ Build an instance of CompositionInstance @@ -270,6 +273,7 @@ def __repr__(self) -> str: class CompositionList(ListResource): + def __init__(self, version: Version): """ Initialize the CompositionList @@ -308,6 +312,7 @@ def create( :returns: The created CompositionInstance """ + data = values.of( { "RoomSid": room_sid, @@ -359,6 +364,7 @@ async def create_async( :returns: The created CompositionInstance """ + data = values.of( { "RoomSid": room_sid, diff --git a/twilio/rest/video/v1/composition_hook.py b/twilio/rest/video/v1/composition_hook.py index 58f91fec4b..f6156e82ff 100644 --- a/twilio/rest/video/v1/composition_hook.py +++ b/twilio/rest/video/v1/composition_hook.py @@ -23,6 +23,7 @@ class CompositionHookInstance(InstanceResource): + class Format(object): MP4 = "mp4" WEBM = "webm" @@ -225,6 +226,7 @@ def __repr__(self) -> str: class CompositionHookContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CompositionHookContext @@ -425,6 +427,7 @@ def __repr__(self) -> str: class CompositionHookPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CompositionHookInstance: """ Build an instance of CompositionHookInstance @@ -443,6 +446,7 @@ def __repr__(self) -> str: class CompositionHookList(ListResource): + def __init__(self, version: Version): """ Initialize the CompositionHookList @@ -483,6 +487,7 @@ def create( :returns: The created CompositionHookInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -537,6 +542,7 @@ async def create_async( :returns: The created CompositionHookInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/video/v1/composition_settings.py b/twilio/rest/video/v1/composition_settings.py index 12da95a9dd..7082866b32 100644 --- a/twilio/rest/video/v1/composition_settings.py +++ b/twilio/rest/video/v1/composition_settings.py @@ -25,7 +25,7 @@ class CompositionSettingsInstance(InstanceResource): :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the CompositionSettings resource. :ivar friendly_name: The string that you assigned to describe the resource and that will be shown in the console :ivar aws_credentials_sid: The SID of the stored Credential resource. - :ivar aws_s3_url: The URL of the AWS S3 bucket where the compositions are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :ivar aws_s3_url: The URL of the AWS S3 bucket where the compositions are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :ivar aws_storage_enabled: Whether all compositions are written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. :ivar encryption_key_sid: The SID of the Public Key resource used for encryption. :ivar encryption_enabled: Whether all compositions are stored in an encrypted form. The default is `false`. @@ -75,7 +75,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource and show to the user in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. :param encryption_enabled: Whether all compositions should be stored in an encrypted form. The default is `false`. @@ -105,7 +105,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource and show to the user in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. :param encryption_enabled: Whether all compositions should be stored in an encrypted form. The default is `false`. @@ -149,6 +149,7 @@ def __repr__(self) -> str: class CompositionSettingsContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the CompositionSettingsContext @@ -174,7 +175,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource and show to the user in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. :param encryption_enabled: Whether all compositions should be stored in an encrypted form. The default is `false`. @@ -210,7 +211,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource and show to the user in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. :param encryption_enabled: Whether all compositions should be stored in an encrypted form. The default is `false`. @@ -280,6 +281,7 @@ def __repr__(self) -> str: class CompositionSettingsList(ListResource): + def __init__(self, version: Version): """ Initialize the CompositionSettingsList diff --git a/twilio/rest/video/v1/recording.py b/twilio/rest/video/v1/recording.py index c72ce8528f..20c836d2b0 100644 --- a/twilio/rest/video/v1/recording.py +++ b/twilio/rest/video/v1/recording.py @@ -23,6 +23,7 @@ class RecordingInstance(InstanceResource): + class Codec(object): VP8 = "VP8" H264 = "H264" @@ -164,6 +165,7 @@ def __repr__(self) -> str: class RecordingContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RecordingContext @@ -252,6 +254,7 @@ def __repr__(self) -> str: class RecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RecordingInstance: """ Build an instance of RecordingInstance @@ -270,6 +273,7 @@ def __repr__(self) -> str: class RecordingList(ListResource): + def __init__(self, version: Version): """ Initialize the RecordingList diff --git a/twilio/rest/video/v1/recording_settings.py b/twilio/rest/video/v1/recording_settings.py index 372b070ae3..d0d6e5ebb8 100644 --- a/twilio/rest/video/v1/recording_settings.py +++ b/twilio/rest/video/v1/recording_settings.py @@ -25,7 +25,7 @@ class RecordingSettingsInstance(InstanceResource): :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the RecordingSettings resource. :ivar friendly_name: The string that you assigned to describe the resource and show the user in the console :ivar aws_credentials_sid: The SID of the stored Credential resource. - :ivar aws_s3_url: The URL of the AWS S3 bucket where the recordings are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :ivar aws_s3_url: The URL of the AWS S3 bucket where the recordings are stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :ivar aws_storage_enabled: Whether all recordings are written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. :ivar encryption_key_sid: The SID of the Public Key resource used for encryption. :ivar encryption_enabled: Whether all recordings are stored in an encrypted form. The default is `false`. @@ -75,7 +75,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource and be shown to users in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. :param encryption_enabled: Whether all recordings should be stored in an encrypted form. The default is `false`. @@ -105,7 +105,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource and be shown to users in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. :param encryption_enabled: Whether all recordings should be stored in an encrypted form. The default is `false`. @@ -149,6 +149,7 @@ def __repr__(self) -> str: class RecordingSettingsContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the RecordingSettingsContext @@ -174,7 +175,7 @@ def create( :param friendly_name: A descriptive string that you create to describe the resource and be shown to users in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. :param encryption_enabled: Whether all recordings should be stored in an encrypted form. The default is `false`. @@ -210,7 +211,7 @@ async def create_async( :param friendly_name: A descriptive string that you create to describe the resource and be shown to users in the console :param aws_credentials_sid: The SID of the stored Credential resource. :param encryption_key_sid: The SID of the Public Key resource to use for encryption. - :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + :param aws_s3_url: The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the [RFC 3986](https://tools.ietf.org/html/rfc3986#section-2). :param aws_storage_enabled: Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. :param encryption_enabled: Whether all recordings should be stored in an encrypted form. The default is `false`. @@ -280,6 +281,7 @@ def __repr__(self) -> str: class RecordingSettingsList(ListResource): + def __init__(self, version: Version): """ Initialize the RecordingSettingsList diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index 71fb8a9e7d..d787c9896e 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -26,6 +26,7 @@ class RoomInstance(InstanceResource): + class RoomStatus(object): IN_PROGRESS = "in-progress" COMPLETED = "completed" @@ -214,6 +215,7 @@ def __repr__(self) -> str: class RoomContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RoomContext @@ -362,6 +364,7 @@ def __repr__(self) -> str: class RoomPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoomInstance: """ Build an instance of RoomInstance @@ -380,6 +383,7 @@ def __repr__(self) -> str: class RoomList(ListResource): + def __init__(self, version: Version): """ Initialize the RoomList @@ -430,6 +434,7 @@ def create( :returns: The created RoomInstance """ + data = values.of( { "EnableTurn": enable_turn, @@ -497,6 +502,7 @@ async def create_async( :returns: The created RoomInstance """ + data = values.of( { "EnableTurn": enable_turn, diff --git a/twilio/rest/video/v1/room/participant/__init__.py b/twilio/rest/video/v1/room/participant/__init__.py index 40c8dff509..145d95429a 100644 --- a/twilio/rest/video/v1/room/participant/__init__.py +++ b/twilio/rest/video/v1/room/participant/__init__.py @@ -27,6 +27,7 @@ class ParticipantInstance(InstanceResource): + class Status(object): CONNECTED = "connected" DISCONNECTED = "disconnected" @@ -183,6 +184,7 @@ def __repr__(self) -> str: class ParticipantContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, sid: str): """ Initialize the ParticipantContext @@ -366,6 +368,7 @@ def __repr__(self) -> str: class ParticipantPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ParticipantInstance: """ Build an instance of ParticipantInstance @@ -386,6 +389,7 @@ def __repr__(self) -> str: class ParticipantList(ListResource): + def __init__(self, version: Version, room_sid: str): """ Initialize the ParticipantList diff --git a/twilio/rest/video/v1/room/participant/anonymize.py b/twilio/rest/video/v1/room/participant/anonymize.py index 2f1b29b267..e9a7f1383e 100644 --- a/twilio/rest/video/v1/room/participant/anonymize.py +++ b/twilio/rest/video/v1/room/participant/anonymize.py @@ -22,6 +22,7 @@ class AnonymizeInstance(InstanceResource): + class Status(object): CONNECTED = "connected" DISCONNECTED = "disconnected" @@ -116,6 +117,7 @@ def __repr__(self) -> str: class AnonymizeContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, sid: str): """ Initialize the AnonymizeContext @@ -190,6 +192,7 @@ def __repr__(self) -> str: class AnonymizeList(ListResource): + def __init__(self, version: Version, room_sid: str, sid: str): """ Initialize the AnonymizeList diff --git a/twilio/rest/video/v1/room/participant/published_track.py b/twilio/rest/video/v1/room/participant/published_track.py index faedb7f71d..1fa84827b6 100644 --- a/twilio/rest/video/v1/room/participant/published_track.py +++ b/twilio/rest/video/v1/room/participant/published_track.py @@ -23,6 +23,7 @@ class PublishedTrackInstance(InstanceResource): + class Kind(object): AUDIO = "audio" VIDEO = "video" @@ -117,6 +118,7 @@ def __repr__(self) -> str: class PublishedTrackContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, participant_sid: str, sid: str): """ Initialize the PublishedTrackContext @@ -191,6 +193,7 @@ def __repr__(self) -> str: class PublishedTrackPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> PublishedTrackInstance: """ Build an instance of PublishedTrackInstance @@ -214,6 +217,7 @@ def __repr__(self) -> str: class PublishedTrackList(ListResource): + def __init__(self, version: Version, room_sid: str, participant_sid: str): """ Initialize the PublishedTrackList diff --git a/twilio/rest/video/v1/room/participant/subscribe_rules.py b/twilio/rest/video/v1/room/participant/subscribe_rules.py index cc3a62cb28..3015163e6d 100644 --- a/twilio/rest/video/v1/room/participant/subscribe_rules.py +++ b/twilio/rest/video/v1/room/participant/subscribe_rules.py @@ -65,6 +65,7 @@ def __repr__(self) -> str: class SubscribeRulesList(ListResource): + def __init__(self, version: Version, room_sid: str, participant_sid: str): """ Initialize the SubscribeRulesList @@ -91,8 +92,10 @@ def fetch(self) -> SubscribeRulesInstance: """ Asynchronously fetch the SubscribeRulesInstance + :returns: The fetched SubscribeRulesInstance """ + payload = self._version.fetch(method="GET", uri=self._uri) return SubscribeRulesInstance( @@ -106,8 +109,10 @@ async def fetch_async(self) -> SubscribeRulesInstance: """ Asynchronously fetch the SubscribeRulesInstance + :returns: The fetched SubscribeRulesInstance """ + payload = await self._version.fetch_async(method="GET", uri=self._uri) return SubscribeRulesInstance( diff --git a/twilio/rest/video/v1/room/participant/subscribed_track.py b/twilio/rest/video/v1/room/participant/subscribed_track.py index aaffdf5f9f..7c915095ec 100644 --- a/twilio/rest/video/v1/room/participant/subscribed_track.py +++ b/twilio/rest/video/v1/room/participant/subscribed_track.py @@ -23,6 +23,7 @@ class SubscribedTrackInstance(InstanceResource): + class Kind(object): AUDIO = "audio" VIDEO = "video" @@ -119,6 +120,7 @@ def __repr__(self) -> str: class SubscribedTrackContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, participant_sid: str, sid: str): """ Initialize the SubscribedTrackContext @@ -193,6 +195,7 @@ def __repr__(self) -> str: class SubscribedTrackPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SubscribedTrackInstance: """ Build an instance of SubscribedTrackInstance @@ -216,6 +219,7 @@ def __repr__(self) -> str: class SubscribedTrackList(ListResource): + def __init__(self, version: Version, room_sid: str, participant_sid: str): """ Initialize the SubscribedTrackList diff --git a/twilio/rest/video/v1/room/recording_rules.py b/twilio/rest/video/v1/room/recording_rules.py index 9ebbb24083..6e731a1458 100644 --- a/twilio/rest/video/v1/room/recording_rules.py +++ b/twilio/rest/video/v1/room/recording_rules.py @@ -56,6 +56,7 @@ def __repr__(self) -> str: class RecordingRulesList(ListResource): + def __init__(self, version: Version, room_sid: str): """ Initialize the RecordingRulesList @@ -76,8 +77,10 @@ def fetch(self) -> RecordingRulesInstance: """ Asynchronously fetch the RecordingRulesInstance + :returns: The fetched RecordingRulesInstance """ + payload = self._version.fetch(method="GET", uri=self._uri) return RecordingRulesInstance( @@ -88,8 +91,10 @@ async def fetch_async(self) -> RecordingRulesInstance: """ Asynchronously fetch the RecordingRulesInstance + :returns: The fetched RecordingRulesInstance """ + payload = await self._version.fetch_async(method="GET", uri=self._uri) return RecordingRulesInstance( diff --git a/twilio/rest/video/v1/room/room_recording.py b/twilio/rest/video/v1/room/room_recording.py index 284e2670c6..db67f29947 100644 --- a/twilio/rest/video/v1/room/room_recording.py +++ b/twilio/rest/video/v1/room/room_recording.py @@ -23,6 +23,7 @@ class RoomRecordingInstance(InstanceResource): + class Codec(object): VP8 = "VP8" H264 = "H264" @@ -166,6 +167,7 @@ def __repr__(self) -> str: class RoomRecordingContext(InstanceContext): + def __init__(self, version: Version, room_sid: str, sid: str): """ Initialize the RoomRecordingContext @@ -258,6 +260,7 @@ def __repr__(self) -> str: class RoomRecordingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RoomRecordingInstance: """ Build an instance of RoomRecordingInstance @@ -278,6 +281,7 @@ def __repr__(self) -> str: class RoomRecordingList(ListResource): + def __init__(self, version: Version, room_sid: str): """ Initialize the RoomRecordingList diff --git a/twilio/rest/voice/VoiceBase.py b/twilio/rest/voice/VoiceBase.py index 21a11ce350..4394ab1a2d 100644 --- a/twilio/rest/voice/VoiceBase.py +++ b/twilio/rest/voice/VoiceBase.py @@ -17,6 +17,7 @@ class VoiceBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Voice Domain diff --git a/twilio/rest/voice/v1/__init__.py b/twilio/rest/voice/v1/__init__.py index 2014cd1626..75c0c7fc74 100644 --- a/twilio/rest/voice/v1/__init__.py +++ b/twilio/rest/voice/v1/__init__.py @@ -24,6 +24,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Voice diff --git a/twilio/rest/voice/v1/archived_call.py b/twilio/rest/voice/v1/archived_call.py index a5272513a3..ec8a5bb68e 100644 --- a/twilio/rest/voice/v1/archived_call.py +++ b/twilio/rest/voice/v1/archived_call.py @@ -20,6 +20,7 @@ class ArchivedCallContext(InstanceContext): + def __init__(self, version: Version, date: date, sid: str): """ Initialize the ArchivedCallContext @@ -72,6 +73,7 @@ def __repr__(self) -> str: class ArchivedCallList(ListResource): + def __init__(self, version: Version): """ Initialize the ArchivedCallList diff --git a/twilio/rest/voice/v1/byoc_trunk.py b/twilio/rest/voice/v1/byoc_trunk.py index 31e3b6d4ec..1a8f60984d 100644 --- a/twilio/rest/voice/v1/byoc_trunk.py +++ b/twilio/rest/voice/v1/byoc_trunk.py @@ -219,6 +219,7 @@ def __repr__(self) -> str: class ByocTrunkContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ByocTrunkContext @@ -411,6 +412,7 @@ def __repr__(self) -> str: class ByocTrunkPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ByocTrunkInstance: """ Build an instance of ByocTrunkInstance @@ -429,6 +431,7 @@ def __repr__(self) -> str: class ByocTrunkList(ListResource): + def __init__(self, version: Version): """ Initialize the ByocTrunkList @@ -469,6 +472,7 @@ def create( :returns: The created ByocTrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -521,6 +525,7 @@ async def create_async( :returns: The created ByocTrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/voice/v1/connection_policy/__init__.py b/twilio/rest/voice/v1/connection_policy/__init__.py index d4e6260713..d1d8aac893 100644 --- a/twilio/rest/voice/v1/connection_policy/__init__.py +++ b/twilio/rest/voice/v1/connection_policy/__init__.py @@ -155,6 +155,7 @@ def __repr__(self) -> str: class ConnectionPolicyContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the ConnectionPolicyContext @@ -309,6 +310,7 @@ def __repr__(self) -> str: class ConnectionPolicyPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConnectionPolicyInstance: """ Build an instance of ConnectionPolicyInstance @@ -327,6 +329,7 @@ def __repr__(self) -> str: class ConnectionPolicyList(ListResource): + def __init__(self, version: Version): """ Initialize the ConnectionPolicyList @@ -348,6 +351,7 @@ def create( :returns: The created ConnectionPolicyInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -372,6 +376,7 @@ async def create_async( :returns: The created ConnectionPolicyInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py index 67b720914c..d1f8a41524 100644 --- a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py +++ b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py @@ -185,6 +185,7 @@ def __repr__(self) -> str: class ConnectionPolicyTargetContext(InstanceContext): + def __init__(self, version: Version, connection_policy_sid: str, sid: str): """ Initialize the ConnectionPolicyTargetContext @@ -363,6 +364,7 @@ def __repr__(self) -> str: class ConnectionPolicyTargetPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> ConnectionPolicyTargetInstance: """ Build an instance of ConnectionPolicyTargetInstance @@ -385,6 +387,7 @@ def __repr__(self) -> str: class ConnectionPolicyTargetList(ListResource): + def __init__(self, version: Version, connection_policy_sid: str): """ Initialize the ConnectionPolicyTargetList @@ -422,6 +425,7 @@ def create( :returns: The created ConnectionPolicyTargetInstance """ + data = values.of( { "Target": target, @@ -463,6 +467,7 @@ async def create_async( :returns: The created ConnectionPolicyTargetInstance """ + data = values.of( { "Target": target, diff --git a/twilio/rest/voice/v1/dialing_permissions/__init__.py b/twilio/rest/voice/v1/dialing_permissions/__init__.py index 1439a7ef62..2346430adc 100644 --- a/twilio/rest/voice/v1/dialing_permissions/__init__.py +++ b/twilio/rest/voice/v1/dialing_permissions/__init__.py @@ -26,6 +26,7 @@ class DialingPermissionsList(ListResource): + def __init__(self, version: Version): """ Initialize the DialingPermissionsList diff --git a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py index d8f2e33eb0..60aa2642f0 100644 --- a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py +++ b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py @@ -45,6 +45,7 @@ def __repr__(self) -> str: class BulkCountryUpdateList(ListResource): + def __init__(self, version: Version): """ Initialize the BulkCountryUpdateList @@ -64,6 +65,7 @@ def create(self, update_request: str) -> BulkCountryUpdateInstance: :returns: The created BulkCountryUpdateInstance """ + data = values.of( { "UpdateRequest": update_request, @@ -86,6 +88,7 @@ async def create_async(self, update_request: str) -> BulkCountryUpdateInstance: :returns: The created BulkCountryUpdateInstance """ + data = values.of( { "UpdateRequest": update_request, diff --git a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py index 63bf8fa636..4f694f41b0 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py @@ -114,6 +114,7 @@ def __repr__(self) -> str: class CountryContext(InstanceContext): + def __init__(self, version: Version, iso_code: str): """ Initialize the CountryContext @@ -192,6 +193,7 @@ def __repr__(self) -> str: class CountryPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CountryInstance: """ Build an instance of CountryInstance @@ -210,6 +212,7 @@ def __repr__(self) -> str: class CountryList(ListResource): + def __init__(self, version: Version): """ Initialize the CountryList diff --git a/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py b/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py index ce08da28bc..9303f2c9ae 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py @@ -46,6 +46,7 @@ def __repr__(self) -> str: class HighriskSpecialPrefixPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> HighriskSpecialPrefixInstance: """ Build an instance of HighriskSpecialPrefixInstance @@ -66,6 +67,7 @@ def __repr__(self) -> str: class HighriskSpecialPrefixList(ListResource): + def __init__(self, version: Version, iso_code: str): """ Initialize the HighriskSpecialPrefixList diff --git a/twilio/rest/voice/v1/dialing_permissions/settings.py b/twilio/rest/voice/v1/dialing_permissions/settings.py index eba5fa8017..6ede5e3a6f 100644 --- a/twilio/rest/voice/v1/dialing_permissions/settings.py +++ b/twilio/rest/voice/v1/dialing_permissions/settings.py @@ -107,6 +107,7 @@ def __repr__(self) -> str: class SettingsContext(InstanceContext): + def __init__(self, version: Version): """ Initialize the SettingsContext @@ -212,6 +213,7 @@ def __repr__(self) -> str: class SettingsList(ListResource): + def __init__(self, version: Version): """ Initialize the SettingsList diff --git a/twilio/rest/voice/v1/ip_record.py b/twilio/rest/voice/v1/ip_record.py index 9e8a0f5c01..ee409ba78c 100644 --- a/twilio/rest/voice/v1/ip_record.py +++ b/twilio/rest/voice/v1/ip_record.py @@ -149,6 +149,7 @@ def __repr__(self) -> str: class IpRecordContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the IpRecordContext @@ -285,6 +286,7 @@ def __repr__(self) -> str: class IpRecordPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> IpRecordInstance: """ Build an instance of IpRecordInstance @@ -303,6 +305,7 @@ def __repr__(self) -> str: class IpRecordList(ListResource): + def __init__(self, version: Version): """ Initialize the IpRecordList @@ -329,6 +332,7 @@ def create( :returns: The created IpRecordInstance """ + data = values.of( { "IpAddress": ip_address, @@ -360,6 +364,7 @@ async def create_async( :returns: The created IpRecordInstance """ + data = values.of( { "IpAddress": ip_address, diff --git a/twilio/rest/voice/v1/source_ip_mapping.py b/twilio/rest/voice/v1/source_ip_mapping.py index 7123ca1aa2..8a0d4a9126 100644 --- a/twilio/rest/voice/v1/source_ip_mapping.py +++ b/twilio/rest/voice/v1/source_ip_mapping.py @@ -139,6 +139,7 @@ def __repr__(self) -> str: class SourceIpMappingContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SourceIpMappingContext @@ -275,6 +276,7 @@ def __repr__(self) -> str: class SourceIpMappingPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SourceIpMappingInstance: """ Build an instance of SourceIpMappingInstance @@ -293,6 +295,7 @@ def __repr__(self) -> str: class SourceIpMappingList(ListResource): + def __init__(self, version: Version): """ Initialize the SourceIpMappingList @@ -315,6 +318,7 @@ def create( :returns: The created SourceIpMappingInstance """ + data = values.of( { "IpRecordSid": ip_record_sid, @@ -341,6 +345,7 @@ async def create_async( :returns: The created SourceIpMappingInstance """ + data = values.of( { "IpRecordSid": ip_record_sid, diff --git a/twilio/rest/wireless/WirelessBase.py b/twilio/rest/wireless/WirelessBase.py index 5bec36968e..0228c4d666 100644 --- a/twilio/rest/wireless/WirelessBase.py +++ b/twilio/rest/wireless/WirelessBase.py @@ -17,6 +17,7 @@ class WirelessBase(Domain): + def __init__(self, twilio: Client): """ Initialize the Wireless Domain diff --git a/twilio/rest/wireless/v1/__init__.py b/twilio/rest/wireless/v1/__init__.py index 7d94692e45..8f4d0dc5d7 100644 --- a/twilio/rest/wireless/v1/__init__.py +++ b/twilio/rest/wireless/v1/__init__.py @@ -22,6 +22,7 @@ class V1(Version): + def __init__(self, domain: Domain): """ Initialize the V1 version of Wireless diff --git a/twilio/rest/wireless/v1/command.py b/twilio/rest/wireless/v1/command.py index b669e287d4..cb33e1d397 100644 --- a/twilio/rest/wireless/v1/command.py +++ b/twilio/rest/wireless/v1/command.py @@ -23,6 +23,7 @@ class CommandInstance(InstanceResource): + class CommandMode(object): TEXT = "text" BINARY = "binary" @@ -150,6 +151,7 @@ def __repr__(self) -> str: class CommandContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the CommandContext @@ -238,6 +240,7 @@ def __repr__(self) -> str: class CommandPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> CommandInstance: """ Build an instance of CommandInstance @@ -256,6 +259,7 @@ def __repr__(self) -> str: class CommandList(ListResource): + def __init__(self, version: Version): """ Initialize the CommandList @@ -290,6 +294,7 @@ def create( :returns: The created CommandInstance """ + data = values.of( { "Command": command, @@ -333,6 +338,7 @@ async def create_async( :returns: The created CommandInstance """ + data = values.of( { "Command": command, diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index e6f6b4bcf4..2bc8939257 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -179,6 +179,7 @@ def __repr__(self) -> str: class RatePlanContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the RatePlanContext @@ -323,6 +324,7 @@ def __repr__(self) -> str: class RatePlanPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> RatePlanInstance: """ Build an instance of RatePlanInstance @@ -341,6 +343,7 @@ def __repr__(self) -> str: class RatePlanList(ListResource): + def __init__(self, version: Version): """ Initialize the RatePlanList @@ -383,6 +386,7 @@ def create( :returns: The created RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, @@ -440,6 +444,7 @@ async def create_async( :returns: The created RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, diff --git a/twilio/rest/wireless/v1/sim/__init__.py b/twilio/rest/wireless/v1/sim/__init__.py index 0060eb6883..f0d21c447e 100644 --- a/twilio/rest/wireless/v1/sim/__init__.py +++ b/twilio/rest/wireless/v1/sim/__init__.py @@ -25,6 +25,7 @@ class SimInstance(InstanceResource): + class ResetStatus(object): RESETTING = "resetting" @@ -316,6 +317,7 @@ def __repr__(self) -> str: class SimContext(InstanceContext): + def __init__(self, version: Version, sid: str): """ Initialize the SimContext @@ -583,6 +585,7 @@ def __repr__(self) -> str: class SimPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> SimInstance: """ Build an instance of SimInstance @@ -601,6 +604,7 @@ def __repr__(self) -> str: class SimList(ListResource): + def __init__(self, version: Version): """ Initialize the SimList diff --git a/twilio/rest/wireless/v1/sim/data_session.py b/twilio/rest/wireless/v1/sim/data_session.py index 0b94a9836c..649eb49631 100644 --- a/twilio/rest/wireless/v1/sim/data_session.py +++ b/twilio/rest/wireless/v1/sim/data_session.py @@ -87,6 +87,7 @@ def __repr__(self) -> str: class DataSessionPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> DataSessionInstance: """ Build an instance of DataSessionInstance @@ -107,6 +108,7 @@ def __repr__(self) -> str: class DataSessionList(ListResource): + def __init__(self, version: Version, sim_sid: str): """ Initialize the DataSessionList diff --git a/twilio/rest/wireless/v1/sim/usage_record.py b/twilio/rest/wireless/v1/sim/usage_record.py index a759afe519..8b1db6d0da 100644 --- a/twilio/rest/wireless/v1/sim/usage_record.py +++ b/twilio/rest/wireless/v1/sim/usage_record.py @@ -23,6 +23,7 @@ class UsageRecordInstance(InstanceResource): + class Granularity(object): HOURLY = "hourly" DAILY = "daily" @@ -60,6 +61,7 @@ def __repr__(self) -> str: class UsageRecordPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UsageRecordInstance: """ Build an instance of UsageRecordInstance @@ -80,6 +82,7 @@ def __repr__(self) -> str: class UsageRecordList(ListResource): + def __init__(self, version: Version, sim_sid: str): """ Initialize the UsageRecordList diff --git a/twilio/rest/wireless/v1/usage_record.py b/twilio/rest/wireless/v1/usage_record.py index 40992a01da..43e34469ce 100644 --- a/twilio/rest/wireless/v1/usage_record.py +++ b/twilio/rest/wireless/v1/usage_record.py @@ -23,6 +23,7 @@ class UsageRecordInstance(InstanceResource): + class Granularity(object): HOURLY = "hourly" DAILY = "daily" @@ -54,6 +55,7 @@ def __repr__(self) -> str: class UsageRecordPage(Page): + def get_instance(self, payload: Dict[str, Any]) -> UsageRecordInstance: """ Build an instance of UsageRecordInstance @@ -72,6 +74,7 @@ def __repr__(self) -> str: class UsageRecordList(ListResource): + def __init__(self, version: Version): """ Initialize the UsageRecordList From d8fa9e8e6859c0a163fbfa7e2796b1ef69676264 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 9 Feb 2024 12:23:56 +0000 Subject: [PATCH 005/113] Release 8.13.0 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 213c094a09..bb6ca3cecf 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="8.12.0", + version="8.13.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index cda97201bf..1d1288358e 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("8", "12", "0") +__version_info__ = ("8", "13", "0") __version__ = ".".join(__version_info__) From 040d2eb487908cf973b5227f0b19693638985b4e Mon Sep 17 00:00:00 2001 From: sbansla <104902068+sbansla@users.noreply.github.com> Date: Thu, 22 Feb 2024 16:57:46 +0530 Subject: [PATCH 006/113] chore: cluster tests enabled (#768) --- .github/workflows/test-and-deploy.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index c9d4c023f7..9fdcf4c752 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -38,16 +38,16 @@ jobs: - name: Run the tests run: make test-with-coverage -# - name: Run Cluster Tests -# if: (!github.event.pull_request.head.repo.fork) -# env: -# TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} -# TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} -# TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} -# TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} -# TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} -# TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} -# run: make cluster-test + - name: Run Cluster Tests + if: (!github.event.pull_request.head.repo.fork) + env: + TWILIO_ACCOUNT_SID: ${{ secrets.TWILIO_ACCOUNT_SID }} + TWILIO_API_KEY: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY}} + TWILIO_API_SECRET: ${{ secrets.TWILIO_CLUSTER_TEST_API_KEY_SECRET }} + TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} + TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} + TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} + run: make cluster-test - name: Verify docs generation run: make docs From 69441eb97ff9d9a36703a057ff88a49978d5a92f Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 22 Feb 2024 19:09:38 +0530 Subject: [PATCH 007/113] chore: added check for unset values (#771) --- twilio/base/serialize.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/twilio/base/serialize.py b/twilio/base/serialize.py index eac2e12c2e..cea91b04c7 100644 --- a/twilio/base/serialize.py +++ b/twilio/base/serialize.py @@ -62,6 +62,9 @@ def flatten_dict(d, result=None, prv_keys=None): def boolean_to_string(bool_or_str): + if bool_or_str == values.unset: + return bool_or_str + if bool_or_str is None: return bool_or_str From 7b52a49026a45bad6cb4e2840cb8f77d51a216f8 Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 23 Feb 2024 18:27:15 +0530 Subject: [PATCH 008/113] * feat: json content type (#737) * feat: add application/json support for client * feat: add application/json support for client * feat: add application/json support for client * feat: add application/json support for client * feat: add application/json support for client * chore: updated changelogs for rc-branch * chore: add domain detail (#739) * feat: add domain detail to twilio python * feat: add domain detail to twilio python * feat: add domain detail to twilio python * feat: add domain detail to twilio python * corrected rc version * Update setup.py * Update setup.py * chore: corrected cluster test * chore: disables cluster test (#765) * chore: disables cluster test * chore: added make prettier to workflow * feat!: MVR release preparation (#766) * feat!: MVR release preparation * fix: added test for json data in http client --------- Co-authored-by: Manisha Singh Co-authored-by: sbansla Co-authored-by: Twilio --- UPGRADE.md | 9 + tests/unit/http/test_http_client.py | 26 +++ twilio/http/http_client.py | 13 +- twilio/rest/__init__.py | 15 ++ .../rest/api/v2010/account/call/__init__.py | 72 ------- .../api/v2010/account/conference/__init__.py | 72 ------- .../api/v2010/account/message/__init__.py | 46 +--- .../content/v1/content/approval_create.py | 138 ++++++++++++ twilio/rest/flex_api/v1/configuration.py | 52 +++++ twilio/rest/numbers/v1/__init__.py | 16 ++ twilio/rest/numbers/v1/bulk_eligibility.py | 32 +++ twilio/rest/numbers/v1/eligibility.py | 91 ++++++++ twilio/rest/numbers/v1/porting_port_in.py | 93 ++++++++ .../numbers/v2/bulk_hosted_number_order.py | 32 +++ .../regulatory_compliance/bundle/__init__.py | 36 ---- .../preview_messaging/PreviewMessagingBase.py | 44 ++++ twilio/rest/preview_messaging/__init__.py | 13 ++ twilio/rest/preview_messaging/v1/__init__.py | 51 +++++ twilio/rest/preview_messaging/v1/broadcast.py | 125 +++++++++++ twilio/rest/preview_messaging/v1/message.py | 203 ++++++++++++++++++ .../v1/workspace/task_queue/__init__.py | 17 ++ .../task_queue_bulk_real_time_statistics.py | 123 +++++++++++ 22 files changed, 1089 insertions(+), 230 deletions(-) create mode 100644 twilio/rest/content/v1/content/approval_create.py create mode 100644 twilio/rest/numbers/v1/eligibility.py create mode 100644 twilio/rest/numbers/v1/porting_port_in.py create mode 100644 twilio/rest/preview_messaging/PreviewMessagingBase.py create mode 100644 twilio/rest/preview_messaging/__init__.py create mode 100644 twilio/rest/preview_messaging/v1/__init__.py create mode 100644 twilio/rest/preview_messaging/v1/broadcast.py create mode 100644 twilio/rest/preview_messaging/v1/message.py create mode 100644 twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py diff --git a/UPGRADE.md b/UPGRADE.md index 79bdb48cc5..03c196bf5b 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -3,6 +3,15 @@ _`MAJOR` version bumps will have upgrade notes posted here._ +## [2024-02-20] 8.x.x to 9.x.x +### Overview + +##### Twilio Python Helper Library’s major version 9.0.0 is now available. We ensured that you can upgrade to Python helper Library 9.0.0 version without any breaking changes of existing apis + +Behind the scenes Python Helper is now auto-generated via OpenAPI with this release. This enables us to rapidly add new features and enhance consistency across versions and languages. +We're pleased to inform you that version 9.0.0 adds support for the application/json content type in the request body. + + ## [2023-04-05] 7.x.x to 8.x.x - **Supported Python versions updated** diff --git a/tests/unit/http/test_http_client.py b/tests/unit/http/test_http_client.py index e599aaaf00..8484e57b17 100644 --- a/tests/unit/http/test_http_client.py +++ b/tests/unit/http/test_http_client.py @@ -145,6 +145,32 @@ def test_last_request_last_response_exist(self): "testing-unicode: Ω≈ç√, 💩", self.client._test_only_last_response.text ) + def test_request_with_json(self): + self.request_mock.url = "https://api.twilio.com/" + self.request_mock.headers = {"Host": "other.twilio.com"} + + self.client.request( + "doesnt-matter-method", + "doesnt-matter-url", + {"params-value": "params-key"}, + {"json-key": "json-value"}, + {"Content-Type": "application/json"}, + ) + + self.assertIsNotNone(self.client._test_only_last_request) + self.assertEqual( + {"Content-Type": "application/json"}, + self.client._test_only_last_request.headers, + ) + + self.assertIsNotNone(self.client._test_only_last_response) + + if self.client._test_only_last_response is not None: + self.assertEqual(200, self.client._test_only_last_response.status_code) + self.assertEqual( + "testing-unicode: Ω≈ç√, 💩", self.client._test_only_last_response.text + ) + def test_last_response_empty_on_error(self): self.session_mock.send.side_effect = Exception("voltron") diff --git a/twilio/http/http_client.py b/twilio/http/http_client.py index bfc38feaf7..7a1715ad49 100644 --- a/twilio/http/http_client.py +++ b/twilio/http/http_client.py @@ -27,11 +27,10 @@ def __init__( ): """ Constructor for the TwilioHttpClient - :param pool_connections :param request_hooks :param timeout: Timeout for the requests. - Timeout should never be zero (0) or less. + Timeout should never be zero (0) or less :param logger :param proxy: Http proxy for the requests session :param max_retries: Maximum number of retries each request should attempt @@ -65,10 +64,10 @@ def request( :param headers: HTTP Headers to send with the request :param auth: Basic Auth arguments :param timeout: Socket/Read timeout for the request - :param allow_redirects: Whether or not to allow redirects + :param allow_redirects: Whether to allow redirects See the requests documentation for explanation of all these parameters - :return: An http response + :return: An HTTP response """ if timeout is None: timeout = self.timeout @@ -79,12 +78,14 @@ def request( "method": method.upper(), "url": url, "params": params, - "data": data, "headers": headers, "auth": auth, "hooks": self.request_hooks, } - + if headers and headers.get("Content-Type") == "application/json": + kwargs["json"] = data + else: + kwargs["data"] = data self.log_request(kwargs) self._test_only_last_response = None diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 3e895271f9..818688e399 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -28,6 +28,7 @@ from twilio.rest.ip_messaging import IpMessaging from twilio.rest.lookups import Lookups from twilio.rest.media import Media + from twilio.rest.preview_messaging import PreviewMessaging from twilio.rest.messaging import Messaging from twilio.rest.microvisor import Microvisor from twilio.rest.monitor import Monitor @@ -135,6 +136,7 @@ def __init__( self._ip_messaging: Optional["IpMessaging"] = None self._lookups: Optional["Lookups"] = None self._media: Optional["Media"] = None + self._preview_messaging: Optional["PreviewMessaging"] = None self._messaging: Optional["Messaging"] = None self._microvisor: Optional["Microvisor"] = None self._monitor: Optional["Monitor"] = None @@ -338,6 +340,19 @@ def media(self) -> "Media": self._media = Media(self) return self._media + @property + def preview_messaging(self) -> "PreviewMessaging": + """ + Access the PreviewMessaging Twilio Domain + + :returns: PreviewMessaging Twilio Domain + """ + if self._preview_messaging is None: + from twilio.rest.preview_messaging import PreviewMessaging + + self._preview_messaging = PreviewMessaging(self) + return self._preview_messaging + @property def messaging(self) -> "Messaging": """ diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 406db27602..21c4e9c27e 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -984,11 +984,7 @@ def stream( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[CallInstance]: @@ -1003,11 +999,7 @@ def stream( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1024,11 +1016,7 @@ def stream( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, page_size=limits["page_size"], ) @@ -1041,11 +1029,7 @@ async def stream_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[CallInstance]: @@ -1060,11 +1044,7 @@ async def stream_async( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1081,11 +1061,7 @@ async def stream_async( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, page_size=limits["page_size"], ) @@ -1098,11 +1074,7 @@ def list( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CallInstance]: @@ -1116,11 +1088,7 @@ def list( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1137,11 +1105,7 @@ def list( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, limit=limit, page_size=page_size, ) @@ -1154,11 +1118,7 @@ async def list_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CallInstance]: @@ -1172,11 +1132,7 @@ async def list_async( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1194,11 +1150,7 @@ async def list_async( parent_call_sid=parent_call_sid, status=status, start_time=start_time, - start_time_before=start_time_before, - start_time_after=start_time_after, end_time=end_time, - end_time_before=end_time_before, - end_time_after=end_time_after, limit=limit, page_size=page_size, ) @@ -1211,11 +1163,7 @@ def page( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -1229,11 +1177,7 @@ def page( :param parent_call_sid: Only include calls spawned by calls with this SID. :param status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1247,11 +1191,7 @@ def page( "ParentCallSid": parent_call_sid, "Status": status, "StartTime": serialize.iso8601_datetime(start_time), - "StartTime<": serialize.iso8601_datetime(start_time_before), - "StartTime>": serialize.iso8601_datetime(start_time_after), "EndTime": serialize.iso8601_datetime(end_time), - "EndTime<": serialize.iso8601_datetime(end_time_before), - "EndTime>": serialize.iso8601_datetime(end_time_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -1268,11 +1208,7 @@ async def page_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, - start_time_before: Union[datetime, object] = values.unset, - start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, - end_time_before: Union[datetime, object] = values.unset, - end_time_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -1286,11 +1222,7 @@ async def page_async( :param parent_call_sid: Only include calls spawned by calls with this SID. :param status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1304,11 +1236,7 @@ async def page_async( "ParentCallSid": parent_call_sid, "Status": status, "StartTime": serialize.iso8601_datetime(start_time), - "StartTime<": serialize.iso8601_datetime(start_time_before), - "StartTime>": serialize.iso8601_datetime(start_time_after), "EndTime": serialize.iso8601_datetime(end_time), - "EndTime<": serialize.iso8601_datetime(end_time_before), - "EndTime>": serialize.iso8601_datetime(end_time_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index fff75dea5d..36cd390c60 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -412,11 +412,7 @@ def __init__(self, version: Version, account_sid: str): def stream( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -429,11 +425,7 @@ def stream( The results are returned as a generator, so this operation is memory efficient. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. stream() @@ -448,11 +440,7 @@ def stream( limits = self._version.read_limits(limit, page_size) page = self.page( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, page_size=limits["page_size"], @@ -463,11 +451,7 @@ def stream( async def stream_async( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -480,11 +464,7 @@ async def stream_async( The results are returned as a generator, so this operation is memory efficient. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. stream() @@ -499,11 +479,7 @@ async def stream_async( limits = self._version.read_limits(limit, page_size) page = await self.page_async( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, page_size=limits["page_size"], @@ -514,11 +490,7 @@ async def stream_async( def list( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -530,11 +502,7 @@ def list( memory before returning. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. list() guarantees @@ -549,11 +517,7 @@ def list( return list( self.stream( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, limit=limit, @@ -564,11 +528,7 @@ def list( async def list_async( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -580,11 +540,7 @@ async def list_async( memory before returning. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. list() guarantees @@ -600,11 +556,7 @@ async def list_async( record async for record in await self.stream_async( date_created=date_created, - date_created_before=date_created_before, - date_created_after=date_created_after, date_updated=date_updated, - date_updated_before=date_updated_before, - date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, limit=limit, @@ -615,11 +567,7 @@ async def list_async( def page( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, page_token: Union[str, object] = values.unset, @@ -631,11 +579,7 @@ def page( Request is executed immediately :param date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param friendly_name: The string that identifies the Conference resources to read. :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param page_token: PageToken provided by the API @@ -647,11 +591,7 @@ def page( data = values.of( { "DateCreated": serialize.iso8601_date(date_created), - "DateCreated<": serialize.iso8601_date(date_created_before), - "DateCreated>": serialize.iso8601_date(date_created_after), "DateUpdated": serialize.iso8601_date(date_updated), - "DateUpdated<": serialize.iso8601_date(date_updated_before), - "DateUpdated>": serialize.iso8601_date(date_updated_after), "FriendlyName": friendly_name, "Status": status, "PageToken": page_token, @@ -666,11 +606,7 @@ def page( async def page_async( self, date_created: Union[date, object] = values.unset, - date_created_before: Union[date, object] = values.unset, - date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, - date_updated_before: Union[date, object] = values.unset, - date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, page_token: Union[str, object] = values.unset, @@ -682,11 +618,7 @@ async def page_async( Request is executed immediately :param date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param friendly_name: The string that identifies the Conference resources to read. :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param page_token: PageToken provided by the API @@ -698,11 +630,7 @@ async def page_async( data = values.of( { "DateCreated": serialize.iso8601_date(date_created), - "DateCreated<": serialize.iso8601_date(date_created_before), - "DateCreated>": serialize.iso8601_date(date_created_after), "DateUpdated": serialize.iso8601_date(date_updated), - "DateUpdated<": serialize.iso8601_date(date_updated_before), - "DateUpdated>": serialize.iso8601_date(date_updated_after), "FriendlyName": friendly_name, "Status": status, "PageToken": page_token, diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 9706e80cf0..8d8144d331 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -674,8 +674,6 @@ def stream( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[MessageInstance]: @@ -688,8 +686,6 @@ def stream( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -701,12 +697,7 @@ def stream( """ limits = self._version.read_limits(limit, page_size) page = self.page( - to=to, - from_=from_, - date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, - page_size=limits["page_size"], + to=to, from_=from_, date_sent=date_sent, page_size=limits["page_size"] ) return self._version.stream(page, limits["limit"]) @@ -716,8 +707,6 @@ async def stream_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[MessageInstance]: @@ -730,8 +719,6 @@ async def stream_async( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -743,12 +730,7 @@ async def stream_async( """ limits = self._version.read_limits(limit, page_size) page = await self.page_async( - to=to, - from_=from_, - date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, - page_size=limits["page_size"], + to=to, from_=from_, date_sent=date_sent, page_size=limits["page_size"] ) return self._version.stream_async(page, limits["limit"]) @@ -758,8 +740,6 @@ def list( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[MessageInstance]: @@ -771,8 +751,6 @@ def list( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -787,8 +765,6 @@ def list( to=to, from_=from_, date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, limit=limit, page_size=page_size, ) @@ -799,8 +775,6 @@ async def list_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[MessageInstance]: @@ -812,8 +786,6 @@ async def list_async( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -829,8 +801,6 @@ async def list_async( to=to, from_=from_, date_sent=date_sent, - date_sent_before=date_sent_before, - date_sent_after=date_sent_after, limit=limit, page_size=page_size, ) @@ -841,8 +811,6 @@ def page( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -854,8 +822,6 @@ def page( :param to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -867,8 +833,6 @@ def page( "To": to, "From": from_, "DateSent": serialize.iso8601_datetime(date_sent), - "DateSent<": serialize.iso8601_datetime(date_sent_before), - "DateSent>": serialize.iso8601_datetime(date_sent_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -883,8 +847,6 @@ async def page_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, - date_sent_before: Union[datetime, object] = values.unset, - date_sent_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -896,8 +858,6 @@ async def page_async( :param to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). - :param date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -909,8 +869,6 @@ async def page_async( "To": to, "From": from_, "DateSent": serialize.iso8601_datetime(date_sent), - "DateSent<": serialize.iso8601_datetime(date_sent_before), - "DateSent>": serialize.iso8601_datetime(date_sent_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/content/v1/content/approval_create.py b/twilio/rest/content/v1/content/approval_create.py new file mode 100644 index 0000000000..63a4474306 --- /dev/null +++ b/twilio/rest/content/v1/content/approval_create.py @@ -0,0 +1,138 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Content + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ApprovalCreateInstance(InstanceResource): + """ + :ivar name: + :ivar category: + :ivar content_type: + :ivar status: + :ivar rejection_reason: + :ivar allow_category_change: + """ + + def __init__(self, version: Version, payload: Dict[str, Any], sid: str): + super().__init__(version) + + self.name: Optional[str] = payload.get("name") + self.category: Optional[str] = payload.get("category") + self.content_type: Optional[str] = payload.get("content_type") + self.status: Optional[str] = payload.get("status") + self.rejection_reason: Optional[str] = payload.get("rejection_reason") + self.allow_category_change: Optional[bool] = payload.get( + "allow_category_change" + ) + + self._solution = { + "sid": sid, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ApprovalCreateList(ListResource): + + class ContentApprovalRequest(object): + """ + :ivar name: Name of the template. + :ivar category: A WhatsApp recognized template category. + """ + + def __init__(self, payload: Dict[str, Any], sid: str): + + self.name: Optional[str] = payload.get("name") + self.category: Optional[str] = payload.get("category") + + def to_dict(self): + return { + "name": self.name, + "category": self.category, + } + + def __init__(self, version: Version, sid: str): + """ + Initialize the ApprovalCreateList + + :param version: Version that contains the resource + :param sid: + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/Content/{sid}/ApprovalRequests/whatsapp".format(**self._solution) + + def create( + self, content_approval_request: ContentApprovalRequest + ) -> ApprovalCreateInstance: + """ + Create the ApprovalCreateInstance + + :param content_approval_request: + + :returns: The created ApprovalCreateInstance + """ + data = content_approval_request.to_dict() + + headers = {"Content-Type": "application/json"} + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) + + async def create_async( + self, content_approval_request: ContentApprovalRequest + ) -> ApprovalCreateInstance: + """ + Asynchronously create the ApprovalCreateInstance + + :param content_approval_request: + + :returns: The created ApprovalCreateInstance + """ + + data = content_approval_request.to_dict() + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index 511321a588..b358081517 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -237,6 +237,24 @@ async def fetch_async( ui_version=ui_version, ) + def update(self) -> "ConfigurationInstance": + """ + Update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + return self._proxy.update() + + async def update_async(self) -> "ConfigurationInstance": + """ + Asynchronous coroutine to update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + return await self._proxy.update_async() + def __repr__(self) -> str: """ Provide a friendly representation @@ -309,6 +327,40 @@ async def fetch_async( payload, ) + def update(self) -> ConfigurationInstance: + """ + Update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + data = values.of({}) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return ConfigurationInstance(self._version, payload) + + async def update_async(self) -> ConfigurationInstance: + """ + Asynchronous coroutine to update the ConfigurationInstance + + + :returns: The updated ConfigurationInstance + """ + data = values.of({}) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ConfigurationInstance(self._version, payload) + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 384b0d95e3..95223e1615 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -16,7 +16,9 @@ from twilio.base.version import Version from twilio.base.domain import Domain from twilio.rest.numbers.v1.bulk_eligibility import BulkEligibilityList +from twilio.rest.numbers.v1.eligibility import EligibilityList from twilio.rest.numbers.v1.porting_bulk_portability import PortingBulkPortabilityList +from twilio.rest.numbers.v1.porting_port_in import PortingPortInList from twilio.rest.numbers.v1.porting_port_in_fetch import PortingPortInFetchList from twilio.rest.numbers.v1.porting_portability import PortingPortabilityList @@ -31,7 +33,9 @@ def __init__(self, domain: Domain): """ super().__init__(domain, "v1") self._bulk_eligibilities: Optional[BulkEligibilityList] = None + self._eligibilities: Optional[EligibilityList] = None self._porting_bulk_portabilities: Optional[PortingBulkPortabilityList] = None + self._porting_port_ins: Optional[PortingPortInList] = None self._porting_port_ins: Optional[PortingPortInFetchList] = None self._porting_portabilities: Optional[PortingPortabilityList] = None @@ -41,12 +45,24 @@ def bulk_eligibilities(self) -> BulkEligibilityList: self._bulk_eligibilities = BulkEligibilityList(self) return self._bulk_eligibilities + @property + def eligibilities(self) -> EligibilityList: + if self._eligibilities is None: + self._eligibilities = EligibilityList(self) + return self._eligibilities + @property def porting_bulk_portabilities(self) -> PortingBulkPortabilityList: if self._porting_bulk_portabilities is None: self._porting_bulk_portabilities = PortingBulkPortabilityList(self) return self._porting_bulk_portabilities + @property + def porting_port_ins(self) -> PortingPortInList: + if self._porting_port_ins is None: + self._porting_port_ins = PortingPortInList(self) + return self._porting_port_ins + @property def porting_port_ins(self) -> PortingPortInFetchList: if self._porting_port_ins is None: diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index 64be314b44..c13f42c796 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -178,6 +178,38 @@ def __init__(self, version: Version): """ super().__init__(version) + self._uri = "/HostedNumber/Eligibility/Bulk" + + def create(self) -> BulkEligibilityInstance: + """ + Create the BulkEligibilityInstance + + + :returns: The created BulkEligibilityInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return BulkEligibilityInstance(self._version, payload) + + async def create_async(self) -> BulkEligibilityInstance: + """ + Asynchronously create the BulkEligibilityInstance + + + :returns: The created BulkEligibilityInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return BulkEligibilityInstance(self._version, payload) + def get(self, request_id: str) -> BulkEligibilityContext: """ Constructs a BulkEligibilityContext diff --git a/twilio/rest/numbers/v1/eligibility.py b/twilio/rest/numbers/v1/eligibility.py new file mode 100644 index 0000000000..99461374ee --- /dev/null +++ b/twilio/rest/numbers/v1/eligibility.py @@ -0,0 +1,91 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class EligibilityInstance(InstanceResource): + """ + :ivar results: The result set that contains the eligibility check response for the requested number, each result has at least the following attributes: phone_number: The requested phone number ,hosting_account_sid: The account sid where the phone number will be hosted, date_last_checked: Datetime (ISO 8601) when the PN was last checked for eligibility, country: Phone number’s country, eligibility_status: Indicates the eligibility status of the PN (Eligible/Ineligible), eligibility_sub_status: Indicates the sub status of the eligibility , ineligibility_reason: Reason for number's ineligibility (if applicable), next_step: Suggested next step in the hosting process based on the eligibility status. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.results: Optional[List[Dict[str, object]]] = payload.get("results") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class EligibilityList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the EligibilityList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/HostedNumber/Eligibility" + + def create(self) -> EligibilityInstance: + """ + Create the EligibilityInstance + + + :returns: The created EligibilityInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return EligibilityInstance(self._version, payload) + + async def create_async(self) -> EligibilityInstance: + """ + Asynchronously create the EligibilityInstance + + + :returns: The created EligibilityInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return EligibilityInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py new file mode 100644 index 0000000000..ad3140a0b8 --- /dev/null +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -0,0 +1,93 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PortingPortInInstance(InstanceResource): + """ + :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + :ivar url: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") + self.url: Optional[str] = payload.get("url") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class PortingPortInList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PortingPortInList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Porting/PortIn" + + def create(self) -> PortingPortInInstance: + """ + Create the PortingPortInInstance + + + :returns: The created PortingPortInInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return PortingPortInInstance(self._version, payload) + + async def create_async(self) -> PortingPortInInstance: + """ + Asynchronously create the PortingPortInInstance + + + :returns: The created PortingPortInInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return PortingPortInInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index 31f95814f0..f7f6026c50 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -216,6 +216,38 @@ def __init__(self, version: Version): """ super().__init__(version) + self._uri = "/HostedNumber/Orders/Bulk" + + def create(self) -> BulkHostedNumberOrderInstance: + """ + Create the BulkHostedNumberOrderInstance + + + :returns: The created BulkHostedNumberOrderInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return BulkHostedNumberOrderInstance(self._version, payload) + + async def create_async(self) -> BulkHostedNumberOrderInstance: + """ + Asynchronously create the BulkHostedNumberOrderInstance + + + :returns: The created BulkHostedNumberOrderInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return BulkHostedNumberOrderInstance(self._version, payload) + def get(self, bulk_hosting_sid: str) -> BulkHostedNumberOrderContext: """ Constructs a BulkHostedNumberOrderContext diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index 5e1eec5b16..8215bb95b7 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -578,8 +578,6 @@ def stream( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[BundleInstance]: @@ -598,8 +596,6 @@ def stream( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -620,8 +616,6 @@ def stream( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, page_size=limits["page_size"], ) @@ -638,8 +632,6 @@ async def stream_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[BundleInstance]: @@ -658,8 +650,6 @@ async def stream_async( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -680,8 +670,6 @@ async def stream_async( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, page_size=limits["page_size"], ) @@ -698,8 +686,6 @@ def list( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[BundleInstance]: @@ -717,8 +703,6 @@ def list( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -739,8 +723,6 @@ def list( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, limit=limit, page_size=page_size, ) @@ -757,8 +739,6 @@ async def list_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[BundleInstance]: @@ -776,8 +756,6 @@ async def list_async( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -799,8 +777,6 @@ async def list_async( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, - valid_until_date_before=valid_until_date_before, - valid_until_date_after=valid_until_date_after, limit=limit, page_size=page_size, ) @@ -817,8 +793,6 @@ def page( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -836,8 +810,6 @@ def page( :param sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -855,8 +827,6 @@ def page( "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), - "ValidUntilDate<": serialize.iso8601_datetime(valid_until_date_before), - "ValidUntilDate>": serialize.iso8601_datetime(valid_until_date_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -877,8 +847,6 @@ async def page_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, - valid_until_date_before: Union[datetime, object] = values.unset, - valid_until_date_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -896,8 +864,6 @@ async def page_async( :param sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. - :param valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -915,8 +881,6 @@ async def page_async( "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), - "ValidUntilDate<": serialize.iso8601_datetime(valid_until_date_before), - "ValidUntilDate>": serialize.iso8601_datetime(valid_until_date_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/preview_messaging/PreviewMessagingBase.py b/twilio/rest/preview_messaging/PreviewMessagingBase.py new file mode 100644 index 0000000000..12b19f4cf1 --- /dev/null +++ b/twilio/rest/preview_messaging/PreviewMessagingBase.py @@ -0,0 +1,44 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional + +from twilio.base.domain import Domain +from twilio.rest import Client +from twilio.rest.preview_messaging.v1 import V1 + + +class PreviewMessagingBase(Domain): + + def __init__(self, twilio: Client): + """ + Initialize the PreviewMessaging Domain + + :returns: Domain for PreviewMessaging + """ + super().__init__(twilio, "https://preview.messaging.twilio.com") + self._v1: Optional[V1] = None + + @property + def v1(self) -> V1: + """ + :returns: Versions v1 of PreviewMessaging + """ + if self._v1 is None: + self._v1 = V1(self) + return self._v1 + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_messaging/__init__.py b/twilio/rest/preview_messaging/__init__.py new file mode 100644 index 0000000000..73bf67969d --- /dev/null +++ b/twilio/rest/preview_messaging/__init__.py @@ -0,0 +1,13 @@ +from twilio.rest.preview_messaging.PreviewMessagingBase import PreviewMessagingBase +from twilio.rest.preview_messaging.v1.broadcast import BroadcastList +from twilio.rest.preview_messaging.v1.message import MessageList + + +class PreviewMessaging(PreviewMessagingBase): + @property + def broadcast(self) -> BroadcastList: + return self.v1.broadcasts + + @property + def messages(self) -> MessageList: + return self.v1.messages diff --git a/twilio/rest/preview_messaging/v1/__init__.py b/twilio/rest/preview_messaging/v1/__init__.py new file mode 100644 index 0000000000..424af648e8 --- /dev/null +++ b/twilio/rest/preview_messaging/v1/__init__.py @@ -0,0 +1,51 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Bulk Messaging and Broadcast + Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.preview_messaging.v1.broadcast import BroadcastList +from twilio.rest.preview_messaging.v1.message import MessageList + + +class V1(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V1 version of PreviewMessaging + + :param domain: The Twilio.preview_messaging domain + """ + super().__init__(domain, "v1") + self._broadcasts: Optional[BroadcastList] = None + self._messages: Optional[MessageList] = None + + @property + def broadcasts(self) -> BroadcastList: + if self._broadcasts is None: + self._broadcasts = BroadcastList(self) + return self._broadcasts + + @property + def messages(self) -> MessageList: + if self._messages is None: + self._messages = MessageList(self) + return self._messages + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_messaging/v1/broadcast.py b/twilio/rest/preview_messaging/v1/broadcast.py new file mode 100644 index 0000000000..e41e066bad --- /dev/null +++ b/twilio/rest/preview_messaging/v1/broadcast.py @@ -0,0 +1,125 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Bulk Messaging and Broadcast + Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class BroadcastInstance(InstanceResource): + """ + :ivar broadcast_sid: Numeric ID indentifying individual Broadcast requests + :ivar created_date: Timestamp of when the Broadcast was created + :ivar updated_date: Timestamp of when the Broadcast was last updated + :ivar broadcast_status: Status of the Broadcast request. Valid values are None, Pending-Upload, Uploaded, Queued, Executing, Execution-Failure, Execution-Completed, Cancelation-Requested, and Canceled + :ivar execution_details: + :ivar results_file: Path to a file detailing successful requests and errors from Broadcast execution + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.broadcast_sid: Optional[str] = payload.get("broadcast_sid") + self.created_date: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("created_date") + ) + self.updated_date: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("updated_date") + ) + self.broadcast_status: Optional[str] = payload.get("broadcast_status") + self.execution_details: Optional[str] = payload.get("execution_details") + self.results_file: Optional[str] = payload.get("results_file") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class BroadcastList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the BroadcastList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Broadcasts" + + def create( + self, x_twilio_request_key: Union[str, object] = values.unset + ) -> BroadcastInstance: + """ + Create the BroadcastInstance + + :param x_twilio_request_key: Idempotency key provided by the client + + :returns: The created BroadcastInstance + """ + + data = values.of({}) + headers = values.of( + { + "X-Twilio-Request-Key": x_twilio_request_key, + } + ) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return BroadcastInstance(self._version, payload) + + async def create_async( + self, x_twilio_request_key: Union[str, object] = values.unset + ) -> BroadcastInstance: + """ + Asynchronously create the BroadcastInstance + + :param x_twilio_request_key: Idempotency key provided by the client + + :returns: The created BroadcastInstance + """ + + data = values.of({}) + headers = values.of( + { + "X-Twilio-Request-Key": x_twilio_request_key, + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return BroadcastInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_messaging/v1/message.py b/twilio/rest/preview_messaging/v1/message.py new file mode 100644 index 0000000000..c6212c7f4f --- /dev/null +++ b/twilio/rest/preview_messaging/v1/message.py @@ -0,0 +1,203 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Bulk Messaging and Broadcast + Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional +from twilio.base import deserialize + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class MessageInstance(InstanceResource): + """ + :ivar total_message_count: The number of Messages processed in the request, equal to the sum of success_count and error_count. + :ivar success_count: The number of Messages successfully created. + :ivar error_count: The number of Messages unsuccessfully processed in the request. + :ivar message_receipts: + :ivar failed_message_receipts: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.total_message_count: Optional[int] = deserialize.integer( + payload.get("total_message_count") + ) + self.success_count: Optional[int] = deserialize.integer( + payload.get("success_count") + ) + self.error_count: Optional[int] = deserialize.integer( + payload.get("error_count") + ) + self.message_receipts: Optional[List[str]] = payload.get("message_receipts") + self.failed_message_receipts: Optional[List[str]] = payload.get( + "failed_message_receipts" + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class MessageList(ListResource): + + class CreateMessagesRequest(object): + """ + :ivar messages: + :ivar from_: A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. + :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. + :ivar body: The text of the message you want to send. Can be up to 1,600 characters in length. + :ivar content_sid: The SID of the preconfigured [Content Template](https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided `ContentVariables`. This Twilio product is currently in Private Beta. + :ivar media_url: The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. + :ivar status_callback: The URL we should call using the \"status_callback_method\" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including \"MessageSid\", \"MessageStatus\", and \"ErrorCode\". If you include this parameter with the \"messaging_service_sid\", we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed. + :ivar validity_period: How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. + :ivar send_at: The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format. + :ivar schedule_type: This parameter indicates your intent to schedule a message. Pass the value `fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter. + :ivar shorten_urls: Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`. + :ivar send_as_mms: If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media. + :ivar max_price: The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked. + :ivar attempt: Total number of attempts made ( including this ) to send out the message regardless of the provider used + :ivar smart_encoded: This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false. + :ivar force_delivery: This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline. + :ivar application_sid: The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application's message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application's message_status_callback parameter will be used. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.messages: Optional[List[MessageList.MessagingV1Message]] = payload.get( + "messages" + ) + self.from_: Optional[str] = payload.get("from_") + self.messaging_service_sid: Optional[str] = payload.get( + "messaging_service_sid" + ) + self.body: Optional[str] = payload.get("body") + self.content_sid: Optional[str] = payload.get("content_sid") + self.media_url: Optional[List[str]] = payload.get("media_url") + self.status_callback: Optional[str] = payload.get("status_callback") + self.validity_period: Optional[int] = payload.get("validity_period") + self.send_at: Optional[str] = payload.get("send_at") + self.schedule_type: Optional[str] = payload.get("schedule_type") + self.shorten_urls: Optional[bool] = payload.get("shorten_urls") + self.send_as_mms: Optional[bool] = payload.get("send_as_mms") + self.max_price: Optional[float] = payload.get("max_price") + self.attempt: Optional[int] = payload.get("attempt") + self.smart_encoded: Optional[bool] = payload.get("smart_encoded") + self.force_delivery: Optional[bool] = payload.get("force_delivery") + self.application_sid: Optional[str] = payload.get("application_sid") + + def to_dict(self): + return { + "messages": [messages.to_dict() for messages in self.messages], + "from": self.from_, + "messaging_service_sid": self.messaging_service_sid, + "body": self.body, + "content_sid": self.content_sid, + "media_url": self.media_url, + "status_callback": self.status_callback, + "validity_period": self.validity_period, + "send_at": self.send_at, + "schedule_type": self.schedule_type, + "shorten_urls": self.shorten_urls, + "send_as_mms": self.send_as_mms, + "max_price": self.max_price, + "attempt": self.attempt, + "smart_encoded": self.smart_encoded, + "force_delivery": self.force_delivery, + "application_sid": self.application_sid, + } + + class MessagingV1Message(object): + """ + :ivar to: The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels. + :ivar body: The text of the message you want to send. Can be up to 1,600 characters in length. Overrides the request-level body and content template if provided. + :ivar content_variables: Key-value pairs of variable names to substitution values. Refer to the [Twilio Content API Resources](https://www.twilio.com/docs/content-api/content-api-resources#send-a-message-with-preconfigured-content) for more details. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.to: Optional[str] = payload.get("to") + self.body: Optional[str] = payload.get("body") + self.content_variables: Optional[dict[str, str]] = payload.get( + "content_variables" + ) + + def to_dict(self): + return { + "to": self.to, + "body": self.body, + "content_variables": self.content_variables, + } + + def __init__(self, version: Version): + """ + Initialize the MessageList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Messages" + + def create(self, create_messages_request: CreateMessagesRequest) -> MessageInstance: + """ + Create the MessageInstance + + :param create_messages_request: + + :returns: The created MessageInstance + """ + data = create_messages_request.to_dict() + + headers = {"Content-Type": "application/json"} + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return MessageInstance(self._version, payload) + + async def create_async( + self, create_messages_request: CreateMessagesRequest + ) -> MessageInstance: + """ + Asynchronously create the MessageInstance + + :param create_messages_request: + + :returns: The created MessageInstance + """ + + data = create_messages_request.to_dict() + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return MessageInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py index 5c750d94cb..794fd216d3 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py @@ -20,6 +20,9 @@ from twilio.base.list_resource import ListResource from twilio.base.version import Version from twilio.base.page import Page +from twilio.rest.taskrouter.v1.workspace.task_queue.task_queue_bulk_real_time_statistics import ( + TaskQueueBulkRealTimeStatisticsList, +) from twilio.rest.taskrouter.v1.workspace.task_queue.task_queue_cumulative_statistics import ( TaskQueueCumulativeStatisticsList, ) @@ -515,6 +518,9 @@ def __init__(self, version: Version, workspace_sid: str): } self._uri = "/Workspaces/{workspace_sid}/TaskQueues".format(**self._solution) + self._bulk_real_time_statistics: Optional[ + TaskQueueBulkRealTimeStatisticsList + ] = None self._statistics: Optional[TaskQueuesStatisticsList] = None def create( @@ -862,6 +868,17 @@ async def get_page_async(self, target_url: str) -> TaskQueuePage: response = await self._version.domain.twilio.request_async("GET", target_url) return TaskQueuePage(self._version, response, self._solution) + @property + def bulk_real_time_statistics(self) -> TaskQueueBulkRealTimeStatisticsList: + """ + Access the bulk_real_time_statistics + """ + if self._bulk_real_time_statistics is None: + self._bulk_real_time_statistics = TaskQueueBulkRealTimeStatisticsList( + self._version, workspace_sid=self._solution["workspace_sid"] + ) + return self._bulk_real_time_statistics + @property def statistics(self) -> TaskQueuesStatisticsList: """ diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py new file mode 100644 index 0000000000..90552babf3 --- /dev/null +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py @@ -0,0 +1,123 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Taskrouter + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional +from twilio.base import deserialize + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class TaskQueueBulkRealTimeStatisticsInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the TaskQueue resource. + :ivar workspace_sid: The SID of the Workspace that contains the TaskQueue. + :ivar task_queue_data: The real-time statistics for each requested TaskQueue SID. `task_queue_data` returns the following attributes: `task_queue_sid`: The SID of the TaskQueue from which these statistics were calculated. `total_available_workers`: The total number of Workers available for Tasks in the TaskQueue. `total_eligible_workers`: The total number of Workers eligible for Tasks in the TaskQueue, regardless of their Activity state. `total_tasks`: The total number of Tasks. `longest_task_waiting_age`: The age of the longest waiting Task. `longest_task_waiting_sid`: The SID of the longest waiting Task. `tasks_by_status`: The number of Tasks grouped by their current status. `tasks_by_priority`: The number of Tasks grouped by priority. `activity_statistics`: The number of current Workers grouped by Activity. + :ivar task_queue_response_count: The number of TaskQueue statistics received in task_queue_data. + :ivar url: The absolute URL of the TaskQueue statistics resource. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], workspace_sid: str): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.workspace_sid: Optional[str] = payload.get("workspace_sid") + self.task_queue_data: Optional[List[Dict[str, object]]] = payload.get( + "task_queue_data" + ) + self.task_queue_response_count: Optional[int] = deserialize.integer( + payload.get("task_queue_response_count") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "workspace_sid": workspace_sid, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return ( + "".format( + context + ) + ) + + +class TaskQueueBulkRealTimeStatisticsList(ListResource): + + def __init__(self, version: Version, workspace_sid: str): + """ + Initialize the TaskQueueBulkRealTimeStatisticsList + + :param version: Version that contains the resource + :param workspace_sid: The unique SID identifier of the Workspace. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "workspace_sid": workspace_sid, + } + self._uri = "/Workspaces/{workspace_sid}/TaskQueues/RealTimeStatistics".format( + **self._solution + ) + + def create(self) -> TaskQueueBulkRealTimeStatisticsInstance: + """ + Create the TaskQueueBulkRealTimeStatisticsInstance + + + :returns: The created TaskQueueBulkRealTimeStatisticsInstance + """ + + payload = self._version.create( + method="POST", + uri=self._uri, + ) + + return TaskQueueBulkRealTimeStatisticsInstance( + self._version, payload, workspace_sid=self._solution["workspace_sid"] + ) + + async def create_async(self) -> TaskQueueBulkRealTimeStatisticsInstance: + """ + Asynchronously create the TaskQueueBulkRealTimeStatisticsInstance + + + :returns: The created TaskQueueBulkRealTimeStatisticsInstance + """ + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + ) + + return TaskQueueBulkRealTimeStatisticsInstance( + self._version, payload, workspace_sid=self._solution["workspace_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" From af6547ffc7e94099915bcddffbb0489eacf87a7b Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 27 Feb 2024 13:59:00 +0000 Subject: [PATCH 009/113] [Librarian] Regenerated @ f75e0fb81b57afeb6b457dc85e19644ebb530f9b --- CHANGES.md | 33 ++ .../api/v2010/account/address/__init__.py | 18 +- twilio/rest/api/v2010/account/application.py | 34 +- .../available_phone_number_country/local.py | 46 +- .../machine_to_machine.py | 46 +- .../available_phone_number_country/mobile.py | 46 +- .../national.py | 46 +- .../shared_cost.py | 46 +- .../toll_free.py | 46 +- .../available_phone_number_country/voip.py | 46 +- .../rest/api/v2010/account/call/__init__.py | 40 +- .../rest/api/v2010/account/call/feedback.py | 333 ------------- .../v2010/account/call/feedback_summary.py | 378 --------------- twilio/rest/api/v2010/account/call/payment.py | 8 +- .../v2010/account/conference/participant.py | 68 +-- .../account/incoming_phone_number/__init__.py | 22 +- .../account/incoming_phone_number/local.py | 14 +- .../account/incoming_phone_number/mobile.py | 14 +- .../incoming_phone_number/toll_free.py | 14 +- .../api/v2010/account/message/__init__.py | 20 +- .../api/v2010/account/recording/__init__.py | 8 +- .../api/v2010/account/sip/domain/__init__.py | 34 +- .../v2010/account/usage/record/__init__.py | 4 +- .../v2010/account/usage/record/all_time.py | 4 +- .../api/v2010/account/usage/record/daily.py | 4 +- .../v2010/account/usage/record/last_month.py | 4 +- .../api/v2010/account/usage/record/monthly.py | 4 +- .../v2010/account/usage/record/this_month.py | 4 +- .../api/v2010/account/usage/record/today.py | 4 +- .../api/v2010/account/usage/record/yearly.py | 4 +- .../v2010/account/usage/record/yesterday.py | 4 +- .../bulkexports/v1/export_configuration.py | 6 +- twilio/rest/chat/v1/credential.py | 10 +- twilio/rest/chat/v1/service/__init__.py | 44 +- twilio/rest/chat/v2/credential.py | 10 +- twilio/rest/chat/v2/service/__init__.py | 60 ++- twilio/rest/content/v1/content/__init__.py | 458 +++++++++++++++++- .../rest/content/v1/content_and_approvals.py | 2 +- .../conversations/v1/address_configuration.py | 16 +- twilio/rest/conversations/v1/credential.py | 10 +- .../v1/service/configuration/__init__.py | 10 +- .../v1/service/configuration/notification.py | 42 +- twilio/rest/events/v1/sink/__init__.py | 4 +- twilio/rest/flex_api/v1/__init__.py | 26 - twilio/rest/flex_api/v1/channel.py | 6 +- twilio/rest/flex_api/v1/configuration.py | 46 +- twilio/rest/flex_api/v1/flex_flow.py | 42 +- .../flex_api/v1/insights_conversational_ai.py | 295 ----------- ...ights_conversational_ai_report_insights.py | 279 ----------- .../flex_api/v1/insights_questionnaires.py | 12 +- .../v1/insights_questionnaires_question.py | 8 +- .../interaction_channel_participant.py | 10 + twilio/rest/frontline_api/v1/user.py | 6 +- twilio/rest/insights/v1/call/annotation.py | 6 +- twilio/rest/insights/v1/call_summaries.py | 22 +- twilio/rest/insights/v1/setting.py | 10 +- twilio/rest/intelligence/v2/service.py | 34 +- .../rest/intelligence/v2/transcript/media.py | 6 +- .../v2/transcript/operator_result.py | 10 +- .../intelligence/v2/transcript/sentence.py | 6 +- twilio/rest/ip_messaging/v1/credential.py | 10 +- .../rest/ip_messaging/v1/service/__init__.py | 44 +- twilio/rest/ip_messaging/v2/credential.py | 10 +- .../rest/ip_messaging/v2/service/__init__.py | 60 ++- twilio/rest/lookups/v2/phone_number.py | 12 +- .../rest/media/v1/player_streamer/__init__.py | 6 +- .../v1/brand_registration/__init__.py | 14 +- twilio/rest/messaging/v1/domain_config.py | 10 +- twilio/rest/messaging/v1/service/__init__.py | 82 ++-- .../messaging/v1/service/us_app_to_person.py | 36 +- .../messaging/v1/tollfree_verification.py | 18 +- twilio/rest/microvisor/v1/device/__init__.py | 10 +- twilio/rest/notify/v1/credential.py | 10 +- twilio/rest/notify/v1/service/__init__.py | 26 +- twilio/rest/numbers/v1/bulk_eligibility.py | 25 +- twilio/rest/numbers/v1/eligibility.py | 22 +- twilio/rest/numbers/v1/porting_port_in.py | 24 +- .../numbers/v2/bulk_hosted_number_order.py | 21 +- twilio/rest/numbers/v2/hosted_number_order.py | 8 +- .../regulatory_compliance/bundle/__init__.py | 4 +- .../preview/deployed_devices/fleet/device.py | 10 +- .../hosted_numbers/hosted_number_order.py | 4 +- .../marketplace/installed_add_on/__init__.py | 8 +- .../installed_add_on_extension.py | 6 +- twilio/rest/preview/sync/service/__init__.py | 26 +- .../service/document/document_permission.py | 14 +- .../service/sync_list/sync_list_permission.py | 14 +- .../service/sync_map/sync_map_permission.py | 14 +- twilio/rest/preview/wireless/rate_plan.py | 24 +- twilio/rest/proxy/v1/service/phone_number.py | 10 +- twilio/rest/proxy/v1/service/short_code.py | 6 +- twilio/rest/serverless/v1/service/__init__.py | 18 +- twilio/rest/supersim/v1/esim_profile.py | 6 +- twilio/rest/supersim/v1/fleet.py | 10 +- twilio/rest/sync/v1/service/__init__.py | 58 ++- .../service/document/document_permission.py | 14 +- .../service/sync_list/sync_list_permission.py | 14 +- .../service/sync_map/sync_map_permission.py | 14 +- .../rest/taskrouter/v1/workspace/__init__.py | 10 +- .../rest/taskrouter/v1/workspace/activity.py | 6 +- .../taskrouter/v1/workspace/task/__init__.py | 4 +- .../v1/workspace/task/reservation.py | 52 +- .../taskrouter/v1/workspace/task_channel.py | 18 +- .../task_queue_bulk_real_time_statistics.py | 25 +- .../v1/workspace/worker/__init__.py | 10 +- .../v1/workspace/worker/reservation.py | 52 +- .../v1/workspace/worker/worker_channel.py | 6 +- twilio/rest/trunking/v1/trunk/__init__.py | 18 +- .../rest/trunking/v1/trunk/origination_url.py | 10 +- .../v1/compliance_registration_inquiries.py | 75 ++- twilio/rest/verify/v2/service/__init__.py | 90 ++-- twilio/rest/video/v1/composition.py | 4 +- twilio/rest/video/v1/composition_hook.py | 20 +- twilio/rest/video/v1/composition_settings.py | 10 +- twilio/rest/video/v1/recording_settings.py | 10 +- twilio/rest/video/v1/room/__init__.py | 20 +- twilio/rest/voice/v1/byoc_trunk.py | 10 +- .../connection_policy_target.py | 10 +- .../dialing_permissions/country/__init__.py | 26 +- .../voice/v1/dialing_permissions/settings.py | 10 +- twilio/rest/wireless/v1/command.py | 10 +- twilio/rest/wireless/v1/rate_plan.py | 20 +- 122 files changed, 1932 insertions(+), 2208 deletions(-) delete mode 100644 twilio/rest/api/v2010/account/call/feedback.py delete mode 100644 twilio/rest/api/v2010/account/call/feedback_summary.py delete mode 100644 twilio/rest/flex_api/v1/insights_conversational_ai.py delete mode 100644 twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py diff --git a/CHANGES.md b/CHANGES.md index 73bbaa1061..d9cb281a5e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,39 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-02-27] Version 9.0.0 +-------------------------- +**Note:** This release contains breaking changes, check our [upgrade guide](./UPGRADE.md###-2024-02-20-8xx-to-9xx) for detailed migration notes. + +**Library - Feature** +- [PR #767](https://github.com/twilio/twilio-python/pull/767): Merge branch '9.0.0-rc' into main. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! **(breaking change)** + +**Library - Chore** +- [PR #771](https://github.com/twilio/twilio-python/pull/771): added check for unset values. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #768](https://github.com/twilio/twilio-python/pull/768): cluster tests enabled. Thanks to [@sbansla](https://github.com/sbansla)! + +**Api** +- remove feedback and feedback summary from call resource + +**Flex** +- Adding `routing_properties` to Interactions Channels Participant + +**Lookups** +- Add new `line_status` package to the lookup response +- Remove `live_activity` package from the lookup response **(breaking change)** + +**Messaging** +- Add tollfree multiple rejection reasons response array + +**Trusthub** +- Add ENUM for businessRegistrationAuthority in compliance_registration. **(breaking change)** +- Add new field in isIsvEmbed in compliance_registration. +- Add additional optional fields in compliance_registration for Individual business type. + +**Twiml** +- Add support for new Amazon Polly and Google voices (Q1 2024) for `Say` verb + + [2024-02-09] Version 8.13.0 --------------------------- **Library - Fix** diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index 422d7f776c..fd77747102 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -350,8 +350,8 @@ def update( "City": city, "Region": region, "PostalCode": postal_code, - "EmergencyEnabled": emergency_enabled, - "AutoCorrectAddress": auto_correct_address, + "EmergencyEnabled": serialize.boolean_to_string(emergency_enabled), + "AutoCorrectAddress": serialize.boolean_to_string(auto_correct_address), "StreetSecondary": street_secondary, } ) @@ -404,8 +404,8 @@ async def update_async( "City": city, "Region": region, "PostalCode": postal_code, - "EmergencyEnabled": emergency_enabled, - "AutoCorrectAddress": auto_correct_address, + "EmergencyEnabled": serialize.boolean_to_string(emergency_enabled), + "AutoCorrectAddress": serialize.boolean_to_string(auto_correct_address), "StreetSecondary": street_secondary, } ) @@ -524,8 +524,8 @@ def create( "PostalCode": postal_code, "IsoCountry": iso_country, "FriendlyName": friendly_name, - "EmergencyEnabled": emergency_enabled, - "AutoCorrectAddress": auto_correct_address, + "EmergencyEnabled": serialize.boolean_to_string(emergency_enabled), + "AutoCorrectAddress": serialize.boolean_to_string(auto_correct_address), "StreetSecondary": street_secondary, } ) @@ -579,8 +579,8 @@ async def create_async( "PostalCode": postal_code, "IsoCountry": iso_country, "FriendlyName": friendly_name, - "EmergencyEnabled": emergency_enabled, - "AutoCorrectAddress": auto_correct_address, + "EmergencyEnabled": serialize.boolean_to_string(emergency_enabled), + "AutoCorrectAddress": serialize.boolean_to_string(auto_correct_address), "StreetSecondary": street_secondary, } ) diff --git a/twilio/rest/api/v2010/account/application.py b/twilio/rest/api/v2010/account/application.py index 3f70417b5e..a3b11f0282 100644 --- a/twilio/rest/api/v2010/account/application.py +++ b/twilio/rest/api/v2010/account/application.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -414,14 +414,18 @@ def update( "VoiceFallbackMethod": voice_fallback_method, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, "SmsFallbackMethod": sms_fallback_method, "SmsStatusCallback": sms_status_callback, "MessageStatusCallback": message_status_callback, - "PublicApplicationConnectEnabled": public_application_connect_enabled, + "PublicApplicationConnectEnabled": serialize.boolean_to_string( + public_application_connect_enabled + ), } ) @@ -489,14 +493,18 @@ async def update_async( "VoiceFallbackMethod": voice_fallback_method, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, "SmsFallbackMethod": sms_fallback_method, "SmsStatusCallback": sms_status_callback, "MessageStatusCallback": message_status_callback, - "PublicApplicationConnectEnabled": public_application_connect_enabled, + "PublicApplicationConnectEnabled": serialize.boolean_to_string( + public_application_connect_enabled + ), } ) @@ -613,7 +621,9 @@ def create( "VoiceFallbackMethod": voice_fallback_method, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, @@ -621,7 +631,9 @@ def create( "SmsStatusCallback": sms_status_callback, "MessageStatusCallback": message_status_callback, "FriendlyName": friendly_name, - "PublicApplicationConnectEnabled": public_application_connect_enabled, + "PublicApplicationConnectEnabled": serialize.boolean_to_string( + public_application_connect_enabled + ), } ) @@ -686,7 +698,9 @@ async def create_async( "VoiceFallbackMethod": voice_fallback_method, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, @@ -694,7 +708,9 @@ async def create_async( "SmsStatusCallback": sms_status_callback, "MessageStatusCallback": message_status_callback, "FriendlyName": friendly_name, - "PublicApplicationConnectEnabled": public_application_connect_enabled, + "PublicApplicationConnectEnabled": serialize.boolean_to_string( + public_application_connect_enabled + ), } ) diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/local.py b/twilio/rest/api/v2010/account/available_phone_number_country/local.py index a3fd567a7f..43118d9f72 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/local.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/local.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py index 04ba514cca..ee94aa944e 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py index cd37127017..622d2b8597 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/national.py b/twilio/rest/api/v2010/account/available_phone_number_country/national.py index 018bef3ac7..d0f3a63dda 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/national.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/national.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py index 3cb7af3eff..7b5b9b11c8 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py index e9d830c0bb..4368018001 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py index 8825843c8f..e0615d5a6e 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -501,13 +501,19 @@ def page( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -516,7 +522,7 @@ def page( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -582,13 +588,19 @@ async def page_async( { "AreaCode": area_code, "Contains": contains, - "SmsEnabled": sms_enabled, - "MmsEnabled": mms_enabled, - "VoiceEnabled": voice_enabled, - "ExcludeAllAddressRequired": exclude_all_address_required, - "ExcludeLocalAddressRequired": exclude_local_address_required, - "ExcludeForeignAddressRequired": exclude_foreign_address_required, - "Beta": beta, + "SmsEnabled": serialize.boolean_to_string(sms_enabled), + "MmsEnabled": serialize.boolean_to_string(mms_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "ExcludeAllAddressRequired": serialize.boolean_to_string( + exclude_all_address_required + ), + "ExcludeLocalAddressRequired": serialize.boolean_to_string( + exclude_local_address_required + ), + "ExcludeForeignAddressRequired": serialize.boolean_to_string( + exclude_foreign_address_required + ), + "Beta": serialize.boolean_to_string(beta), "NearNumber": near_number, "NearLatLong": near_lat_long, "Distance": distance, @@ -597,7 +609,7 @@ async def page_async( "InRateCenter": in_rate_center, "InLata": in_lata, "InLocality": in_locality, - "FaxEnabled": fax_enabled, + "FaxEnabled": serialize.boolean_to_string(fax_enabled), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 21c4e9c27e..0dcb8c5d5b 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -21,8 +21,6 @@ from twilio.base.version import Version from twilio.base.page import Page from twilio.rest.api.v2010.account.call.event import EventList -from twilio.rest.api.v2010.account.call.feedback import FeedbackList -from twilio.rest.api.v2010.account.call.feedback_summary import FeedbackSummaryList from twilio.rest.api.v2010.account.call.notification import NotificationList from twilio.rest.api.v2010.account.call.payment import PaymentList from twilio.rest.api.v2010.account.call.recording import RecordingList @@ -270,13 +268,6 @@ def events(self) -> EventList: """ return self._proxy.events - @property - def feedback(self) -> FeedbackList: - """ - Access the feedback - """ - return self._proxy.feedback - @property def notifications(self) -> NotificationList: """ @@ -356,7 +347,6 @@ def __init__(self, version: Version, account_sid: str, sid: str): self._uri = "/Accounts/{account_sid}/Calls/{sid}.json".format(**self._solution) self._events: Optional[EventList] = None - self._feedback: Optional[FeedbackList] = None self._notifications: Optional[NotificationList] = None self._payments: Optional[PaymentList] = None self._recordings: Optional[RecordingList] = None @@ -552,19 +542,6 @@ def events(self) -> EventList: ) return self._events - @property - def feedback(self) -> FeedbackList: - """ - Access the feedback - """ - if self._feedback is None: - self._feedback = FeedbackList( - self._version, - self._solution["account_sid"], - self._solution["sid"], - ) - return self._feedback - @property def notifications(self) -> NotificationList: """ @@ -707,8 +684,6 @@ def __init__(self, version: Version, account_sid: str): } self._uri = "/Accounts/{account_sid}/Calls.json".format(**self._solution) - self._feedback_summaries: Optional[FeedbackSummaryList] = None - def create( self, to: str, @@ -803,7 +778,7 @@ def create( "StatusCallbackMethod": status_callback_method, "SendDigits": send_digits, "Timeout": timeout, - "Record": record, + "Record": serialize.boolean_to_string(record), "RecordingChannels": recording_channels, "RecordingStatusCallback": recording_status_callback, "RecordingStatusCallbackMethod": recording_status_callback_method, @@ -937,7 +912,7 @@ async def create_async( "StatusCallbackMethod": status_callback_method, "SendDigits": send_digits, "Timeout": timeout, - "Record": record, + "Record": serialize.boolean_to_string(record), "RecordingChannels": recording_channels, "RecordingStatusCallback": recording_status_callback, "RecordingStatusCallbackMethod": recording_status_callback_method, @@ -1272,17 +1247,6 @@ async def get_page_async(self, target_url: str) -> CallPage: response = await self._version.domain.twilio.request_async("GET", target_url) return CallPage(self._version, response, self._solution) - @property - def feedback_summaries(self) -> FeedbackSummaryList: - """ - Access the feedback_summaries - """ - if self._feedback_summaries is None: - self._feedback_summaries = FeedbackSummaryList( - self._version, account_sid=self._solution["account_sid"] - ) - return self._feedback_summaries - def get(self, sid: str) -> CallContext: """ Constructs a CallContext diff --git a/twilio/rest/api/v2010/account/call/feedback.py b/twilio/rest/api/v2010/account/call/feedback.py deleted file mode 100644 index 210a529ac2..0000000000 --- a/twilio/rest/api/v2010/account/call/feedback.py +++ /dev/null @@ -1,333 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Api - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class FeedbackInstance(InstanceResource): - - class Issues(object): - AUDIO_LATENCY = "audio-latency" - DIGITS_NOT_CAPTURED = "digits-not-captured" - DROPPED_CALL = "dropped-call" - IMPERFECT_AUDIO = "imperfect-audio" - INCORRECT_CALLER_ID = "incorrect-caller-id" - ONE_WAY_AUDIO = "one-way-audio" - POST_DIAL_DELAY = "post-dial-delay" - UNSOLICITED_CALL = "unsolicited-call" - - """ - :ivar account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - :ivar date_created: The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - :ivar date_updated: The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - :ivar issues: A list of issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - :ivar quality_score: `1` to `5` quality score where `1` represents imperfect experience and `5` represents a perfect call. - :ivar sid: A 34 character string that uniquely identifies this resource. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], account_sid: str, call_sid: str - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.rfc2822_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( - payload.get("date_updated") - ) - self.issues: Optional[List["FeedbackInstance.Issues"]] = payload.get("issues") - self.quality_score: Optional[int] = deserialize.integer( - payload.get("quality_score") - ) - self.sid: Optional[str] = payload.get("sid") - - self._solution = { - "account_sid": account_sid, - "call_sid": call_sid, - } - self._context: Optional[FeedbackContext] = None - - @property - def _proxy(self) -> "FeedbackContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FeedbackContext for this FeedbackInstance - """ - if self._context is None: - self._context = FeedbackContext( - self._version, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - return self._context - - def fetch(self) -> "FeedbackInstance": - """ - Fetch the FeedbackInstance - - - :returns: The fetched FeedbackInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FeedbackInstance": - """ - Asynchronous coroutine to fetch the FeedbackInstance - - - :returns: The fetched FeedbackInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - quality_score: Union[int, object] = values.unset, - issue: Union[List["FeedbackInstance.Issues"], object] = values.unset, - ) -> "FeedbackInstance": - """ - Update the FeedbackInstance - - :param quality_score: The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - :param issue: One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - - :returns: The updated FeedbackInstance - """ - return self._proxy.update( - quality_score=quality_score, - issue=issue, - ) - - async def update_async( - self, - quality_score: Union[int, object] = values.unset, - issue: Union[List["FeedbackInstance.Issues"], object] = values.unset, - ) -> "FeedbackInstance": - """ - Asynchronous coroutine to update the FeedbackInstance - - :param quality_score: The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - :param issue: One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - - :returns: The updated FeedbackInstance - """ - return await self._proxy.update_async( - quality_score=quality_score, - issue=issue, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FeedbackContext(InstanceContext): - - def __init__(self, version: Version, account_sid: str, call_sid: str): - """ - Initialize the FeedbackContext - - :param version: Version that contains the resource - :param account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - :param call_sid: The call sid that uniquely identifies the call - """ - super().__init__(version) - - # Path Solution - self._solution = { - "account_sid": account_sid, - "call_sid": call_sid, - } - self._uri = "/Accounts/{account_sid}/Calls/{call_sid}/Feedback.json".format( - **self._solution - ) - - def fetch(self) -> FeedbackInstance: - """ - Fetch the FeedbackInstance - - - :returns: The fetched FeedbackInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FeedbackInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - async def fetch_async(self) -> FeedbackInstance: - """ - Asynchronous coroutine to fetch the FeedbackInstance - - - :returns: The fetched FeedbackInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FeedbackInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - def update( - self, - quality_score: Union[int, object] = values.unset, - issue: Union[List["FeedbackInstance.Issues"], object] = values.unset, - ) -> FeedbackInstance: - """ - Update the FeedbackInstance - - :param quality_score: The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - :param issue: One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - - :returns: The updated FeedbackInstance - """ - data = values.of( - { - "QualityScore": quality_score, - "Issue": serialize.map(issue, lambda e: e), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return FeedbackInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - async def update_async( - self, - quality_score: Union[int, object] = values.unset, - issue: Union[List["FeedbackInstance.Issues"], object] = values.unset, - ) -> FeedbackInstance: - """ - Asynchronous coroutine to update the FeedbackInstance - - :param quality_score: The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. - :param issue: One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. - - :returns: The updated FeedbackInstance - """ - data = values.of( - { - "QualityScore": quality_score, - "Issue": serialize.map(issue, lambda e: e), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FeedbackInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FeedbackList(ListResource): - - def __init__(self, version: Version, account_sid: str, call_sid: str): - """ - Initialize the FeedbackList - - :param version: Version that contains the resource - :param account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - :param call_sid: The call sid that uniquely identifies the call - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "account_sid": account_sid, - "call_sid": call_sid, - } - - def get(self) -> FeedbackContext: - """ - Constructs a FeedbackContext - - """ - return FeedbackContext( - self._version, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - def __call__(self) -> FeedbackContext: - """ - Constructs a FeedbackContext - - """ - return FeedbackContext( - self._version, - account_sid=self._solution["account_sid"], - call_sid=self._solution["call_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/api/v2010/account/call/feedback_summary.py b/twilio/rest/api/v2010/account/call/feedback_summary.py deleted file mode 100644 index 2f26b0b0a4..0000000000 --- a/twilio/rest/api/v2010/account/call/feedback_summary.py +++ /dev/null @@ -1,378 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Api - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import date, datetime -from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class FeedbackSummaryInstance(InstanceResource): - - class Status(object): - QUEUED = "queued" - IN_PROGRESS = "in-progress" - COMPLETED = "completed" - FAILED = "failed" - - """ - :ivar account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - :ivar call_count: The total number of calls. - :ivar call_feedback_count: The total number of calls with a feedback entry. - :ivar date_created: The date that this resource was created, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - :ivar date_updated: The date that this resource was last updated, given in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. - :ivar end_date: The last date for which feedback entries are included in this Feedback Summary, formatted as `YYYY-MM-DD` and specified in UTC. - :ivar include_subaccounts: Whether the feedback summary includes subaccounts; `true` if it does, otherwise `false`. - :ivar issues: A list of issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, or `one-way-audio`. - :ivar quality_score_average: The average QualityScore of the feedback entries. - :ivar quality_score_median: The median QualityScore of the feedback entries. - :ivar quality_score_standard_deviation: The standard deviation of the quality scores. - :ivar sid: A 34 character string that uniquely identifies this resource. - :ivar start_date: The first date for which feedback entries are included in this feedback summary, formatted as `YYYY-MM-DD` and specified in UTC. - :ivar status: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - account_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.call_count: Optional[int] = deserialize.integer(payload.get("call_count")) - self.call_feedback_count: Optional[int] = deserialize.integer( - payload.get("call_feedback_count") - ) - self.date_created: Optional[datetime] = deserialize.rfc2822_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( - payload.get("date_updated") - ) - self.end_date: Optional[date] = deserialize.iso8601_date( - payload.get("end_date") - ) - self.include_subaccounts: Optional[bool] = payload.get("include_subaccounts") - self.issues: Optional[List[Dict[str, object]]] = payload.get("issues") - self.quality_score_average: Optional[float] = deserialize.decimal( - payload.get("quality_score_average") - ) - self.quality_score_median: Optional[float] = deserialize.decimal( - payload.get("quality_score_median") - ) - self.quality_score_standard_deviation: Optional[float] = deserialize.decimal( - payload.get("quality_score_standard_deviation") - ) - self.sid: Optional[str] = payload.get("sid") - self.start_date: Optional[date] = deserialize.iso8601_date( - payload.get("start_date") - ) - self.status: Optional["FeedbackSummaryInstance.Status"] = payload.get("status") - - self._solution = { - "account_sid": account_sid, - "sid": sid or self.sid, - } - self._context: Optional[FeedbackSummaryContext] = None - - @property - def _proxy(self) -> "FeedbackSummaryContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FeedbackSummaryContext for this FeedbackSummaryInstance - """ - if self._context is None: - self._context = FeedbackSummaryContext( - self._version, - account_sid=self._solution["account_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FeedbackSummaryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FeedbackSummaryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FeedbackSummaryInstance": - """ - Fetch the FeedbackSummaryInstance - - - :returns: The fetched FeedbackSummaryInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FeedbackSummaryInstance": - """ - Asynchronous coroutine to fetch the FeedbackSummaryInstance - - - :returns: The fetched FeedbackSummaryInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FeedbackSummaryContext(InstanceContext): - - def __init__(self, version: Version, account_sid: str, sid: str): - """ - Initialize the FeedbackSummaryContext - - :param version: Version that contains the resource - :param account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - :param sid: A 34 character string that uniquely identifies this resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "account_sid": account_sid, - "sid": sid, - } - self._uri = "/Accounts/{account_sid}/Calls/FeedbackSummary/{sid}.json".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the FeedbackSummaryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FeedbackSummaryInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FeedbackSummaryInstance: - """ - Fetch the FeedbackSummaryInstance - - - :returns: The fetched FeedbackSummaryInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FeedbackSummaryInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FeedbackSummaryInstance: - """ - Asynchronous coroutine to fetch the FeedbackSummaryInstance - - - :returns: The fetched FeedbackSummaryInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FeedbackSummaryInstance( - self._version, - payload, - account_sid=self._solution["account_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FeedbackSummaryList(ListResource): - - def __init__(self, version: Version, account_sid: str): - """ - Initialize the FeedbackSummaryList - - :param version: Version that contains the resource - :param account_sid: The unique id of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this resource. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "account_sid": account_sid, - } - self._uri = "/Accounts/{account_sid}/Calls/FeedbackSummary.json".format( - **self._solution - ) - - def create( - self, - start_date: date, - end_date: date, - include_subaccounts: Union[bool, object] = values.unset, - status_callback: Union[str, object] = values.unset, - status_callback_method: Union[str, object] = values.unset, - ) -> FeedbackSummaryInstance: - """ - Create the FeedbackSummaryInstance - - :param start_date: Only include feedback given on or after this date. Format is `YYYY-MM-DD` and specified in UTC. - :param end_date: Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. - :param include_subaccounts: Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. - :param status_callback: The URL that we will request when the feedback summary is complete. - :param status_callback_method: The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. - - :returns: The created FeedbackSummaryInstance - """ - - data = values.of( - { - "StartDate": serialize.iso8601_date(start_date), - "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, - "StatusCallback": status_callback, - "StatusCallbackMethod": status_callback_method, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return FeedbackSummaryInstance( - self._version, payload, account_sid=self._solution["account_sid"] - ) - - async def create_async( - self, - start_date: date, - end_date: date, - include_subaccounts: Union[bool, object] = values.unset, - status_callback: Union[str, object] = values.unset, - status_callback_method: Union[str, object] = values.unset, - ) -> FeedbackSummaryInstance: - """ - Asynchronously create the FeedbackSummaryInstance - - :param start_date: Only include feedback given on or after this date. Format is `YYYY-MM-DD` and specified in UTC. - :param end_date: Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. - :param include_subaccounts: Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. - :param status_callback: The URL that we will request when the feedback summary is complete. - :param status_callback_method: The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. - - :returns: The created FeedbackSummaryInstance - """ - - data = values.of( - { - "StartDate": serialize.iso8601_date(start_date), - "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, - "StatusCallback": status_callback, - "StatusCallbackMethod": status_callback_method, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FeedbackSummaryInstance( - self._version, payload, account_sid=self._solution["account_sid"] - ) - - def get(self, sid: str) -> FeedbackSummaryContext: - """ - Constructs a FeedbackSummaryContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return FeedbackSummaryContext( - self._version, account_sid=self._solution["account_sid"], sid=sid - ) - - def __call__(self, sid: str) -> FeedbackSummaryContext: - """ - Constructs a FeedbackSummaryContext - - :param sid: A 34 character string that uniquely identifies this resource. - """ - return FeedbackSummaryContext( - self._version, account_sid=self._solution["account_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/api/v2010/account/call/payment.py b/twilio/rest/api/v2010/account/call/payment.py index 540baa8435..d6252f5277 100644 --- a/twilio/rest/api/v2010/account/call/payment.py +++ b/twilio/rest/api/v2010/account/call/payment.py @@ -354,8 +354,8 @@ def create( "Parameter": serialize.object(parameter), "PaymentConnector": payment_connector, "PaymentMethod": payment_method, - "PostalCode": postal_code, - "SecurityCode": security_code, + "PostalCode": serialize.boolean_to_string(postal_code), + "SecurityCode": serialize.boolean_to_string(security_code), "Timeout": timeout, "TokenType": token_type, "ValidCardTypes": valid_card_types, @@ -432,8 +432,8 @@ async def create_async( "Parameter": serialize.object(parameter), "PaymentConnector": payment_connector, "PaymentMethod": payment_method, - "PostalCode": postal_code, - "SecurityCode": security_code, + "PostalCode": serialize.boolean_to_string(postal_code), + "SecurityCode": serialize.boolean_to_string(security_code), "Timeout": timeout, "TokenType": token_type, "ValidCardTypes": valid_card_types, diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index 3759e4558d..1f3fffd8a4 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -374,17 +374,19 @@ def update( """ data = values.of( { - "Muted": muted, - "Hold": hold, + "Muted": serialize.boolean_to_string(muted), + "Hold": serialize.boolean_to_string(hold), "HoldUrl": hold_url, "HoldMethod": hold_method, "AnnounceUrl": announce_url, "AnnounceMethod": announce_method, "WaitUrl": wait_url, "WaitMethod": wait_method, - "BeepOnExit": beep_on_exit, - "EndConferenceOnExit": end_conference_on_exit, - "Coaching": coaching, + "BeepOnExit": serialize.boolean_to_string(beep_on_exit), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), + "Coaching": serialize.boolean_to_string(coaching), "CallSidToCoach": call_sid_to_coach, } ) @@ -438,17 +440,19 @@ async def update_async( """ data = values.of( { - "Muted": muted, - "Hold": hold, + "Muted": serialize.boolean_to_string(muted), + "Hold": serialize.boolean_to_string(hold), "HoldUrl": hold_url, "HoldMethod": hold_method, "AnnounceUrl": announce_url, "AnnounceMethod": announce_method, "WaitUrl": wait_url, "WaitMethod": wait_method, - "BeepOnExit": beep_on_exit, - "EndConferenceOnExit": end_conference_on_exit, - "Coaching": coaching, + "BeepOnExit": serialize.boolean_to_string(beep_on_exit), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), + "Coaching": serialize.boolean_to_string(coaching), "CallSidToCoach": call_sid_to_coach, } ) @@ -642,14 +646,18 @@ def create( ), "Label": label, "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceRecord": conference_record, "ConferenceTrim": conference_trim, @@ -672,7 +680,7 @@ def create( "ConferenceRecordingStatusCallbackEvent": serialize.map( conference_recording_status_callback_event, lambda e: e ), - "Coaching": coaching, + "Coaching": serialize.boolean_to_string(coaching), "CallSidToCoach": call_sid_to_coach, "JitterBufferSize": jitter_buffer_size, "Byoc": byoc, @@ -824,14 +832,18 @@ async def create_async( ), "Label": label, "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceRecord": conference_record, "ConferenceTrim": conference_trim, @@ -854,7 +866,7 @@ async def create_async( "ConferenceRecordingStatusCallbackEvent": serialize.map( conference_recording_status_callback_event, lambda e: e ), - "Coaching": coaching, + "Coaching": serialize.boolean_to_string(coaching), "CallSidToCoach": call_sid_to_coach, "JitterBufferSize": jitter_buffer_size, "Byoc": byoc, @@ -1048,9 +1060,9 @@ def page( """ data = values.of( { - "Muted": muted, - "Hold": hold, - "Coaching": coaching, + "Muted": serialize.boolean_to_string(muted), + "Hold": serialize.boolean_to_string(hold), + "Coaching": serialize.boolean_to_string(coaching), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -1084,9 +1096,9 @@ async def page_async( """ data = values.of( { - "Muted": muted, - "Hold": hold, - "Coaching": coaching, + "Muted": serialize.boolean_to_string(muted), + "Hold": serialize.boolean_to_string(hold), + "Coaching": serialize.boolean_to_string(coaching), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py index b1910d5bf6..6fa4748b60 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -553,7 +553,9 @@ def update( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -653,7 +655,9 @@ async def update_async( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -823,7 +827,9 @@ def create( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -924,7 +930,9 @@ async def create_async( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -1132,7 +1140,7 @@ def page( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, @@ -1171,7 +1179,7 @@ async def page_async( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/local.py b/twilio/rest/api/v2010/account/incoming_phone_number/local.py index 6f87f0e94c..4548720329 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/local.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/local.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -263,7 +263,9 @@ def create( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -359,7 +361,9 @@ async def create_async( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -565,7 +569,7 @@ def page( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, @@ -604,7 +608,7 @@ async def page_async( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py index 59fdda7a90..6147d4bfe7 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -265,7 +265,9 @@ def create( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -363,7 +365,9 @@ async def create_async( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -569,7 +573,7 @@ def page( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, @@ -608,7 +612,7 @@ async def page_async( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py index e6a197283a..806b7c0500 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -265,7 +265,9 @@ def create( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -363,7 +365,9 @@ async def create_async( "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "VoiceApplicationSid": voice_application_sid, - "VoiceCallerIdLookup": voice_caller_id_lookup, + "VoiceCallerIdLookup": serialize.boolean_to_string( + voice_caller_id_lookup + ), "VoiceFallbackMethod": voice_fallback_method, "VoiceFallbackUrl": voice_fallback_url, "VoiceMethod": voice_method, @@ -569,7 +573,7 @@ def page( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, @@ -608,7 +612,7 @@ async def page_async( """ data = values.of( { - "Beta": beta, + "Beta": serialize.boolean_to_string(beta), "FriendlyName": friendly_name, "PhoneNumber": phone_number, "Origin": origin, diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 8d8144d331..795ad19747 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -539,18 +539,18 @@ def create( "StatusCallback": status_callback, "ApplicationSid": application_sid, "MaxPrice": max_price, - "ProvideFeedback": provide_feedback, + "ProvideFeedback": serialize.boolean_to_string(provide_feedback), "Attempt": attempt, "ValidityPeriod": validity_period, - "ForceDelivery": force_delivery, + "ForceDelivery": serialize.boolean_to_string(force_delivery), "ContentRetention": content_retention, "AddressRetention": address_retention, - "SmartEncoded": smart_encoded, + "SmartEncoded": serialize.boolean_to_string(smart_encoded), "PersistentAction": serialize.map(persistent_action, lambda e: e), - "ShortenUrls": shorten_urls, + "ShortenUrls": serialize.boolean_to_string(shorten_urls), "ScheduleType": schedule_type, "SendAt": serialize.iso8601_datetime(send_at), - "SendAsMms": send_as_mms, + "SendAsMms": serialize.boolean_to_string(send_as_mms), "ContentVariables": content_variables, "RiskCheck": risk_check, "From": from_, @@ -637,18 +637,18 @@ async def create_async( "StatusCallback": status_callback, "ApplicationSid": application_sid, "MaxPrice": max_price, - "ProvideFeedback": provide_feedback, + "ProvideFeedback": serialize.boolean_to_string(provide_feedback), "Attempt": attempt, "ValidityPeriod": validity_period, - "ForceDelivery": force_delivery, + "ForceDelivery": serialize.boolean_to_string(force_delivery), "ContentRetention": content_retention, "AddressRetention": address_retention, - "SmartEncoded": smart_encoded, + "SmartEncoded": serialize.boolean_to_string(smart_encoded), "PersistentAction": serialize.map(persistent_action, lambda e: e), - "ShortenUrls": shorten_urls, + "ShortenUrls": serialize.boolean_to_string(shorten_urls), "ScheduleType": schedule_type, "SendAt": serialize.iso8601_datetime(send_at), - "SendAsMms": send_as_mms, + "SendAsMms": serialize.boolean_to_string(send_as_mms), "ContentVariables": content_variables, "RiskCheck": risk_check, "From": from_, diff --git a/twilio/rest/api/v2010/account/recording/__init__.py b/twilio/rest/api/v2010/account/recording/__init__.py index b6d7c98273..bc1ddccb76 100644 --- a/twilio/rest/api/v2010/account/recording/__init__.py +++ b/twilio/rest/api/v2010/account/recording/__init__.py @@ -258,7 +258,7 @@ def fetch( data = values.of( { - "IncludeSoftDeleted": include_soft_deleted, + "IncludeSoftDeleted": serialize.boolean_to_string(include_soft_deleted), } ) @@ -284,7 +284,7 @@ async def fetch_async( data = values.of( { - "IncludeSoftDeleted": include_soft_deleted, + "IncludeSoftDeleted": serialize.boolean_to_string(include_soft_deleted), } ) @@ -588,7 +588,7 @@ def page( "DateCreated>": serialize.iso8601_datetime(date_created_after), "CallSid": call_sid, "ConferenceSid": conference_sid, - "IncludeSoftDeleted": include_soft_deleted, + "IncludeSoftDeleted": serialize.boolean_to_string(include_soft_deleted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -633,7 +633,7 @@ async def page_async( "DateCreated>": serialize.iso8601_datetime(date_created_after), "CallSid": call_sid, "ConferenceSid": conference_sid, - "IncludeSoftDeleted": include_soft_deleted, + "IncludeSoftDeleted": serialize.boolean_to_string(include_soft_deleted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/sip/domain/__init__.py b/twilio/rest/api/v2010/account/sip/domain/__init__.py index f59a0c8a27..b469628388 100644 --- a/twilio/rest/api/v2010/account/sip/domain/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -423,10 +423,12 @@ def update( "VoiceStatusCallbackMethod": voice_status_callback_method, "VoiceStatusCallbackUrl": voice_status_callback_url, "VoiceUrl": voice_url, - "SipRegistration": sip_registration, + "SipRegistration": serialize.boolean_to_string(sip_registration), "DomainName": domain_name, - "EmergencyCallingEnabled": emergency_calling_enabled, - "Secure": secure, + "EmergencyCallingEnabled": serialize.boolean_to_string( + emergency_calling_enabled + ), + "Secure": serialize.boolean_to_string(secure), "ByocTrunkSid": byoc_trunk_sid, "EmergencyCallerSid": emergency_caller_sid, } @@ -489,10 +491,12 @@ async def update_async( "VoiceStatusCallbackMethod": voice_status_callback_method, "VoiceStatusCallbackUrl": voice_status_callback_url, "VoiceUrl": voice_url, - "SipRegistration": sip_registration, + "SipRegistration": serialize.boolean_to_string(sip_registration), "DomainName": domain_name, - "EmergencyCallingEnabled": emergency_calling_enabled, - "Secure": secure, + "EmergencyCallingEnabled": serialize.boolean_to_string( + emergency_calling_enabled + ), + "Secure": serialize.boolean_to_string(secure), "ByocTrunkSid": byoc_trunk_sid, "EmergencyCallerSid": emergency_caller_sid, } @@ -645,9 +649,11 @@ def create( "VoiceFallbackMethod": voice_fallback_method, "VoiceStatusCallbackUrl": voice_status_callback_url, "VoiceStatusCallbackMethod": voice_status_callback_method, - "SipRegistration": sip_registration, - "EmergencyCallingEnabled": emergency_calling_enabled, - "Secure": secure, + "SipRegistration": serialize.boolean_to_string(sip_registration), + "EmergencyCallingEnabled": serialize.boolean_to_string( + emergency_calling_enabled + ), + "Secure": serialize.boolean_to_string(secure), "ByocTrunkSid": byoc_trunk_sid, "EmergencyCallerSid": emergency_caller_sid, } @@ -709,9 +715,11 @@ async def create_async( "VoiceFallbackMethod": voice_fallback_method, "VoiceStatusCallbackUrl": voice_status_callback_url, "VoiceStatusCallbackMethod": voice_status_callback_method, - "SipRegistration": sip_registration, - "EmergencyCallingEnabled": emergency_calling_enabled, - "Secure": secure, + "SipRegistration": serialize.boolean_to_string(sip_registration), + "EmergencyCallingEnabled": serialize.boolean_to_string( + emergency_calling_enabled + ), + "Secure": serialize.boolean_to_string(secure), "ByocTrunkSid": byoc_trunk_sid, "EmergencyCallerSid": emergency_caller_sid, } diff --git a/twilio/rest/api/v2010/account/usage/record/__init__.py b/twilio/rest/api/v2010/account/usage/record/__init__.py index 8f8236fa23..0afc8e3472 100644 --- a/twilio/rest/api/v2010/account/usage/record/__init__.py +++ b/twilio/rest/api/v2010/account/usage/record/__init__.py @@ -646,7 +646,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -685,7 +685,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/all_time.py b/twilio/rest/api/v2010/account/usage/record/all_time.py index 5c424bbb80..7c0b6f5ce4 100644 --- a/twilio/rest/api/v2010/account/usage/record/all_time.py +++ b/twilio/rest/api/v2010/account/usage/record/all_time.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/daily.py b/twilio/rest/api/v2010/account/usage/record/daily.py index 6ce34da022..a0acd62b2a 100644 --- a/twilio/rest/api/v2010/account/usage/record/daily.py +++ b/twilio/rest/api/v2010/account/usage/record/daily.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/last_month.py b/twilio/rest/api/v2010/account/usage/record/last_month.py index 53b6deec6f..21fa1e1b61 100644 --- a/twilio/rest/api/v2010/account/usage/record/last_month.py +++ b/twilio/rest/api/v2010/account/usage/record/last_month.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/monthly.py b/twilio/rest/api/v2010/account/usage/record/monthly.py index baa1164a7d..0eff14396a 100644 --- a/twilio/rest/api/v2010/account/usage/record/monthly.py +++ b/twilio/rest/api/v2010/account/usage/record/monthly.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/this_month.py b/twilio/rest/api/v2010/account/usage/record/this_month.py index 5ce2ddc58a..646b4a49d5 100644 --- a/twilio/rest/api/v2010/account/usage/record/this_month.py +++ b/twilio/rest/api/v2010/account/usage/record/this_month.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/today.py b/twilio/rest/api/v2010/account/usage/record/today.py index cb814db819..30de9d4cb7 100644 --- a/twilio/rest/api/v2010/account/usage/record/today.py +++ b/twilio/rest/api/v2010/account/usage/record/today.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/yearly.py b/twilio/rest/api/v2010/account/usage/record/yearly.py index ac757b9eb7..fbe9dd1f6f 100644 --- a/twilio/rest/api/v2010/account/usage/record/yearly.py +++ b/twilio/rest/api/v2010/account/usage/record/yearly.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/usage/record/yesterday.py b/twilio/rest/api/v2010/account/usage/record/yesterday.py index ab262b7092..db5f9eb472 100644 --- a/twilio/rest/api/v2010/account/usage/record/yesterday.py +++ b/twilio/rest/api/v2010/account/usage/record/yesterday.py @@ -629,7 +629,7 @@ def page( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -668,7 +668,7 @@ async def page_async( "Category": category, "StartDate": serialize.iso8601_date(start_date), "EndDate": serialize.iso8601_date(end_date), - "IncludeSubaccounts": include_subaccounts, + "IncludeSubaccounts": serialize.boolean_to_string(include_subaccounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/bulkexports/v1/export_configuration.py b/twilio/rest/bulkexports/v1/export_configuration.py index 59aee93915..c6629d21cf 100644 --- a/twilio/rest/bulkexports/v1/export_configuration.py +++ b/twilio/rest/bulkexports/v1/export_configuration.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -205,7 +205,7 @@ def update( """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "WebhookUrl": webhook_url, "WebhookMethod": webhook_method, } @@ -238,7 +238,7 @@ async def update_async( """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "WebhookUrl": webhook_url, "WebhookMethod": webhook_method, } diff --git a/twilio/rest/chat/v1/credential.py b/twilio/rest/chat/v1/credential.py index 8b477b675d..68ec9f4b46 100644 --- a/twilio/rest/chat/v1/credential.py +++ b/twilio/rest/chat/v1/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -289,7 +289,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -329,7 +329,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -415,7 +415,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -459,7 +459,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/chat/v1/service/__init__.py b/twilio/rest/chat/v1/service/__init__.py index 2783da6a9a..1e2a5884a7 100644 --- a/twilio/rest/chat/v1/service/__init__.py +++ b/twilio/rest/chat/v1/service/__init__.py @@ -732,17 +732,27 @@ def update( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "PreWebhookUrl": pre_webhook_url, "PostWebhookUrl": post_webhook_url, @@ -916,17 +926,27 @@ async def update_async( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "PreWebhookUrl": pre_webhook_url, "PostWebhookUrl": post_webhook_url, diff --git a/twilio/rest/chat/v2/credential.py b/twilio/rest/chat/v2/credential.py index 564cd5159f..8011ed0e1f 100644 --- a/twilio/rest/chat/v2/credential.py +++ b/twilio/rest/chat/v2/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -289,7 +289,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -329,7 +329,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -415,7 +415,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -459,7 +459,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/chat/v2/service/__init__.py b/twilio/rest/chat/v2/service/__init__.py index 66dd200b41..f6fa9e2c49 100644 --- a/twilio/rest/chat/v2/service/__init__.py +++ b/twilio/rest/chat/v2/service/__init__.py @@ -571,21 +571,33 @@ def update( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, "Notifications.NewMessage.Sound": notifications_new_message_sound, - "Notifications.NewMessage.BadgeCountEnabled": notifications_new_message_badge_count_enabled, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + notifications_new_message_badge_count_enabled + ), + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, "Notifications.AddedToChannel.Sound": notifications_added_to_channel_sound, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, "Notifications.RemovedFromChannel.Sound": notifications_removed_from_channel_sound, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "Notifications.InvitedToChannel.Sound": notifications_invited_to_channel_sound, "PreWebhookUrl": pre_webhook_url, @@ -597,7 +609,9 @@ def update( "Media.CompatibilityMessage": media_compatibility_message, "PreWebhookRetryCount": pre_webhook_retry_count, "PostWebhookRetryCount": post_webhook_retry_count, - "Notifications.LogEnabled": notifications_log_enabled, + "Notifications.LogEnabled": serialize.boolean_to_string( + notifications_log_enabled + ), } ) @@ -688,21 +702,33 @@ async def update_async( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, "Notifications.NewMessage.Sound": notifications_new_message_sound, - "Notifications.NewMessage.BadgeCountEnabled": notifications_new_message_badge_count_enabled, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + notifications_new_message_badge_count_enabled + ), + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, "Notifications.AddedToChannel.Sound": notifications_added_to_channel_sound, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, "Notifications.RemovedFromChannel.Sound": notifications_removed_from_channel_sound, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "Notifications.InvitedToChannel.Sound": notifications_invited_to_channel_sound, "PreWebhookUrl": pre_webhook_url, @@ -714,7 +740,9 @@ async def update_async( "Media.CompatibilityMessage": media_compatibility_message, "PreWebhookRetryCount": pre_webhook_retry_count, "PostWebhookRetryCount": post_webhook_retry_count, - "Notifications.LogEnabled": notifications_log_enabled, + "Notifications.LogEnabled": serialize.boolean_to_string( + notifications_log_enabled + ), } ) diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index b057cb4f86..39496ace84 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -20,10 +20,27 @@ from twilio.base.list_resource import ListResource from twilio.base.version import Version from twilio.base.page import Page +from twilio.rest.content.v1.content.approval_create import ApprovalCreateList from twilio.rest.content.v1.content.approval_fetch import ApprovalFetchList class ContentInstance(InstanceResource): + + class AuthenticationActionType(object): + COPY_CODE = "COPY_CODE" + + class CallToActionActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + + class CardActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + QUICK_REPLY = "QUICK_REPLY" + + class QuickReplyActionType(object): + QUICK_REPLY = "QUICK_REPLY" + """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -32,7 +49,7 @@ class ContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar url: The URL of the resource, relative to `https://content.twilio.com`. :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create """ @@ -113,6 +130,13 @@ async def fetch_async(self) -> "ContentInstance": """ return await self._proxy.fetch_async() + @property + def approval_create(self) -> ApprovalCreateList: + """ + Access the approval_create + """ + return self._proxy.approval_create + @property def approval_fetch(self) -> ApprovalFetchList: """ @@ -147,6 +171,7 @@ def __init__(self, version: Version, sid: str): } self._uri = "/Content/{sid}".format(**self._solution) + self._approval_create: Optional[ApprovalCreateList] = None self._approval_fetch: Optional[ApprovalFetchList] = None def delete(self) -> bool: @@ -211,6 +236,18 @@ async def fetch_async(self) -> ContentInstance: sid=self._solution["sid"], ) + @property + def approval_create(self) -> ApprovalCreateList: + """ + Access the approval_create + """ + if self._approval_create is None: + self._approval_create = ApprovalCreateList( + self._version, + self._solution["sid"], + ) + return self._approval_create + @property def approval_fetch(self) -> ApprovalFetchList: """ @@ -254,6 +291,388 @@ def __repr__(self) -> str: class ContentList(ListResource): + class AuthenticationAction(object): + """ + :ivar type: + :ivar copy_code_text: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.AuthenticationActionType"] = ( + payload.get("type") + ) + self.copy_code_text: Optional[str] = payload.get("copy_code_text") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "copy_code_text": self.copy_code_text, + } + + class CallToActionAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.CallToActionActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class CardAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.CardActionType"] = payload.get("type") + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class ContentCreateRequest(object): + """ + :ivar friendly_name: User defined name of the content + :ivar variables: Key value pairs of variable name to value + :ivar language: Language code for the content + :ivar types: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.variables: Optional[dict[str, str]] = payload.get("variables") + self.language: Optional[str] = payload.get("language") + self.types: Optional[ContentList.Types] = payload.get("types") + + def to_dict(self): + return { + "friendly_name": self.friendly_name, + "variables": self.variables, + "language": self.language, + "types": self.types.to_dict(), + } + + class ListItem(object): + """ + :ivar id: + :ivar item: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.id: Optional[str] = payload.get("id") + self.item: Optional[str] = payload.get("item") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "item": self.item, + "description": self.description, + } + + class QuickReplyAction(object): + """ + :ivar type: + :ivar title: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.QuickReplyActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "id": self.id, + } + + class TwilioCallToAction(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.CallToActionAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioCard(object): + """ + :ivar title: + :ivar subtitle: + :ivar media: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.title: Optional[str] = payload.get("title") + self.subtitle: Optional[str] = payload.get("subtitle") + self.media: Optional[List[str]] = payload.get("media") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "title": self.title, + "subtitle": self.subtitle, + "media": self.media, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioListPicker(object): + """ + :ivar body: + :ivar button: + :ivar items: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.button: Optional[str] = payload.get("button") + self.items: Optional[List[ContentList.ListItem]] = payload.get("items") + + def to_dict(self): + return { + "body": self.body, + "button": self.button, + "items": [items.to_dict() for items in self.items], + } + + class TwilioLocation(object): + """ + :ivar latitude: + :ivar longitude: + :ivar label: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.latitude: Optional[float] = payload.get("latitude") + self.longitude: Optional[float] = payload.get("longitude") + self.label: Optional[str] = payload.get("label") + + def to_dict(self): + return { + "latitude": self.latitude, + "longitude": self.longitude, + "label": self.label, + } + + class TwilioMedia(object): + """ + :ivar body: + :ivar media: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.media: Optional[List[str]] = payload.get("media") + + def to_dict(self): + return { + "body": self.body, + "media": self.media, + } + + class TwilioQuickReply(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.QuickReplyAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioText(object): + """ + :ivar body: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + + def to_dict(self): + return { + "body": self.body, + } + + class Types(object): + """ + :ivar twilio_text: + :ivar twilio_media: + :ivar twilio_location: + :ivar twilio_list_picker: + :ivar twilio_call_to_action: + :ivar twilio_quick_reply: + :ivar twilio_card: + :ivar whatsapp_card: + :ivar whatsapp_authentication: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.twilio_text: Optional[ContentList.TwilioText] = payload.get( + "twilio_text" + ) + self.twilio_media: Optional[ContentList.TwilioMedia] = payload.get( + "twilio_media" + ) + self.twilio_location: Optional[ContentList.TwilioLocation] = payload.get( + "twilio_location" + ) + self.twilio_list_picker: Optional[ContentList.TwilioListPicker] = ( + payload.get("twilio_list_picker") + ) + self.twilio_call_to_action: Optional[ContentList.TwilioCallToAction] = ( + payload.get("twilio_call_to_action") + ) + self.twilio_quick_reply: Optional[ContentList.TwilioQuickReply] = ( + payload.get("twilio_quick_reply") + ) + self.twilio_card: Optional[ContentList.TwilioCard] = payload.get( + "twilio_card" + ) + self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( + "whatsapp_card" + ) + self.whatsapp_authentication: Optional[ + ContentList.WhatsappAuthentication + ] = payload.get("whatsapp_authentication") + + def to_dict(self): + return { + "twilio_text": self.twilio_text.to_dict(), + "twilio_media": self.twilio_media.to_dict(), + "twilio_location": self.twilio_location.to_dict(), + "twilio_list_picker": self.twilio_list_picker.to_dict(), + "twilio_call_to_action": self.twilio_call_to_action.to_dict(), + "twilio_quick_reply": self.twilio_quick_reply.to_dict(), + "twilio_card": self.twilio_card.to_dict(), + "whatsapp_card": self.whatsapp_card.to_dict(), + "whatsapp_authentication": self.whatsapp_authentication.to_dict(), + } + + class WhatsappAuthentication(object): + """ + :ivar add_security_recommendation: + :ivar code_expiration_minutes: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.add_security_recommendation: Optional[bool] = payload.get( + "add_security_recommendation" + ) + self.code_expiration_minutes: Optional[float] = payload.get( + "code_expiration_minutes" + ) + self.actions: Optional[List[ContentList.AuthenticationAction]] = ( + payload.get("actions") + ) + + def to_dict(self): + return { + "add_security_recommendation": self.add_security_recommendation, + "code_expiration_minutes": self.code_expiration_minutes, + "actions": [actions.to_dict() for actions in self.actions], + } + + class WhatsappCard(object): + """ + :ivar body: + :ivar footer: + :ivar media: + :ivar header_text: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.footer: Optional[str] = payload.get("footer") + self.media: Optional[List[str]] = payload.get("media") + self.header_text: Optional[str] = payload.get("header_text") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "footer": self.footer, + "media": self.media, + "header_text": self.header_text, + "actions": [actions.to_dict() for actions in self.actions], + } + def __init__(self, version: Version): """ Initialize the ContentList @@ -265,6 +684,43 @@ def __init__(self, version: Version): self._uri = "/Content" + def create(self, content_create_request: ContentCreateRequest) -> ContentInstance: + """ + Create the ContentInstance + + :param content_create_request: + + :returns: The created ContentInstance + """ + data = content_create_request.to_dict() + + headers = {"Content-Type": "application/json"} + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ContentInstance(self._version, payload) + + async def create_async( + self, content_create_request: ContentCreateRequest + ) -> ContentInstance: + """ + Asynchronously create the ContentInstance + + :param content_create_request: + + :returns: The created ContentInstance + """ + + data = content_create_request.to_dict() + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ContentInstance(self._version, payload) + def stream( self, limit: Optional[int] = None, diff --git a/twilio/rest/content/v1/content_and_approvals.py b/twilio/rest/content/v1/content_and_approvals.py index e2d6d72aaf..de40cfc172 100644 --- a/twilio/rest/content/v1/content_and_approvals.py +++ b/twilio/rest/content/v1/content_and_approvals.py @@ -31,7 +31,7 @@ class ContentAndApprovalsInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar approval_requests: The submitted information and approval request status of the Content resource. """ diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index 3295eade6c..86cdb08066 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -340,7 +340,9 @@ def update( data = values.of( { "FriendlyName": friendly_name, - "AutoCreation.Enabled": auto_creation_enabled, + "AutoCreation.Enabled": serialize.boolean_to_string( + auto_creation_enabled + ), "AutoCreation.Type": auto_creation_type, "AutoCreation.ConversationServiceSid": auto_creation_conversation_service_sid, "AutoCreation.WebhookUrl": auto_creation_webhook_url, @@ -397,7 +399,9 @@ async def update_async( data = values.of( { "FriendlyName": friendly_name, - "AutoCreation.Enabled": auto_creation_enabled, + "AutoCreation.Enabled": serialize.boolean_to_string( + auto_creation_enabled + ), "AutoCreation.Type": auto_creation_type, "AutoCreation.ConversationServiceSid": auto_creation_conversation_service_sid, "AutoCreation.WebhookUrl": auto_creation_webhook_url, @@ -507,7 +511,9 @@ def create( "Type": type, "Address": address, "FriendlyName": friendly_name, - "AutoCreation.Enabled": auto_creation_enabled, + "AutoCreation.Enabled": serialize.boolean_to_string( + auto_creation_enabled + ), "AutoCreation.Type": auto_creation_type, "AutoCreation.ConversationServiceSid": auto_creation_conversation_service_sid, "AutoCreation.WebhookUrl": auto_creation_webhook_url, @@ -572,7 +578,9 @@ async def create_async( "Type": type, "Address": address, "FriendlyName": friendly_name, - "AutoCreation.Enabled": auto_creation_enabled, + "AutoCreation.Enabled": serialize.boolean_to_string( + auto_creation_enabled + ), "AutoCreation.Type": auto_creation_type, "AutoCreation.ConversationServiceSid": auto_creation_conversation_service_sid, "AutoCreation.WebhookUrl": auto_creation_webhook_url, diff --git a/twilio/rest/conversations/v1/credential.py b/twilio/rest/conversations/v1/credential.py index 92f26d1f0a..120710f7e8 100644 --- a/twilio/rest/conversations/v1/credential.py +++ b/twilio/rest/conversations/v1/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -298,7 +298,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -341,7 +341,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -427,7 +427,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -471,7 +471,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/conversations/v1/service/configuration/__init__.py b/twilio/rest/conversations/v1/service/configuration/__init__.py index 15de8dfda9..9ca23a435f 100644 --- a/twilio/rest/conversations/v1/service/configuration/__init__.py +++ b/twilio/rest/conversations/v1/service/configuration/__init__.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -230,7 +230,9 @@ def update( "DefaultConversationCreatorRoleSid": default_conversation_creator_role_sid, "DefaultConversationRoleSid": default_conversation_role_sid, "DefaultChatServiceRoleSid": default_chat_service_role_sid, - "ReachabilityEnabled": reachability_enabled, + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), } ) @@ -266,7 +268,9 @@ async def update_async( "DefaultConversationCreatorRoleSid": default_conversation_creator_role_sid, "DefaultConversationRoleSid": default_conversation_role_sid, "DefaultChatServiceRoleSid": default_chat_service_role_sid, - "ReachabilityEnabled": reachability_enabled, + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), } ) diff --git a/twilio/rest/conversations/v1/service/configuration/notification.py b/twilio/rest/conversations/v1/service/configuration/notification.py index 498478fdf7..2dee2d4d29 100644 --- a/twilio/rest/conversations/v1/service/configuration/notification.py +++ b/twilio/rest/conversations/v1/service/configuration/notification.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -292,18 +292,26 @@ def update( """ data = values.of( { - "LogEnabled": log_enabled, - "NewMessage.Enabled": new_message_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), + "NewMessage.Enabled": serialize.boolean_to_string(new_message_enabled), "NewMessage.Template": new_message_template, "NewMessage.Sound": new_message_sound, - "NewMessage.BadgeCountEnabled": new_message_badge_count_enabled, - "AddedToConversation.Enabled": added_to_conversation_enabled, + "NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + new_message_badge_count_enabled + ), + "AddedToConversation.Enabled": serialize.boolean_to_string( + added_to_conversation_enabled + ), "AddedToConversation.Template": added_to_conversation_template, "AddedToConversation.Sound": added_to_conversation_sound, - "RemovedFromConversation.Enabled": removed_from_conversation_enabled, + "RemovedFromConversation.Enabled": serialize.boolean_to_string( + removed_from_conversation_enabled + ), "RemovedFromConversation.Template": removed_from_conversation_template, "RemovedFromConversation.Sound": removed_from_conversation_sound, - "NewMessage.WithMedia.Enabled": new_message_with_media_enabled, + "NewMessage.WithMedia.Enabled": serialize.boolean_to_string( + new_message_with_media_enabled + ), "NewMessage.WithMedia.Template": new_message_with_media_template, } ) @@ -355,18 +363,26 @@ async def update_async( """ data = values.of( { - "LogEnabled": log_enabled, - "NewMessage.Enabled": new_message_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), + "NewMessage.Enabled": serialize.boolean_to_string(new_message_enabled), "NewMessage.Template": new_message_template, "NewMessage.Sound": new_message_sound, - "NewMessage.BadgeCountEnabled": new_message_badge_count_enabled, - "AddedToConversation.Enabled": added_to_conversation_enabled, + "NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + new_message_badge_count_enabled + ), + "AddedToConversation.Enabled": serialize.boolean_to_string( + added_to_conversation_enabled + ), "AddedToConversation.Template": added_to_conversation_template, "AddedToConversation.Sound": added_to_conversation_sound, - "RemovedFromConversation.Enabled": removed_from_conversation_enabled, + "RemovedFromConversation.Enabled": serialize.boolean_to_string( + removed_from_conversation_enabled + ), "RemovedFromConversation.Template": removed_from_conversation_template, "RemovedFromConversation.Sound": removed_from_conversation_sound, - "NewMessage.WithMedia.Enabled": new_message_with_media_enabled, + "NewMessage.WithMedia.Enabled": serialize.boolean_to_string( + new_message_with_media_enabled + ), "NewMessage.WithMedia.Template": new_message_with_media_template, } ) diff --git a/twilio/rest/events/v1/sink/__init__.py b/twilio/rest/events/v1/sink/__init__.py index 67688f296d..b09b5edec3 100644 --- a/twilio/rest/events/v1/sink/__init__.py +++ b/twilio/rest/events/v1/sink/__init__.py @@ -577,7 +577,7 @@ def page( """ data = values.of( { - "InUse": in_use, + "InUse": serialize.boolean_to_string(in_use), "Status": status, "PageToken": page_token, "Page": page_number, @@ -610,7 +610,7 @@ async def page_async( """ data = values.of( { - "InUse": in_use, + "InUse": serialize.boolean_to_string(in_use), "Status": status, "PageToken": page_token, "Page": page_number, diff --git a/twilio/rest/flex_api/v1/__init__.py b/twilio/rest/flex_api/v1/__init__.py index 7ee41b75f0..9ea1197724 100644 --- a/twilio/rest/flex_api/v1/__init__.py +++ b/twilio/rest/flex_api/v1/__init__.py @@ -22,12 +22,6 @@ from twilio.rest.flex_api.v1.insights_assessments_comment import ( InsightsAssessmentsCommentList, ) -from twilio.rest.flex_api.v1.insights_conversational_ai import ( - InsightsConversationalAiList, -) -from twilio.rest.flex_api.v1.insights_conversational_ai_report_insights import ( - InsightsConversationalAiReportInsightsList, -) from twilio.rest.flex_api.v1.insights_conversations import InsightsConversationsList from twilio.rest.flex_api.v1.insights_questionnaires import InsightsQuestionnairesList from twilio.rest.flex_api.v1.insights_questionnaires_category import ( @@ -66,10 +60,6 @@ def __init__(self, domain: Domain): self._insights_assessments_comment: Optional[InsightsAssessmentsCommentList] = ( None ) - self._insights_conversational_ai: Optional[InsightsConversationalAiList] = None - self._insights_conversational_ai_report_insights: Optional[ - InsightsConversationalAiReportInsightsList - ] = None self._insights_conversations: Optional[InsightsConversationsList] = None self._insights_questionnaires: Optional[InsightsQuestionnairesList] = None self._insights_questionnaires_category: Optional[ @@ -119,22 +109,6 @@ def insights_assessments_comment(self) -> InsightsAssessmentsCommentList: self._insights_assessments_comment = InsightsAssessmentsCommentList(self) return self._insights_assessments_comment - @property - def insights_conversational_ai(self) -> InsightsConversationalAiList: - if self._insights_conversational_ai is None: - self._insights_conversational_ai = InsightsConversationalAiList(self) - return self._insights_conversational_ai - - @property - def insights_conversational_ai_report_insights( - self, - ) -> InsightsConversationalAiReportInsightsList: - if self._insights_conversational_ai_report_insights is None: - self._insights_conversational_ai_report_insights = ( - InsightsConversationalAiReportInsightsList(self) - ) - return self._insights_conversational_ai_report_insights - @property def insights_conversations(self) -> InsightsConversationsList: if self._insights_conversations is None: diff --git a/twilio/rest/flex_api/v1/channel.py b/twilio/rest/flex_api/v1/channel.py index a2f1e1af0f..f362d5b01b 100644 --- a/twilio/rest/flex_api/v1/channel.py +++ b/twilio/rest/flex_api/v1/channel.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -280,7 +280,7 @@ def create( "PreEngagementData": pre_engagement_data, "TaskSid": task_sid, "TaskAttributes": task_attributes, - "LongLived": long_lived, + "LongLived": serialize.boolean_to_string(long_lived), } ) @@ -333,7 +333,7 @@ async def create_async( "PreEngagementData": pre_engagement_data, "TaskSid": task_sid, "TaskAttributes": task_attributes, - "LongLived": long_lived, + "LongLived": serialize.boolean_to_string(long_lived), } ) diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index b358081517..bec7034cfe 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -237,23 +237,33 @@ async def fetch_async( ui_version=ui_version, ) - def update(self) -> "ConfigurationInstance": + def update( + self, body: Union[object, object] = values.unset + ) -> "ConfigurationInstance": """ Update the ConfigurationInstance + :param body: :returns: The updated ConfigurationInstance """ - return self._proxy.update() + return self._proxy.update( + body=body, + ) - async def update_async(self) -> "ConfigurationInstance": + async def update_async( + self, body: Union[object, object] = values.unset + ) -> "ConfigurationInstance": """ Asynchronous coroutine to update the ConfigurationInstance + :param body: :returns: The updated ConfigurationInstance """ - return await self._proxy.update_async() + return await self._proxy.update_async( + body=body, + ) def __repr__(self) -> str: """ @@ -327,36 +337,48 @@ async def fetch_async( payload, ) - def update(self) -> ConfigurationInstance: + def update( + self, body: Union[object, object] = values.unset + ) -> ConfigurationInstance: """ Update the ConfigurationInstance + :param body: :returns: The updated ConfigurationInstance """ data = values.of({}) + headers = values.of( + { + "body": body, + } + ) payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConfigurationInstance(self._version, payload) - async def update_async(self) -> ConfigurationInstance: + async def update_async( + self, body: Union[object, object] = values.unset + ) -> ConfigurationInstance: """ Asynchronous coroutine to update the ConfigurationInstance + :param body: :returns: The updated ConfigurationInstance """ data = values.of({}) + headers = values.of( + { + "body": body, + } + ) payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConfigurationInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v1/flex_flow.py b/twilio/rest/flex_api/v1/flex_flow.py index 57c9a8f430..b11482937e 100644 --- a/twilio/rest/flex_api/v1/flex_flow.py +++ b/twilio/rest/flex_api/v1/flex_flow.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -408,7 +408,7 @@ def update( "ChatServiceSid": chat_service_sid, "ChannelType": channel_type, "ContactIdentity": contact_identity, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "IntegrationType": integration_type, "Integration.FlowSid": integration_flow_sid, "Integration.Url": integration_url, @@ -417,9 +417,11 @@ def update( "Integration.Channel": integration_channel, "Integration.Timeout": integration_timeout, "Integration.Priority": integration_priority, - "Integration.CreationOnMessage": integration_creation_on_message, - "LongLived": long_lived, - "JanitorEnabled": janitor_enabled, + "Integration.CreationOnMessage": serialize.boolean_to_string( + integration_creation_on_message + ), + "LongLived": serialize.boolean_to_string(long_lived), + "JanitorEnabled": serialize.boolean_to_string(janitor_enabled), "Integration.RetryCount": integration_retry_count, } ) @@ -483,7 +485,7 @@ async def update_async( "ChatServiceSid": chat_service_sid, "ChannelType": channel_type, "ContactIdentity": contact_identity, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "IntegrationType": integration_type, "Integration.FlowSid": integration_flow_sid, "Integration.Url": integration_url, @@ -492,9 +494,11 @@ async def update_async( "Integration.Channel": integration_channel, "Integration.Timeout": integration_timeout, "Integration.Priority": integration_priority, - "Integration.CreationOnMessage": integration_creation_on_message, - "LongLived": long_lived, - "JanitorEnabled": janitor_enabled, + "Integration.CreationOnMessage": serialize.boolean_to_string( + integration_creation_on_message + ), + "LongLived": serialize.boolean_to_string(long_lived), + "JanitorEnabled": serialize.boolean_to_string(janitor_enabled), "Integration.RetryCount": integration_retry_count, } ) @@ -601,7 +605,7 @@ def create( "ChatServiceSid": chat_service_sid, "ChannelType": channel_type, "ContactIdentity": contact_identity, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "IntegrationType": integration_type, "Integration.FlowSid": integration_flow_sid, "Integration.Url": integration_url, @@ -610,9 +614,11 @@ def create( "Integration.Channel": integration_channel, "Integration.Timeout": integration_timeout, "Integration.Priority": integration_priority, - "Integration.CreationOnMessage": integration_creation_on_message, - "LongLived": long_lived, - "JanitorEnabled": janitor_enabled, + "Integration.CreationOnMessage": serialize.boolean_to_string( + integration_creation_on_message + ), + "LongLived": serialize.boolean_to_string(long_lived), + "JanitorEnabled": serialize.boolean_to_string(janitor_enabled), "Integration.RetryCount": integration_retry_count, } ) @@ -677,7 +683,7 @@ async def create_async( "ChatServiceSid": chat_service_sid, "ChannelType": channel_type, "ContactIdentity": contact_identity, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "IntegrationType": integration_type, "Integration.FlowSid": integration_flow_sid, "Integration.Url": integration_url, @@ -686,9 +692,11 @@ async def create_async( "Integration.Channel": integration_channel, "Integration.Timeout": integration_timeout, "Integration.Priority": integration_priority, - "Integration.CreationOnMessage": integration_creation_on_message, - "LongLived": long_lived, - "JanitorEnabled": janitor_enabled, + "Integration.CreationOnMessage": serialize.boolean_to_string( + integration_creation_on_message + ), + "LongLived": serialize.boolean_to_string(long_lived), + "JanitorEnabled": serialize.boolean_to_string(janitor_enabled), "Integration.RetryCount": integration_retry_count, } ) diff --git a/twilio/rest/flex_api/v1/insights_conversational_ai.py b/twilio/rest/flex_api/v1/insights_conversational_ai.py deleted file mode 100644 index 0cce79ad9d..0000000000 --- a/twilio/rest/flex_api/v1/insights_conversational_ai.py +++ /dev/null @@ -1,295 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Flex - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class InsightsConversationalAiInstance(InstanceResource): - - class Granularity(object): - DAYS = "days" - WEEKS = "weeks" - MONTHS = "months" - QUARTERS = "quarters" - YEARS = "years" - - """ - :ivar instance_sid: Sid of Flex Service Instance - :ivar report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - :ivar granularity: - :ivar period_start: The start date from which report data is included - :ivar period_end: The end date till report data is included - :ivar updated: Updated time of the report - :ivar total_pages: Represents total number of pages fetched report has - :ivar page: Page offset required for pagination - :ivar rows: List of report breakdown - :ivar url: The URL of this resource. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - instance_sid: Optional[str] = None, - ): - super().__init__(version) - - self.instance_sid: Optional[str] = payload.get("instance_sid") - self.report_id: Optional[str] = payload.get("report_id") - self.granularity: Optional["InsightsConversationalAiInstance.Granularity"] = ( - payload.get("granularity") - ) - self.period_start: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("period_start") - ) - self.period_end: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("period_end") - ) - self.updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("updated") - ) - self.total_pages: Optional[int] = deserialize.integer( - payload.get("total_pages") - ) - self.page: Optional[int] = deserialize.integer(payload.get("page")) - self.rows: Optional[List[Dict[str, object]]] = payload.get("rows") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "instance_sid": instance_sid or self.instance_sid, - } - self._context: Optional[InsightsConversationalAiContext] = None - - @property - def _proxy(self) -> "InsightsConversationalAiContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: InsightsConversationalAiContext for this InsightsConversationalAiInstance - """ - if self._context is None: - self._context = InsightsConversationalAiContext( - self._version, - instance_sid=self._solution["instance_sid"], - ) - return self._context - - def fetch( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[ - "InsightsConversationalAiInstance.Granularity", object - ] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> "InsightsConversationalAiInstance": - """ - Fetch the InsightsConversationalAiInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiInstance - """ - return self._proxy.fetch( - max_rows=max_rows, - report_id=report_id, - granularity=granularity, - include_date=include_date, - ) - - async def fetch_async( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[ - "InsightsConversationalAiInstance.Granularity", object - ] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> "InsightsConversationalAiInstance": - """ - Asynchronous coroutine to fetch the InsightsConversationalAiInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiInstance - """ - return await self._proxy.fetch_async( - max_rows=max_rows, - report_id=report_id, - granularity=granularity, - include_date=include_date, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class InsightsConversationalAiContext(InstanceContext): - - def __init__(self, version: Version, instance_sid: str): - """ - Initialize the InsightsConversationalAiContext - - :param version: Version that contains the resource - :param instance_sid: Sid of Flex Service Instance - """ - super().__init__(version) - - # Path Solution - self._solution = { - "instance_sid": instance_sid, - } - self._uri = "/Insights/Instances/{instance_sid}/AI/Reports".format( - **self._solution - ) - - def fetch( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[ - "InsightsConversationalAiInstance.Granularity", object - ] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> InsightsConversationalAiInstance: - """ - Fetch the InsightsConversationalAiInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiInstance - """ - - data = values.of( - { - "MaxRows": max_rows, - "ReportId": report_id, - "Granularity": granularity, - "IncludeDate": serialize.iso8601_datetime(include_date), - } - ) - - payload = self._version.fetch(method="GET", uri=self._uri, params=data) - - return InsightsConversationalAiInstance( - self._version, - payload, - instance_sid=self._solution["instance_sid"], - ) - - async def fetch_async( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[ - "InsightsConversationalAiInstance.Granularity", object - ] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> InsightsConversationalAiInstance: - """ - Asynchronous coroutine to fetch the InsightsConversationalAiInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiInstance - """ - - data = values.of( - { - "MaxRows": max_rows, - "ReportId": report_id, - "Granularity": granularity, - "IncludeDate": serialize.iso8601_datetime(include_date), - } - ) - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data - ) - - return InsightsConversationalAiInstance( - self._version, - payload, - instance_sid=self._solution["instance_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class InsightsConversationalAiList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the InsightsConversationalAiList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - def get(self, instance_sid: str) -> InsightsConversationalAiContext: - """ - Constructs a InsightsConversationalAiContext - - :param instance_sid: Sid of Flex Service Instance - """ - return InsightsConversationalAiContext(self._version, instance_sid=instance_sid) - - def __call__(self, instance_sid: str) -> InsightsConversationalAiContext: - """ - Constructs a InsightsConversationalAiContext - - :param instance_sid: Sid of Flex Service Instance - """ - return InsightsConversationalAiContext(self._version, instance_sid=instance_sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py b/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py deleted file mode 100644 index 59ac5a04bf..0000000000 --- a/twilio/rest/flex_api/v1/insights_conversational_ai_report_insights.py +++ /dev/null @@ -1,279 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Flex - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class InsightsConversationalAiReportInsightsInstance(InstanceResource): - """ - :ivar instance_sid: The Instance SID of the instance for which report insights is fetched - :ivar report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - :ivar period_start: The start date from which report insights data is included - :ivar period_end: The end date till report insights data is included - :ivar updated: Updated time of the report insights - :ivar insights: List of report insights breakdown - :ivar url: The URL of this resource - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - instance_sid: Optional[str] = None, - ): - super().__init__(version) - - self.instance_sid: Optional[str] = payload.get("instance_sid") - self.report_id: Optional[str] = payload.get("report_id") - self.period_start: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("period_start") - ) - self.period_end: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("period_end") - ) - self.updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("updated") - ) - self.insights: Optional[List[Dict[str, object]]] = payload.get("insights") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "instance_sid": instance_sid or self.instance_sid, - } - self._context: Optional[InsightsConversationalAiReportInsightsContext] = None - - @property - def _proxy(self) -> "InsightsConversationalAiReportInsightsContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: InsightsConversationalAiReportInsightsContext for this InsightsConversationalAiReportInsightsInstance - """ - if self._context is None: - self._context = InsightsConversationalAiReportInsightsContext( - self._version, - instance_sid=self._solution["instance_sid"], - ) - return self._context - - def fetch( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[str, object] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> "InsightsConversationalAiReportInsightsInstance": - """ - Fetch the InsightsConversationalAiReportInsightsInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report insights is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiReportInsightsInstance - """ - return self._proxy.fetch( - max_rows=max_rows, - report_id=report_id, - granularity=granularity, - include_date=include_date, - ) - - async def fetch_async( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[str, object] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> "InsightsConversationalAiReportInsightsInstance": - """ - Asynchronous coroutine to fetch the InsightsConversationalAiReportInsightsInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report insights is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiReportInsightsInstance - """ - return await self._proxy.fetch_async( - max_rows=max_rows, - report_id=report_id, - granularity=granularity, - include_date=include_date, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format( - context - ) - - -class InsightsConversationalAiReportInsightsContext(InstanceContext): - - def __init__(self, version: Version, instance_sid: str): - """ - Initialize the InsightsConversationalAiReportInsightsContext - - :param version: Version that contains the resource - :param instance_sid: The Instance SID of the instance for which report insights will be fetched - """ - super().__init__(version) - - # Path Solution - self._solution = { - "instance_sid": instance_sid, - } - self._uri = "/Insights/Instances/{instance_sid}/AI/ReportInsights".format( - **self._solution - ) - - def fetch( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[str, object] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> InsightsConversationalAiReportInsightsInstance: - """ - Fetch the InsightsConversationalAiReportInsightsInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report insights is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiReportInsightsInstance - """ - - data = values.of( - { - "MaxRows": max_rows, - "ReportId": report_id, - "Granularity": granularity, - "IncludeDate": serialize.iso8601_datetime(include_date), - } - ) - - payload = self._version.fetch(method="GET", uri=self._uri, params=data) - - return InsightsConversationalAiReportInsightsInstance( - self._version, - payload, - instance_sid=self._solution["instance_sid"], - ) - - async def fetch_async( - self, - max_rows: Union[int, object] = values.unset, - report_id: Union[str, object] = values.unset, - granularity: Union[str, object] = values.unset, - include_date: Union[datetime, object] = values.unset, - ) -> InsightsConversationalAiReportInsightsInstance: - """ - Asynchronous coroutine to fetch the InsightsConversationalAiReportInsightsInstance - - :param max_rows: Maximum number of rows to return - :param report_id: The type of report insights required to fetch.Like gauge,channel-metrics,queue-metrics - :param granularity: The time period for which report insights is needed - :param include_date: A reference date that should be included in the returned period - - :returns: The fetched InsightsConversationalAiReportInsightsInstance - """ - - data = values.of( - { - "MaxRows": max_rows, - "ReportId": report_id, - "Granularity": granularity, - "IncludeDate": serialize.iso8601_datetime(include_date), - } - ) - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data - ) - - return InsightsConversationalAiReportInsightsInstance( - self._version, - payload, - instance_sid=self._solution["instance_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format( - context - ) - - -class InsightsConversationalAiReportInsightsList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the InsightsConversationalAiReportInsightsList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - def get(self, instance_sid: str) -> InsightsConversationalAiReportInsightsContext: - """ - Constructs a InsightsConversationalAiReportInsightsContext - - :param instance_sid: The Instance SID of the instance for which report insights will be fetched - """ - return InsightsConversationalAiReportInsightsContext( - self._version, instance_sid=instance_sid - ) - - def __call__( - self, instance_sid: str - ) -> InsightsConversationalAiReportInsightsContext: - """ - Constructs a InsightsConversationalAiReportInsightsContext - - :param instance_sid: The Instance SID of the instance for which report insights will be fetched - """ - return InsightsConversationalAiReportInsightsContext( - self._version, instance_sid=instance_sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/flex_api/v1/insights_questionnaires.py b/twilio/rest/flex_api/v1/insights_questionnaires.py index fe0338a9fe..807f129955 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires.py @@ -316,7 +316,7 @@ def update( """ data = values.of( { - "Active": active, + "Active": serialize.boolean_to_string(active), "Name": name, "Description": description, "QuestionSids": serialize.map(question_sids, lambda e: e), @@ -359,7 +359,7 @@ async def update_async( """ data = values.of( { - "Active": active, + "Active": serialize.boolean_to_string(active), "Name": name, "Description": description, "QuestionSids": serialize.map(question_sids, lambda e: e), @@ -447,7 +447,7 @@ def create( { "Name": name, "Description": description, - "Active": active, + "Active": serialize.boolean_to_string(active), "QuestionSids": serialize.map(question_sids, lambda e: e), } ) @@ -487,7 +487,7 @@ async def create_async( { "Name": name, "Description": description, - "Active": active, + "Active": serialize.boolean_to_string(active), "QuestionSids": serialize.map(question_sids, lambda e: e), } ) @@ -657,7 +657,7 @@ def page( data = values.of( { "Authorization": authorization, - "IncludeInactive": include_inactive, + "IncludeInactive": serialize.boolean_to_string(include_inactive), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -690,7 +690,7 @@ async def page_async( data = values.of( { "Authorization": authorization, - "IncludeInactive": include_inactive, + "IncludeInactive": serialize.boolean_to_string(include_inactive), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_question.py b/twilio/rest/flex_api/v1/insights_questionnaires_question.py index b796ff6afd..e4f2f4a4f0 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_question.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_question.py @@ -250,7 +250,7 @@ def update( """ data = values.of( { - "AllowNa": allow_na, + "AllowNa": serialize.boolean_to_string(allow_na), "CategorySid": category_sid, "Question": question, "Description": description, @@ -294,7 +294,7 @@ async def update_async( """ data = values.of( { - "AllowNa": allow_na, + "AllowNa": serialize.boolean_to_string(allow_na), "CategorySid": category_sid, "Question": question, "Description": description, @@ -388,7 +388,7 @@ def create( "CategorySid": category_sid, "Question": question, "AnswerSetId": answer_set_id, - "AllowNa": allow_na, + "AllowNa": serialize.boolean_to_string(allow_na), "Description": description, } ) @@ -431,7 +431,7 @@ async def create_async( "CategorySid": category_sid, "Question": question, "AnswerSetId": answer_set_id, - "AllowNa": allow_na, + "AllowNa": serialize.boolean_to_string(allow_na), "Description": description, } ) diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py index 649439ba2b..ba9f80f9a3 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py @@ -40,6 +40,7 @@ class Type(object): :ivar interaction_sid: The Interaction Sid for this channel. :ivar channel_sid: The Channel Sid for this Participant. :ivar url: + :ivar routing_properties: The Participant's routing properties. """ def __init__( @@ -59,6 +60,9 @@ def __init__( self.interaction_sid: Optional[str] = payload.get("interaction_sid") self.channel_sid: Optional[str] = payload.get("channel_sid") self.url: Optional[str] = payload.get("url") + self.routing_properties: Optional[Dict[str, object]] = payload.get( + "routing_properties" + ) self._solution = { "interaction_sid": interaction_sid, @@ -273,12 +277,14 @@ def create( self, type: "InteractionChannelParticipantInstance.Type", media_properties: object, + routing_properties: Union[object, object] = values.unset, ) -> InteractionChannelParticipantInstance: """ Create the InteractionChannelParticipantInstance :param type: :param media_properties: JSON representing the Media Properties for the new Participant. + :param routing_properties: Object representing the Routing Properties for the new Participant. :returns: The created InteractionChannelParticipantInstance """ @@ -287,6 +293,7 @@ def create( { "Type": type, "MediaProperties": serialize.object(media_properties), + "RoutingProperties": serialize.object(routing_properties), } ) @@ -307,12 +314,14 @@ async def create_async( self, type: "InteractionChannelParticipantInstance.Type", media_properties: object, + routing_properties: Union[object, object] = values.unset, ) -> InteractionChannelParticipantInstance: """ Asynchronously create the InteractionChannelParticipantInstance :param type: :param media_properties: JSON representing the Media Properties for the new Participant. + :param routing_properties: Object representing the Routing Properties for the new Participant. :returns: The created InteractionChannelParticipantInstance """ @@ -321,6 +330,7 @@ async def create_async( { "Type": type, "MediaProperties": serialize.object(media_properties), + "RoutingProperties": serialize.object(routing_properties), } ) diff --git a/twilio/rest/frontline_api/v1/user.py b/twilio/rest/frontline_api/v1/user.py index b14fbd0989..8c9dd93853 100644 --- a/twilio/rest/frontline_api/v1/user.py +++ b/twilio/rest/frontline_api/v1/user.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -222,7 +222,7 @@ def update( "FriendlyName": friendly_name, "Avatar": avatar, "State": state, - "IsAvailable": is_available, + "IsAvailable": serialize.boolean_to_string(is_available), } ) @@ -256,7 +256,7 @@ async def update_async( "FriendlyName": friendly_name, "Avatar": avatar, "State": state, - "IsAvailable": is_available, + "IsAvailable": serialize.boolean_to_string(is_available), } ) diff --git a/twilio/rest/insights/v1/call/annotation.py b/twilio/rest/insights/v1/call/annotation.py index 0d3f7bb4f4..d560003c0a 100644 --- a/twilio/rest/insights/v1/call/annotation.py +++ b/twilio/rest/insights/v1/call/annotation.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -269,7 +269,7 @@ def update( "AnsweredBy": answered_by, "ConnectivityIssue": connectivity_issue, "QualityIssues": quality_issues, - "Spam": spam, + "Spam": serialize.boolean_to_string(spam), "CallScore": call_score, "Comment": comment, "Incident": incident, @@ -316,7 +316,7 @@ async def update_async( "AnsweredBy": answered_by, "ConnectivityIssue": connectivity_issue, "QualityIssues": quality_issues, - "Spam": spam, + "Spam": serialize.boolean_to_string(spam), "CallScore": call_score, "Comment": comment, "Incident": incident, diff --git a/twilio/rest/insights/v1/call_summaries.py b/twilio/rest/insights/v1/call_summaries.py index 78cd5b506e..f68744eefc 100644 --- a/twilio/rest/insights/v1/call_summaries.py +++ b/twilio/rest/insights/v1/call_summaries.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -651,9 +651,9 @@ def page( "ToCarrier": to_carrier, "FromCountryCode": from_country_code, "ToCountryCode": to_country_code, - "Branded": branded, - "VerifiedCaller": verified_caller, - "HasTag": has_tag, + "Branded": serialize.boolean_to_string(branded), + "VerifiedCaller": serialize.boolean_to_string(verified_caller), + "HasTag": serialize.boolean_to_string(has_tag), "StartTime": start_time, "EndTime": end_time, "CallType": call_type, @@ -662,12 +662,12 @@ def page( "ProcessingState": processing_state, "SortBy": sort_by, "Subaccount": subaccount, - "AbnormalSession": abnormal_session, + "AbnormalSession": serialize.boolean_to_string(abnormal_session), "AnsweredBy": answered_by, "AnsweredByAnnotation": answered_by_annotation, "ConnectivityIssueAnnotation": connectivity_issue_annotation, "QualityIssueAnnotation": quality_issue_annotation, - "SpamAnnotation": spam_annotation, + "SpamAnnotation": serialize.boolean_to_string(spam_annotation), "CallScoreAnnotation": call_score_annotation, "PageToken": page_token, "Page": page_number, @@ -752,9 +752,9 @@ async def page_async( "ToCarrier": to_carrier, "FromCountryCode": from_country_code, "ToCountryCode": to_country_code, - "Branded": branded, - "VerifiedCaller": verified_caller, - "HasTag": has_tag, + "Branded": serialize.boolean_to_string(branded), + "VerifiedCaller": serialize.boolean_to_string(verified_caller), + "HasTag": serialize.boolean_to_string(has_tag), "StartTime": start_time, "EndTime": end_time, "CallType": call_type, @@ -763,12 +763,12 @@ async def page_async( "ProcessingState": processing_state, "SortBy": sort_by, "Subaccount": subaccount, - "AbnormalSession": abnormal_session, + "AbnormalSession": serialize.boolean_to_string(abnormal_session), "AnsweredBy": answered_by, "AnsweredByAnnotation": answered_by_annotation, "ConnectivityIssueAnnotation": connectivity_issue_annotation, "QualityIssueAnnotation": quality_issue_annotation, - "SpamAnnotation": spam_annotation, + "SpamAnnotation": serialize.boolean_to_string(spam_annotation), "CallScoreAnnotation": call_score_annotation, "PageToken": page_token, "Page": page_number, diff --git a/twilio/rest/insights/v1/setting.py b/twilio/rest/insights/v1/setting.py index f0bb5f60d8..c385fc424e 100644 --- a/twilio/rest/insights/v1/setting.py +++ b/twilio/rest/insights/v1/setting.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -211,8 +211,8 @@ def update( """ data = values.of( { - "AdvancedFeatures": advanced_features, - "VoiceTrace": voice_trace, + "AdvancedFeatures": serialize.boolean_to_string(advanced_features), + "VoiceTrace": serialize.boolean_to_string(voice_trace), "SubaccountSid": subaccount_sid, } ) @@ -242,8 +242,8 @@ async def update_async( """ data = values.of( { - "AdvancedFeatures": advanced_features, - "VoiceTrace": voice_trace, + "AdvancedFeatures": serialize.boolean_to_string(advanced_features), + "VoiceTrace": serialize.boolean_to_string(voice_trace), "SubaccountSid": subaccount_sid, } ) diff --git a/twilio/rest/intelligence/v2/service.py b/twilio/rest/intelligence/v2/service.py index 0761da5445..d983be5b2e 100644 --- a/twilio/rest/intelligence/v2/service.py +++ b/twilio/rest/intelligence/v2/service.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -334,13 +334,13 @@ def update( """ data = values.of( { - "AutoTranscribe": auto_transcribe, - "DataLogging": data_logging, + "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), + "DataLogging": serialize.boolean_to_string(data_logging), "FriendlyName": friendly_name, "LanguageCode": language_code, "UniqueName": unique_name, - "AutoRedaction": auto_redaction, - "MediaRedaction": media_redaction, + "AutoRedaction": serialize.boolean_to_string(auto_redaction), + "MediaRedaction": serialize.boolean_to_string(media_redaction), "WebhookUrl": webhook_url, "WebhookHttpMethod": webhook_http_method, } @@ -388,13 +388,13 @@ async def update_async( """ data = values.of( { - "AutoTranscribe": auto_transcribe, - "DataLogging": data_logging, + "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), + "DataLogging": serialize.boolean_to_string(data_logging), "FriendlyName": friendly_name, "LanguageCode": language_code, "UniqueName": unique_name, - "AutoRedaction": auto_redaction, - "MediaRedaction": media_redaction, + "AutoRedaction": serialize.boolean_to_string(auto_redaction), + "MediaRedaction": serialize.boolean_to_string(media_redaction), "WebhookUrl": webhook_url, "WebhookHttpMethod": webhook_http_method, } @@ -484,12 +484,12 @@ def create( data = values.of( { "UniqueName": unique_name, - "AutoTranscribe": auto_transcribe, - "DataLogging": data_logging, + "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), + "DataLogging": serialize.boolean_to_string(data_logging), "FriendlyName": friendly_name, "LanguageCode": language_code, - "AutoRedaction": auto_redaction, - "MediaRedaction": media_redaction, + "AutoRedaction": serialize.boolean_to_string(auto_redaction), + "MediaRedaction": serialize.boolean_to_string(media_redaction), "WebhookUrl": webhook_url, "WebhookHttpMethod": webhook_http_method, } @@ -534,12 +534,12 @@ async def create_async( data = values.of( { "UniqueName": unique_name, - "AutoTranscribe": auto_transcribe, - "DataLogging": data_logging, + "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), + "DataLogging": serialize.boolean_to_string(data_logging), "FriendlyName": friendly_name, "LanguageCode": language_code, - "AutoRedaction": auto_redaction, - "MediaRedaction": media_redaction, + "AutoRedaction": serialize.boolean_to_string(auto_redaction), + "MediaRedaction": serialize.boolean_to_string(media_redaction), "WebhookUrl": webhook_url, "WebhookHttpMethod": webhook_http_method, } diff --git a/twilio/rest/intelligence/v2/transcript/media.py b/twilio/rest/intelligence/v2/transcript/media.py index cb129b436a..74d3ab9959 100644 --- a/twilio/rest/intelligence/v2/transcript/media.py +++ b/twilio/rest/intelligence/v2/transcript/media.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -122,7 +122,7 @@ def fetch(self, redacted: Union[bool, object] = values.unset) -> MediaInstance: data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), } ) @@ -147,7 +147,7 @@ async def fetch_async( data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), } ) diff --git a/twilio/rest/intelligence/v2/transcript/operator_result.py b/twilio/rest/intelligence/v2/transcript/operator_result.py index 0865673329..9d1d614f4d 100644 --- a/twilio/rest/intelligence/v2/transcript/operator_result.py +++ b/twilio/rest/intelligence/v2/transcript/operator_result.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -183,7 +183,7 @@ def fetch( data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), } ) @@ -209,7 +209,7 @@ async def fetch_async( data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), } ) @@ -408,7 +408,7 @@ def page( """ data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -438,7 +438,7 @@ async def page_async( """ data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/intelligence/v2/transcript/sentence.py b/twilio/rest/intelligence/v2/transcript/sentence.py index f419135419..5bdd18b00f 100644 --- a/twilio/rest/intelligence/v2/transcript/sentence.py +++ b/twilio/rest/intelligence/v2/transcript/sentence.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -237,7 +237,7 @@ def page( """ data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -267,7 +267,7 @@ async def page_async( """ data = values.of( { - "Redacted": redacted, + "Redacted": serialize.boolean_to_string(redacted), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/ip_messaging/v1/credential.py b/twilio/rest/ip_messaging/v1/credential.py index 01423f4900..eac8e38cf5 100644 --- a/twilio/rest/ip_messaging/v1/credential.py +++ b/twilio/rest/ip_messaging/v1/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -289,7 +289,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -329,7 +329,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -415,7 +415,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -459,7 +459,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/ip_messaging/v1/service/__init__.py b/twilio/rest/ip_messaging/v1/service/__init__.py index 8e080657b5..ad4f002513 100644 --- a/twilio/rest/ip_messaging/v1/service/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/__init__.py @@ -732,17 +732,27 @@ def update( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "PreWebhookUrl": pre_webhook_url, "PostWebhookUrl": post_webhook_url, @@ -916,17 +926,27 @@ async def update_async( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "PreWebhookUrl": pre_webhook_url, "PostWebhookUrl": post_webhook_url, diff --git a/twilio/rest/ip_messaging/v2/credential.py b/twilio/rest/ip_messaging/v2/credential.py index f81892c742..beec9fbebe 100644 --- a/twilio/rest/ip_messaging/v2/credential.py +++ b/twilio/rest/ip_messaging/v2/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -289,7 +289,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -329,7 +329,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -415,7 +415,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -459,7 +459,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/ip_messaging/v2/service/__init__.py b/twilio/rest/ip_messaging/v2/service/__init__.py index 227789bab8..b107a11976 100644 --- a/twilio/rest/ip_messaging/v2/service/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/__init__.py @@ -571,21 +571,33 @@ def update( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, "Notifications.NewMessage.Sound": notifications_new_message_sound, - "Notifications.NewMessage.BadgeCountEnabled": notifications_new_message_badge_count_enabled, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + notifications_new_message_badge_count_enabled + ), + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, "Notifications.AddedToChannel.Sound": notifications_added_to_channel_sound, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, "Notifications.RemovedFromChannel.Sound": notifications_removed_from_channel_sound, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "Notifications.InvitedToChannel.Sound": notifications_invited_to_channel_sound, "PreWebhookUrl": pre_webhook_url, @@ -597,7 +609,9 @@ def update( "Media.CompatibilityMessage": media_compatibility_message, "PreWebhookRetryCount": pre_webhook_retry_count, "PostWebhookRetryCount": post_webhook_retry_count, - "Notifications.LogEnabled": notifications_log_enabled, + "Notifications.LogEnabled": serialize.boolean_to_string( + notifications_log_enabled + ), } ) @@ -688,21 +702,33 @@ async def update_async( "DefaultServiceRoleSid": default_service_role_sid, "DefaultChannelRoleSid": default_channel_role_sid, "DefaultChannelCreatorRoleSid": default_channel_creator_role_sid, - "ReadStatusEnabled": read_status_enabled, - "ReachabilityEnabled": reachability_enabled, + "ReadStatusEnabled": serialize.boolean_to_string(read_status_enabled), + "ReachabilityEnabled": serialize.boolean_to_string( + reachability_enabled + ), "TypingIndicatorTimeout": typing_indicator_timeout, "ConsumptionReportInterval": consumption_report_interval, - "Notifications.NewMessage.Enabled": notifications_new_message_enabled, + "Notifications.NewMessage.Enabled": serialize.boolean_to_string( + notifications_new_message_enabled + ), "Notifications.NewMessage.Template": notifications_new_message_template, "Notifications.NewMessage.Sound": notifications_new_message_sound, - "Notifications.NewMessage.BadgeCountEnabled": notifications_new_message_badge_count_enabled, - "Notifications.AddedToChannel.Enabled": notifications_added_to_channel_enabled, + "Notifications.NewMessage.BadgeCountEnabled": serialize.boolean_to_string( + notifications_new_message_badge_count_enabled + ), + "Notifications.AddedToChannel.Enabled": serialize.boolean_to_string( + notifications_added_to_channel_enabled + ), "Notifications.AddedToChannel.Template": notifications_added_to_channel_template, "Notifications.AddedToChannel.Sound": notifications_added_to_channel_sound, - "Notifications.RemovedFromChannel.Enabled": notifications_removed_from_channel_enabled, + "Notifications.RemovedFromChannel.Enabled": serialize.boolean_to_string( + notifications_removed_from_channel_enabled + ), "Notifications.RemovedFromChannel.Template": notifications_removed_from_channel_template, "Notifications.RemovedFromChannel.Sound": notifications_removed_from_channel_sound, - "Notifications.InvitedToChannel.Enabled": notifications_invited_to_channel_enabled, + "Notifications.InvitedToChannel.Enabled": serialize.boolean_to_string( + notifications_invited_to_channel_enabled + ), "Notifications.InvitedToChannel.Template": notifications_invited_to_channel_template, "Notifications.InvitedToChannel.Sound": notifications_invited_to_channel_sound, "PreWebhookUrl": pre_webhook_url, @@ -714,7 +740,9 @@ async def update_async( "Media.CompatibilityMessage": media_compatibility_message, "PreWebhookRetryCount": pre_webhook_retry_count, "PostWebhookRetryCount": post_webhook_retry_count, - "Notifications.LogEnabled": notifications_log_enabled, + "Notifications.LogEnabled": serialize.boolean_to_string( + notifications_log_enabled + ), } ) diff --git a/twilio/rest/lookups/v2/phone_number.py b/twilio/rest/lookups/v2/phone_number.py index 97ef39b940..57491aa0a9 100644 --- a/twilio/rest/lookups/v2/phone_number.py +++ b/twilio/rest/lookups/v2/phone_number.py @@ -40,7 +40,7 @@ class ValidationError(object): :ivar caller_name: An object that contains caller name information based on [CNAM](https://support.twilio.com/hc/en-us/articles/360051670533-Getting-Started-with-CNAM-Caller-ID). :ivar sim_swap: An object that contains information on the last date the subscriber identity module (SIM) was changed for a mobile phone number. :ivar call_forwarding: An object that contains information on the unconditional call forwarding status of mobile phone number. - :ivar live_activity: An object that contains live activity information for a mobile phone number. + :ivar line_status: An object that contains line status information for a mobile phone number. :ivar line_type_intelligence: An object that contains line type information including the carrier name, mobile country code, and mobile network code. :ivar identity_match: An object that contains identity match information. The result of comparing user-provided information including name, address, date of birth, national ID, against authoritative phone-based data sources :ivar reassigned_number: An object that contains reassigned number information. Reassigned Numbers will return a phone number's reassignment status given a phone number and date @@ -70,7 +70,7 @@ def __init__( self.call_forwarding: Optional[Dict[str, object]] = payload.get( "call_forwarding" ) - self.live_activity: Optional[Dict[str, object]] = payload.get("live_activity") + self.line_status: Optional[Dict[str, object]] = payload.get("line_status") self.line_type_intelligence: Optional[Dict[str, object]] = payload.get( "line_type_intelligence" ) @@ -125,7 +125,7 @@ def fetch( """ Fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -176,7 +176,7 @@ async def fetch_async( """ Asynchronous coroutine to fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -254,7 +254,7 @@ def fetch( """ Fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -316,7 +316,7 @@ async def fetch_async( """ Asynchronous coroutine to fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match, reassigned_number. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. diff --git a/twilio/rest/media/v1/player_streamer/__init__.py b/twilio/rest/media/v1/player_streamer/__init__.py index 6ea0889fc3..86832ba990 100644 --- a/twilio/rest/media/v1/player_streamer/__init__.py +++ b/twilio/rest/media/v1/player_streamer/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -349,7 +349,7 @@ def create( data = values.of( { - "Video": video, + "Video": serialize.boolean_to_string(video), "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "MaxDuration": max_duration, @@ -384,7 +384,7 @@ async def create_async( data = values.of( { - "Video": video, + "Video": serialize.boolean_to_string(video), "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "MaxDuration": max_duration, diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index 5c6dbc8246..e69e149239 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -382,8 +382,10 @@ def create( "CustomerProfileBundleSid": customer_profile_bundle_sid, "A2PProfileBundleSid": a2p_profile_bundle_sid, "BrandType": brand_type, - "Mock": mock, - "SkipAutomaticSecVet": skip_automatic_sec_vet, + "Mock": serialize.boolean_to_string(mock), + "SkipAutomaticSecVet": serialize.boolean_to_string( + skip_automatic_sec_vet + ), } ) @@ -420,8 +422,10 @@ async def create_async( "CustomerProfileBundleSid": customer_profile_bundle_sid, "A2PProfileBundleSid": a2p_profile_bundle_sid, "BrandType": brand_type, - "Mock": mock, - "SkipAutomaticSecVet": skip_automatic_sec_vet, + "Mock": serialize.boolean_to_string(mock), + "SkipAutomaticSecVet": serialize.boolean_to_string( + skip_automatic_sec_vet + ), } ) diff --git a/twilio/rest/messaging/v1/domain_config.py b/twilio/rest/messaging/v1/domain_config.py index 4889827a60..25d69342d0 100644 --- a/twilio/rest/messaging/v1/domain_config.py +++ b/twilio/rest/messaging/v1/domain_config.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, Optional, Union -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -230,8 +230,8 @@ def update( { "FallbackUrl": fallback_url, "CallbackUrl": callback_url, - "ContinueOnFailure": continue_on_failure, - "DisableHttps": disable_https, + "ContinueOnFailure": serialize.boolean_to_string(continue_on_failure), + "DisableHttps": serialize.boolean_to_string(disable_https), } ) @@ -266,8 +266,8 @@ async def update_async( { "FallbackUrl": fallback_url, "CallbackUrl": callback_url, - "ContinueOnFailure": continue_on_failure, - "DisableHttps": disable_https, + "ContinueOnFailure": serialize.boolean_to_string(continue_on_failure), + "DisableHttps": serialize.boolean_to_string(disable_https), } ) diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 3695b744f7..75c798f4c4 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -477,16 +477,22 @@ def update( "FallbackUrl": fallback_url, "FallbackMethod": fallback_method, "StatusCallback": status_callback, - "StickySender": sticky_sender, - "MmsConverter": mms_converter, - "SmartEncoding": smart_encoding, + "StickySender": serialize.boolean_to_string(sticky_sender), + "MmsConverter": serialize.boolean_to_string(mms_converter), + "SmartEncoding": serialize.boolean_to_string(smart_encoding), "ScanMessageContent": scan_message_content, - "FallbackToLongCode": fallback_to_long_code, - "AreaCodeGeomatch": area_code_geomatch, + "FallbackToLongCode": serialize.boolean_to_string( + fallback_to_long_code + ), + "AreaCodeGeomatch": serialize.boolean_to_string(area_code_geomatch), "ValidityPeriod": validity_period, - "SynchronousValidation": synchronous_validation, + "SynchronousValidation": serialize.boolean_to_string( + synchronous_validation + ), "Usecase": usecase, - "UseInboundWebhookOnNumber": use_inbound_webhook_on_number, + "UseInboundWebhookOnNumber": serialize.boolean_to_string( + use_inbound_webhook_on_number + ), } ) @@ -549,16 +555,22 @@ async def update_async( "FallbackUrl": fallback_url, "FallbackMethod": fallback_method, "StatusCallback": status_callback, - "StickySender": sticky_sender, - "MmsConverter": mms_converter, - "SmartEncoding": smart_encoding, + "StickySender": serialize.boolean_to_string(sticky_sender), + "MmsConverter": serialize.boolean_to_string(mms_converter), + "SmartEncoding": serialize.boolean_to_string(smart_encoding), "ScanMessageContent": scan_message_content, - "FallbackToLongCode": fallback_to_long_code, - "AreaCodeGeomatch": area_code_geomatch, + "FallbackToLongCode": serialize.boolean_to_string( + fallback_to_long_code + ), + "AreaCodeGeomatch": serialize.boolean_to_string(area_code_geomatch), "ValidityPeriod": validity_period, - "SynchronousValidation": synchronous_validation, + "SynchronousValidation": serialize.boolean_to_string( + synchronous_validation + ), "Usecase": usecase, - "UseInboundWebhookOnNumber": use_inbound_webhook_on_number, + "UseInboundWebhookOnNumber": serialize.boolean_to_string( + use_inbound_webhook_on_number + ), } ) @@ -736,16 +748,22 @@ def create( "FallbackUrl": fallback_url, "FallbackMethod": fallback_method, "StatusCallback": status_callback, - "StickySender": sticky_sender, - "MmsConverter": mms_converter, - "SmartEncoding": smart_encoding, + "StickySender": serialize.boolean_to_string(sticky_sender), + "MmsConverter": serialize.boolean_to_string(mms_converter), + "SmartEncoding": serialize.boolean_to_string(smart_encoding), "ScanMessageContent": scan_message_content, - "FallbackToLongCode": fallback_to_long_code, - "AreaCodeGeomatch": area_code_geomatch, + "FallbackToLongCode": serialize.boolean_to_string( + fallback_to_long_code + ), + "AreaCodeGeomatch": serialize.boolean_to_string(area_code_geomatch), "ValidityPeriod": validity_period, - "SynchronousValidation": synchronous_validation, + "SynchronousValidation": serialize.boolean_to_string( + synchronous_validation + ), "Usecase": usecase, - "UseInboundWebhookOnNumber": use_inbound_webhook_on_number, + "UseInboundWebhookOnNumber": serialize.boolean_to_string( + use_inbound_webhook_on_number + ), } ) @@ -809,16 +827,22 @@ async def create_async( "FallbackUrl": fallback_url, "FallbackMethod": fallback_method, "StatusCallback": status_callback, - "StickySender": sticky_sender, - "MmsConverter": mms_converter, - "SmartEncoding": smart_encoding, + "StickySender": serialize.boolean_to_string(sticky_sender), + "MmsConverter": serialize.boolean_to_string(mms_converter), + "SmartEncoding": serialize.boolean_to_string(smart_encoding), "ScanMessageContent": scan_message_content, - "FallbackToLongCode": fallback_to_long_code, - "AreaCodeGeomatch": area_code_geomatch, + "FallbackToLongCode": serialize.boolean_to_string( + fallback_to_long_code + ), + "AreaCodeGeomatch": serialize.boolean_to_string(area_code_geomatch), "ValidityPeriod": validity_period, - "SynchronousValidation": synchronous_validation, + "SynchronousValidation": serialize.boolean_to_string( + synchronous_validation + ), "Usecase": usecase, - "UseInboundWebhookOnNumber": use_inbound_webhook_on_number, + "UseInboundWebhookOnNumber": serialize.boolean_to_string( + use_inbound_webhook_on_number + ), } ) diff --git a/twilio/rest/messaging/v1/service/us_app_to_person.py b/twilio/rest/messaging/v1/service/us_app_to_person.py index cc23f0caf5..9034e4e2eb 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person.py @@ -346,13 +346,13 @@ def update( """ data = values.of( { - "HasEmbeddedLinks": has_embedded_links, - "HasEmbeddedPhone": has_embedded_phone, + "HasEmbeddedLinks": serialize.boolean_to_string(has_embedded_links), + "HasEmbeddedPhone": serialize.boolean_to_string(has_embedded_phone), "MessageSamples": serialize.map(message_samples, lambda e: e), "MessageFlow": message_flow, "Description": description, - "AgeGated": age_gated, - "DirectLending": direct_lending, + "AgeGated": serialize.boolean_to_string(age_gated), + "DirectLending": serialize.boolean_to_string(direct_lending), } ) @@ -394,13 +394,13 @@ async def update_async( """ data = values.of( { - "HasEmbeddedLinks": has_embedded_links, - "HasEmbeddedPhone": has_embedded_phone, + "HasEmbeddedLinks": serialize.boolean_to_string(has_embedded_links), + "HasEmbeddedPhone": serialize.boolean_to_string(has_embedded_phone), "MessageSamples": serialize.map(message_samples, lambda e: e), "MessageFlow": message_flow, "Description": description, - "AgeGated": age_gated, - "DirectLending": direct_lending, + "AgeGated": serialize.boolean_to_string(age_gated), + "DirectLending": serialize.boolean_to_string(direct_lending), } ) @@ -519,17 +519,17 @@ def create( "MessageFlow": message_flow, "MessageSamples": serialize.map(message_samples, lambda e: e), "UsAppToPersonUsecase": us_app_to_person_usecase, - "HasEmbeddedLinks": has_embedded_links, - "HasEmbeddedPhone": has_embedded_phone, + "HasEmbeddedLinks": serialize.boolean_to_string(has_embedded_links), + "HasEmbeddedPhone": serialize.boolean_to_string(has_embedded_phone), "OptInMessage": opt_in_message, "OptOutMessage": opt_out_message, "HelpMessage": help_message, "OptInKeywords": serialize.map(opt_in_keywords, lambda e: e), "OptOutKeywords": serialize.map(opt_out_keywords, lambda e: e), "HelpKeywords": serialize.map(help_keywords, lambda e: e), - "SubscriberOptIn": subscriber_opt_in, - "AgeGated": age_gated, - "DirectLending": direct_lending, + "SubscriberOptIn": serialize.boolean_to_string(subscriber_opt_in), + "AgeGated": serialize.boolean_to_string(age_gated), + "DirectLending": serialize.boolean_to_string(direct_lending), } ) @@ -594,17 +594,17 @@ async def create_async( "MessageFlow": message_flow, "MessageSamples": serialize.map(message_samples, lambda e: e), "UsAppToPersonUsecase": us_app_to_person_usecase, - "HasEmbeddedLinks": has_embedded_links, - "HasEmbeddedPhone": has_embedded_phone, + "HasEmbeddedLinks": serialize.boolean_to_string(has_embedded_links), + "HasEmbeddedPhone": serialize.boolean_to_string(has_embedded_phone), "OptInMessage": opt_in_message, "OptOutMessage": opt_out_message, "HelpMessage": help_message, "OptInKeywords": serialize.map(opt_in_keywords, lambda e: e), "OptOutKeywords": serialize.map(opt_out_keywords, lambda e: e), "HelpKeywords": serialize.map(help_keywords, lambda e: e), - "SubscriberOptIn": subscriber_opt_in, - "AgeGated": age_gated, - "DirectLending": direct_lending, + "SubscriberOptIn": serialize.boolean_to_string(subscriber_opt_in), + "AgeGated": serialize.boolean_to_string(age_gated), + "DirectLending": serialize.boolean_to_string(direct_lending), } ) diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index af57cfc5fc..e742c57191 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -56,7 +56,7 @@ class Status(object): :ivar business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. :ivar business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :ivar business_contact_email: The email address of the contact for the business or organization using the Tollfree number. - :ivar business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :ivar business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :ivar notification_email: The email address to receive the notification about the verification result. . :ivar use_case_categories: The category of the use case for the Tollfree Number. List as many are applicable.. :ivar use_case_summary: Use this to further explain how messaging is used by the business or organization. @@ -72,6 +72,7 @@ class Status(object): :ivar error_code: The error code given when a Tollfree Verification has been rejected. :ivar edit_expiration: The date and time when the ability to edit a rejected verification expires. :ivar edit_allowed: If a rejected verification is allowed to be edited/resubmitted. Some rejection reasons allow editing and some do not. + :ivar rejection_reasons: A list of rejection reasons and codes describing why a Tollfree Verification has been rejected. :ivar resource_links: The URLs of the documents associated with the Tollfree Verification resource. :ivar external_reference_id: An optional external reference ID supplied by customer and echoed back on status retrieval. """ @@ -147,6 +148,9 @@ def __init__( payload.get("edit_expiration") ) self.edit_allowed: Optional[bool] = payload.get("edit_allowed") + self.rejection_reasons: Optional[List[Dict[str, object]]] = payload.get( + "rejection_reasons" + ) self.resource_links: Optional[Dict[str, object]] = payload.get("resource_links") self.external_reference_id: Optional[str] = payload.get("external_reference_id") @@ -254,7 +258,7 @@ def update( :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. - :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance @@ -331,7 +335,7 @@ async def update_async( :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. - :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance @@ -497,7 +501,7 @@ def update( :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. - :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance @@ -586,7 +590,7 @@ async def update_async( :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. - :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param edit_reason: Describe why the verification is being edited. If the verification was rejected because of a technical issue, such as the website being down, and the issue has been resolved this parameter should be set to something similar to 'Website fixed'. :returns: The updated TollfreeVerificationInstance @@ -719,7 +723,7 @@ def create( :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. - :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param external_reference_id: An optional external reference ID supplied by customer and echoed back on status retrieval. :returns: The created TollfreeVerificationInstance @@ -811,7 +815,7 @@ async def create_async( :param business_contact_first_name: The first name of the contact for the business or organization using the Tollfree number. :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. - :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param business_contact_phone: The E.164 formatted phone number of the contact for the business or organization using the Tollfree number. :param external_reference_id: An optional external reference ID supplied by customer and echoed back on status retrieval. :returns: The created TollfreeVerificationInstance diff --git a/twilio/rest/microvisor/v1/device/__init__.py b/twilio/rest/microvisor/v1/device/__init__.py index 56904ee1f7..42a17340f6 100644 --- a/twilio/rest/microvisor/v1/device/__init__.py +++ b/twilio/rest/microvisor/v1/device/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -245,8 +245,8 @@ def update( { "UniqueName": unique_name, "TargetApp": target_app, - "LoggingEnabled": logging_enabled, - "RestartApp": restart_app, + "LoggingEnabled": serialize.boolean_to_string(logging_enabled), + "RestartApp": serialize.boolean_to_string(restart_app), } ) @@ -279,8 +279,8 @@ async def update_async( { "UniqueName": unique_name, "TargetApp": target_app, - "LoggingEnabled": logging_enabled, - "RestartApp": restart_app, + "LoggingEnabled": serialize.boolean_to_string(logging_enabled), + "RestartApp": serialize.boolean_to_string(restart_app), } ) diff --git a/twilio/rest/notify/v1/credential.py b/twilio/rest/notify/v1/credential.py index 3dd6380cee..5cb86363a3 100644 --- a/twilio/rest/notify/v1/credential.py +++ b/twilio/rest/notify/v1/credential.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -289,7 +289,7 @@ def update( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -329,7 +329,7 @@ async def update_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -415,7 +415,7 @@ def create( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } @@ -459,7 +459,7 @@ async def create_async( "FriendlyName": friendly_name, "Certificate": certificate, "PrivateKey": private_key, - "Sandbox": sandbox, + "Sandbox": serialize.boolean_to_string(sandbox), "ApiKey": api_key, "Secret": secret, } diff --git a/twilio/rest/notify/v1/service/__init__.py b/twilio/rest/notify/v1/service/__init__.py index 912d6ba9cd..0cd9adb685 100644 --- a/twilio/rest/notify/v1/service/__init__.py +++ b/twilio/rest/notify/v1/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -408,11 +408,13 @@ def update( "DefaultGcmNotificationProtocolVersion": default_gcm_notification_protocol_version, "FcmCredentialSid": fcm_credential_sid, "DefaultFcmNotificationProtocolVersion": default_fcm_notification_protocol_version, - "LogEnabled": log_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), "AlexaSkillId": alexa_skill_id, "DefaultAlexaNotificationProtocolVersion": default_alexa_notification_protocol_version, "DeliveryCallbackUrl": delivery_callback_url, - "DeliveryCallbackEnabled": delivery_callback_enabled, + "DeliveryCallbackEnabled": serialize.boolean_to_string( + delivery_callback_enabled + ), } ) @@ -472,11 +474,13 @@ async def update_async( "DefaultGcmNotificationProtocolVersion": default_gcm_notification_protocol_version, "FcmCredentialSid": fcm_credential_sid, "DefaultFcmNotificationProtocolVersion": default_fcm_notification_protocol_version, - "LogEnabled": log_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), "AlexaSkillId": alexa_skill_id, "DefaultAlexaNotificationProtocolVersion": default_alexa_notification_protocol_version, "DeliveryCallbackUrl": delivery_callback_url, - "DeliveryCallbackEnabled": delivery_callback_enabled, + "DeliveryCallbackEnabled": serialize.boolean_to_string( + delivery_callback_enabled + ), } ) @@ -603,11 +607,13 @@ def create( "DefaultGcmNotificationProtocolVersion": default_gcm_notification_protocol_version, "FcmCredentialSid": fcm_credential_sid, "DefaultFcmNotificationProtocolVersion": default_fcm_notification_protocol_version, - "LogEnabled": log_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), "AlexaSkillId": alexa_skill_id, "DefaultAlexaNotificationProtocolVersion": default_alexa_notification_protocol_version, "DeliveryCallbackUrl": delivery_callback_url, - "DeliveryCallbackEnabled": delivery_callback_enabled, + "DeliveryCallbackEnabled": serialize.boolean_to_string( + delivery_callback_enabled + ), } ) @@ -668,11 +674,13 @@ async def create_async( "DefaultGcmNotificationProtocolVersion": default_gcm_notification_protocol_version, "FcmCredentialSid": fcm_credential_sid, "DefaultFcmNotificationProtocolVersion": default_fcm_notification_protocol_version, - "LogEnabled": log_enabled, + "LogEnabled": serialize.boolean_to_string(log_enabled), "AlexaSkillId": alexa_skill_id, "DefaultAlexaNotificationProtocolVersion": default_alexa_notification_protocol_version, "DeliveryCallbackUrl": delivery_callback_url, - "DeliveryCallbackEnabled": delivery_callback_enabled, + "DeliveryCallbackEnabled": serialize.boolean_to_string( + delivery_callback_enabled + ), } ) diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index c13f42c796..3915116416 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -13,8 +13,8 @@ """ from datetime import datetime -from typing import Any, Dict, List, Optional -from twilio.base import deserialize +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -180,32 +180,41 @@ def __init__(self, version: Version): self._uri = "/HostedNumber/Eligibility/Bulk" - def create(self) -> BulkEligibilityInstance: + def create( + self, body: Union[object, object] = values.unset + ) -> BulkEligibilityInstance: """ Create the BulkEligibilityInstance + :param body: :returns: The created BulkEligibilityInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = self._version.create( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkEligibilityInstance(self._version, payload) - async def create_async(self) -> BulkEligibilityInstance: + async def create_async( + self, body: Union[object, object] = values.unset + ) -> BulkEligibilityInstance: """ Asynchronously create the BulkEligibilityInstance + :param body: :returns: The created BulkEligibilityInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkEligibilityInstance(self._version, payload) diff --git a/twilio/rest/numbers/v1/eligibility.py b/twilio/rest/numbers/v1/eligibility.py index 99461374ee..3b8b5be345 100644 --- a/twilio/rest/numbers/v1/eligibility.py +++ b/twilio/rest/numbers/v1/eligibility.py @@ -12,7 +12,8 @@ Do not edit the class manually. """ -from typing import Any, Dict, List, Optional +from typing import Any, Dict, List, Optional, Union +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -52,32 +53,39 @@ def __init__(self, version: Version): self._uri = "/HostedNumber/Eligibility" - def create(self) -> EligibilityInstance: + def create(self, body: Union[object, object] = values.unset) -> EligibilityInstance: """ Create the EligibilityInstance + :param body: :returns: The created EligibilityInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = self._version.create( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return EligibilityInstance(self._version, payload) - async def create_async(self) -> EligibilityInstance: + async def create_async( + self, body: Union[object, object] = values.unset + ) -> EligibilityInstance: """ Asynchronously create the EligibilityInstance + :param body: :returns: The created EligibilityInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return EligibilityInstance(self._version, payload) diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index ad3140a0b8..b0cd0fdfc1 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -12,7 +12,8 @@ Do not edit the class manually. """ -from typing import Any, Dict, Optional +from typing import Any, Dict, Optional, Union +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -54,32 +55,41 @@ def __init__(self, version: Version): self._uri = "/Porting/PortIn" - def create(self) -> PortingPortInInstance: + def create( + self, body: Union[object, object] = values.unset + ) -> PortingPortInInstance: """ Create the PortingPortInInstance + :param body: :returns: The created PortingPortInInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = self._version.create( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return PortingPortInInstance(self._version, payload) - async def create_async(self) -> PortingPortInInstance: + async def create_async( + self, body: Union[object, object] = values.unset + ) -> PortingPortInInstance: """ Asynchronously create the PortingPortInInstance + :param body: :returns: The created PortingPortInInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return PortingPortInInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index f7f6026c50..0e75a5067b 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -218,32 +218,41 @@ def __init__(self, version: Version): self._uri = "/HostedNumber/Orders/Bulk" - def create(self) -> BulkHostedNumberOrderInstance: + def create( + self, body: Union[object, object] = values.unset + ) -> BulkHostedNumberOrderInstance: """ Create the BulkHostedNumberOrderInstance + :param body: :returns: The created BulkHostedNumberOrderInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = self._version.create( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkHostedNumberOrderInstance(self._version, payload) - async def create_async(self) -> BulkHostedNumberOrderInstance: + async def create_async( + self, body: Union[object, object] = values.unset + ) -> BulkHostedNumberOrderInstance: """ Asynchronously create the BulkHostedNumberOrderInstance + :param body: :returns: The created BulkHostedNumberOrderInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkHostedNumberOrderInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index c20fc517c8..2063e7a87d 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -331,7 +331,7 @@ def create( "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "SmsFallbackMethod": sms_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, @@ -402,7 +402,7 @@ async def create_async( "SmsUrl": sms_url, "SmsMethod": sms_method, "SmsFallbackUrl": sms_fallback_url, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "SmsFallbackMethod": sms_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, @@ -615,7 +615,7 @@ def page( data = values.of( { "Status": status, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "PhoneNumber": phone_number, "IncomingPhoneNumberSid": incoming_phone_number_sid, "FriendlyName": friendly_name, @@ -657,7 +657,7 @@ async def page_async( data = values.of( { "Status": status, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "PhoneNumber": phone_number, "IncomingPhoneNumberSid": incoming_phone_number_sid, "FriendlyName": friendly_name, diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index 8215bb95b7..a76ceaf83a 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -823,7 +823,7 @@ def page( "RegulationSid": regulation_sid, "IsoCountry": iso_country, "NumberType": number_type, - "HasValidUntilDate": has_valid_until_date, + "HasValidUntilDate": serialize.boolean_to_string(has_valid_until_date), "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), @@ -877,7 +877,7 @@ async def page_async( "RegulationSid": regulation_sid, "IsoCountry": iso_country, "NumberType": number_type, - "HasValidUntilDate": has_valid_until_date, + "HasValidUntilDate": serialize.boolean_to_string(has_valid_until_date), "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), diff --git a/twilio/rest/preview/deployed_devices/fleet/device.py b/twilio/rest/preview/deployed_devices/fleet/device.py index 8f20074915..7e9b818140 100644 --- a/twilio/rest/preview/deployed_devices/fleet/device.py +++ b/twilio/rest/preview/deployed_devices/fleet/device.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -287,7 +287,7 @@ def update( "FriendlyName": friendly_name, "Identity": identity, "DeploymentSid": deployment_sid, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -326,7 +326,7 @@ async def update_async( "FriendlyName": friendly_name, "Identity": identity, "DeploymentSid": deployment_sid, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -418,7 +418,7 @@ def create( "FriendlyName": friendly_name, "Identity": identity, "DeploymentSid": deployment_sid, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -458,7 +458,7 @@ async def create_async( "FriendlyName": friendly_name, "Identity": identity, "DeploymentSid": deployment_sid, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) diff --git a/twilio/rest/preview/hosted_numbers/hosted_number_order.py b/twilio/rest/preview/hosted_numbers/hosted_number_order.py index 70b9f309ba..7e68f57b56 100644 --- a/twilio/rest/preview/hosted_numbers/hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/hosted_number_order.py @@ -550,7 +550,7 @@ def create( data = values.of( { "PhoneNumber": phone_number, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "AccountSid": account_sid, "FriendlyName": friendly_name, "UniqueName": unique_name, @@ -626,7 +626,7 @@ async def create_async( data = values.of( { "PhoneNumber": phone_number, - "SmsCapability": sms_capability, + "SmsCapability": serialize.boolean_to_string(sms_capability), "AccountSid": account_sid, "FriendlyName": friendly_name, "UniqueName": unique_name, diff --git a/twilio/rest/preview/marketplace/installed_add_on/__init__.py b/twilio/rest/preview/marketplace/installed_add_on/__init__.py index 5a0530aef4..d067f9fe79 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/installed_add_on/__init__.py @@ -380,7 +380,9 @@ def create( data = values.of( { "AvailableAddOnSid": available_add_on_sid, - "AcceptTermsOfService": accept_terms_of_service, + "AcceptTermsOfService": serialize.boolean_to_string( + accept_terms_of_service + ), "Configuration": serialize.object(configuration), "UniqueName": unique_name, } @@ -415,7 +417,9 @@ async def create_async( data = values.of( { "AvailableAddOnSid": available_add_on_sid, - "AcceptTermsOfService": accept_terms_of_service, + "AcceptTermsOfService": serialize.boolean_to_string( + accept_terms_of_service + ), "Configuration": serialize.object(configuration), "UniqueName": unique_name, } diff --git a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py index a6002fa0d1..f8e65d12c1 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py +++ b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -196,7 +196,7 @@ def update(self, enabled: bool) -> InstalledAddOnExtensionInstance: """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -223,7 +223,7 @@ async def update_async(self, enabled: bool) -> InstalledAddOnExtensionInstance: """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py index e270895fbf..cb8cdf7910 100644 --- a/twilio/rest/preview/sync/service/__init__.py +++ b/twilio/rest/preview/sync/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -300,8 +300,10 @@ def update( { "WebhookUrl": webhook_url, "FriendlyName": friendly_name, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) @@ -334,8 +336,10 @@ async def update_async( { "WebhookUrl": webhook_url, "FriendlyName": friendly_name, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) @@ -447,8 +451,10 @@ def create( { "FriendlyName": friendly_name, "WebhookUrl": webhook_url, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) @@ -482,8 +488,10 @@ async def create_async( { "FriendlyName": friendly_name, "WebhookUrl": webhook_url, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) diff --git a/twilio/rest/preview/sync/service/document/document_permission.py b/twilio/rest/preview/sync/service/document/document_permission.py index 7439d34341..48addbb163 100644 --- a/twilio/rest/preview/sync/service/document/document_permission.py +++ b/twilio/rest/preview/sync/service/document/document_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -263,9 +263,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -297,9 +297,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py index 0f4f9e4b28..2fcaca5b26 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -265,9 +265,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -299,9 +299,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py index 999713e0e9..b626f07bdc 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -263,9 +263,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -297,9 +297,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/preview/wireless/rate_plan.py b/twilio/rest/preview/wireless/rate_plan.py index abd9cbecc2..f3484efa66 100644 --- a/twilio/rest/preview/wireless/rate_plan.py +++ b/twilio/rest/preview/wireless/rate_plan.py @@ -381,13 +381,15 @@ def create( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "DataMetering": data_metering, - "MessagingEnabled": messaging_enabled, - "VoiceEnabled": voice_enabled, - "CommandsEnabled": commands_enabled, - "NationalRoamingEnabled": national_roaming_enabled, + "MessagingEnabled": serialize.boolean_to_string(messaging_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "CommandsEnabled": serialize.boolean_to_string(commands_enabled), + "NationalRoamingEnabled": serialize.boolean_to_string( + national_roaming_enabled + ), "InternationalRoaming": serialize.map( international_roaming, lambda e: e ), @@ -436,13 +438,15 @@ async def create_async( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "DataMetering": data_metering, - "MessagingEnabled": messaging_enabled, - "VoiceEnabled": voice_enabled, - "CommandsEnabled": commands_enabled, - "NationalRoamingEnabled": national_roaming_enabled, + "MessagingEnabled": serialize.boolean_to_string(messaging_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "CommandsEnabled": serialize.boolean_to_string(commands_enabled), + "NationalRoamingEnabled": serialize.boolean_to_string( + national_roaming_enabled + ), "InternationalRoaming": serialize.map( international_roaming, lambda e: e ), diff --git a/twilio/rest/proxy/v1/service/phone_number.py b/twilio/rest/proxy/v1/service/phone_number.py index c4252b3980..366b9ba11f 100644 --- a/twilio/rest/proxy/v1/service/phone_number.py +++ b/twilio/rest/proxy/v1/service/phone_number.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -257,7 +257,7 @@ def update( """ data = values.of( { - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) @@ -286,7 +286,7 @@ async def update_async( """ data = values.of( { - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) @@ -372,7 +372,7 @@ def create( { "Sid": sid, "PhoneNumber": phone_number, - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) @@ -406,7 +406,7 @@ async def create_async( { "Sid": sid, "PhoneNumber": phone_number, - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) diff --git a/twilio/rest/proxy/v1/service/short_code.py b/twilio/rest/proxy/v1/service/short_code.py index 7fc108e673..712d6f82fa 100644 --- a/twilio/rest/proxy/v1/service/short_code.py +++ b/twilio/rest/proxy/v1/service/short_code.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -251,7 +251,7 @@ def update( """ data = values.of( { - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) @@ -280,7 +280,7 @@ async def update_async( """ data = values.of( { - "IsReserved": is_reserved, + "IsReserved": serialize.boolean_to_string(is_reserved), } ) diff --git a/twilio/rest/serverless/v1/service/__init__.py b/twilio/rest/serverless/v1/service/__init__.py index 493b1a2e05..0fe404c8f1 100644 --- a/twilio/rest/serverless/v1/service/__init__.py +++ b/twilio/rest/serverless/v1/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -299,9 +299,9 @@ def update( """ data = values.of( { - "IncludeCredentials": include_credentials, + "IncludeCredentials": serialize.boolean_to_string(include_credentials), "FriendlyName": friendly_name, - "UiEditable": ui_editable, + "UiEditable": serialize.boolean_to_string(ui_editable), } ) @@ -330,9 +330,9 @@ async def update_async( """ data = values.of( { - "IncludeCredentials": include_credentials, + "IncludeCredentials": serialize.boolean_to_string(include_credentials), "FriendlyName": friendly_name, - "UiEditable": ui_editable, + "UiEditable": serialize.boolean_to_string(ui_editable), } ) @@ -456,8 +456,8 @@ def create( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "IncludeCredentials": include_credentials, - "UiEditable": ui_editable, + "IncludeCredentials": serialize.boolean_to_string(include_credentials), + "UiEditable": serialize.boolean_to_string(ui_editable), } ) @@ -491,8 +491,8 @@ async def create_async( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "IncludeCredentials": include_credentials, - "UiEditable": ui_editable, + "IncludeCredentials": serialize.boolean_to_string(include_credentials), + "UiEditable": serialize.boolean_to_string(ui_editable), } ) diff --git a/twilio/rest/supersim/v1/esim_profile.py b/twilio/rest/supersim/v1/esim_profile.py index c8ecb02ae0..847bcae33a 100644 --- a/twilio/rest/supersim/v1/esim_profile.py +++ b/twilio/rest/supersim/v1/esim_profile.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -240,7 +240,7 @@ def create( { "CallbackUrl": callback_url, "CallbackMethod": callback_method, - "GenerateMatchingId": generate_matching_id, + "GenerateMatchingId": serialize.boolean_to_string(generate_matching_id), "Eid": eid, } ) @@ -275,7 +275,7 @@ async def create_async( { "CallbackUrl": callback_url, "CallbackMethod": callback_method, - "GenerateMatchingId": generate_matching_id, + "GenerateMatchingId": serialize.boolean_to_string(generate_matching_id), "Eid": eid, } ) diff --git a/twilio/rest/supersim/v1/fleet.py b/twilio/rest/supersim/v1/fleet.py index 2447057a7f..2003eb77b5 100644 --- a/twilio/rest/supersim/v1/fleet.py +++ b/twilio/rest/supersim/v1/fleet.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -403,11 +403,11 @@ def create( { "NetworkAccessProfile": network_access_profile, "UniqueName": unique_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "IpCommandsUrl": ip_commands_url, "IpCommandsMethod": ip_commands_method, - "SmsCommandsEnabled": sms_commands_enabled, + "SmsCommandsEnabled": serialize.boolean_to_string(sms_commands_enabled), "SmsCommandsUrl": sms_commands_url, "SmsCommandsMethod": sms_commands_method, } @@ -453,11 +453,11 @@ async def create_async( { "NetworkAccessProfile": network_access_profile, "UniqueName": unique_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "IpCommandsUrl": ip_commands_url, "IpCommandsMethod": ip_commands_method, - "SmsCommandsEnabled": sms_commands_enabled, + "SmsCommandsEnabled": serialize.boolean_to_string(sms_commands_enabled), "SmsCommandsUrl": sms_commands_url, "SmsCommandsMethod": sms_commands_method, } diff --git a/twilio/rest/sync/v1/service/__init__.py b/twilio/rest/sync/v1/service/__init__.py index 9fd7c22e30..0bf1045f2b 100644 --- a/twilio/rest/sync/v1/service/__init__.py +++ b/twilio/rest/sync/v1/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -347,11 +347,17 @@ def update( { "WebhookUrl": webhook_url, "FriendlyName": friendly_name, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, - "ReachabilityDebouncingEnabled": reachability_debouncing_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), + "ReachabilityDebouncingEnabled": serialize.boolean_to_string( + reachability_debouncing_enabled + ), "ReachabilityDebouncingWindow": reachability_debouncing_window, - "WebhooksFromRestEnabled": webhooks_from_rest_enabled, + "WebhooksFromRestEnabled": serialize.boolean_to_string( + webhooks_from_rest_enabled + ), } ) @@ -390,11 +396,17 @@ async def update_async( { "WebhookUrl": webhook_url, "FriendlyName": friendly_name, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, - "ReachabilityDebouncingEnabled": reachability_debouncing_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), + "ReachabilityDebouncingEnabled": serialize.boolean_to_string( + reachability_debouncing_enabled + ), "ReachabilityDebouncingWindow": reachability_debouncing_window, - "WebhooksFromRestEnabled": webhooks_from_rest_enabled, + "WebhooksFromRestEnabled": serialize.boolean_to_string( + webhooks_from_rest_enabled + ), } ) @@ -524,11 +536,17 @@ def create( { "FriendlyName": friendly_name, "WebhookUrl": webhook_url, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, - "ReachabilityDebouncingEnabled": reachability_debouncing_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), + "ReachabilityDebouncingEnabled": serialize.boolean_to_string( + reachability_debouncing_enabled + ), "ReachabilityDebouncingWindow": reachability_debouncing_window, - "WebhooksFromRestEnabled": webhooks_from_rest_enabled, + "WebhooksFromRestEnabled": serialize.boolean_to_string( + webhooks_from_rest_enabled + ), } ) @@ -568,11 +586,17 @@ async def create_async( { "FriendlyName": friendly_name, "WebhookUrl": webhook_url, - "ReachabilityWebhooksEnabled": reachability_webhooks_enabled, - "AclEnabled": acl_enabled, - "ReachabilityDebouncingEnabled": reachability_debouncing_enabled, + "ReachabilityWebhooksEnabled": serialize.boolean_to_string( + reachability_webhooks_enabled + ), + "AclEnabled": serialize.boolean_to_string(acl_enabled), + "ReachabilityDebouncingEnabled": serialize.boolean_to_string( + reachability_debouncing_enabled + ), "ReachabilityDebouncingWindow": reachability_debouncing_window, - "WebhooksFromRestEnabled": webhooks_from_rest_enabled, + "WebhooksFromRestEnabled": serialize.boolean_to_string( + webhooks_from_rest_enabled + ), } ) diff --git a/twilio/rest/sync/v1/service/document/document_permission.py b/twilio/rest/sync/v1/service/document/document_permission.py index d8f157fb4e..40f524832c 100644 --- a/twilio/rest/sync/v1/service/document/document_permission.py +++ b/twilio/rest/sync/v1/service/document/document_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -263,9 +263,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -297,9 +297,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py index 228ab0d192..07fce14b95 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -265,9 +265,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -299,9 +299,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py index 3f204d65ba..ba056906c7 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -263,9 +263,9 @@ def update( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) @@ -297,9 +297,9 @@ async def update_async( """ data = values.of( { - "Read": read, - "Write": write, - "Manage": manage, + "Read": serialize.boolean_to_string(read), + "Write": serialize.boolean_to_string(write), + "Manage": serialize.boolean_to_string(manage), } ) diff --git a/twilio/rest/taskrouter/v1/workspace/__init__.py b/twilio/rest/taskrouter/v1/workspace/__init__.py index 0b0136fedc..f1202197c4 100644 --- a/twilio/rest/taskrouter/v1/workspace/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -416,7 +416,7 @@ def update( "EventCallbackUrl": event_callback_url, "EventsFilter": events_filter, "FriendlyName": friendly_name, - "MultiTaskEnabled": multi_task_enabled, + "MultiTaskEnabled": serialize.boolean_to_string(multi_task_enabled), "TimeoutActivitySid": timeout_activity_sid, "PrioritizeQueueOrder": prioritize_queue_order, } @@ -461,7 +461,7 @@ async def update_async( "EventCallbackUrl": event_callback_url, "EventsFilter": events_filter, "FriendlyName": friendly_name, - "MultiTaskEnabled": multi_task_enabled, + "MultiTaskEnabled": serialize.boolean_to_string(multi_task_enabled), "TimeoutActivitySid": timeout_activity_sid, "PrioritizeQueueOrder": prioritize_queue_order, } @@ -666,7 +666,7 @@ def create( "FriendlyName": friendly_name, "EventCallbackUrl": event_callback_url, "EventsFilter": events_filter, - "MultiTaskEnabled": multi_task_enabled, + "MultiTaskEnabled": serialize.boolean_to_string(multi_task_enabled), "Template": template, "PrioritizeQueueOrder": prioritize_queue_order, } @@ -709,7 +709,7 @@ async def create_async( "FriendlyName": friendly_name, "EventCallbackUrl": event_callback_url, "EventsFilter": events_filter, - "MultiTaskEnabled": multi_task_enabled, + "MultiTaskEnabled": serialize.boolean_to_string(multi_task_enabled), "Template": template, "PrioritizeQueueOrder": prioritize_queue_order, } diff --git a/twilio/rest/taskrouter/v1/workspace/activity.py b/twilio/rest/taskrouter/v1/workspace/activity.py index 3ab15acf8e..bae49d5efa 100644 --- a/twilio/rest/taskrouter/v1/workspace/activity.py +++ b/twilio/rest/taskrouter/v1/workspace/activity.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -361,7 +361,7 @@ def create( data = values.of( { "FriendlyName": friendly_name, - "Available": available, + "Available": serialize.boolean_to_string(available), } ) @@ -390,7 +390,7 @@ async def create_async( data = values.of( { "FriendlyName": friendly_name, - "Available": available, + "Available": serialize.boolean_to_string(available), } ) diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index 708db25105..f5c306b65a 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -855,7 +855,7 @@ def page( "TaskQueueName": task_queue_name, "EvaluateTaskAttributes": evaluate_task_attributes, "Ordering": ordering, - "HasAddons": has_addons, + "HasAddons": serialize.boolean_to_string(has_addons), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -909,7 +909,7 @@ async def page_async( "TaskQueueName": task_queue_name, "EvaluateTaskAttributes": evaluate_task_attributes, "Ordering": ordering, - "HasAddons": has_addons, + "HasAddons": serialize.boolean_to_string(has_addons), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/taskrouter/v1/workspace/task/reservation.py b/twilio/rest/taskrouter/v1/workspace/task/reservation.py index 7ac7807c0e..50b1ed1273 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/task/reservation.py @@ -723,9 +723,9 @@ def update( "CallTo": call_to, "CallUrl": call_url, "CallStatusCallbackUrl": call_status_callback_url, - "CallAccept": call_accept, + "CallAccept": serialize.boolean_to_string(call_accept), "RedirectCallSid": redirect_call_sid, - "RedirectAccept": redirect_accept, + "RedirectAccept": serialize.boolean_to_string(redirect_accept), "RedirectUrl": redirect_url, "To": to, "From": from_, @@ -735,14 +735,18 @@ def update( status_callback_event, lambda e: e ), "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceStatusCallback": conference_status_callback, "ConferenceStatusCallbackMethod": conference_status_callback_method, @@ -765,8 +769,12 @@ def update( "PostWorkActivitySid": post_work_activity_sid, "SupervisorMode": supervisor_mode, "Supervisor": supervisor, - "EndConferenceOnCustomerExit": end_conference_on_customer_exit, - "BeepOnCustomerEntrance": beep_on_customer_entrance, + "EndConferenceOnCustomerExit": serialize.boolean_to_string( + end_conference_on_customer_exit + ), + "BeepOnCustomerEntrance": serialize.boolean_to_string( + beep_on_customer_entrance + ), "JitterBufferSize": jitter_buffer_size, } ) @@ -930,9 +938,9 @@ async def update_async( "CallTo": call_to, "CallUrl": call_url, "CallStatusCallbackUrl": call_status_callback_url, - "CallAccept": call_accept, + "CallAccept": serialize.boolean_to_string(call_accept), "RedirectCallSid": redirect_call_sid, - "RedirectAccept": redirect_accept, + "RedirectAccept": serialize.boolean_to_string(redirect_accept), "RedirectUrl": redirect_url, "To": to, "From": from_, @@ -942,14 +950,18 @@ async def update_async( status_callback_event, lambda e: e ), "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceStatusCallback": conference_status_callback, "ConferenceStatusCallbackMethod": conference_status_callback_method, @@ -972,8 +984,12 @@ async def update_async( "PostWorkActivitySid": post_work_activity_sid, "SupervisorMode": supervisor_mode, "Supervisor": supervisor, - "EndConferenceOnCustomerExit": end_conference_on_customer_exit, - "BeepOnCustomerEntrance": beep_on_customer_entrance, + "EndConferenceOnCustomerExit": serialize.boolean_to_string( + end_conference_on_customer_exit + ), + "BeepOnCustomerEntrance": serialize.boolean_to_string( + beep_on_customer_entrance + ), "JitterBufferSize": jitter_buffer_size, } ) diff --git a/twilio/rest/taskrouter/v1/workspace/task_channel.py b/twilio/rest/taskrouter/v1/workspace/task_channel.py index 780c4ef9fa..099f85efb1 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/task_channel.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -267,7 +267,9 @@ def update( data = values.of( { "FriendlyName": friendly_name, - "ChannelOptimizedRouting": channel_optimized_routing, + "ChannelOptimizedRouting": serialize.boolean_to_string( + channel_optimized_routing + ), } ) @@ -300,7 +302,9 @@ async def update_async( data = values.of( { "FriendlyName": friendly_name, - "ChannelOptimizedRouting": channel_optimized_routing, + "ChannelOptimizedRouting": serialize.boolean_to_string( + channel_optimized_routing + ), } ) @@ -386,7 +390,9 @@ def create( { "FriendlyName": friendly_name, "UniqueName": unique_name, - "ChannelOptimizedRouting": channel_optimized_routing, + "ChannelOptimizedRouting": serialize.boolean_to_string( + channel_optimized_routing + ), } ) @@ -420,7 +426,9 @@ async def create_async( { "FriendlyName": friendly_name, "UniqueName": unique_name, - "ChannelOptimizedRouting": channel_optimized_routing, + "ChannelOptimizedRouting": serialize.boolean_to_string( + channel_optimized_routing + ), } ) diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py index 90552babf3..0556e6bb4a 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py @@ -12,8 +12,8 @@ Do not edit the class manually. """ -from typing import Any, Dict, List, Optional -from twilio.base import deserialize +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -80,34 +80,43 @@ def __init__(self, version: Version, workspace_sid: str): **self._solution ) - def create(self) -> TaskQueueBulkRealTimeStatisticsInstance: + def create( + self, body: Union[object, object] = values.unset + ) -> TaskQueueBulkRealTimeStatisticsInstance: """ Create the TaskQueueBulkRealTimeStatisticsInstance + :param body: :returns: The created TaskQueueBulkRealTimeStatisticsInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = self._version.create( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskQueueBulkRealTimeStatisticsInstance( self._version, payload, workspace_sid=self._solution["workspace_sid"] ) - async def create_async(self) -> TaskQueueBulkRealTimeStatisticsInstance: + async def create_async( + self, body: Union[object, object] = values.unset + ) -> TaskQueueBulkRealTimeStatisticsInstance: """ Asynchronously create the TaskQueueBulkRealTimeStatisticsInstance + :param body: :returns: The created TaskQueueBulkRealTimeStatisticsInstance """ + data = body.to_dict() + headers = {"Content-Type": "application/json"} + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskQueueBulkRealTimeStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py index a3ce2db7d4..a236fcae8d 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -352,7 +352,9 @@ def update( "ActivitySid": activity_sid, "Attributes": attributes, "FriendlyName": friendly_name, - "RejectPendingReservations": reject_pending_reservations, + "RejectPendingReservations": serialize.boolean_to_string( + reject_pending_reservations + ), } ) headers = values.of( @@ -396,7 +398,9 @@ async def update_async( "ActivitySid": activity_sid, "Attributes": attributes, "FriendlyName": friendly_name, - "RejectPendingReservations": reject_pending_reservations, + "RejectPendingReservations": serialize.boolean_to_string( + reject_pending_reservations + ), } ) headers = values.of( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py index 2f62c433ef..b7dc4bca9e 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py @@ -694,9 +694,9 @@ def update( "CallTo": call_to, "CallUrl": call_url, "CallStatusCallbackUrl": call_status_callback_url, - "CallAccept": call_accept, + "CallAccept": serialize.boolean_to_string(call_accept), "RedirectCallSid": redirect_call_sid, - "RedirectAccept": redirect_accept, + "RedirectAccept": serialize.boolean_to_string(redirect_accept), "RedirectUrl": redirect_url, "To": to, "From": from_, @@ -706,14 +706,18 @@ def update( status_callback_event, lambda e: e ), "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceStatusCallback": conference_status_callback, "ConferenceStatusCallbackMethod": conference_status_callback_method, @@ -734,8 +738,12 @@ def update( dequeue_status_callback_event, lambda e: e ), "PostWorkActivitySid": post_work_activity_sid, - "EndConferenceOnCustomerExit": end_conference_on_customer_exit, - "BeepOnCustomerEntrance": beep_on_customer_entrance, + "EndConferenceOnCustomerExit": serialize.boolean_to_string( + end_conference_on_customer_exit + ), + "BeepOnCustomerEntrance": serialize.boolean_to_string( + beep_on_customer_entrance + ), "JitterBufferSize": jitter_buffer_size, } ) @@ -893,9 +901,9 @@ async def update_async( "CallTo": call_to, "CallUrl": call_url, "CallStatusCallbackUrl": call_status_callback_url, - "CallAccept": call_accept, + "CallAccept": serialize.boolean_to_string(call_accept), "RedirectCallSid": redirect_call_sid, - "RedirectAccept": redirect_accept, + "RedirectAccept": serialize.boolean_to_string(redirect_accept), "RedirectUrl": redirect_url, "To": to, "From": from_, @@ -905,14 +913,18 @@ async def update_async( status_callback_event, lambda e: e ), "Timeout": timeout, - "Record": record, - "Muted": muted, + "Record": serialize.boolean_to_string(record), + "Muted": serialize.boolean_to_string(muted), "Beep": beep, - "StartConferenceOnEnter": start_conference_on_enter, - "EndConferenceOnExit": end_conference_on_exit, + "StartConferenceOnEnter": serialize.boolean_to_string( + start_conference_on_enter + ), + "EndConferenceOnExit": serialize.boolean_to_string( + end_conference_on_exit + ), "WaitUrl": wait_url, "WaitMethod": wait_method, - "EarlyMedia": early_media, + "EarlyMedia": serialize.boolean_to_string(early_media), "MaxParticipants": max_participants, "ConferenceStatusCallback": conference_status_callback, "ConferenceStatusCallbackMethod": conference_status_callback_method, @@ -933,8 +945,12 @@ async def update_async( dequeue_status_callback_event, lambda e: e ), "PostWorkActivitySid": post_work_activity_sid, - "EndConferenceOnCustomerExit": end_conference_on_customer_exit, - "BeepOnCustomerEntrance": beep_on_customer_entrance, + "EndConferenceOnCustomerExit": serialize.boolean_to_string( + end_conference_on_customer_exit + ), + "BeepOnCustomerEntrance": serialize.boolean_to_string( + beep_on_customer_entrance + ), "JitterBufferSize": jitter_buffer_size, } ) diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py index 64f0c3afe9..f48ebb3a62 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -246,7 +246,7 @@ def update( data = values.of( { "Capacity": capacity, - "Available": available, + "Available": serialize.boolean_to_string(available), } ) @@ -280,7 +280,7 @@ async def update_async( data = values.of( { "Capacity": capacity, - "Available": available, + "Available": serialize.boolean_to_string(available), } ) diff --git a/twilio/rest/trunking/v1/trunk/__init__.py b/twilio/rest/trunking/v1/trunk/__init__.py index 935ce2718d..16125ead02 100644 --- a/twilio/rest/trunking/v1/trunk/__init__.py +++ b/twilio/rest/trunking/v1/trunk/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -387,8 +387,8 @@ def update( "DisasterRecoveryUrl": disaster_recovery_url, "DisasterRecoveryMethod": disaster_recovery_method, "TransferMode": transfer_mode, - "Secure": secure, - "CnamLookupEnabled": cnam_lookup_enabled, + "Secure": serialize.boolean_to_string(secure), + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "TransferCallerId": transfer_caller_id, } ) @@ -435,8 +435,8 @@ async def update_async( "DisasterRecoveryUrl": disaster_recovery_url, "DisasterRecoveryMethod": disaster_recovery_method, "TransferMode": transfer_mode, - "Secure": secure, - "CnamLookupEnabled": cnam_lookup_enabled, + "Secure": serialize.boolean_to_string(secure), + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "TransferCallerId": transfer_caller_id, } ) @@ -586,8 +586,8 @@ def create( "DisasterRecoveryUrl": disaster_recovery_url, "DisasterRecoveryMethod": disaster_recovery_method, "TransferMode": transfer_mode, - "Secure": secure, - "CnamLookupEnabled": cnam_lookup_enabled, + "Secure": serialize.boolean_to_string(secure), + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "TransferCallerId": transfer_caller_id, } ) @@ -635,8 +635,8 @@ async def create_async( "DisasterRecoveryUrl": disaster_recovery_url, "DisasterRecoveryMethod": disaster_recovery_method, "TransferMode": transfer_mode, - "Secure": secure, - "CnamLookupEnabled": cnam_lookup_enabled, + "Secure": serialize.boolean_to_string(secure), + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "TransferCallerId": transfer_caller_id, } ) diff --git a/twilio/rest/trunking/v1/trunk/origination_url.py b/twilio/rest/trunking/v1/trunk/origination_url.py index 426938995e..bcf0c5205f 100644 --- a/twilio/rest/trunking/v1/trunk/origination_url.py +++ b/twilio/rest/trunking/v1/trunk/origination_url.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -290,7 +290,7 @@ def update( { "Weight": weight, "Priority": priority, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "FriendlyName": friendly_name, "SipUrl": sip_url, } @@ -332,7 +332,7 @@ async def update_async( { "Weight": weight, "Priority": priority, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "FriendlyName": friendly_name, "SipUrl": sip_url, } @@ -424,7 +424,7 @@ def create( { "Weight": weight, "Priority": priority, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "FriendlyName": friendly_name, "SipUrl": sip_url, } @@ -464,7 +464,7 @@ async def create_async( { "Weight": weight, "Priority": priority, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "FriendlyName": friendly_name, "SipUrl": sip_url, } diff --git a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py index 264dd4ae31..b3ad6790ac 100644 --- a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -27,6 +27,13 @@ class BusinessIdentityType(object): ISV_RESELLER_OR_PARTNER = "isv_reseller_or_partner" UNKNOWN = "unknown" + class BusinessRegistrationAuthority(object): + UK_CRN = "UK:CRN" + US_EIN = "US:EIN" + CA_CBN = "CA:CBN" + AU_ACN = "AU:ACN" + OTHER = "Other" + class EndUserType(object): INDIVIDUAL = "Individual" BUSINESS = "Business" @@ -84,7 +91,10 @@ def create( business_identity_type: Union[ "ComplianceRegistrationInquiriesInstance.BusinessIdentityType", object ] = values.unset, - business_registration_authority: Union[str, object] = values.unset, + business_registration_authority: Union[ + "ComplianceRegistrationInquiriesInstance.BusinessRegistrationAuthority", + object, + ] = values.unset, business_legal_name: Union[str, object] = values.unset, notification_email: Union[str, object] = values.unset, accepted_notification_receipt: Union[bool, object] = values.unset, @@ -111,6 +121,12 @@ def create( use_address_as_emergency_address: Union[bool, object] = values.unset, file_name: Union[str, object] = values.unset, file: Union[str, object] = values.unset, + first_name: Union[str, object] = values.unset, + last_name: Union[str, object] = values.unset, + date_of_birth: Union[str, object] = values.unset, + individual_email: Union[str, object] = values.unset, + individual_phone: Union[str, object] = values.unset, + is_isv_embed: Union[bool, object] = values.unset, ) -> ComplianceRegistrationInquiriesInstance: """ Create the ComplianceRegistrationInquiriesInstance @@ -118,7 +134,7 @@ def create( :param end_user_type: :param phone_number_type: :param business_identity_type: - :param business_registration_authority: The authority that registered the business + :param business_registration_authority: :param business_legal_name: he name of the business or organization using the Tollfree number. :param notification_email: he email address to receive the notification about the verification result. :param accepted_notification_receipt: The email address to receive the notification about the verification result. @@ -145,6 +161,12 @@ def create( :param use_address_as_emergency_address: Use the business address as the emergency address :param file_name: The name of the verification document to upload :param file: The verification document to upload + :param first_name: The first name of the Individual User. + :param last_name: The last name of the Individual User. + :param date_of_birth: The date of birth of the Individual User. + :param individual_email: The email address of the Individual User. + :param individual_phone: The phone number of the Individual User. + :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. :returns: The created ComplianceRegistrationInquiriesInstance """ @@ -157,7 +179,9 @@ def create( "BusinessRegistrationAuthority": business_registration_authority, "BusinessLegalName": business_legal_name, "NotificationEmail": notification_email, - "AcceptedNotificationReceipt": accepted_notification_receipt, + "AcceptedNotificationReceipt": serialize.boolean_to_string( + accepted_notification_receipt + ), "BusinessRegistrationNumber": business_registration_number, "BusinessWebsiteUrl": business_website_url, "FriendlyName": friendly_name, @@ -178,9 +202,17 @@ def create( "EmergencyAddressSubdivision": emergency_address_subdivision, "EmergencyAddressPostalCode": emergency_address_postal_code, "EmergencyAddressCountryCode": emergency_address_country_code, - "UseAddressAsEmergencyAddress": use_address_as_emergency_address, + "UseAddressAsEmergencyAddress": serialize.boolean_to_string( + use_address_as_emergency_address + ), "FileName": file_name, "File": file, + "FirstName": first_name, + "LastName": last_name, + "DateOfBirth": date_of_birth, + "IndividualEmail": individual_email, + "IndividualPhone": individual_phone, + "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), } ) @@ -199,7 +231,10 @@ async def create_async( business_identity_type: Union[ "ComplianceRegistrationInquiriesInstance.BusinessIdentityType", object ] = values.unset, - business_registration_authority: Union[str, object] = values.unset, + business_registration_authority: Union[ + "ComplianceRegistrationInquiriesInstance.BusinessRegistrationAuthority", + object, + ] = values.unset, business_legal_name: Union[str, object] = values.unset, notification_email: Union[str, object] = values.unset, accepted_notification_receipt: Union[bool, object] = values.unset, @@ -226,6 +261,12 @@ async def create_async( use_address_as_emergency_address: Union[bool, object] = values.unset, file_name: Union[str, object] = values.unset, file: Union[str, object] = values.unset, + first_name: Union[str, object] = values.unset, + last_name: Union[str, object] = values.unset, + date_of_birth: Union[str, object] = values.unset, + individual_email: Union[str, object] = values.unset, + individual_phone: Union[str, object] = values.unset, + is_isv_embed: Union[bool, object] = values.unset, ) -> ComplianceRegistrationInquiriesInstance: """ Asynchronously create the ComplianceRegistrationInquiriesInstance @@ -233,7 +274,7 @@ async def create_async( :param end_user_type: :param phone_number_type: :param business_identity_type: - :param business_registration_authority: The authority that registered the business + :param business_registration_authority: :param business_legal_name: he name of the business or organization using the Tollfree number. :param notification_email: he email address to receive the notification about the verification result. :param accepted_notification_receipt: The email address to receive the notification about the verification result. @@ -260,6 +301,12 @@ async def create_async( :param use_address_as_emergency_address: Use the business address as the emergency address :param file_name: The name of the verification document to upload :param file: The verification document to upload + :param first_name: The first name of the Individual User. + :param last_name: The last name of the Individual User. + :param date_of_birth: The date of birth of the Individual User. + :param individual_email: The email address of the Individual User. + :param individual_phone: The phone number of the Individual User. + :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. :returns: The created ComplianceRegistrationInquiriesInstance """ @@ -272,7 +319,9 @@ async def create_async( "BusinessRegistrationAuthority": business_registration_authority, "BusinessLegalName": business_legal_name, "NotificationEmail": notification_email, - "AcceptedNotificationReceipt": accepted_notification_receipt, + "AcceptedNotificationReceipt": serialize.boolean_to_string( + accepted_notification_receipt + ), "BusinessRegistrationNumber": business_registration_number, "BusinessWebsiteUrl": business_website_url, "FriendlyName": friendly_name, @@ -293,9 +342,17 @@ async def create_async( "EmergencyAddressSubdivision": emergency_address_subdivision, "EmergencyAddressPostalCode": emergency_address_postal_code, "EmergencyAddressCountryCode": emergency_address_country_code, - "UseAddressAsEmergencyAddress": use_address_as_emergency_address, + "UseAddressAsEmergencyAddress": serialize.boolean_to_string( + use_address_as_emergency_address + ), "FileName": file_name, "File": file, + "FirstName": first_name, + "LastName": last_name, + "DateOfBirth": date_of_birth, + "IndividualEmail": individual_email, + "IndividualPhone": individual_phone, + "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), } ) diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 374ecb3ef1..9e4d69d52b 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -474,14 +474,18 @@ def update( { "FriendlyName": friendly_name, "CodeLength": code_length, - "LookupEnabled": lookup_enabled, - "SkipSmsToLandlines": skip_sms_to_landlines, - "DtmfInputRequired": dtmf_input_required, + "LookupEnabled": serialize.boolean_to_string(lookup_enabled), + "SkipSmsToLandlines": serialize.boolean_to_string( + skip_sms_to_landlines + ), + "DtmfInputRequired": serialize.boolean_to_string(dtmf_input_required), "TtsName": tts_name, - "Psd2Enabled": psd2_enabled, - "DoNotShareWarningEnabled": do_not_share_warning_enabled, - "CustomCodeEnabled": custom_code_enabled, - "Push.IncludeDate": push_include_date, + "Psd2Enabled": serialize.boolean_to_string(psd2_enabled), + "DoNotShareWarningEnabled": serialize.boolean_to_string( + do_not_share_warning_enabled + ), + "CustomCodeEnabled": serialize.boolean_to_string(custom_code_enabled), + "Push.IncludeDate": serialize.boolean_to_string(push_include_date), "Push.ApnCredentialSid": push_apn_credential_sid, "Push.FcmCredentialSid": push_fcm_credential_sid, "Totp.Issuer": totp_issuer, @@ -489,7 +493,9 @@ def update( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, + "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( + verify_event_subscription_enabled + ), } ) @@ -550,14 +556,18 @@ async def update_async( { "FriendlyName": friendly_name, "CodeLength": code_length, - "LookupEnabled": lookup_enabled, - "SkipSmsToLandlines": skip_sms_to_landlines, - "DtmfInputRequired": dtmf_input_required, + "LookupEnabled": serialize.boolean_to_string(lookup_enabled), + "SkipSmsToLandlines": serialize.boolean_to_string( + skip_sms_to_landlines + ), + "DtmfInputRequired": serialize.boolean_to_string(dtmf_input_required), "TtsName": tts_name, - "Psd2Enabled": psd2_enabled, - "DoNotShareWarningEnabled": do_not_share_warning_enabled, - "CustomCodeEnabled": custom_code_enabled, - "Push.IncludeDate": push_include_date, + "Psd2Enabled": serialize.boolean_to_string(psd2_enabled), + "DoNotShareWarningEnabled": serialize.boolean_to_string( + do_not_share_warning_enabled + ), + "CustomCodeEnabled": serialize.boolean_to_string(custom_code_enabled), + "Push.IncludeDate": serialize.boolean_to_string(push_include_date), "Push.ApnCredentialSid": push_apn_credential_sid, "Push.FcmCredentialSid": push_fcm_credential_sid, "Totp.Issuer": totp_issuer, @@ -565,7 +575,9 @@ async def update_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, + "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( + verify_event_subscription_enabled + ), } ) @@ -753,14 +765,18 @@ def create( { "FriendlyName": friendly_name, "CodeLength": code_length, - "LookupEnabled": lookup_enabled, - "SkipSmsToLandlines": skip_sms_to_landlines, - "DtmfInputRequired": dtmf_input_required, + "LookupEnabled": serialize.boolean_to_string(lookup_enabled), + "SkipSmsToLandlines": serialize.boolean_to_string( + skip_sms_to_landlines + ), + "DtmfInputRequired": serialize.boolean_to_string(dtmf_input_required), "TtsName": tts_name, - "Psd2Enabled": psd2_enabled, - "DoNotShareWarningEnabled": do_not_share_warning_enabled, - "CustomCodeEnabled": custom_code_enabled, - "Push.IncludeDate": push_include_date, + "Psd2Enabled": serialize.boolean_to_string(psd2_enabled), + "DoNotShareWarningEnabled": serialize.boolean_to_string( + do_not_share_warning_enabled + ), + "CustomCodeEnabled": serialize.boolean_to_string(custom_code_enabled), + "Push.IncludeDate": serialize.boolean_to_string(push_include_date), "Push.ApnCredentialSid": push_apn_credential_sid, "Push.FcmCredentialSid": push_fcm_credential_sid, "Totp.Issuer": totp_issuer, @@ -768,7 +784,9 @@ def create( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, + "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( + verify_event_subscription_enabled + ), } ) @@ -830,14 +848,18 @@ async def create_async( { "FriendlyName": friendly_name, "CodeLength": code_length, - "LookupEnabled": lookup_enabled, - "SkipSmsToLandlines": skip_sms_to_landlines, - "DtmfInputRequired": dtmf_input_required, + "LookupEnabled": serialize.boolean_to_string(lookup_enabled), + "SkipSmsToLandlines": serialize.boolean_to_string( + skip_sms_to_landlines + ), + "DtmfInputRequired": serialize.boolean_to_string(dtmf_input_required), "TtsName": tts_name, - "Psd2Enabled": psd2_enabled, - "DoNotShareWarningEnabled": do_not_share_warning_enabled, - "CustomCodeEnabled": custom_code_enabled, - "Push.IncludeDate": push_include_date, + "Psd2Enabled": serialize.boolean_to_string(psd2_enabled), + "DoNotShareWarningEnabled": serialize.boolean_to_string( + do_not_share_warning_enabled + ), + "CustomCodeEnabled": serialize.boolean_to_string(custom_code_enabled), + "Push.IncludeDate": serialize.boolean_to_string(push_include_date), "Push.ApnCredentialSid": push_apn_credential_sid, "Push.FcmCredentialSid": push_fcm_credential_sid, "Totp.Issuer": totp_issuer, @@ -845,7 +867,9 @@ async def create_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, - "VerifyEventSubscriptionEnabled": verify_event_subscription_enabled, + "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( + verify_event_subscription_enabled + ), } ) diff --git a/twilio/rest/video/v1/composition.py b/twilio/rest/video/v1/composition.py index 64ee0b2ce8..30aa33fff8 100644 --- a/twilio/rest/video/v1/composition.py +++ b/twilio/rest/video/v1/composition.py @@ -325,7 +325,7 @@ def create( "Format": format, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), } ) @@ -377,7 +377,7 @@ async def create_async( "Format": format, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), } ) diff --git a/twilio/rest/video/v1/composition_hook.py b/twilio/rest/video/v1/composition_hook.py index f6156e82ff..027a27f740 100644 --- a/twilio/rest/video/v1/composition_hook.py +++ b/twilio/rest/video/v1/composition_hook.py @@ -336,13 +336,13 @@ def update( data = values.of( { "FriendlyName": friendly_name, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "VideoLayout": serialize.object(video_layout), "AudioSources": serialize.map(audio_sources, lambda e: e), "AudioSourcesExcluded": serialize.map( audio_sources_excluded, lambda e: e ), - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), "Format": format, "Resolution": resolution, "StatusCallback": status_callback, @@ -392,13 +392,13 @@ async def update_async( data = values.of( { "FriendlyName": friendly_name, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "VideoLayout": serialize.object(video_layout), "AudioSources": serialize.map(audio_sources, lambda e: e), "AudioSourcesExcluded": serialize.map( audio_sources_excluded, lambda e: e ), - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), "Format": format, "Resolution": resolution, "StatusCallback": status_callback, @@ -491,7 +491,7 @@ def create( data = values.of( { "FriendlyName": friendly_name, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "VideoLayout": serialize.object(video_layout), "AudioSources": serialize.map(audio_sources, lambda e: e), "AudioSourcesExcluded": serialize.map( @@ -501,7 +501,7 @@ def create( "Format": format, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), } ) @@ -546,7 +546,7 @@ async def create_async( data = values.of( { "FriendlyName": friendly_name, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "VideoLayout": serialize.object(video_layout), "AudioSources": serialize.map(audio_sources, lambda e: e), "AudioSourcesExcluded": serialize.map( @@ -556,7 +556,7 @@ async def create_async( "Format": format, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, - "Trim": trim, + "Trim": serialize.boolean_to_string(trim), } ) @@ -749,7 +749,7 @@ def page( """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "DateCreatedAfter": serialize.iso8601_datetime(date_created_after), "DateCreatedBefore": serialize.iso8601_datetime(date_created_before), "FriendlyName": friendly_name, @@ -788,7 +788,7 @@ async def page_async( """ data = values.of( { - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), "DateCreatedAfter": serialize.iso8601_datetime(date_created_after), "DateCreatedBefore": serialize.iso8601_datetime(date_created_before), "FriendlyName": friendly_name, diff --git a/twilio/rest/video/v1/composition_settings.py b/twilio/rest/video/v1/composition_settings.py index 7082866b32..366ec727cf 100644 --- a/twilio/rest/video/v1/composition_settings.py +++ b/twilio/rest/video/v1/composition_settings.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -187,8 +187,8 @@ def create( "AwsCredentialsSid": aws_credentials_sid, "EncryptionKeySid": encryption_key_sid, "AwsS3Url": aws_s3_url, - "AwsStorageEnabled": aws_storage_enabled, - "EncryptionEnabled": encryption_enabled, + "AwsStorageEnabled": serialize.boolean_to_string(aws_storage_enabled), + "EncryptionEnabled": serialize.boolean_to_string(encryption_enabled), } ) @@ -223,8 +223,8 @@ async def create_async( "AwsCredentialsSid": aws_credentials_sid, "EncryptionKeySid": encryption_key_sid, "AwsS3Url": aws_s3_url, - "AwsStorageEnabled": aws_storage_enabled, - "EncryptionEnabled": encryption_enabled, + "AwsStorageEnabled": serialize.boolean_to_string(aws_storage_enabled), + "EncryptionEnabled": serialize.boolean_to_string(encryption_enabled), } ) diff --git a/twilio/rest/video/v1/recording_settings.py b/twilio/rest/video/v1/recording_settings.py index d0d6e5ebb8..3895b9d4ba 100644 --- a/twilio/rest/video/v1/recording_settings.py +++ b/twilio/rest/video/v1/recording_settings.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -187,8 +187,8 @@ def create( "AwsCredentialsSid": aws_credentials_sid, "EncryptionKeySid": encryption_key_sid, "AwsS3Url": aws_s3_url, - "AwsStorageEnabled": aws_storage_enabled, - "EncryptionEnabled": encryption_enabled, + "AwsStorageEnabled": serialize.boolean_to_string(aws_storage_enabled), + "EncryptionEnabled": serialize.boolean_to_string(encryption_enabled), } ) @@ -223,8 +223,8 @@ async def create_async( "AwsCredentialsSid": aws_credentials_sid, "EncryptionKeySid": encryption_key_sid, "AwsS3Url": aws_s3_url, - "AwsStorageEnabled": aws_storage_enabled, - "EncryptionEnabled": encryption_enabled, + "AwsStorageEnabled": serialize.boolean_to_string(aws_storage_enabled), + "EncryptionEnabled": serialize.boolean_to_string(encryption_enabled), } ) diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index d787c9896e..a8ffdb895c 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -437,21 +437,23 @@ def create( data = values.of( { - "EnableTurn": enable_turn, + "EnableTurn": serialize.boolean_to_string(enable_turn), "Type": type, "UniqueName": unique_name, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "MaxParticipants": max_participants, - "RecordParticipantsOnConnect": record_participants_on_connect, + "RecordParticipantsOnConnect": serialize.boolean_to_string( + record_participants_on_connect + ), "VideoCodecs": serialize.map(video_codecs, lambda e: e), "MediaRegion": media_region, "RecordingRules": serialize.object(recording_rules), - "AudioOnly": audio_only, + "AudioOnly": serialize.boolean_to_string(audio_only), "MaxParticipantDuration": max_participant_duration, "EmptyRoomTimeout": empty_room_timeout, "UnusedRoomTimeout": unused_room_timeout, - "LargeRoom": large_room, + "LargeRoom": serialize.boolean_to_string(large_room), } ) @@ -505,21 +507,23 @@ async def create_async( data = values.of( { - "EnableTurn": enable_turn, + "EnableTurn": serialize.boolean_to_string(enable_turn), "Type": type, "UniqueName": unique_name, "StatusCallback": status_callback, "StatusCallbackMethod": status_callback_method, "MaxParticipants": max_participants, - "RecordParticipantsOnConnect": record_participants_on_connect, + "RecordParticipantsOnConnect": serialize.boolean_to_string( + record_participants_on_connect + ), "VideoCodecs": serialize.map(video_codecs, lambda e: e), "MediaRegion": media_region, "RecordingRules": serialize.object(recording_rules), - "AudioOnly": audio_only, + "AudioOnly": serialize.boolean_to_string(audio_only), "MaxParticipantDuration": max_participant_duration, "EmptyRoomTimeout": empty_room_timeout, "UnusedRoomTimeout": unused_room_timeout, - "LargeRoom": large_room, + "LargeRoom": serialize.boolean_to_string(large_room), } ) diff --git a/twilio/rest/voice/v1/byoc_trunk.py b/twilio/rest/voice/v1/byoc_trunk.py index 1a8f60984d..a85cae660a 100644 --- a/twilio/rest/voice/v1/byoc_trunk.py +++ b/twilio/rest/voice/v1/byoc_trunk.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -335,7 +335,7 @@ def update( "VoiceFallbackMethod": voice_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, - "CnamLookupEnabled": cnam_lookup_enabled, + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "ConnectionPolicySid": connection_policy_sid, "FromDomainSid": from_domain_sid, } @@ -387,7 +387,7 @@ async def update_async( "VoiceFallbackMethod": voice_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, - "CnamLookupEnabled": cnam_lookup_enabled, + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "ConnectionPolicySid": connection_policy_sid, "FromDomainSid": from_domain_sid, } @@ -482,7 +482,7 @@ def create( "VoiceFallbackMethod": voice_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, - "CnamLookupEnabled": cnam_lookup_enabled, + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "ConnectionPolicySid": connection_policy_sid, "FromDomainSid": from_domain_sid, } @@ -535,7 +535,7 @@ async def create_async( "VoiceFallbackMethod": voice_fallback_method, "StatusCallbackUrl": status_callback_url, "StatusCallbackMethod": status_callback_method, - "CnamLookupEnabled": cnam_lookup_enabled, + "CnamLookupEnabled": serialize.boolean_to_string(cnam_lookup_enabled), "ConnectionPolicySid": connection_policy_sid, "FromDomainSid": from_domain_sid, } diff --git a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py index d1f8a41524..2fa490880a 100644 --- a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py +++ b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -294,7 +294,7 @@ def update( "Target": target, "Priority": priority, "Weight": weight, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -336,7 +336,7 @@ async def update_async( "Target": target, "Priority": priority, "Weight": weight, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -432,7 +432,7 @@ def create( "FriendlyName": friendly_name, "Priority": priority, "Weight": weight, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) @@ -474,7 +474,7 @@ async def create_async( "FriendlyName": friendly_name, "Priority": priority, "Weight": weight, - "Enabled": enabled, + "Enabled": serialize.boolean_to_string(enabled), } ) diff --git a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py index 4f694f41b0..2b9285c112 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -436,9 +436,15 @@ def page( "IsoCode": iso_code, "Continent": continent, "CountryCode": country_code, - "LowRiskNumbersEnabled": low_risk_numbers_enabled, - "HighRiskSpecialNumbersEnabled": high_risk_special_numbers_enabled, - "HighRiskTollfraudNumbersEnabled": high_risk_tollfraud_numbers_enabled, + "LowRiskNumbersEnabled": serialize.boolean_to_string( + low_risk_numbers_enabled + ), + "HighRiskSpecialNumbersEnabled": serialize.boolean_to_string( + high_risk_special_numbers_enabled + ), + "HighRiskTollfraudNumbersEnabled": serialize.boolean_to_string( + high_risk_tollfraud_numbers_enabled + ), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -481,9 +487,15 @@ async def page_async( "IsoCode": iso_code, "Continent": continent, "CountryCode": country_code, - "LowRiskNumbersEnabled": low_risk_numbers_enabled, - "HighRiskSpecialNumbersEnabled": high_risk_special_numbers_enabled, - "HighRiskTollfraudNumbersEnabled": high_risk_tollfraud_numbers_enabled, + "LowRiskNumbersEnabled": serialize.boolean_to_string( + low_risk_numbers_enabled + ), + "HighRiskSpecialNumbersEnabled": serialize.boolean_to_string( + high_risk_special_numbers_enabled + ), + "HighRiskTollfraudNumbersEnabled": serialize.boolean_to_string( + high_risk_tollfraud_numbers_enabled + ), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/voice/v1/dialing_permissions/settings.py b/twilio/rest/voice/v1/dialing_permissions/settings.py index 6ede5e3a6f..20d845673a 100644 --- a/twilio/rest/voice/v1/dialing_permissions/settings.py +++ b/twilio/rest/voice/v1/dialing_permissions/settings.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, Optional, Union -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -166,7 +166,9 @@ def update( """ data = values.of( { - "DialingPermissionsInheritance": dialing_permissions_inheritance, + "DialingPermissionsInheritance": serialize.boolean_to_string( + dialing_permissions_inheritance + ), } ) @@ -190,7 +192,9 @@ async def update_async( """ data = values.of( { - "DialingPermissionsInheritance": dialing_permissions_inheritance, + "DialingPermissionsInheritance": serialize.boolean_to_string( + dialing_permissions_inheritance + ), } ) diff --git a/twilio/rest/wireless/v1/command.py b/twilio/rest/wireless/v1/command.py index cb33e1d397..f310db8918 100644 --- a/twilio/rest/wireless/v1/command.py +++ b/twilio/rest/wireless/v1/command.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -303,7 +303,9 @@ def create( "CallbackUrl": callback_url, "CommandMode": command_mode, "IncludeSid": include_sid, - "DeliveryReceiptRequested": delivery_receipt_requested, + "DeliveryReceiptRequested": serialize.boolean_to_string( + delivery_receipt_requested + ), } ) @@ -347,7 +349,9 @@ async def create_async( "CallbackUrl": callback_url, "CommandMode": command_mode, "IncludeSid": include_sid, - "DeliveryReceiptRequested": delivery_receipt_requested, + "DeliveryReceiptRequested": serialize.boolean_to_string( + delivery_receipt_requested + ), } ) diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index 2bc8939257..0ee1e205a2 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -391,12 +391,14 @@ def create( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "DataMetering": data_metering, - "MessagingEnabled": messaging_enabled, - "VoiceEnabled": voice_enabled, - "NationalRoamingEnabled": national_roaming_enabled, + "MessagingEnabled": serialize.boolean_to_string(messaging_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "NationalRoamingEnabled": serialize.boolean_to_string( + national_roaming_enabled + ), "InternationalRoaming": serialize.map( international_roaming, lambda e: e ), @@ -449,12 +451,14 @@ async def create_async( { "UniqueName": unique_name, "FriendlyName": friendly_name, - "DataEnabled": data_enabled, + "DataEnabled": serialize.boolean_to_string(data_enabled), "DataLimit": data_limit, "DataMetering": data_metering, - "MessagingEnabled": messaging_enabled, - "VoiceEnabled": voice_enabled, - "NationalRoamingEnabled": national_roaming_enabled, + "MessagingEnabled": serialize.boolean_to_string(messaging_enabled), + "VoiceEnabled": serialize.boolean_to_string(voice_enabled), + "NationalRoamingEnabled": serialize.boolean_to_string( + national_roaming_enabled + ), "InternationalRoaming": serialize.map( international_roaming, lambda e: e ), From e4285a40a798fce3a0894b1f7e40bb0c3e8955ef Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 27 Feb 2024 14:14:41 +0000 Subject: [PATCH 010/113] Release 9.0.0 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index bb6ca3cecf..295f4e3498 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="8.13.0", + version="9.0.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 1d1288358e..77a8b581b3 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("8", "13", "0") +__version_info__ = ("9", "0", "0") __version__ = ".".join(__version_info__) From bfb07a77d22b28282c671efb9008dfa74464b27e Mon Sep 17 00:00:00 2001 From: Shubham Date: Wed, 6 Mar 2024 11:52:55 +0530 Subject: [PATCH 011/113] chore: removing preview.understand references (#775) --- twilio/rest/preview/__init__.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/twilio/rest/preview/__init__.py b/twilio/rest/preview/__init__.py index 6933f3627c..79d870e134 100644 --- a/twilio/rest/preview/__init__.py +++ b/twilio/rest/preview/__init__.py @@ -9,7 +9,6 @@ from twilio.rest.preview.marketplace.available_add_on import AvailableAddOnList from twilio.rest.preview.marketplace.installed_add_on import InstalledAddOnList from twilio.rest.preview.sync.service import ServiceList -from twilio.rest.preview.understand.assistant import AssistantList from twilio.rest.preview.wireless.command import CommandList from twilio.rest.preview.wireless.rate_plan import RatePlanList from twilio.rest.preview.wireless.sim import SimList @@ -70,15 +69,6 @@ def services(self) -> ServiceList: ) return self.sync.services - @property - def assistants(self) -> AssistantList: - warn( - "assistants is deprecated. Use understand.assistants instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.understand.assistants - @property def commands(self) -> CommandList: warn( From c715d109792f0b32966b732987551f3a1f2816f5 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 12 Mar 2024 08:59:37 +0000 Subject: [PATCH 012/113] [Librarian] Regenerated @ 2264f28906b87ae1f1aedbf72f8dc0e4b57a545a --- CHANGES.md | 29 + .../api/v2010/account/message/__init__.py | 8 +- twilio/rest/content/v1/legacy_content.py | 2 +- twilio/rest/flex_api/v1/__init__.py | 52 ++ twilio/rest/flex_api/v1/plugin/__init__.py | 653 ++++++++++++++++++ .../flex_api/v1/plugin/plugin_versions.py | 558 +++++++++++++++ twilio/rest/flex_api/v1/plugin_archive.py | 220 ++++++ .../v1/plugin_configuration/__init__.py | 543 +++++++++++++++ .../plugin_configuration/configured_plugin.py | 494 +++++++++++++ .../v1/plugin_configuration_archive.py | 224 ++++++ twilio/rest/flex_api/v1/plugin_release.py | 497 +++++++++++++ .../flex_api/v1/plugin_version_archive.py | 246 +++++++ .../v1/brand_registration/__init__.py | 6 +- twilio/rest/numbers/v1/__init__.py | 10 +- .../v1/compliance_registration_inquiries.py | 12 + twilio/twiml/messaging_response.py | 2 +- 16 files changed, 3543 insertions(+), 13 deletions(-) create mode 100644 twilio/rest/flex_api/v1/plugin/__init__.py create mode 100644 twilio/rest/flex_api/v1/plugin/plugin_versions.py create mode 100644 twilio/rest/flex_api/v1/plugin_archive.py create mode 100644 twilio/rest/flex_api/v1/plugin_configuration/__init__.py create mode 100644 twilio/rest/flex_api/v1/plugin_configuration/configured_plugin.py create mode 100644 twilio/rest/flex_api/v1/plugin_configuration_archive.py create mode 100644 twilio/rest/flex_api/v1/plugin_release.py create mode 100644 twilio/rest/flex_api/v1/plugin_version_archive.py diff --git a/CHANGES.md b/CHANGES.md index d9cb281a5e..54f764154d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,35 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-03-12] Version 9.0.1 +-------------------------- +**Library - Chore** +- [PR #775](https://github.com/twilio/twilio-python/pull/775): removing preview.understand references. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Api** +- Correct precedence documentation for application_sid vs status_callback in message creation +- Mark MaxPrice as deprecated + +**Flex** +- Making `plugins` visibility to public + +**Messaging** +- Add new `errors` attribute to the Brand Registration resource. +- Mark `brand_feedback` attribute as deprecated. +- Mark `failure_reason` attribute as deprecated. +- The new `errors` attribute is expected to provide additional information about Brand registration failures and feedback (if any has been provided by The Campaign Registry). Consumers should use this attribute instead of `brand_feedback` and `failure_reason`. + +**Numbers** +- Correcting mount_name for porting port in fetch API + +**Trusthub** +- Add new field in statusCallbackUrl in compliance_registration. +- Add new field in isvRegisteringForSelfOrTenant in compliance_registration. + +**Twiml** +- Expanded description of Action parameter for Message verb + + [2024-02-27] Version 9.0.0 -------------------------- **Note:** This release contains breaking changes, check our [upgrade guide](./UPGRADE.md###-2024-02-20-8xx-to-9xx) for detailed migration notes. diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 795ad19747..eb562be023 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -508,8 +508,8 @@ def create( :param to: The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`. :param status_callback: The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). - :param application_sid: The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). If this parameter is provided, the `status_callback` parameter of this request is ignored; [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. - :param max_price: The maximum price in US dollars that you are willing to pay for this Message's delivery. The value can have up to four decimal places. When the `max_price` parameter is provided, the cost of a message is checked before it is sent. If the cost exceeds `max_price`, the message is not sent and the Message `status` is `failed`. + :param application_sid: The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. + :param max_price: [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03. :param provide_feedback: Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. :param attempt: Total number of attempts made (including this request) to send the message regardless of the provider used :param validity_period: The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) @@ -606,8 +606,8 @@ async def create_async( :param to: The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`. :param status_callback: The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). - :param application_sid: The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). If this parameter is provided, the `status_callback` parameter of this request is ignored; [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. - :param max_price: The maximum price in US dollars that you are willing to pay for this Message's delivery. The value can have up to four decimal places. When the `max_price` parameter is provided, the cost of a message is checked before it is sent. If the cost exceeds `max_price`, the message is not sent and the Message `status` is `failed`. + :param application_sid: The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. + :param max_price: [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03. :param provide_feedback: Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. :param attempt: Total number of attempts made (including this request) to send the message regardless of the provider used :param validity_period: The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) diff --git a/twilio/rest/content/v1/legacy_content.py b/twilio/rest/content/v1/legacy_content.py index 5705c33b0b..cfb4ac698d 100644 --- a/twilio/rest/content/v1/legacy_content.py +++ b/twilio/rest/content/v1/legacy_content.py @@ -31,7 +31,7 @@ class LegacyContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar legacy_template_name: The string name of the legacy content template associated with this Content resource, unique across all template names for its account. Only lowercase letters, numbers and underscores are allowed :ivar legacy_body: The string body field of the legacy content template associated with this Content resource :ivar url: The URL of the resource, relative to `https://content.twilio.com`. diff --git a/twilio/rest/flex_api/v1/__init__.py b/twilio/rest/flex_api/v1/__init__.py index 9ea1197724..eeb00227e9 100644 --- a/twilio/rest/flex_api/v1/__init__.py +++ b/twilio/rest/flex_api/v1/__init__.py @@ -40,6 +40,14 @@ ) from twilio.rest.flex_api.v1.insights_user_roles import InsightsUserRolesList from twilio.rest.flex_api.v1.interaction import InteractionList +from twilio.rest.flex_api.v1.plugin import PluginList +from twilio.rest.flex_api.v1.plugin_archive import PluginArchiveList +from twilio.rest.flex_api.v1.plugin_configuration import PluginConfigurationList +from twilio.rest.flex_api.v1.plugin_configuration_archive import ( + PluginConfigurationArchiveList, +) +from twilio.rest.flex_api.v1.plugin_release import PluginReleaseList +from twilio.rest.flex_api.v1.plugin_version_archive import PluginVersionArchiveList from twilio.rest.flex_api.v1.provisioning_status import ProvisioningStatusList from twilio.rest.flex_api.v1.web_channel import WebChannelList @@ -76,6 +84,14 @@ def __init__(self, domain: Domain): self._insights_settings_comment: Optional[InsightsSettingsCommentList] = None self._insights_user_roles: Optional[InsightsUserRolesList] = None self._interaction: Optional[InteractionList] = None + self._plugins: Optional[PluginList] = None + self._plugin_archive: Optional[PluginArchiveList] = None + self._plugin_configurations: Optional[PluginConfigurationList] = None + self._plugin_configuration_archive: Optional[PluginConfigurationArchiveList] = ( + None + ) + self._plugin_releases: Optional[PluginReleaseList] = None + self._plugin_version_archive: Optional[PluginVersionArchiveList] = None self._provisioning_status: Optional[ProvisioningStatusList] = None self._web_channel: Optional[WebChannelList] = None @@ -173,6 +189,42 @@ def interaction(self) -> InteractionList: self._interaction = InteractionList(self) return self._interaction + @property + def plugins(self) -> PluginList: + if self._plugins is None: + self._plugins = PluginList(self) + return self._plugins + + @property + def plugin_archive(self) -> PluginArchiveList: + if self._plugin_archive is None: + self._plugin_archive = PluginArchiveList(self) + return self._plugin_archive + + @property + def plugin_configurations(self) -> PluginConfigurationList: + if self._plugin_configurations is None: + self._plugin_configurations = PluginConfigurationList(self) + return self._plugin_configurations + + @property + def plugin_configuration_archive(self) -> PluginConfigurationArchiveList: + if self._plugin_configuration_archive is None: + self._plugin_configuration_archive = PluginConfigurationArchiveList(self) + return self._plugin_configuration_archive + + @property + def plugin_releases(self) -> PluginReleaseList: + if self._plugin_releases is None: + self._plugin_releases = PluginReleaseList(self) + return self._plugin_releases + + @property + def plugin_version_archive(self) -> PluginVersionArchiveList: + if self._plugin_version_archive is None: + self._plugin_version_archive = PluginVersionArchiveList(self) + return self._plugin_version_archive + @property def provisioning_status(self) -> ProvisioningStatusList: if self._provisioning_status is None: diff --git a/twilio/rest/flex_api/v1/plugin/__init__.py b/twilio/rest/flex_api/v1/plugin/__init__.py new file mode 100644 index 0000000000..09244d42de --- /dev/null +++ b/twilio/rest/flex_api/v1/plugin/__init__.py @@ -0,0 +1,653 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page +from twilio.rest.flex_api.v1.plugin.plugin_versions import PluginVersionsList + + +class PluginInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the Flex Plugin resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Plugin resource and owns this resource. + :ivar unique_name: The name that uniquely identifies this Flex Plugin resource. + :ivar friendly_name: The friendly name this Flex Plugin resource. + :ivar description: A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + :ivar archived: Whether the Flex Plugin is archived. The default value is false. + :ivar date_created: The date and time in GMT-7 when the Flex Plugin was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT-7 when the Flex Plugin was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar url: The absolute URL of the Flex Plugin resource. + :ivar links: + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.unique_name: Optional[str] = payload.get("unique_name") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.description: Optional[str] = payload.get("description") + self.archived: Optional[bool] = payload.get("archived") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.url: Optional[str] = payload.get("url") + self.links: Optional[Dict[str, object]] = payload.get("links") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[PluginContext] = None + + @property + def _proxy(self) -> "PluginContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PluginContext for this PluginInstance + """ + if self._context is None: + self._context = PluginContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def fetch( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginInstance": + """ + Fetch the PluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginInstance + """ + return self._proxy.fetch( + flex_metadata=flex_metadata, + ) + + async def fetch_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginInstance": + """ + Asynchronous coroutine to fetch the PluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginInstance + """ + return await self._proxy.fetch_async( + flex_metadata=flex_metadata, + ) + + def update( + self, + flex_metadata: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + description: Union[str, object] = values.unset, + ) -> "PluginInstance": + """ + Update the PluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + :param friendly_name: The Flex Plugin's friendly name. + :param description: A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long + + :returns: The updated PluginInstance + """ + return self._proxy.update( + flex_metadata=flex_metadata, + friendly_name=friendly_name, + description=description, + ) + + async def update_async( + self, + flex_metadata: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + description: Union[str, object] = values.unset, + ) -> "PluginInstance": + """ + Asynchronous coroutine to update the PluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + :param friendly_name: The Flex Plugin's friendly name. + :param description: A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long + + :returns: The updated PluginInstance + """ + return await self._proxy.update_async( + flex_metadata=flex_metadata, + friendly_name=friendly_name, + description=description, + ) + + @property + def plugin_versions(self) -> PluginVersionsList: + """ + Access the plugin_versions + """ + return self._proxy.plugin_versions + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the PluginContext + + :param version: Version that contains the resource + :param sid: The SID of the Flex Plugin resource to update. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/PluginService/Plugins/{sid}".format(**self._solution) + + self._plugin_versions: Optional[PluginVersionsList] = None + + def fetch(self, flex_metadata: Union[str, object] = values.unset) -> PluginInstance: + """ + Fetch the PluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginInstance + """ + + data = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + + return PluginInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginInstance: + """ + Asynchronous coroutine to fetch the PluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginInstance + """ + + data = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=data + ) + + return PluginInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + def update( + self, + flex_metadata: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + description: Union[str, object] = values.unset, + ) -> PluginInstance: + """ + Update the PluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + :param friendly_name: The Flex Plugin's friendly name. + :param description: A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long + + :returns: The updated PluginInstance + """ + data = values.of( + { + "FriendlyName": friendly_name, + "Description": description, + } + ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.update( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginInstance(self._version, payload, sid=self._solution["sid"]) + + async def update_async( + self, + flex_metadata: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + description: Union[str, object] = values.unset, + ) -> PluginInstance: + """ + Asynchronous coroutine to update the PluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + :param friendly_name: The Flex Plugin's friendly name. + :param description: A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long + + :returns: The updated PluginInstance + """ + data = values.of( + { + "FriendlyName": friendly_name, + "Description": description, + } + ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.update_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginInstance(self._version, payload, sid=self._solution["sid"]) + + @property + def plugin_versions(self) -> PluginVersionsList: + """ + Access the plugin_versions + """ + if self._plugin_versions is None: + self._plugin_versions = PluginVersionsList( + self._version, + self._solution["sid"], + ) + return self._plugin_versions + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> PluginInstance: + """ + Build an instance of PluginInstance + + :param payload: Payload response from the API + """ + return PluginInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class PluginList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PluginList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/PluginService/Plugins" + + def create( + self, + unique_name: str, + flex_metadata: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + description: Union[str, object] = values.unset, + ) -> PluginInstance: + """ + Create the PluginInstance + + :param unique_name: The Flex Plugin's unique name. + :param flex_metadata: The Flex-Metadata HTTP request header + :param friendly_name: The Flex Plugin's friendly name. + :param description: A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + + :returns: The created PluginInstance + """ + + data = values.of( + { + "UniqueName": unique_name, + "FriendlyName": friendly_name, + "Description": description, + } + ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginInstance(self._version, payload) + + async def create_async( + self, + unique_name: str, + flex_metadata: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + description: Union[str, object] = values.unset, + ) -> PluginInstance: + """ + Asynchronously create the PluginInstance + + :param unique_name: The Flex Plugin's unique name. + :param flex_metadata: The Flex-Metadata HTTP request header + :param friendly_name: The Flex Plugin's friendly name. + :param description: A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + + :returns: The created PluginInstance + """ + + data = values.of( + { + "UniqueName": unique_name, + "FriendlyName": friendly_name, + "Description": description, + } + ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginInstance(self._version, payload) + + def stream( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[PluginInstance]: + """ + Streams PluginInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(flex_metadata=flex_metadata, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[PluginInstance]: + """ + Asynchronously streams PluginInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + flex_metadata=flex_metadata, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PluginInstance]: + """ + Lists PluginInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + flex_metadata=flex_metadata, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PluginInstance]: + """ + Asynchronously lists PluginInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + flex_metadata=flex_metadata, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + flex_metadata: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PluginPage: + """ + Retrieve a single page of PluginInstance records from the API. + Request is executed immediately + + :param flex_metadata: The Flex-Metadata HTTP request header + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PluginInstance + """ + data = values.of( + { + "Flex-Metadata": flex_metadata, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return PluginPage(self._version, response) + + async def page_async( + self, + flex_metadata: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PluginPage: + """ + Asynchronously retrieve a single page of PluginInstance records from the API. + Request is executed immediately + + :param flex_metadata: The Flex-Metadata HTTP request header + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PluginInstance + """ + data = values.of( + { + "Flex-Metadata": flex_metadata, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return PluginPage(self._version, response) + + def get_page(self, target_url: str) -> PluginPage: + """ + Retrieve a specific page of PluginInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PluginInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return PluginPage(self._version, response) + + async def get_page_async(self, target_url: str) -> PluginPage: + """ + Asynchronously retrieve a specific page of PluginInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PluginInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return PluginPage(self._version, response) + + def get(self, sid: str) -> PluginContext: + """ + Constructs a PluginContext + + :param sid: The SID of the Flex Plugin resource to update. + """ + return PluginContext(self._version, sid=sid) + + def __call__(self, sid: str) -> PluginContext: + """ + Constructs a PluginContext + + :param sid: The SID of the Flex Plugin resource to update. + """ + return PluginContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/plugin/plugin_versions.py b/twilio/rest/flex_api/v1/plugin/plugin_versions.py new file mode 100644 index 0000000000..6f492dbad6 --- /dev/null +++ b/twilio/rest/flex_api/v1/plugin/plugin_versions.py @@ -0,0 +1,558 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class PluginVersionsInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the Flex Plugin Version resource. + :ivar plugin_sid: The SID of the Flex Plugin resource this Flex Plugin Version belongs to. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Plugin Version resource and owns this resource. + :ivar version: The unique version of this Flex Plugin Version. + :ivar plugin_url: The URL of where the Flex Plugin Version JavaScript bundle is hosted on. + :ivar changelog: A changelog that describes the changes this Flex Plugin Version brings. + :ivar private: Whether to inject credentials while accessing this Plugin Version. The default value is false. + :ivar archived: Whether the Flex Plugin Version is archived. The default value is false. + :ivar date_created: The date and time in GMT when the Flex Plugin Version was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar url: The absolute URL of the Flex Plugin Version resource. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + plugin_sid: str, + sid: Optional[str] = None, + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.plugin_sid: Optional[str] = payload.get("plugin_sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.version: Optional[str] = payload.get("version") + self.plugin_url: Optional[str] = payload.get("plugin_url") + self.changelog: Optional[str] = payload.get("changelog") + self.private: Optional[bool] = payload.get("private") + self.archived: Optional[bool] = payload.get("archived") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "plugin_sid": plugin_sid, + "sid": sid or self.sid, + } + self._context: Optional[PluginVersionsContext] = None + + @property + def _proxy(self) -> "PluginVersionsContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PluginVersionsContext for this PluginVersionsInstance + """ + if self._context is None: + self._context = PluginVersionsContext( + self._version, + plugin_sid=self._solution["plugin_sid"], + sid=self._solution["sid"], + ) + return self._context + + def fetch( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginVersionsInstance": + """ + Fetch the PluginVersionsInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginVersionsInstance + """ + return self._proxy.fetch( + flex_metadata=flex_metadata, + ) + + async def fetch_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginVersionsInstance": + """ + Asynchronous coroutine to fetch the PluginVersionsInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginVersionsInstance + """ + return await self._proxy.fetch_async( + flex_metadata=flex_metadata, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginVersionsContext(InstanceContext): + + def __init__(self, version: Version, plugin_sid: str, sid: str): + """ + Initialize the PluginVersionsContext + + :param version: Version that contains the resource + :param plugin_sid: The SID of the Flex Plugin the resource to belongs to. + :param sid: The SID of the Flex Plugin Version resource to fetch. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "plugin_sid": plugin_sid, + "sid": sid, + } + self._uri = "/PluginService/Plugins/{plugin_sid}/Versions/{sid}".format( + **self._solution + ) + + def fetch( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginVersionsInstance: + """ + Fetch the PluginVersionsInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginVersionsInstance + """ + + data = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + + return PluginVersionsInstance( + self._version, + payload, + plugin_sid=self._solution["plugin_sid"], + sid=self._solution["sid"], + ) + + async def fetch_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginVersionsInstance: + """ + Asynchronous coroutine to fetch the PluginVersionsInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginVersionsInstance + """ + + data = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=data + ) + + return PluginVersionsInstance( + self._version, + payload, + plugin_sid=self._solution["plugin_sid"], + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginVersionsPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> PluginVersionsInstance: + """ + Build an instance of PluginVersionsInstance + + :param payload: Payload response from the API + """ + return PluginVersionsInstance( + self._version, payload, plugin_sid=self._solution["plugin_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class PluginVersionsList(ListResource): + + def __init__(self, version: Version, plugin_sid: str): + """ + Initialize the PluginVersionsList + + :param version: Version that contains the resource + :param plugin_sid: The SID of the Flex Plugin the resource to belongs to. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "plugin_sid": plugin_sid, + } + self._uri = "/PluginService/Plugins/{plugin_sid}/Versions".format( + **self._solution + ) + + def create( + self, + version: str, + plugin_url: str, + flex_metadata: Union[str, object] = values.unset, + changelog: Union[str, object] = values.unset, + private: Union[bool, object] = values.unset, + ) -> PluginVersionsInstance: + """ + Create the PluginVersionsInstance + + :param version: The Flex Plugin Version's version. + :param plugin_url: The URL of the Flex Plugin Version bundle + :param flex_metadata: The Flex-Metadata HTTP request header + :param changelog: The changelog of the Flex Plugin Version. + :param private: Whether this Flex Plugin Version requires authorization. + + :returns: The created PluginVersionsInstance + """ + + data = values.of( + { + "Version": version, + "PluginUrl": plugin_url, + "Changelog": changelog, + "Private": serialize.boolean_to_string(private), + } + ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginVersionsInstance( + self._version, payload, plugin_sid=self._solution["plugin_sid"] + ) + + async def create_async( + self, + version: str, + plugin_url: str, + flex_metadata: Union[str, object] = values.unset, + changelog: Union[str, object] = values.unset, + private: Union[bool, object] = values.unset, + ) -> PluginVersionsInstance: + """ + Asynchronously create the PluginVersionsInstance + + :param version: The Flex Plugin Version's version. + :param plugin_url: The URL of the Flex Plugin Version bundle + :param flex_metadata: The Flex-Metadata HTTP request header + :param changelog: The changelog of the Flex Plugin Version. + :param private: Whether this Flex Plugin Version requires authorization. + + :returns: The created PluginVersionsInstance + """ + + data = values.of( + { + "Version": version, + "PluginUrl": plugin_url, + "Changelog": changelog, + "Private": serialize.boolean_to_string(private), + } + ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginVersionsInstance( + self._version, payload, plugin_sid=self._solution["plugin_sid"] + ) + + def stream( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[PluginVersionsInstance]: + """ + Streams PluginVersionsInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(flex_metadata=flex_metadata, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[PluginVersionsInstance]: + """ + Asynchronously streams PluginVersionsInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + flex_metadata=flex_metadata, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PluginVersionsInstance]: + """ + Lists PluginVersionsInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + flex_metadata=flex_metadata, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PluginVersionsInstance]: + """ + Asynchronously lists PluginVersionsInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + flex_metadata=flex_metadata, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + flex_metadata: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PluginVersionsPage: + """ + Retrieve a single page of PluginVersionsInstance records from the API. + Request is executed immediately + + :param flex_metadata: The Flex-Metadata HTTP request header + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PluginVersionsInstance + """ + data = values.of( + { + "Flex-Metadata": flex_metadata, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return PluginVersionsPage(self._version, response, self._solution) + + async def page_async( + self, + flex_metadata: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PluginVersionsPage: + """ + Asynchronously retrieve a single page of PluginVersionsInstance records from the API. + Request is executed immediately + + :param flex_metadata: The Flex-Metadata HTTP request header + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PluginVersionsInstance + """ + data = values.of( + { + "Flex-Metadata": flex_metadata, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return PluginVersionsPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> PluginVersionsPage: + """ + Retrieve a specific page of PluginVersionsInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PluginVersionsInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return PluginVersionsPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> PluginVersionsPage: + """ + Asynchronously retrieve a specific page of PluginVersionsInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PluginVersionsInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return PluginVersionsPage(self._version, response, self._solution) + + def get(self, sid: str) -> PluginVersionsContext: + """ + Constructs a PluginVersionsContext + + :param sid: The SID of the Flex Plugin Version resource to fetch. + """ + return PluginVersionsContext( + self._version, plugin_sid=self._solution["plugin_sid"], sid=sid + ) + + def __call__(self, sid: str) -> PluginVersionsContext: + """ + Constructs a PluginVersionsContext + + :param sid: The SID of the Flex Plugin Version resource to fetch. + """ + return PluginVersionsContext( + self._version, plugin_sid=self._solution["plugin_sid"], sid=sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/plugin_archive.py b/twilio/rest/flex_api/v1/plugin_archive.py new file mode 100644 index 0000000000..68f9bce384 --- /dev/null +++ b/twilio/rest/flex_api/v1/plugin_archive.py @@ -0,0 +1,220 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PluginArchiveInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the Flex Plugin resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Plugin resource and owns this resource. + :ivar unique_name: The name that uniquely identifies this Flex Plugin resource. + :ivar friendly_name: The friendly name this Flex Plugin resource. + :ivar description: A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + :ivar archived: Whether the Flex Plugin is archived. The default value is false. + :ivar date_created: The date and time in GMT when the Flex Plugin was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Flex Plugin was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar url: The absolute URL of the Flex Plugin resource. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.unique_name: Optional[str] = payload.get("unique_name") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.description: Optional[str] = payload.get("description") + self.archived: Optional[bool] = payload.get("archived") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[PluginArchiveContext] = None + + @property + def _proxy(self) -> "PluginArchiveContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PluginArchiveContext for this PluginArchiveInstance + """ + if self._context is None: + self._context = PluginArchiveContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def update( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginArchiveInstance": + """ + Update the PluginArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginArchiveInstance + """ + return self._proxy.update( + flex_metadata=flex_metadata, + ) + + async def update_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginArchiveInstance": + """ + Asynchronous coroutine to update the PluginArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginArchiveInstance + """ + return await self._proxy.update_async( + flex_metadata=flex_metadata, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginArchiveContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the PluginArchiveContext + + :param version: Version that contains the resource + :param sid: The SID of the Flex Plugin resource to archive. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/PluginService/Plugins/{sid}/Archive".format(**self._solution) + + def update( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginArchiveInstance: + """ + Update the PluginArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginArchiveInstance + """ + data = values.of({}) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.update( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginArchiveInstance(self._version, payload, sid=self._solution["sid"]) + + async def update_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginArchiveInstance: + """ + Asynchronous coroutine to update the PluginArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginArchiveInstance + """ + data = values.of({}) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.update_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginArchiveInstance(self._version, payload, sid=self._solution["sid"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginArchiveList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PluginArchiveList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, sid: str) -> PluginArchiveContext: + """ + Constructs a PluginArchiveContext + + :param sid: The SID of the Flex Plugin resource to archive. + """ + return PluginArchiveContext(self._version, sid=sid) + + def __call__(self, sid: str) -> PluginArchiveContext: + """ + Constructs a PluginArchiveContext + + :param sid: The SID of the Flex Plugin resource to archive. + """ + return PluginArchiveContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/plugin_configuration/__init__.py b/twilio/rest/flex_api/v1/plugin_configuration/__init__.py new file mode 100644 index 0000000000..ebe173985b --- /dev/null +++ b/twilio/rest/flex_api/v1/plugin_configuration/__init__.py @@ -0,0 +1,543 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page +from twilio.rest.flex_api.v1.plugin_configuration.configured_plugin import ( + ConfiguredPluginList, +) + + +class PluginConfigurationInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the Flex Plugin Configuration resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Plugin Configuration resource and owns this resource. + :ivar name: The name of this Flex Plugin Configuration. + :ivar description: The description of the Flex Plugin Configuration resource. + :ivar archived: Whether the Flex Plugin Configuration is archived. The default value is false. + :ivar date_created: The date and time in GMT when the Flex Plugin Configuration was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar url: The absolute URL of the Flex Plugin Configuration resource. + :ivar links: + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.name: Optional[str] = payload.get("name") + self.description: Optional[str] = payload.get("description") + self.archived: Optional[bool] = payload.get("archived") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.url: Optional[str] = payload.get("url") + self.links: Optional[Dict[str, object]] = payload.get("links") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[PluginConfigurationContext] = None + + @property + def _proxy(self) -> "PluginConfigurationContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PluginConfigurationContext for this PluginConfigurationInstance + """ + if self._context is None: + self._context = PluginConfigurationContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def fetch( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginConfigurationInstance": + """ + Fetch the PluginConfigurationInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginConfigurationInstance + """ + return self._proxy.fetch( + flex_metadata=flex_metadata, + ) + + async def fetch_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginConfigurationInstance": + """ + Asynchronous coroutine to fetch the PluginConfigurationInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginConfigurationInstance + """ + return await self._proxy.fetch_async( + flex_metadata=flex_metadata, + ) + + @property + def plugins(self) -> ConfiguredPluginList: + """ + Access the plugins + """ + return self._proxy.plugins + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginConfigurationContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the PluginConfigurationContext + + :param version: Version that contains the resource + :param sid: The SID of the Flex Plugin Configuration resource to fetch. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/PluginService/Configurations/{sid}".format(**self._solution) + + self._plugins: Optional[ConfiguredPluginList] = None + + def fetch( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginConfigurationInstance: + """ + Fetch the PluginConfigurationInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginConfigurationInstance + """ + + data = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + + return PluginConfigurationInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginConfigurationInstance: + """ + Asynchronous coroutine to fetch the PluginConfigurationInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginConfigurationInstance + """ + + data = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=data + ) + + return PluginConfigurationInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + @property + def plugins(self) -> ConfiguredPluginList: + """ + Access the plugins + """ + if self._plugins is None: + self._plugins = ConfiguredPluginList( + self._version, + self._solution["sid"], + ) + return self._plugins + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginConfigurationPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> PluginConfigurationInstance: + """ + Build an instance of PluginConfigurationInstance + + :param payload: Payload response from the API + """ + return PluginConfigurationInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class PluginConfigurationList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PluginConfigurationList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/PluginService/Configurations" + + def create( + self, + name: str, + flex_metadata: Union[str, object] = values.unset, + plugins: Union[List[object], object] = values.unset, + description: Union[str, object] = values.unset, + ) -> PluginConfigurationInstance: + """ + Create the PluginConfigurationInstance + + :param name: The Flex Plugin Configuration's name. + :param flex_metadata: The Flex-Metadata HTTP request header + :param plugins: A list of objects that describe the plugin versions included in the configuration. Each object contains the sid of the plugin version. + :param description: The Flex Plugin Configuration's description. + + :returns: The created PluginConfigurationInstance + """ + + data = values.of( + { + "Name": name, + "Plugins": serialize.map(plugins, lambda e: serialize.object(e)), + "Description": description, + } + ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginConfigurationInstance(self._version, payload) + + async def create_async( + self, + name: str, + flex_metadata: Union[str, object] = values.unset, + plugins: Union[List[object], object] = values.unset, + description: Union[str, object] = values.unset, + ) -> PluginConfigurationInstance: + """ + Asynchronously create the PluginConfigurationInstance + + :param name: The Flex Plugin Configuration's name. + :param flex_metadata: The Flex-Metadata HTTP request header + :param plugins: A list of objects that describe the plugin versions included in the configuration. Each object contains the sid of the plugin version. + :param description: The Flex Plugin Configuration's description. + + :returns: The created PluginConfigurationInstance + """ + + data = values.of( + { + "Name": name, + "Plugins": serialize.map(plugins, lambda e: serialize.object(e)), + "Description": description, + } + ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginConfigurationInstance(self._version, payload) + + def stream( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[PluginConfigurationInstance]: + """ + Streams PluginConfigurationInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(flex_metadata=flex_metadata, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[PluginConfigurationInstance]: + """ + Asynchronously streams PluginConfigurationInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + flex_metadata=flex_metadata, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PluginConfigurationInstance]: + """ + Lists PluginConfigurationInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + flex_metadata=flex_metadata, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PluginConfigurationInstance]: + """ + Asynchronously lists PluginConfigurationInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + flex_metadata=flex_metadata, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + flex_metadata: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PluginConfigurationPage: + """ + Retrieve a single page of PluginConfigurationInstance records from the API. + Request is executed immediately + + :param flex_metadata: The Flex-Metadata HTTP request header + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PluginConfigurationInstance + """ + data = values.of( + { + "Flex-Metadata": flex_metadata, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return PluginConfigurationPage(self._version, response) + + async def page_async( + self, + flex_metadata: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PluginConfigurationPage: + """ + Asynchronously retrieve a single page of PluginConfigurationInstance records from the API. + Request is executed immediately + + :param flex_metadata: The Flex-Metadata HTTP request header + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PluginConfigurationInstance + """ + data = values.of( + { + "Flex-Metadata": flex_metadata, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return PluginConfigurationPage(self._version, response) + + def get_page(self, target_url: str) -> PluginConfigurationPage: + """ + Retrieve a specific page of PluginConfigurationInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PluginConfigurationInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return PluginConfigurationPage(self._version, response) + + async def get_page_async(self, target_url: str) -> PluginConfigurationPage: + """ + Asynchronously retrieve a specific page of PluginConfigurationInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PluginConfigurationInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return PluginConfigurationPage(self._version, response) + + def get(self, sid: str) -> PluginConfigurationContext: + """ + Constructs a PluginConfigurationContext + + :param sid: The SID of the Flex Plugin Configuration resource to fetch. + """ + return PluginConfigurationContext(self._version, sid=sid) + + def __call__(self, sid: str) -> PluginConfigurationContext: + """ + Constructs a PluginConfigurationContext + + :param sid: The SID of the Flex Plugin Configuration resource to fetch. + """ + return PluginConfigurationContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/plugin_configuration/configured_plugin.py b/twilio/rest/flex_api/v1/plugin_configuration/configured_plugin.py new file mode 100644 index 0000000000..6e54012eb0 --- /dev/null +++ b/twilio/rest/flex_api/v1/plugin_configuration/configured_plugin.py @@ -0,0 +1,494 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class ConfiguredPluginInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the Flex Plugin resource is installed for. + :ivar configuration_sid: The SID of the Flex Plugin Configuration that this Flex Plugin belongs to. + :ivar plugin_sid: The SID of the Flex Plugin. + :ivar plugin_version_sid: The SID of the Flex Plugin Version. + :ivar phase: The phase this Flex Plugin would initialize at runtime. + :ivar plugin_url: The URL of where the Flex Plugin Version JavaScript bundle is hosted on. + :ivar unique_name: The name that uniquely identifies this Flex Plugin resource. + :ivar friendly_name: The friendly name of this Flex Plugin resource. + :ivar description: A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + :ivar plugin_archived: Whether the Flex Plugin is archived. The default value is false. + :ivar version: The latest version of this Flex Plugin Version. + :ivar changelog: A changelog that describes the changes this Flex Plugin Version brings. + :ivar plugin_version_archived: Whether the Flex Plugin Version is archived. The default value is false. + :ivar private: Whether to validate the request is authorized to access the Flex Plugin Version. + :ivar date_created: The date and time in GMT when the Flex Plugin was installed specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar url: The absolute URL of the Flex Plugin resource. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + configuration_sid: str, + plugin_sid: Optional[str] = None, + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.configuration_sid: Optional[str] = payload.get("configuration_sid") + self.plugin_sid: Optional[str] = payload.get("plugin_sid") + self.plugin_version_sid: Optional[str] = payload.get("plugin_version_sid") + self.phase: Optional[int] = deserialize.integer(payload.get("phase")) + self.plugin_url: Optional[str] = payload.get("plugin_url") + self.unique_name: Optional[str] = payload.get("unique_name") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.description: Optional[str] = payload.get("description") + self.plugin_archived: Optional[bool] = payload.get("plugin_archived") + self.version: Optional[str] = payload.get("version") + self.changelog: Optional[str] = payload.get("changelog") + self.plugin_version_archived: Optional[bool] = payload.get( + "plugin_version_archived" + ) + self.private: Optional[bool] = payload.get("private") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "configuration_sid": configuration_sid, + "plugin_sid": plugin_sid or self.plugin_sid, + } + self._context: Optional[ConfiguredPluginContext] = None + + @property + def _proxy(self) -> "ConfiguredPluginContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: ConfiguredPluginContext for this ConfiguredPluginInstance + """ + if self._context is None: + self._context = ConfiguredPluginContext( + self._version, + configuration_sid=self._solution["configuration_sid"], + plugin_sid=self._solution["plugin_sid"], + ) + return self._context + + def fetch( + self, flex_metadata: Union[str, object] = values.unset + ) -> "ConfiguredPluginInstance": + """ + Fetch the ConfiguredPluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched ConfiguredPluginInstance + """ + return self._proxy.fetch( + flex_metadata=flex_metadata, + ) + + async def fetch_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> "ConfiguredPluginInstance": + """ + Asynchronous coroutine to fetch the ConfiguredPluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched ConfiguredPluginInstance + """ + return await self._proxy.fetch_async( + flex_metadata=flex_metadata, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ConfiguredPluginContext(InstanceContext): + + def __init__(self, version: Version, configuration_sid: str, plugin_sid: str): + """ + Initialize the ConfiguredPluginContext + + :param version: Version that contains the resource + :param configuration_sid: The SID of the Flex Plugin Configuration the resource to belongs to. + :param plugin_sid: The unique string that we created to identify the Flex Plugin resource. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "configuration_sid": configuration_sid, + "plugin_sid": plugin_sid, + } + self._uri = "/PluginService/Configurations/{configuration_sid}/Plugins/{plugin_sid}".format( + **self._solution + ) + + def fetch( + self, flex_metadata: Union[str, object] = values.unset + ) -> ConfiguredPluginInstance: + """ + Fetch the ConfiguredPluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched ConfiguredPluginInstance + """ + + data = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + + return ConfiguredPluginInstance( + self._version, + payload, + configuration_sid=self._solution["configuration_sid"], + plugin_sid=self._solution["plugin_sid"], + ) + + async def fetch_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> ConfiguredPluginInstance: + """ + Asynchronous coroutine to fetch the ConfiguredPluginInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched ConfiguredPluginInstance + """ + + data = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=data + ) + + return ConfiguredPluginInstance( + self._version, + payload, + configuration_sid=self._solution["configuration_sid"], + plugin_sid=self._solution["plugin_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ConfiguredPluginPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> ConfiguredPluginInstance: + """ + Build an instance of ConfiguredPluginInstance + + :param payload: Payload response from the API + """ + return ConfiguredPluginInstance( + self._version, + payload, + configuration_sid=self._solution["configuration_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class ConfiguredPluginList(ListResource): + + def __init__(self, version: Version, configuration_sid: str): + """ + Initialize the ConfiguredPluginList + + :param version: Version that contains the resource + :param configuration_sid: The SID of the Flex Plugin Configuration the resource to belongs to. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "configuration_sid": configuration_sid, + } + self._uri = "/PluginService/Configurations/{configuration_sid}/Plugins".format( + **self._solution + ) + + def stream( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[ConfiguredPluginInstance]: + """ + Streams ConfiguredPluginInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(flex_metadata=flex_metadata, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[ConfiguredPluginInstance]: + """ + Asynchronously streams ConfiguredPluginInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + flex_metadata=flex_metadata, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ConfiguredPluginInstance]: + """ + Lists ConfiguredPluginInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + flex_metadata=flex_metadata, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ConfiguredPluginInstance]: + """ + Asynchronously lists ConfiguredPluginInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + flex_metadata=flex_metadata, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + flex_metadata: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ConfiguredPluginPage: + """ + Retrieve a single page of ConfiguredPluginInstance records from the API. + Request is executed immediately + + :param flex_metadata: The Flex-Metadata HTTP request header + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ConfiguredPluginInstance + """ + data = values.of( + { + "Flex-Metadata": flex_metadata, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return ConfiguredPluginPage(self._version, response, self._solution) + + async def page_async( + self, + flex_metadata: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ConfiguredPluginPage: + """ + Asynchronously retrieve a single page of ConfiguredPluginInstance records from the API. + Request is executed immediately + + :param flex_metadata: The Flex-Metadata HTTP request header + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ConfiguredPluginInstance + """ + data = values.of( + { + "Flex-Metadata": flex_metadata, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return ConfiguredPluginPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> ConfiguredPluginPage: + """ + Retrieve a specific page of ConfiguredPluginInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ConfiguredPluginInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return ConfiguredPluginPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> ConfiguredPluginPage: + """ + Asynchronously retrieve a specific page of ConfiguredPluginInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ConfiguredPluginInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return ConfiguredPluginPage(self._version, response, self._solution) + + def get(self, plugin_sid: str) -> ConfiguredPluginContext: + """ + Constructs a ConfiguredPluginContext + + :param plugin_sid: The unique string that we created to identify the Flex Plugin resource. + """ + return ConfiguredPluginContext( + self._version, + configuration_sid=self._solution["configuration_sid"], + plugin_sid=plugin_sid, + ) + + def __call__(self, plugin_sid: str) -> ConfiguredPluginContext: + """ + Constructs a ConfiguredPluginContext + + :param plugin_sid: The unique string that we created to identify the Flex Plugin resource. + """ + return ConfiguredPluginContext( + self._version, + configuration_sid=self._solution["configuration_sid"], + plugin_sid=plugin_sid, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/plugin_configuration_archive.py b/twilio/rest/flex_api/v1/plugin_configuration_archive.py new file mode 100644 index 0000000000..97d2f8120d --- /dev/null +++ b/twilio/rest/flex_api/v1/plugin_configuration_archive.py @@ -0,0 +1,224 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PluginConfigurationArchiveInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the Flex Plugin Configuration resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Plugin Configuration resource and owns this resource. + :ivar name: The name of this Flex Plugin Configuration. + :ivar description: The description of the Flex Plugin Configuration resource. + :ivar archived: Whether the Flex Plugin Configuration is archived. The default value is false. + :ivar date_created: The date and time in GMT when the Flex Plugin Configuration was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar url: The absolute URL of the Flex Plugin Configuration resource. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.name: Optional[str] = payload.get("name") + self.description: Optional[str] = payload.get("description") + self.archived: Optional[bool] = payload.get("archived") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[PluginConfigurationArchiveContext] = None + + @property + def _proxy(self) -> "PluginConfigurationArchiveContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PluginConfigurationArchiveContext for this PluginConfigurationArchiveInstance + """ + if self._context is None: + self._context = PluginConfigurationArchiveContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def update( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginConfigurationArchiveInstance": + """ + Update the PluginConfigurationArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginConfigurationArchiveInstance + """ + return self._proxy.update( + flex_metadata=flex_metadata, + ) + + async def update_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginConfigurationArchiveInstance": + """ + Asynchronous coroutine to update the PluginConfigurationArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginConfigurationArchiveInstance + """ + return await self._proxy.update_async( + flex_metadata=flex_metadata, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class PluginConfigurationArchiveContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the PluginConfigurationArchiveContext + + :param version: Version that contains the resource + :param sid: The SID of the Flex Plugin Configuration resource to archive. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/PluginService/Configurations/{sid}/Archive".format( + **self._solution + ) + + def update( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginConfigurationArchiveInstance: + """ + Update the PluginConfigurationArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginConfigurationArchiveInstance + """ + data = values.of({}) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.update( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginConfigurationArchiveInstance( + self._version, payload, sid=self._solution["sid"] + ) + + async def update_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginConfigurationArchiveInstance: + """ + Asynchronous coroutine to update the PluginConfigurationArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginConfigurationArchiveInstance + """ + data = values.of({}) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.update_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginConfigurationArchiveInstance( + self._version, payload, sid=self._solution["sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class PluginConfigurationArchiveList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PluginConfigurationArchiveList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, sid: str) -> PluginConfigurationArchiveContext: + """ + Constructs a PluginConfigurationArchiveContext + + :param sid: The SID of the Flex Plugin Configuration resource to archive. + """ + return PluginConfigurationArchiveContext(self._version, sid=sid) + + def __call__(self, sid: str) -> PluginConfigurationArchiveContext: + """ + Constructs a PluginConfigurationArchiveContext + + :param sid: The SID of the Flex Plugin Configuration resource to archive. + """ + return PluginConfigurationArchiveContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/plugin_release.py b/twilio/rest/flex_api/v1/plugin_release.py new file mode 100644 index 0000000000..f2e8efd306 --- /dev/null +++ b/twilio/rest/flex_api/v1/plugin_release.py @@ -0,0 +1,497 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class PluginReleaseInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the Plugin Release resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Plugin Release resource and owns this resource. + :ivar configuration_sid: The SID of the Plugin Configuration resource to release. + :ivar date_created: The date and time in GMT when the Flex Plugin Release was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar url: The absolute URL of the Plugin Release resource. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.configuration_sid: Optional[str] = payload.get("configuration_sid") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[PluginReleaseContext] = None + + @property + def _proxy(self) -> "PluginReleaseContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PluginReleaseContext for this PluginReleaseInstance + """ + if self._context is None: + self._context = PluginReleaseContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def fetch( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginReleaseInstance": + """ + Fetch the PluginReleaseInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginReleaseInstance + """ + return self._proxy.fetch( + flex_metadata=flex_metadata, + ) + + async def fetch_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginReleaseInstance": + """ + Asynchronous coroutine to fetch the PluginReleaseInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginReleaseInstance + """ + return await self._proxy.fetch_async( + flex_metadata=flex_metadata, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginReleaseContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the PluginReleaseContext + + :param version: Version that contains the resource + :param sid: The SID of the Flex Plugin Release resource to fetch. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/PluginService/Releases/{sid}".format(**self._solution) + + def fetch( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginReleaseInstance: + """ + Fetch the PluginReleaseInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginReleaseInstance + """ + + data = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + + return PluginReleaseInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginReleaseInstance: + """ + Asynchronous coroutine to fetch the PluginReleaseInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The fetched PluginReleaseInstance + """ + + data = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=data + ) + + return PluginReleaseInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginReleasePage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> PluginReleaseInstance: + """ + Build an instance of PluginReleaseInstance + + :param payload: Payload response from the API + """ + return PluginReleaseInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class PluginReleaseList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PluginReleaseList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/PluginService/Releases" + + def create( + self, configuration_id: str, flex_metadata: Union[str, object] = values.unset + ) -> PluginReleaseInstance: + """ + Create the PluginReleaseInstance + + :param configuration_id: The SID or the Version of the Flex Plugin Configuration to release. + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The created PluginReleaseInstance + """ + + data = values.of( + { + "ConfigurationId": configuration_id, + } + ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginReleaseInstance(self._version, payload) + + async def create_async( + self, configuration_id: str, flex_metadata: Union[str, object] = values.unset + ) -> PluginReleaseInstance: + """ + Asynchronously create the PluginReleaseInstance + + :param configuration_id: The SID or the Version of the Flex Plugin Configuration to release. + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The created PluginReleaseInstance + """ + + data = values.of( + { + "ConfigurationId": configuration_id, + } + ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginReleaseInstance(self._version, payload) + + def stream( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[PluginReleaseInstance]: + """ + Streams PluginReleaseInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(flex_metadata=flex_metadata, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[PluginReleaseInstance]: + """ + Asynchronously streams PluginReleaseInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + flex_metadata=flex_metadata, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PluginReleaseInstance]: + """ + Lists PluginReleaseInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + flex_metadata=flex_metadata, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + flex_metadata: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PluginReleaseInstance]: + """ + Asynchronously lists PluginReleaseInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str flex_metadata: The Flex-Metadata HTTP request header + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + flex_metadata=flex_metadata, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + flex_metadata: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PluginReleasePage: + """ + Retrieve a single page of PluginReleaseInstance records from the API. + Request is executed immediately + + :param flex_metadata: The Flex-Metadata HTTP request header + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PluginReleaseInstance + """ + data = values.of( + { + "Flex-Metadata": flex_metadata, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return PluginReleasePage(self._version, response) + + async def page_async( + self, + flex_metadata: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PluginReleasePage: + """ + Asynchronously retrieve a single page of PluginReleaseInstance records from the API. + Request is executed immediately + + :param flex_metadata: The Flex-Metadata HTTP request header + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PluginReleaseInstance + """ + data = values.of( + { + "Flex-Metadata": flex_metadata, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return PluginReleasePage(self._version, response) + + def get_page(self, target_url: str) -> PluginReleasePage: + """ + Retrieve a specific page of PluginReleaseInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PluginReleaseInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return PluginReleasePage(self._version, response) + + async def get_page_async(self, target_url: str) -> PluginReleasePage: + """ + Asynchronously retrieve a specific page of PluginReleaseInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PluginReleaseInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return PluginReleasePage(self._version, response) + + def get(self, sid: str) -> PluginReleaseContext: + """ + Constructs a PluginReleaseContext + + :param sid: The SID of the Flex Plugin Release resource to fetch. + """ + return PluginReleaseContext(self._version, sid=sid) + + def __call__(self, sid: str) -> PluginReleaseContext: + """ + Constructs a PluginReleaseContext + + :param sid: The SID of the Flex Plugin Release resource to fetch. + """ + return PluginReleaseContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/plugin_version_archive.py b/twilio/rest/flex_api/v1/plugin_version_archive.py new file mode 100644 index 0000000000..ae8d2f3dff --- /dev/null +++ b/twilio/rest/flex_api/v1/plugin_version_archive.py @@ -0,0 +1,246 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PluginVersionArchiveInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the Flex Plugin Version resource. + :ivar plugin_sid: The SID of the Flex Plugin resource this Flex Plugin Version belongs to. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Flex Plugin Version resource and owns this resource. + :ivar version: The unique version of this Flex Plugin Version. + :ivar plugin_url: The URL of where the Flex Plugin Version JavaScript bundle is hosted on. + :ivar changelog: A changelog that describes the changes this Flex Plugin Version brings. + :ivar private: Whether to inject credentials while accessing this Plugin Version. The default value is false. + :ivar archived: Whether the Flex Plugin Version is archived. The default value is false. + :ivar date_created: The date and time in GMT when the Flex Plugin Version was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar url: The absolute URL of the Flex Plugin Version resource. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + plugin_sid: Optional[str] = None, + sid: Optional[str] = None, + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.plugin_sid: Optional[str] = payload.get("plugin_sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.version: Optional[str] = payload.get("version") + self.plugin_url: Optional[str] = payload.get("plugin_url") + self.changelog: Optional[str] = payload.get("changelog") + self.private: Optional[bool] = payload.get("private") + self.archived: Optional[bool] = payload.get("archived") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "plugin_sid": plugin_sid or self.plugin_sid, + "sid": sid or self.sid, + } + self._context: Optional[PluginVersionArchiveContext] = None + + @property + def _proxy(self) -> "PluginVersionArchiveContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PluginVersionArchiveContext for this PluginVersionArchiveInstance + """ + if self._context is None: + self._context = PluginVersionArchiveContext( + self._version, + plugin_sid=self._solution["plugin_sid"], + sid=self._solution["sid"], + ) + return self._context + + def update( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginVersionArchiveInstance": + """ + Update the PluginVersionArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginVersionArchiveInstance + """ + return self._proxy.update( + flex_metadata=flex_metadata, + ) + + async def update_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> "PluginVersionArchiveInstance": + """ + Asynchronous coroutine to update the PluginVersionArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginVersionArchiveInstance + """ + return await self._proxy.update_async( + flex_metadata=flex_metadata, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginVersionArchiveContext(InstanceContext): + + def __init__(self, version: Version, plugin_sid: str, sid: str): + """ + Initialize the PluginVersionArchiveContext + + :param version: Version that contains the resource + :param plugin_sid: The SID of the Flex Plugin the resource to belongs to. + :param sid: The SID of the Flex Plugin Version resource to archive. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "plugin_sid": plugin_sid, + "sid": sid, + } + self._uri = "/PluginService/Plugins/{plugin_sid}/Versions/{sid}/Archive".format( + **self._solution + ) + + def update( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginVersionArchiveInstance: + """ + Update the PluginVersionArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginVersionArchiveInstance + """ + data = values.of({}) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = self._version.update( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginVersionArchiveInstance( + self._version, + payload, + plugin_sid=self._solution["plugin_sid"], + sid=self._solution["sid"], + ) + + async def update_async( + self, flex_metadata: Union[str, object] = values.unset + ) -> PluginVersionArchiveInstance: + """ + Asynchronous coroutine to update the PluginVersionArchiveInstance + + :param flex_metadata: The Flex-Metadata HTTP request header + + :returns: The updated PluginVersionArchiveInstance + """ + data = values.of({}) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + } + ) + + payload = await self._version.update_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PluginVersionArchiveInstance( + self._version, + payload, + plugin_sid=self._solution["plugin_sid"], + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PluginVersionArchiveList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PluginVersionArchiveList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, plugin_sid: str, sid: str) -> PluginVersionArchiveContext: + """ + Constructs a PluginVersionArchiveContext + + :param plugin_sid: The SID of the Flex Plugin the resource to belongs to. + :param sid: The SID of the Flex Plugin Version resource to archive. + """ + return PluginVersionArchiveContext( + self._version, plugin_sid=plugin_sid, sid=sid + ) + + def __call__(self, plugin_sid: str, sid: str) -> PluginVersionArchiveContext: + """ + Constructs a PluginVersionArchiveContext + + :param plugin_sid: The SID of the Flex Plugin the resource to belongs to. + :param sid: The SID of the Flex Plugin Version resource to archive. + """ + return PluginVersionArchiveContext( + self._version, plugin_sid=plugin_sid, sid=sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index e69e149239..b02af94919 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -58,10 +58,11 @@ class Status(object): :ivar brand_type: Type of brand. One of: \"STANDARD\", \"SOLE_PROPRIETOR\". SOLE_PROPRIETOR is for the low volume, SOLE_PROPRIETOR campaign use case. There can only be one SOLE_PROPRIETOR campaign created per SOLE_PROPRIETOR brand. STANDARD is for all other campaign use cases. Multiple campaign use cases can be created per STANDARD brand. :ivar status: :ivar tcr_id: Campaign Registry (TCR) Brand ID. Assigned only after successful brand registration. - :ivar failure_reason: A reason why brand registration has failed. Only applicable when status is FAILED. + :ivar failure_reason: DEPRECATED. A reason why brand registration has failed. Only applicable when status is FAILED. + :ivar errors: A list of errors that occurred during the brand registration process. :ivar url: The absolute URL of the Brand Registration resource. :ivar brand_score: The secondary vetting score if it was done. Otherwise, it will be the brand score if it's returned from TCR. It may be null if no score is available. - :ivar brand_feedback: Feedback on how to improve brand score + :ivar brand_feedback: DEPRECATED. Feedback on how to improve brand score :ivar identity_status: :ivar russell_3000: Publicly traded company identified in the Russell 3000 Index :ivar government_entity: Identified as a government entity @@ -96,6 +97,7 @@ def __init__( ) self.tcr_id: Optional[str] = payload.get("tcr_id") self.failure_reason: Optional[str] = payload.get("failure_reason") + self.errors: Optional[List[Dict[str, object]]] = payload.get("errors") self.url: Optional[str] = payload.get("url") self.brand_score: Optional[int] = deserialize.integer( payload.get("brand_score") diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 95223e1615..9da80f3a34 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -36,7 +36,7 @@ def __init__(self, domain: Domain): self._eligibilities: Optional[EligibilityList] = None self._porting_bulk_portabilities: Optional[PortingBulkPortabilityList] = None self._porting_port_ins: Optional[PortingPortInList] = None - self._porting_port_ins: Optional[PortingPortInFetchList] = None + self._porting_port_ins_fetch: Optional[PortingPortInFetchList] = None self._porting_portabilities: Optional[PortingPortabilityList] = None @property @@ -64,10 +64,10 @@ def porting_port_ins(self) -> PortingPortInList: return self._porting_port_ins @property - def porting_port_ins(self) -> PortingPortInFetchList: - if self._porting_port_ins is None: - self._porting_port_ins = PortingPortInFetchList(self) - return self._porting_port_ins + def porting_port_ins_fetch(self) -> PortingPortInFetchList: + if self._porting_port_ins_fetch is None: + self._porting_port_ins_fetch = PortingPortInFetchList(self) + return self._porting_port_ins_fetch @property def porting_portabilities(self) -> PortingPortabilityList: diff --git a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py index b3ad6790ac..d86b72db01 100644 --- a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py @@ -127,6 +127,8 @@ def create( individual_email: Union[str, object] = values.unset, individual_phone: Union[str, object] = values.unset, is_isv_embed: Union[bool, object] = values.unset, + isv_registering_for_self_or_tenant: Union[str, object] = values.unset, + status_callback_url: Union[str, object] = values.unset, ) -> ComplianceRegistrationInquiriesInstance: """ Create the ComplianceRegistrationInquiriesInstance @@ -167,6 +169,8 @@ def create( :param individual_email: The email address of the Individual User. :param individual_phone: The phone number of the Individual User. :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. + :param isv_registering_for_self_or_tenant: Indicates if the isv registering for self or tenant. + :param status_callback_url: The url we call to inform you of bundle changes. :returns: The created ComplianceRegistrationInquiriesInstance """ @@ -213,6 +217,8 @@ def create( "IndividualEmail": individual_email, "IndividualPhone": individual_phone, "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), + "IsvRegisteringForSelfOrTenant": isv_registering_for_self_or_tenant, + "StatusCallbackUrl": status_callback_url, } ) @@ -267,6 +273,8 @@ async def create_async( individual_email: Union[str, object] = values.unset, individual_phone: Union[str, object] = values.unset, is_isv_embed: Union[bool, object] = values.unset, + isv_registering_for_self_or_tenant: Union[str, object] = values.unset, + status_callback_url: Union[str, object] = values.unset, ) -> ComplianceRegistrationInquiriesInstance: """ Asynchronously create the ComplianceRegistrationInquiriesInstance @@ -307,6 +315,8 @@ async def create_async( :param individual_email: The email address of the Individual User. :param individual_phone: The phone number of the Individual User. :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. + :param isv_registering_for_self_or_tenant: Indicates if the isv registering for self or tenant. + :param status_callback_url: The url we call to inform you of bundle changes. :returns: The created ComplianceRegistrationInquiriesInstance """ @@ -353,6 +363,8 @@ async def create_async( "IndividualEmail": individual_email, "IndividualPhone": individual_phone, "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), + "IsvRegisteringForSelfOrTenant": isv_registering_for_self_or_tenant, + "StatusCallbackUrl": status_callback_url, } ) diff --git a/twilio/twiml/messaging_response.py b/twilio/twiml/messaging_response.py index b938e16448..ec36c74c06 100644 --- a/twilio/twiml/messaging_response.py +++ b/twilio/twiml/messaging_response.py @@ -34,7 +34,7 @@ def message( :param body: Message Body :param to: Phone Number to send Message to :param from: Phone Number to send Message from - :param action: Action URL + :param action: A URL specifying where Twilio should send status callbacks for the created outbound message. :param method: Action URL Method :param status_callback: Status callback URL. Deprecated in favor of action. :param kwargs: additional attributes From 0aa297512d79118f9cb6980c2ee4f3d6763b0f49 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 12 Mar 2024 09:13:37 +0000 Subject: [PATCH 013/113] Release 9.0.1 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 295f4e3498..54c3df9b46 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.0", + version="9.0.1", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 77a8b581b3..ab2ae748c7 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "0", "0") +__version_info__ = ("9", "0", "1") __version__ = ".".join(__version_info__) From 8251f5be0b91edc5215a91f68a05b92ba2de03f3 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 15 Mar 2024 05:29:27 +0000 Subject: [PATCH 014/113] [Librarian] Regenerated @ e39e37b378f3772541a58f8f0d634533863f3f3e --- CHANGES.md | 6 + twilio/rest/__init__.py | 15 ++ twilio/rest/accounts/v1/safelist.py | 2 + .../rest/api/v2010/account/call/__init__.py | 72 ++++++++ .../api/v2010/account/conference/__init__.py | 72 ++++++++ .../api/v2010/account/message/__init__.py | 46 +++++- twilio/rest/content/v1/content/__init__.py | 63 +++++++ .../v1/service/us_app_to_person_usecase.py | 2 + .../regulatory_compliance/bundle/__init__.py | 36 ++++ twilio/rest/oauth/OauthBase.py | 44 +++++ twilio/rest/oauth/v1/__init__.py | 51 ++++++ twilio/rest/oauth/v1/authorize.py | 122 ++++++++++++++ twilio/rest/oauth/v1/token.py | 155 ++++++++++++++++++ .../customer_profiles_entity_assignments.py | 22 ++- .../trust_products_entity_assignments.py | 22 ++- 15 files changed, 724 insertions(+), 6 deletions(-) create mode 100644 twilio/rest/oauth/OauthBase.py create mode 100644 twilio/rest/oauth/v1/__init__.py create mode 100644 twilio/rest/oauth/v1/authorize.py create mode 100644 twilio/rest/oauth/v1/token.py diff --git a/CHANGES.md b/CHANGES.md index 54f764154d..d5fbaebfcc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,12 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-03-15] Version 9.0.2 +-------------------------- +**Oauth** +- Add new APIs for vendor authorize and token endpoints + + [2024-03-12] Version 9.0.1 -------------------------- **Library - Chore** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 818688e399..254d920786 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -34,6 +34,7 @@ from twilio.rest.monitor import Monitor from twilio.rest.notify import Notify from twilio.rest.numbers import Numbers + from twilio.rest.oauth import Oauth from twilio.rest.preview import Preview from twilio.rest.pricing import Pricing from twilio.rest.proxy import Proxy @@ -142,6 +143,7 @@ def __init__( self._monitor: Optional["Monitor"] = None self._notify: Optional["Notify"] = None self._numbers: Optional["Numbers"] = None + self._oauth: Optional["Oauth"] = None self._preview: Optional["Preview"] = None self._pricing: Optional["Pricing"] = None self._proxy: Optional["Proxy"] = None @@ -418,6 +420,19 @@ def numbers(self) -> "Numbers": self._numbers = Numbers(self) return self._numbers + @property + def oauth(self) -> "Oauth": + """ + Access the Oauth Twilio Domain + + :returns: Oauth Twilio Domain + """ + if self._oauth is None: + from twilio.rest.oauth import Oauth + + self._oauth = Oauth(self) + return self._oauth + @property def preview(self) -> "Preview": """ diff --git a/twilio/rest/accounts/v1/safelist.py b/twilio/rest/accounts/v1/safelist.py index e20855965c..ce5672caed 100644 --- a/twilio/rest/accounts/v1/safelist.py +++ b/twilio/rest/accounts/v1/safelist.py @@ -150,6 +150,7 @@ def fetch( "PhoneNumber": phone_number, } ) + payload = self._version.fetch(method="GET", uri=self._uri, params=params) return SafelistInstance(self._version, payload) @@ -169,6 +170,7 @@ async def fetch_async( "PhoneNumber": phone_number, } ) + payload = await self._version.fetch_async( method="GET", uri=self._uri, params=params ) diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 0dcb8c5d5b..b218709a2d 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -959,7 +959,11 @@ def stream( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, + start_time_before: Union[datetime, object] = values.unset, + start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, + end_time_before: Union[datetime, object] = values.unset, + end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[CallInstance]: @@ -974,7 +978,11 @@ def stream( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -991,7 +999,11 @@ def stream( parent_call_sid=parent_call_sid, status=status, start_time=start_time, + start_time_before=start_time_before, + start_time_after=start_time_after, end_time=end_time, + end_time_before=end_time_before, + end_time_after=end_time_after, page_size=limits["page_size"], ) @@ -1004,7 +1016,11 @@ async def stream_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, + start_time_before: Union[datetime, object] = values.unset, + start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, + end_time_before: Union[datetime, object] = values.unset, + end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[CallInstance]: @@ -1019,7 +1035,11 @@ async def stream_async( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1036,7 +1056,11 @@ async def stream_async( parent_call_sid=parent_call_sid, status=status, start_time=start_time, + start_time_before=start_time_before, + start_time_after=start_time_after, end_time=end_time, + end_time_before=end_time_before, + end_time_after=end_time_after, page_size=limits["page_size"], ) @@ -1049,7 +1073,11 @@ def list( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, + start_time_before: Union[datetime, object] = values.unset, + start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, + end_time_before: Union[datetime, object] = values.unset, + end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CallInstance]: @@ -1063,7 +1091,11 @@ def list( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1080,7 +1112,11 @@ def list( parent_call_sid=parent_call_sid, status=status, start_time=start_time, + start_time_before=start_time_before, + start_time_after=start_time_after, end_time=end_time, + end_time_before=end_time_before, + end_time_after=end_time_after, limit=limit, page_size=page_size, ) @@ -1093,7 +1129,11 @@ async def list_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, + start_time_before: Union[datetime, object] = values.unset, + start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, + end_time_before: Union[datetime, object] = values.unset, + end_time_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CallInstance]: @@ -1107,7 +1147,11 @@ async def list_async( :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1125,7 +1169,11 @@ async def list_async( parent_call_sid=parent_call_sid, status=status, start_time=start_time, + start_time_before=start_time_before, + start_time_after=start_time_after, end_time=end_time, + end_time_before=end_time_before, + end_time_after=end_time_after, limit=limit, page_size=page_size, ) @@ -1138,7 +1186,11 @@ def page( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, + start_time_before: Union[datetime, object] = values.unset, + start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, + end_time_before: Union[datetime, object] = values.unset, + end_time_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -1152,7 +1204,11 @@ def page( :param parent_call_sid: Only include calls spawned by calls with this SID. :param status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1166,7 +1222,11 @@ def page( "ParentCallSid": parent_call_sid, "Status": status, "StartTime": serialize.iso8601_datetime(start_time), + "StartTime<": serialize.iso8601_datetime(start_time_before), + "StartTime>": serialize.iso8601_datetime(start_time_after), "EndTime": serialize.iso8601_datetime(end_time), + "EndTime<": serialize.iso8601_datetime(end_time_before), + "EndTime>": serialize.iso8601_datetime(end_time_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -1183,7 +1243,11 @@ async def page_async( parent_call_sid: Union[str, object] = values.unset, status: Union["CallInstance.Status", object] = values.unset, start_time: Union[datetime, object] = values.unset, + start_time_before: Union[datetime, object] = values.unset, + start_time_after: Union[datetime, object] = values.unset, end_time: Union[datetime, object] = values.unset, + end_time_before: Union[datetime, object] = values.unset, + end_time_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -1197,7 +1261,11 @@ async def page_async( :param parent_call_sid: Only include calls spawned by calls with this SID. :param status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1211,7 +1279,11 @@ async def page_async( "ParentCallSid": parent_call_sid, "Status": status, "StartTime": serialize.iso8601_datetime(start_time), + "StartTime<": serialize.iso8601_datetime(start_time_before), + "StartTime>": serialize.iso8601_datetime(start_time_after), "EndTime": serialize.iso8601_datetime(end_time), + "EndTime<": serialize.iso8601_datetime(end_time_before), + "EndTime>": serialize.iso8601_datetime(end_time_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index 36cd390c60..fff75dea5d 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -412,7 +412,11 @@ def __init__(self, version: Version, account_sid: str): def stream( self, date_created: Union[date, object] = values.unset, + date_created_before: Union[date, object] = values.unset, + date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, + date_updated_before: Union[date, object] = values.unset, + date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -425,7 +429,11 @@ def stream( The results are returned as a generator, so this operation is memory efficient. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. stream() @@ -440,7 +448,11 @@ def stream( limits = self._version.read_limits(limit, page_size) page = self.page( date_created=date_created, + date_created_before=date_created_before, + date_created_after=date_created_after, date_updated=date_updated, + date_updated_before=date_updated_before, + date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, page_size=limits["page_size"], @@ -451,7 +463,11 @@ def stream( async def stream_async( self, date_created: Union[date, object] = values.unset, + date_created_before: Union[date, object] = values.unset, + date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, + date_updated_before: Union[date, object] = values.unset, + date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -464,7 +480,11 @@ async def stream_async( The results are returned as a generator, so this operation is memory efficient. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. stream() @@ -479,7 +499,11 @@ async def stream_async( limits = self._version.read_limits(limit, page_size) page = await self.page_async( date_created=date_created, + date_created_before=date_created_before, + date_created_after=date_created_after, date_updated=date_updated, + date_updated_before=date_updated_before, + date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, page_size=limits["page_size"], @@ -490,7 +514,11 @@ async def stream_async( def list( self, date_created: Union[date, object] = values.unset, + date_created_before: Union[date, object] = values.unset, + date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, + date_updated_before: Union[date, object] = values.unset, + date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -502,7 +530,11 @@ def list( memory before returning. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. list() guarantees @@ -517,7 +549,11 @@ def list( return list( self.stream( date_created=date_created, + date_created_before=date_created_before, + date_created_after=date_created_after, date_updated=date_updated, + date_updated_before=date_updated_before, + date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, limit=limit, @@ -528,7 +564,11 @@ def list( async def list_async( self, date_created: Union[date, object] = values.unset, + date_created_before: Union[date, object] = values.unset, + date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, + date_updated_before: Union[date, object] = values.unset, + date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, limit: Optional[int] = None, @@ -540,7 +580,11 @@ async def list_async( memory before returning. :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. list() guarantees @@ -556,7 +600,11 @@ async def list_async( record async for record in await self.stream_async( date_created=date_created, + date_created_before=date_created_before, + date_created_after=date_created_after, date_updated=date_updated, + date_updated_before=date_updated_before, + date_updated_after=date_updated_after, friendly_name=friendly_name, status=status, limit=limit, @@ -567,7 +615,11 @@ async def list_async( def page( self, date_created: Union[date, object] = values.unset, + date_created_before: Union[date, object] = values.unset, + date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, + date_updated_before: Union[date, object] = values.unset, + date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, page_token: Union[str, object] = values.unset, @@ -579,7 +631,11 @@ def page( Request is executed immediately :param date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param friendly_name: The string that identifies the Conference resources to read. :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param page_token: PageToken provided by the API @@ -591,7 +647,11 @@ def page( data = values.of( { "DateCreated": serialize.iso8601_date(date_created), + "DateCreated<": serialize.iso8601_date(date_created_before), + "DateCreated>": serialize.iso8601_date(date_created_after), "DateUpdated": serialize.iso8601_date(date_updated), + "DateUpdated<": serialize.iso8601_date(date_updated_before), + "DateUpdated>": serialize.iso8601_date(date_updated_after), "FriendlyName": friendly_name, "Status": status, "PageToken": page_token, @@ -606,7 +666,11 @@ def page( async def page_async( self, date_created: Union[date, object] = values.unset, + date_created_before: Union[date, object] = values.unset, + date_created_after: Union[date, object] = values.unset, date_updated: Union[date, object] = values.unset, + date_updated_before: Union[date, object] = values.unset, + date_updated_after: Union[date, object] = values.unset, friendly_name: Union[str, object] = values.unset, status: Union["ConferenceInstance.Status", object] = values.unset, page_token: Union[str, object] = values.unset, @@ -618,7 +682,11 @@ async def page_async( Request is executed immediately :param date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + :param date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. :param date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. :param friendly_name: The string that identifies the Conference resources to read. :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param page_token: PageToken provided by the API @@ -630,7 +698,11 @@ async def page_async( data = values.of( { "DateCreated": serialize.iso8601_date(date_created), + "DateCreated<": serialize.iso8601_date(date_created_before), + "DateCreated>": serialize.iso8601_date(date_created_after), "DateUpdated": serialize.iso8601_date(date_updated), + "DateUpdated<": serialize.iso8601_date(date_updated_before), + "DateUpdated>": serialize.iso8601_date(date_updated_after), "FriendlyName": friendly_name, "Status": status, "PageToken": page_token, diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index eb562be023..972d80b172 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -674,6 +674,8 @@ def stream( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, + date_sent_before: Union[datetime, object] = values.unset, + date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[MessageInstance]: @@ -686,6 +688,8 @@ def stream( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -697,7 +701,12 @@ def stream( """ limits = self._version.read_limits(limit, page_size) page = self.page( - to=to, from_=from_, date_sent=date_sent, page_size=limits["page_size"] + to=to, + from_=from_, + date_sent=date_sent, + date_sent_before=date_sent_before, + date_sent_after=date_sent_after, + page_size=limits["page_size"], ) return self._version.stream(page, limits["limit"]) @@ -707,6 +716,8 @@ async def stream_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, + date_sent_before: Union[datetime, object] = values.unset, + date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[MessageInstance]: @@ -719,6 +730,8 @@ async def stream_async( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -730,7 +743,12 @@ async def stream_async( """ limits = self._version.read_limits(limit, page_size) page = await self.page_async( - to=to, from_=from_, date_sent=date_sent, page_size=limits["page_size"] + to=to, + from_=from_, + date_sent=date_sent, + date_sent_before=date_sent_before, + date_sent_after=date_sent_after, + page_size=limits["page_size"], ) return self._version.stream_async(page, limits["limit"]) @@ -740,6 +758,8 @@ def list( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, + date_sent_before: Union[datetime, object] = values.unset, + date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[MessageInstance]: @@ -751,6 +771,8 @@ def list( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -765,6 +787,8 @@ def list( to=to, from_=from_, date_sent=date_sent, + date_sent_before=date_sent_before, + date_sent_after=date_sent_after, limit=limit, page_size=page_size, ) @@ -775,6 +799,8 @@ async def list_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, + date_sent_before: Union[datetime, object] = values.unset, + date_sent_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[MessageInstance]: @@ -786,6 +812,8 @@ async def list_async( :param str to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param str from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param datetime date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param datetime date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param datetime date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -801,6 +829,8 @@ async def list_async( to=to, from_=from_, date_sent=date_sent, + date_sent_before=date_sent_before, + date_sent_after=date_sent_after, limit=limit, page_size=page_size, ) @@ -811,6 +841,8 @@ def page( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, + date_sent_before: Union[datetime, object] = values.unset, + date_sent_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -822,6 +854,8 @@ def page( :param to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -833,6 +867,8 @@ def page( "To": to, "From": from_, "DateSent": serialize.iso8601_datetime(date_sent), + "DateSent<": serialize.iso8601_datetime(date_sent_before), + "DateSent>": serialize.iso8601_datetime(date_sent_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -847,6 +883,8 @@ async def page_async( to: Union[str, object] = values.unset, from_: Union[str, object] = values.unset, date_sent: Union[datetime, object] = values.unset, + date_sent_before: Union[datetime, object] = values.unset, + date_sent_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -858,6 +896,8 @@ async def page_async( :param to: Filter by recipient. For example: Set this `to` parameter to `+15558881111` to retrieve a list of Message resources with `to` properties of `+15558881111` :param from_: Filter by sender. For example: Set this `from` parameter to `+15552229999` to retrieve a list of Message resources with `from` properties of `+15552229999` :param date_sent: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param date_sent_before: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). + :param date_sent_after: Filter by Message `sent_date`. Accepts GMT dates in the following formats: `YYYY-MM-DD` (to find Messages with a specific `sent_date`), `<=YYYY-MM-DD` (to find Messages with `sent_date`s on and before a specific date), and `>=YYYY-MM-DD` (to find Messages with `sent_dates` on and after a specific date). :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -869,6 +909,8 @@ async def page_async( "To": to, "From": from_, "DateSent": serialize.iso8601_datetime(date_sent), + "DateSent<": serialize.iso8601_datetime(date_sent_before), + "DateSent>": serialize.iso8601_datetime(date_sent_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 39496ace84..bdc1102ca4 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -364,6 +364,35 @@ def to_dict(self): "id": self.id, } + class CatalogItem(object): + """ + :ivar id: + :ivar section_title: + :ivar name: + :ivar media_url: + :ivar price: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.id: Optional[str] = payload.get("id") + self.section_title: Optional[str] = payload.get("section_title") + self.name: Optional[str] = payload.get("name") + self.media_url: Optional[str] = payload.get("media_url") + self.price: Optional[float] = payload.get("price") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "section_title": self.section_title, + "name": self.name, + "media_url": self.media_url, + "price": self.price, + "description": self.description, + } + class ContentCreateRequest(object): """ :ivar friendly_name: User defined name of the content @@ -473,6 +502,35 @@ def to_dict(self): "actions": [actions.to_dict() for actions in self.actions], } + class TwilioCatalog(object): + """ + :ivar title: + :ivar body: + :ivar subtitle: + :ivar id: + :ivar items: + :ivar dynamic_items: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.title: Optional[str] = payload.get("title") + self.body: Optional[str] = payload.get("body") + self.subtitle: Optional[str] = payload.get("subtitle") + self.id: Optional[str] = payload.get("id") + self.items: Optional[List[ContentList.CatalogItem]] = payload.get("items") + self.dynamic_items: Optional[str] = payload.get("dynamic_items") + + def to_dict(self): + return { + "title": self.title, + "body": self.body, + "subtitle": self.subtitle, + "id": self.id, + "items": [items.to_dict() for items in self.items], + "dynamic_items": self.dynamic_items, + } + class TwilioListPicker(object): """ :ivar body: @@ -572,6 +630,7 @@ class Types(object): :ivar twilio_call_to_action: :ivar twilio_quick_reply: :ivar twilio_card: + :ivar twilio_catalog: :ivar whatsapp_card: :ivar whatsapp_authentication: """ @@ -599,6 +658,9 @@ def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): self.twilio_card: Optional[ContentList.TwilioCard] = payload.get( "twilio_card" ) + self.twilio_catalog: Optional[ContentList.TwilioCatalog] = payload.get( + "twilio_catalog" + ) self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( "whatsapp_card" ) @@ -615,6 +677,7 @@ def to_dict(self): "twilio_call_to_action": self.twilio_call_to_action.to_dict(), "twilio_quick_reply": self.twilio_quick_reply.to_dict(), "twilio_card": self.twilio_card.to_dict(), + "twilio_catalog": self.twilio_catalog.to_dict(), "whatsapp_card": self.whatsapp_card.to_dict(), "whatsapp_authentication": self.whatsapp_authentication.to_dict(), } diff --git a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py index c4f513ab1b..debcf940d9 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py @@ -85,6 +85,7 @@ def fetch( "BrandRegistrationSid": brand_registration_sid, } ) + payload = self._version.fetch(method="GET", uri=self._uri, params=params) return UsAppToPersonUsecaseInstance( @@ -108,6 +109,7 @@ async def fetch_async( "BrandRegistrationSid": brand_registration_sid, } ) + payload = await self._version.fetch_async( method="GET", uri=self._uri, params=params ) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index a76ceaf83a..d37caa0fb8 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -578,6 +578,8 @@ def stream( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, + valid_until_date_before: Union[datetime, object] = values.unset, + valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[BundleInstance]: @@ -596,6 +598,8 @@ def stream( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -616,6 +620,8 @@ def stream( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, + valid_until_date_before=valid_until_date_before, + valid_until_date_after=valid_until_date_after, page_size=limits["page_size"], ) @@ -632,6 +638,8 @@ async def stream_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, + valid_until_date_before: Union[datetime, object] = values.unset, + valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[BundleInstance]: @@ -650,6 +658,8 @@ async def stream_async( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -670,6 +680,8 @@ async def stream_async( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, + valid_until_date_before=valid_until_date_before, + valid_until_date_after=valid_until_date_after, page_size=limits["page_size"], ) @@ -686,6 +698,8 @@ def list( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, + valid_until_date_before: Union[datetime, object] = values.unset, + valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[BundleInstance]: @@ -703,6 +717,8 @@ def list( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -723,6 +739,8 @@ def list( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, + valid_until_date_before=valid_until_date_before, + valid_until_date_after=valid_until_date_after, limit=limit, page_size=page_size, ) @@ -739,6 +757,8 @@ async def list_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, + valid_until_date_before: Union[datetime, object] = values.unset, + valid_until_date_after: Union[datetime, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[BundleInstance]: @@ -756,6 +776,8 @@ async def list_async( :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param datetime valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param datetime valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param datetime valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -777,6 +799,8 @@ async def list_async( sort_by=sort_by, sort_direction=sort_direction, valid_until_date=valid_until_date, + valid_until_date_before=valid_until_date_before, + valid_until_date_after=valid_until_date_after, limit=limit, page_size=page_size, ) @@ -793,6 +817,8 @@ def page( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, + valid_until_date_before: Union[datetime, object] = values.unset, + valid_until_date_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -810,6 +836,8 @@ def page( :param sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -827,6 +855,8 @@ def page( "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), + "ValidUntilDate<": serialize.iso8601_datetime(valid_until_date_before), + "ValidUntilDate>": serialize.iso8601_datetime(valid_until_date_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -847,6 +877,8 @@ async def page_async( sort_by: Union["BundleInstance.SortBy", object] = values.unset, sort_direction: Union["BundleInstance.SortDirection", object] = values.unset, valid_until_date: Union[datetime, object] = values.unset, + valid_until_date_before: Union[datetime, object] = values.unset, + valid_until_date_after: Union[datetime, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -864,6 +896,8 @@ async def page_async( :param sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. :param valid_until_date: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param valid_until_date_before: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + :param valid_until_date_after: Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -881,6 +915,8 @@ async def page_async( "SortBy": sort_by, "SortDirection": sort_direction, "ValidUntilDate": serialize.iso8601_datetime(valid_until_date), + "ValidUntilDate<": serialize.iso8601_datetime(valid_until_date_before), + "ValidUntilDate>": serialize.iso8601_datetime(valid_until_date_after), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/oauth/OauthBase.py b/twilio/rest/oauth/OauthBase.py new file mode 100644 index 0000000000..87cbbac248 --- /dev/null +++ b/twilio/rest/oauth/OauthBase.py @@ -0,0 +1,44 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional + +from twilio.base.domain import Domain +from twilio.rest import Client +from twilio.rest.oauth.v1 import V1 + + +class OauthBase(Domain): + + def __init__(self, twilio: Client): + """ + Initialize the Oauth Domain + + :returns: Domain for Oauth + """ + super().__init__(twilio, "https://oauth.twilio.com") + self._v1: Optional[V1] = None + + @property + def v1(self) -> V1: + """ + :returns: Versions v1 of Oauth + """ + if self._v1 is None: + self._v1 = V1(self) + return self._v1 + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/oauth/v1/__init__.py b/twilio/rest/oauth/v1/__init__.py new file mode 100644 index 0000000000..e05c7de520 --- /dev/null +++ b/twilio/rest/oauth/v1/__init__.py @@ -0,0 +1,51 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Oauth + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.oauth.v1.authorize import AuthorizeList +from twilio.rest.oauth.v1.token import TokenList + + +class V1(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V1 version of Oauth + + :param domain: The Twilio.oauth domain + """ + super().__init__(domain, "v1") + self._authorize: Optional[AuthorizeList] = None + self._token: Optional[TokenList] = None + + @property + def authorize(self) -> AuthorizeList: + if self._authorize is None: + self._authorize = AuthorizeList(self) + return self._authorize + + @property + def token(self) -> TokenList: + if self._token is None: + self._token = TokenList(self) + return self._token + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/oauth/v1/authorize.py b/twilio/rest/oauth/v1/authorize.py new file mode 100644 index 0000000000..9798a73f3f --- /dev/null +++ b/twilio/rest/oauth/v1/authorize.py @@ -0,0 +1,122 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Oauth + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional, Union +from twilio.base import values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class AuthorizeInstance(InstanceResource): + """ + :ivar redirect_to: The callback URL + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.redirect_to: Optional[str] = payload.get("redirect_to") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class AuthorizeList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the AuthorizeList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/authorize" + + def fetch( + self, + response_type: Union[str, object] = values.unset, + client_id: Union[str, object] = values.unset, + redirect_uri: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + state: Union[str, object] = values.unset, + ) -> AuthorizeInstance: + """ + Asynchronously fetch the AuthorizeInstance + + :param response_type: Response Type:param client_id: The Client Identifier:param redirect_uri: The url to which response will be redirected to:param scope: The scope of the access request:param state: An opaque value which can be used to maintain state between the request and callback + :returns: The fetched AuthorizeInstance + """ + + params = values.of( + { + "ResponseType": response_type, + "ClientId": client_id, + "RedirectUri": redirect_uri, + "Scope": scope, + "State": state, + } + ) + + payload = self._version.fetch(method="GET", uri=self._uri, params=params) + + return AuthorizeInstance(self._version, payload) + + async def fetch_async( + self, + response_type: Union[str, object] = values.unset, + client_id: Union[str, object] = values.unset, + redirect_uri: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + state: Union[str, object] = values.unset, + ) -> AuthorizeInstance: + """ + Asynchronously fetch the AuthorizeInstance + + :param response_type: Response Type:param client_id: The Client Identifier:param redirect_uri: The url to which response will be redirected to:param scope: The scope of the access request:param state: An opaque value which can be used to maintain state between the request and callback + :returns: The fetched AuthorizeInstance + """ + + params = values.of( + { + "ResponseType": response_type, + "ClientId": client_id, + "RedirectUri": redirect_uri, + "Scope": scope, + "State": state, + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, params=params + ) + + return AuthorizeInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/oauth/v1/token.py b/twilio/rest/oauth/v1/token.py new file mode 100644 index 0000000000..eb6d9d1b74 --- /dev/null +++ b/twilio/rest/oauth/v1/token.py @@ -0,0 +1,155 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Oauth + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class TokenInstance(InstanceResource): + """ + :ivar access_token: Token which carries the necessary information to access a Twilio resource directly. + :ivar refresh_token: Token which carries the information necessary to get a new access token. + :ivar id_token: Token which carries the information necessary of user profile. + :ivar token_type: Token type + :ivar expires_in: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.access_token: Optional[str] = payload.get("access_token") + self.refresh_token: Optional[str] = payload.get("refresh_token") + self.id_token: Optional[str] = payload.get("id_token") + self.token_type: Optional[str] = payload.get("token_type") + self.expires_in: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("expires_in") + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class TokenList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the TokenList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/token" + + def create( + self, + grant_type: str, + client_id: str, + client_secret: str, + code: Union[str, object] = values.unset, + redirect_uri: Union[str, object] = values.unset, + audience: Union[str, object] = values.unset, + ) -> TokenInstance: + """ + Create the TokenInstance + + :param grant_type: Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. + :param client_id: A 34 character string that uniquely identifies this OAuth App. + :param client_secret: The credential for confidential OAuth App. + :param code: JWT token related to the authorization code grant type. + :param redirect_uri: The redirect uri + :param audience: The targeted audience uri + + :returns: The created TokenInstance + """ + + data = values.of( + { + "GrantType": grant_type, + "ClientId": client_id, + "ClientSecret": client_secret, + "Code": code, + "RedirectUri": redirect_uri, + "Audience": audience, + } + ) + + payload = self._version.create( + method="POST", + uri=self._uri, + data=data, + ) + + return TokenInstance(self._version, payload) + + async def create_async( + self, + grant_type: str, + client_id: str, + client_secret: str, + code: Union[str, object] = values.unset, + redirect_uri: Union[str, object] = values.unset, + audience: Union[str, object] = values.unset, + ) -> TokenInstance: + """ + Asynchronously create the TokenInstance + + :param grant_type: Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. + :param client_id: A 34 character string that uniquely identifies this OAuth App. + :param client_secret: The credential for confidential OAuth App. + :param code: JWT token related to the authorization code grant type. + :param redirect_uri: The redirect uri + :param audience: The targeted audience uri + + :returns: The created TokenInstance + """ + + data = values.of( + { + "GrantType": grant_type, + "ClientId": client_id, + "ClientSecret": client_secret, + "Code": code, + "RedirectUri": redirect_uri, + "Audience": audience, + } + ) + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + data=data, + ) + + return TokenInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py index 40f0d6a07d..5a19ccaabe 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py @@ -326,6 +326,7 @@ async def create_async( def stream( self, + object_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[CustomerProfilesEntityAssignmentsInstance]: @@ -335,6 +336,7 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. + :param str object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -345,12 +347,13 @@ def stream( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) + page = self.page(object_type=object_type, page_size=limits["page_size"]) return self._version.stream(page, limits["limit"]) async def stream_async( self, + object_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[CustomerProfilesEntityAssignmentsInstance]: @@ -360,6 +363,7 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. + :param str object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -370,12 +374,15 @@ async def stream_async( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) + page = await self.page_async( + object_type=object_type, page_size=limits["page_size"] + ) return self._version.stream_async(page, limits["limit"]) def list( self, + object_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CustomerProfilesEntityAssignmentsInstance]: @@ -384,6 +391,7 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param str object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -395,6 +403,7 @@ def list( """ return list( self.stream( + object_type=object_type, limit=limit, page_size=page_size, ) @@ -402,6 +411,7 @@ def list( async def list_async( self, + object_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CustomerProfilesEntityAssignmentsInstance]: @@ -410,6 +420,7 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param str object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -422,6 +433,7 @@ async def list_async( return [ record async for record in await self.stream_async( + object_type=object_type, limit=limit, page_size=page_size, ) @@ -429,6 +441,7 @@ async def list_async( def page( self, + object_type: Union[str, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -437,6 +450,7 @@ def page( Retrieve a single page of CustomerProfilesEntityAssignmentsInstance records from the API. Request is executed immediately + :param object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -445,6 +459,7 @@ def page( """ data = values.of( { + "ObjectType": object_type, "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -458,6 +473,7 @@ def page( async def page_async( self, + object_type: Union[str, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -466,6 +482,7 @@ async def page_async( Asynchronously retrieve a single page of CustomerProfilesEntityAssignmentsInstance records from the API. Request is executed immediately + :param object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -474,6 +491,7 @@ async def page_async( """ data = values.of( { + "ObjectType": object_type, "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py index 68854b9c5e..16f07a8927 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py @@ -320,6 +320,7 @@ async def create_async( def stream( self, + object_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[TrustProductsEntityAssignmentsInstance]: @@ -329,6 +330,7 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. + :param str object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -339,12 +341,13 @@ def stream( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) + page = self.page(object_type=object_type, page_size=limits["page_size"]) return self._version.stream(page, limits["limit"]) async def stream_async( self, + object_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[TrustProductsEntityAssignmentsInstance]: @@ -354,6 +357,7 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. + :param str object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -364,12 +368,15 @@ async def stream_async( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) + page = await self.page_async( + object_type=object_type, page_size=limits["page_size"] + ) return self._version.stream_async(page, limits["limit"]) def list( self, + object_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[TrustProductsEntityAssignmentsInstance]: @@ -378,6 +385,7 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param str object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -389,6 +397,7 @@ def list( """ return list( self.stream( + object_type=object_type, limit=limit, page_size=page_size, ) @@ -396,6 +405,7 @@ def list( async def list_async( self, + object_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[TrustProductsEntityAssignmentsInstance]: @@ -404,6 +414,7 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param str object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -416,6 +427,7 @@ async def list_async( return [ record async for record in await self.stream_async( + object_type=object_type, limit=limit, page_size=page_size, ) @@ -423,6 +435,7 @@ async def list_async( def page( self, + object_type: Union[str, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -431,6 +444,7 @@ def page( Retrieve a single page of TrustProductsEntityAssignmentsInstance records from the API. Request is executed immediately + :param object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -439,6 +453,7 @@ def page( """ data = values.of( { + "ObjectType": object_type, "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -452,6 +467,7 @@ def page( async def page_async( self, + object_type: Union[str, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -460,6 +476,7 @@ async def page_async( Asynchronously retrieve a single page of TrustProductsEntityAssignmentsInstance records from the API. Request is executed immediately + :param object_type: A string to filter the results by (EndUserType or SupportingDocumentType) machine-name. This is useful when you want to retrieve the entity-assignment of a specific end-user or supporting document. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -468,6 +485,7 @@ async def page_async( """ data = values.of( { + "ObjectType": object_type, "PageToken": page_token, "Page": page_number, "PageSize": page_size, From fcdc07c8fe740aae736803fce0e1b3411011f42c Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 15 Mar 2024 05:37:46 +0000 Subject: [PATCH 015/113] Release 9.0.2 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 54c3df9b46..625c210413 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.1", + version="9.0.2", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index ab2ae748c7..698515090a 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "0", "1") +__version_info__ = ("9", "0", "2") __version__ = ".".join(__version_info__) From f07a244b9020bb299c9e6d1357b26b38ed90ffb3 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 1 Apr 2024 14:56:49 +0000 Subject: [PATCH 016/113] [Librarian] Regenerated @ 7e2caf2ef38bb07afedbc8ba24e3a235c57337ad 2deb312512e85217931fbc99141b334a5d6beaaf --- CHANGES.md | 37 + twilio/rest/__init__.py | 15 - .../rest/api/v2010/account/call/__init__.py | 80 +-- .../v2010/account/conference/participant.py | 2 + twilio/rest/content/v1/content/__init__.py | 521 +------------- .../content/v1/content/approval_create.py | 27 +- .../rest/content/v1/content/approval_fetch.py | 32 +- .../v1/service/conversation/__init__.py | 24 +- twilio/rest/flex_api/v1/plugin/__init__.py | 12 + twilio/rest/media/MediaBase.py | 44 -- twilio/rest/media/v1/__init__.py | 59 -- twilio/rest/media/v1/media_processor.py | 622 ----------------- twilio/rest/media/v1/media_recording.py | 554 --------------- .../rest/media/v1/player_streamer/__init__.py | 641 ------------------ .../v1/player_streamer/playback_grant.py | 280 -------- twilio/rest/numbers/v1/bulk_eligibility.py | 3 +- twilio/rest/numbers/v1/eligibility.py | 3 +- twilio/rest/numbers/v1/porting_port_in.py | 3 +- .../rest/numbers/v1/porting_port_in_fetch.py | 4 + .../numbers/v2/bulk_hosted_number_order.py | 3 +- twilio/rest/oauth/v1/token.py | 23 +- twilio/rest/preview_messaging/v1/message.py | 3 +- .../serverless/v1/service/build/__init__.py | 2 + twilio/rest/studio/v2/flow_validate.py | 2 + .../task_queue_bulk_real_time_statistics.py | 3 +- .../v1/compliance_registration_inquiries.py | 186 ++++- .../trusthub/v1/trust_products/__init__.py | 60 +- .../v1/room/participant/subscribe_rules.py | 2 + twilio/rest/video/v1/room/recording_rules.py | 2 + 29 files changed, 392 insertions(+), 2857 deletions(-) delete mode 100644 twilio/rest/media/MediaBase.py delete mode 100644 twilio/rest/media/v1/__init__.py delete mode 100644 twilio/rest/media/v1/media_processor.py delete mode 100644 twilio/rest/media/v1/media_recording.py delete mode 100644 twilio/rest/media/v1/player_streamer/__init__.py delete mode 100644 twilio/rest/media/v1/player_streamer/playback_grant.py diff --git a/CHANGES.md b/CHANGES.md index d5fbaebfcc..1bc063569b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,43 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-04-01] Version 9.0.3 +-------------------------- +**Api** +- Add property `queue_time` to conference participant resource +- Update RiskCheck documentation +- Correct call filtering by start and end time documentation, clarifying that times are UTC. + +**Flex** +- Adding optional parameter to `plugins` + +**Media** +- Remove API: MediaProcessor + +**Messaging** +- Remove Sending-Window due to test failure +- Add Sending-Window as a response property to Messaging Services, gated by a beta feature flag + +**Numbers** +- Correct valid_until_date field to be visible in Bundles resource +- Adding port_in_status field to the Port In resource and phone_number_status and sid fields to the Port In Phone Number resource + +**Oauth** +- Modified token endpoint response +- Added refresh_token and scope as optional parameter to token endpoint + +**Trusthub** +- Add update inquiry endpoint in compliance_registration. +- Add new field in themeSetId in compliance_registration. + +**Voice** +- Correct call filtering by start and end time documentation, clarifying that times are UTC. + +**Twiml** +- Add support for new Google voices (Q1 2024) for `Say` verb - gu-IN voices +- Add support for new Amazon Polly and Google voices (Q1 2024) for `Say` verb - Niamh (en-IE) and Sofie (da-DK) voices + + [2024-03-15] Version 9.0.2 -------------------------- **Oauth** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 254d920786..c7f722642a 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -27,7 +27,6 @@ from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging from twilio.rest.lookups import Lookups - from twilio.rest.media import Media from twilio.rest.preview_messaging import PreviewMessaging from twilio.rest.messaging import Messaging from twilio.rest.microvisor import Microvisor @@ -136,7 +135,6 @@ def __init__( self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None self._lookups: Optional["Lookups"] = None - self._media: Optional["Media"] = None self._preview_messaging: Optional["PreviewMessaging"] = None self._messaging: Optional["Messaging"] = None self._microvisor: Optional["Microvisor"] = None @@ -329,19 +327,6 @@ def lookups(self) -> "Lookups": self._lookups = Lookups(self) return self._lookups - @property - def media(self) -> "Media": - """ - Access the Media Twilio Domain - - :returns: Media Twilio Domain - """ - if self._media is None: - from twilio.rest.media import Media - - self._media = Media(self) - return self._media - @property def preview_messaging(self) -> "PreviewMessaging": """ diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index b218709a2d..2ba343f566 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -52,8 +52,8 @@ class UpdateStatus(object): """ :ivar sid: The unique string that we created to identify this Call resource. - :ivar date_created: The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_created: The date and time in UTC that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_updated: The date and time in UTC that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar parent_call_sid: The SID that identifies the call that created this leg. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Call resource. :ivar to: The phone number, SIP address, Client identifier or SIM SID that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. Client identifiers are formatted `client:name`. SIM SIDs are formatted as `sim:sid`. @@ -62,8 +62,8 @@ class UpdateStatus(object): :ivar from_formatted: The calling phone number, SIP address, or Client identifier formatted for display. Non-North American phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +442071838750). :ivar phone_number_sid: If the call was inbound, this is the SID of the IncomingPhoneNumber resource that received the call. If the call was outbound, it is the SID of the OutgoingCallerId resource from which the call was placed. :ivar status: - :ivar start_time: The start time of the call, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call has not yet been dialed. - :ivar end_time: The time the call ended, given as GMT in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call did not complete successfully. + :ivar start_time: The start time of the call, given as UTC in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call has not yet been dialed. + :ivar end_time: The time the call ended, given as UTC in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call did not complete successfully. :ivar duration: The length of the call in seconds. This value is empty for busy, failed, unanswered, or ongoing calls. :ivar price: The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. :ivar price_unit: The currency in which `Price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g., `USD`, `EUR`, `JPY`). Always capitalized for calls. @@ -977,12 +977,12 @@ def stream( :param str from_: Only include calls from this phone number, SIP address, Client identifier or SIM SID. :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. - :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1034,12 +1034,12 @@ async def stream_async( :param str from_: Only include calls from this phone number, SIP address, Client identifier or SIM SID. :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. - :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1090,12 +1090,12 @@ def list( :param str from_: Only include calls from this phone number, SIP address, Client identifier or SIM SID. :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. - :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1146,12 +1146,12 @@ async def list_async( :param str from_: Only include calls from this phone number, SIP address, Client identifier or SIM SID. :param str parent_call_sid: Only include calls spawned by calls with this SID. :param "CallInstance.Status" status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. - :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param datetime end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param datetime end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -1203,12 +1203,12 @@ def page( :param from_: Only include calls from this phone number, SIP address, Client identifier or SIM SID. :param parent_call_sid: Only include calls spawned by calls with this SID. :param status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. - :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1260,12 +1260,12 @@ async def page_async( :param from_: Only include calls from this phone number, SIP address, Client identifier or SIM SID. :param parent_call_sid: Only include calls spawned by calls with this SID. :param status: The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. - :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. - :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. - :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param start_time: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param start_time_before: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param start_time_after: Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + :param end_time: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param end_time_before: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + :param end_time_after: Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index 1f3fffd8a4..2c7ae5932c 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -46,6 +46,7 @@ class Status(object): :ivar hold: Whether the participant is on hold. Can be `true` or `false`. :ivar start_conference_on_enter: Whether the conference starts when the participant joins the conference, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. :ivar status: + :ivar queue_time: The wait time in milliseconds before participant's call is placed. Only available in the response to a create participant request. :ivar uri: The URI of the resource, relative to `https://api.twilio.com`. """ @@ -80,6 +81,7 @@ def __init__( "start_conference_on_enter" ) self.status: Optional["ParticipantInstance.Status"] = payload.get("status") + self.queue_time: Optional[str] = payload.get("queue_time") self.uri: Optional[str] = payload.get("uri") self._solution = { diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index bdc1102ca4..b057cb4f86 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -20,27 +20,10 @@ from twilio.base.list_resource import ListResource from twilio.base.version import Version from twilio.base.page import Page -from twilio.rest.content.v1.content.approval_create import ApprovalCreateList from twilio.rest.content.v1.content.approval_fetch import ApprovalFetchList class ContentInstance(InstanceResource): - - class AuthenticationActionType(object): - COPY_CODE = "COPY_CODE" - - class CallToActionActionType(object): - URL = "URL" - PHONE_NUMBER = "PHONE_NUMBER" - - class CardActionType(object): - URL = "URL" - PHONE_NUMBER = "PHONE_NUMBER" - QUICK_REPLY = "QUICK_REPLY" - - class QuickReplyActionType(object): - QUICK_REPLY = "QUICK_REPLY" - """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -49,7 +32,7 @@ class QuickReplyActionType(object): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar url: The URL of the resource, relative to `https://content.twilio.com`. :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create """ @@ -130,13 +113,6 @@ async def fetch_async(self) -> "ContentInstance": """ return await self._proxy.fetch_async() - @property - def approval_create(self) -> ApprovalCreateList: - """ - Access the approval_create - """ - return self._proxy.approval_create - @property def approval_fetch(self) -> ApprovalFetchList: """ @@ -171,7 +147,6 @@ def __init__(self, version: Version, sid: str): } self._uri = "/Content/{sid}".format(**self._solution) - self._approval_create: Optional[ApprovalCreateList] = None self._approval_fetch: Optional[ApprovalFetchList] = None def delete(self) -> bool: @@ -236,18 +211,6 @@ async def fetch_async(self) -> ContentInstance: sid=self._solution["sid"], ) - @property - def approval_create(self) -> ApprovalCreateList: - """ - Access the approval_create - """ - if self._approval_create is None: - self._approval_create = ApprovalCreateList( - self._version, - self._solution["sid"], - ) - return self._approval_create - @property def approval_fetch(self) -> ApprovalFetchList: """ @@ -291,451 +254,6 @@ def __repr__(self) -> str: class ContentList(ListResource): - class AuthenticationAction(object): - """ - :ivar type: - :ivar copy_code_text: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.type: Optional["ContentInstance.AuthenticationActionType"] = ( - payload.get("type") - ) - self.copy_code_text: Optional[str] = payload.get("copy_code_text") - - def to_dict(self): - return { - "type": self.type.to_dict(), - "copy_code_text": self.copy_code_text, - } - - class CallToActionAction(object): - """ - :ivar type: - :ivar title: - :ivar url: - :ivar phone: - :ivar id: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.type: Optional["ContentInstance.CallToActionActionType"] = payload.get( - "type" - ) - self.title: Optional[str] = payload.get("title") - self.url: Optional[str] = payload.get("url") - self.phone: Optional[str] = payload.get("phone") - self.id: Optional[str] = payload.get("id") - - def to_dict(self): - return { - "type": self.type.to_dict(), - "title": self.title, - "url": self.url, - "phone": self.phone, - "id": self.id, - } - - class CardAction(object): - """ - :ivar type: - :ivar title: - :ivar url: - :ivar phone: - :ivar id: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.type: Optional["ContentInstance.CardActionType"] = payload.get("type") - self.title: Optional[str] = payload.get("title") - self.url: Optional[str] = payload.get("url") - self.phone: Optional[str] = payload.get("phone") - self.id: Optional[str] = payload.get("id") - - def to_dict(self): - return { - "type": self.type.to_dict(), - "title": self.title, - "url": self.url, - "phone": self.phone, - "id": self.id, - } - - class CatalogItem(object): - """ - :ivar id: - :ivar section_title: - :ivar name: - :ivar media_url: - :ivar price: - :ivar description: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.id: Optional[str] = payload.get("id") - self.section_title: Optional[str] = payload.get("section_title") - self.name: Optional[str] = payload.get("name") - self.media_url: Optional[str] = payload.get("media_url") - self.price: Optional[float] = payload.get("price") - self.description: Optional[str] = payload.get("description") - - def to_dict(self): - return { - "id": self.id, - "section_title": self.section_title, - "name": self.name, - "media_url": self.media_url, - "price": self.price, - "description": self.description, - } - - class ContentCreateRequest(object): - """ - :ivar friendly_name: User defined name of the content - :ivar variables: Key value pairs of variable name to value - :ivar language: Language code for the content - :ivar types: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.variables: Optional[dict[str, str]] = payload.get("variables") - self.language: Optional[str] = payload.get("language") - self.types: Optional[ContentList.Types] = payload.get("types") - - def to_dict(self): - return { - "friendly_name": self.friendly_name, - "variables": self.variables, - "language": self.language, - "types": self.types.to_dict(), - } - - class ListItem(object): - """ - :ivar id: - :ivar item: - :ivar description: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.id: Optional[str] = payload.get("id") - self.item: Optional[str] = payload.get("item") - self.description: Optional[str] = payload.get("description") - - def to_dict(self): - return { - "id": self.id, - "item": self.item, - "description": self.description, - } - - class QuickReplyAction(object): - """ - :ivar type: - :ivar title: - :ivar id: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.type: Optional["ContentInstance.QuickReplyActionType"] = payload.get( - "type" - ) - self.title: Optional[str] = payload.get("title") - self.id: Optional[str] = payload.get("id") - - def to_dict(self): - return { - "type": self.type.to_dict(), - "title": self.title, - "id": self.id, - } - - class TwilioCallToAction(object): - """ - :ivar body: - :ivar actions: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - self.actions: Optional[List[ContentList.CallToActionAction]] = payload.get( - "actions" - ) - - def to_dict(self): - return { - "body": self.body, - "actions": [actions.to_dict() for actions in self.actions], - } - - class TwilioCard(object): - """ - :ivar title: - :ivar subtitle: - :ivar media: - :ivar actions: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.title: Optional[str] = payload.get("title") - self.subtitle: Optional[str] = payload.get("subtitle") - self.media: Optional[List[str]] = payload.get("media") - self.actions: Optional[List[ContentList.CardAction]] = payload.get( - "actions" - ) - - def to_dict(self): - return { - "title": self.title, - "subtitle": self.subtitle, - "media": self.media, - "actions": [actions.to_dict() for actions in self.actions], - } - - class TwilioCatalog(object): - """ - :ivar title: - :ivar body: - :ivar subtitle: - :ivar id: - :ivar items: - :ivar dynamic_items: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.title: Optional[str] = payload.get("title") - self.body: Optional[str] = payload.get("body") - self.subtitle: Optional[str] = payload.get("subtitle") - self.id: Optional[str] = payload.get("id") - self.items: Optional[List[ContentList.CatalogItem]] = payload.get("items") - self.dynamic_items: Optional[str] = payload.get("dynamic_items") - - def to_dict(self): - return { - "title": self.title, - "body": self.body, - "subtitle": self.subtitle, - "id": self.id, - "items": [items.to_dict() for items in self.items], - "dynamic_items": self.dynamic_items, - } - - class TwilioListPicker(object): - """ - :ivar body: - :ivar button: - :ivar items: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - self.button: Optional[str] = payload.get("button") - self.items: Optional[List[ContentList.ListItem]] = payload.get("items") - - def to_dict(self): - return { - "body": self.body, - "button": self.button, - "items": [items.to_dict() for items in self.items], - } - - class TwilioLocation(object): - """ - :ivar latitude: - :ivar longitude: - :ivar label: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.latitude: Optional[float] = payload.get("latitude") - self.longitude: Optional[float] = payload.get("longitude") - self.label: Optional[str] = payload.get("label") - - def to_dict(self): - return { - "latitude": self.latitude, - "longitude": self.longitude, - "label": self.label, - } - - class TwilioMedia(object): - """ - :ivar body: - :ivar media: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - self.media: Optional[List[str]] = payload.get("media") - - def to_dict(self): - return { - "body": self.body, - "media": self.media, - } - - class TwilioQuickReply(object): - """ - :ivar body: - :ivar actions: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - self.actions: Optional[List[ContentList.QuickReplyAction]] = payload.get( - "actions" - ) - - def to_dict(self): - return { - "body": self.body, - "actions": [actions.to_dict() for actions in self.actions], - } - - class TwilioText(object): - """ - :ivar body: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - - def to_dict(self): - return { - "body": self.body, - } - - class Types(object): - """ - :ivar twilio_text: - :ivar twilio_media: - :ivar twilio_location: - :ivar twilio_list_picker: - :ivar twilio_call_to_action: - :ivar twilio_quick_reply: - :ivar twilio_card: - :ivar twilio_catalog: - :ivar whatsapp_card: - :ivar whatsapp_authentication: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.twilio_text: Optional[ContentList.TwilioText] = payload.get( - "twilio_text" - ) - self.twilio_media: Optional[ContentList.TwilioMedia] = payload.get( - "twilio_media" - ) - self.twilio_location: Optional[ContentList.TwilioLocation] = payload.get( - "twilio_location" - ) - self.twilio_list_picker: Optional[ContentList.TwilioListPicker] = ( - payload.get("twilio_list_picker") - ) - self.twilio_call_to_action: Optional[ContentList.TwilioCallToAction] = ( - payload.get("twilio_call_to_action") - ) - self.twilio_quick_reply: Optional[ContentList.TwilioQuickReply] = ( - payload.get("twilio_quick_reply") - ) - self.twilio_card: Optional[ContentList.TwilioCard] = payload.get( - "twilio_card" - ) - self.twilio_catalog: Optional[ContentList.TwilioCatalog] = payload.get( - "twilio_catalog" - ) - self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( - "whatsapp_card" - ) - self.whatsapp_authentication: Optional[ - ContentList.WhatsappAuthentication - ] = payload.get("whatsapp_authentication") - - def to_dict(self): - return { - "twilio_text": self.twilio_text.to_dict(), - "twilio_media": self.twilio_media.to_dict(), - "twilio_location": self.twilio_location.to_dict(), - "twilio_list_picker": self.twilio_list_picker.to_dict(), - "twilio_call_to_action": self.twilio_call_to_action.to_dict(), - "twilio_quick_reply": self.twilio_quick_reply.to_dict(), - "twilio_card": self.twilio_card.to_dict(), - "twilio_catalog": self.twilio_catalog.to_dict(), - "whatsapp_card": self.whatsapp_card.to_dict(), - "whatsapp_authentication": self.whatsapp_authentication.to_dict(), - } - - class WhatsappAuthentication(object): - """ - :ivar add_security_recommendation: - :ivar code_expiration_minutes: - :ivar actions: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.add_security_recommendation: Optional[bool] = payload.get( - "add_security_recommendation" - ) - self.code_expiration_minutes: Optional[float] = payload.get( - "code_expiration_minutes" - ) - self.actions: Optional[List[ContentList.AuthenticationAction]] = ( - payload.get("actions") - ) - - def to_dict(self): - return { - "add_security_recommendation": self.add_security_recommendation, - "code_expiration_minutes": self.code_expiration_minutes, - "actions": [actions.to_dict() for actions in self.actions], - } - - class WhatsappCard(object): - """ - :ivar body: - :ivar footer: - :ivar media: - :ivar header_text: - :ivar actions: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - self.footer: Optional[str] = payload.get("footer") - self.media: Optional[List[str]] = payload.get("media") - self.header_text: Optional[str] = payload.get("header_text") - self.actions: Optional[List[ContentList.CardAction]] = payload.get( - "actions" - ) - - def to_dict(self): - return { - "body": self.body, - "footer": self.footer, - "media": self.media, - "header_text": self.header_text, - "actions": [actions.to_dict() for actions in self.actions], - } - def __init__(self, version: Version): """ Initialize the ContentList @@ -747,43 +265,6 @@ def __init__(self, version: Version): self._uri = "/Content" - def create(self, content_create_request: ContentCreateRequest) -> ContentInstance: - """ - Create the ContentInstance - - :param content_create_request: - - :returns: The created ContentInstance - """ - data = content_create_request.to_dict() - - headers = {"Content-Type": "application/json"} - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return ContentInstance(self._version, payload) - - async def create_async( - self, content_create_request: ContentCreateRequest - ) -> ContentInstance: - """ - Asynchronously create the ContentInstance - - :param content_create_request: - - :returns: The created ContentInstance - """ - - data = content_create_request.to_dict() - headers = {"Content-Type": "application/json"} - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return ContentInstance(self._version, payload) - def stream( self, limit: Optional[int] = None, diff --git a/twilio/rest/content/v1/content/approval_create.py b/twilio/rest/content/v1/content/approval_create.py index 63a4474306..ddd922afc2 100644 --- a/twilio/rest/content/v1/content/approval_create.py +++ b/twilio/rest/content/v1/content/approval_create.py @@ -29,7 +29,7 @@ class ApprovalCreateInstance(InstanceResource): :ivar allow_category_change: """ - def __init__(self, version: Version, payload: Dict[str, Any], sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): super().__init__(version) self.name: Optional[str] = payload.get("name") @@ -42,7 +42,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], sid: str): ) self._solution = { - "sid": sid, + "content_sid": content_sid, } def __repr__(self) -> str: @@ -63,7 +63,7 @@ class ContentApprovalRequest(object): :ivar category: A WhatsApp recognized template category. """ - def __init__(self, payload: Dict[str, Any], sid: str): + def __init__(self, payload: Dict[str, Any], content_sid: str): self.name: Optional[str] = payload.get("name") self.category: Optional[str] = payload.get("category") @@ -74,21 +74,23 @@ def to_dict(self): "category": self.category, } - def __init__(self, version: Version, sid: str): + def __init__(self, version: Version, content_sid: str): """ Initialize the ApprovalCreateList :param version: Version that contains the resource - :param sid: + :param content_sid: """ super().__init__(version) # Path Solution self._solution = { - "sid": sid, + "content_sid": content_sid, } - self._uri = "/Content/{sid}/ApprovalRequests/whatsapp".format(**self._solution) + self._uri = "/Content/{content_sid}/ApprovalRequests/whatsapp".format( + **self._solution + ) def create( self, content_approval_request: ContentApprovalRequest @@ -103,11 +105,14 @@ def create( data = content_approval_request.to_dict() headers = {"Content-Type": "application/json"} + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) - return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) + return ApprovalCreateInstance( + self._version, payload, content_sid=self._solution["content_sid"] + ) async def create_async( self, content_approval_request: ContentApprovalRequest @@ -119,15 +124,17 @@ async def create_async( :returns: The created ApprovalCreateInstance """ - data = content_approval_request.to_dict() + headers = {"Content-Type": "application/json"} payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) - return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) + return ApprovalCreateInstance( + self._version, payload, content_sid=self._solution["content_sid"] + ) def __repr__(self) -> str: """ diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index f35ef6a48f..f679a920a1 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -27,7 +27,7 @@ class ApprovalFetchInstance(InstanceResource): :ivar url: The URL of the resource, relative to `https://content.twilio.com`. """ - def __init__(self, version: Version, payload: Dict[str, Any], sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): super().__init__(version) self.sid: Optional[str] = payload.get("sid") @@ -36,7 +36,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], sid: str): self.url: Optional[str] = payload.get("url") self._solution = { - "sid": sid, + "content_sid": content_sid, } self._context: Optional[ApprovalFetchContext] = None @@ -51,7 +51,7 @@ def _proxy(self) -> "ApprovalFetchContext": if self._context is None: self._context = ApprovalFetchContext( self._version, - sid=self._solution["sid"], + content_sid=self._solution["content_sid"], ) return self._context @@ -85,20 +85,20 @@ def __repr__(self) -> str: class ApprovalFetchContext(InstanceContext): - def __init__(self, version: Version, sid: str): + def __init__(self, version: Version, content_sid: str): """ Initialize the ApprovalFetchContext :param version: Version that contains the resource - :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "sid": sid, + "content_sid": content_sid, } - self._uri = "/Content/{sid}/ApprovalRequests".format(**self._solution) + self._uri = "/Content/{content_sid}/ApprovalRequests".format(**self._solution) def fetch(self) -> ApprovalFetchInstance: """ @@ -116,7 +116,7 @@ def fetch(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - sid=self._solution["sid"], + content_sid=self._solution["content_sid"], ) async def fetch_async(self) -> ApprovalFetchInstance: @@ -135,7 +135,7 @@ async def fetch_async(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - sid=self._solution["sid"], + content_sid=self._solution["content_sid"], ) def __repr__(self) -> str: @@ -150,19 +150,19 @@ def __repr__(self) -> str: class ApprovalFetchList(ListResource): - def __init__(self, version: Version, sid: str): + def __init__(self, version: Version, content_sid: str): """ Initialize the ApprovalFetchList :param version: Version that contains the resource - :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "sid": sid, + "content_sid": content_sid, } def get(self) -> ApprovalFetchContext: @@ -170,14 +170,18 @@ def get(self) -> ApprovalFetchContext: Constructs a ApprovalFetchContext """ - return ApprovalFetchContext(self._version, sid=self._solution["sid"]) + return ApprovalFetchContext( + self._version, content_sid=self._solution["content_sid"] + ) def __call__(self) -> ApprovalFetchContext: """ Constructs a ApprovalFetchContext """ - return ApprovalFetchContext(self._version, sid=self._solution["sid"]) + return ApprovalFetchContext( + self._version, content_sid=self._solution["content_sid"] + ) def __repr__(self) -> str: """ diff --git a/twilio/rest/conversations/v1/service/conversation/__init__.py b/twilio/rest/conversations/v1/service/conversation/__init__.py index c347977a40..69e87e5eef 100644 --- a/twilio/rest/conversations/v1/service/conversation/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/__init__.py @@ -765,8 +765,8 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. - :param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param str start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param str end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -801,8 +801,8 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. - :param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param str start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param str end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -836,8 +836,8 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param str start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param str end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -871,8 +871,8 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param str start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param str end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -907,8 +907,8 @@ def page( Retrieve a single page of ConversationInstance records from the API. Request is executed immediately - :param start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state @@ -943,8 +943,8 @@ async def page_async( Asynchronously retrieve a single page of ConversationInstance records from the API. Request is executed immediately - :param start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state diff --git a/twilio/rest/flex_api/v1/plugin/__init__.py b/twilio/rest/flex_api/v1/plugin/__init__.py index 09244d42de..90697d1845 100644 --- a/twilio/rest/flex_api/v1/plugin/__init__.py +++ b/twilio/rest/flex_api/v1/plugin/__init__.py @@ -359,6 +359,8 @@ def create( flex_metadata: Union[str, object] = values.unset, friendly_name: Union[str, object] = values.unset, description: Union[str, object] = values.unset, + cli_version: Union[str, object] = values.unset, + validate_status: Union[str, object] = values.unset, ) -> PluginInstance: """ Create the PluginInstance @@ -367,6 +369,8 @@ def create( :param flex_metadata: The Flex-Metadata HTTP request header :param friendly_name: The Flex Plugin's friendly name. :param description: A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + :param cli_version: The version of Flex Plugins CLI used to create this plugin + :param validate_status: The validation status of the plugin, indicating whether it has been validated :returns: The created PluginInstance """ @@ -376,6 +380,8 @@ def create( "UniqueName": unique_name, "FriendlyName": friendly_name, "Description": description, + "CliVersion": cli_version, + "ValidateStatus": validate_status, } ) headers = values.of( @@ -396,6 +402,8 @@ async def create_async( flex_metadata: Union[str, object] = values.unset, friendly_name: Union[str, object] = values.unset, description: Union[str, object] = values.unset, + cli_version: Union[str, object] = values.unset, + validate_status: Union[str, object] = values.unset, ) -> PluginInstance: """ Asynchronously create the PluginInstance @@ -404,6 +412,8 @@ async def create_async( :param flex_metadata: The Flex-Metadata HTTP request header :param friendly_name: The Flex Plugin's friendly name. :param description: A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long + :param cli_version: The version of Flex Plugins CLI used to create this plugin + :param validate_status: The validation status of the plugin, indicating whether it has been validated :returns: The created PluginInstance """ @@ -413,6 +423,8 @@ async def create_async( "UniqueName": unique_name, "FriendlyName": friendly_name, "Description": description, + "CliVersion": cli_version, + "ValidateStatus": validate_status, } ) headers = values.of( diff --git a/twilio/rest/media/MediaBase.py b/twilio/rest/media/MediaBase.py deleted file mode 100644 index 6581eb5d09..0000000000 --- a/twilio/rest/media/MediaBase.py +++ /dev/null @@ -1,44 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional - -from twilio.base.domain import Domain -from twilio.rest import Client -from twilio.rest.media.v1 import V1 - - -class MediaBase(Domain): - - def __init__(self, twilio: Client): - """ - Initialize the Media Domain - - :returns: Domain for Media - """ - super().__init__(twilio, "https://media.twilio.com") - self._v1: Optional[V1] = None - - @property - def v1(self) -> V1: - """ - :returns: Versions v1 of Media - """ - if self._v1 is None: - self._v1 = V1(self) - return self._v1 - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/media/v1/__init__.py b/twilio/rest/media/v1/__init__.py deleted file mode 100644 index 3cef1df9b2..0000000000 --- a/twilio/rest/media/v1/__init__.py +++ /dev/null @@ -1,59 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Media - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.media.v1.media_processor import MediaProcessorList -from twilio.rest.media.v1.media_recording import MediaRecordingList -from twilio.rest.media.v1.player_streamer import PlayerStreamerList - - -class V1(Version): - - def __init__(self, domain: Domain): - """ - Initialize the V1 version of Media - - :param domain: The Twilio.media domain - """ - super().__init__(domain, "v1") - self._media_processor: Optional[MediaProcessorList] = None - self._media_recording: Optional[MediaRecordingList] = None - self._player_streamer: Optional[PlayerStreamerList] = None - - @property - def media_processor(self) -> MediaProcessorList: - if self._media_processor is None: - self._media_processor = MediaProcessorList(self) - return self._media_processor - - @property - def media_recording(self) -> MediaRecordingList: - if self._media_recording is None: - self._media_recording = MediaRecordingList(self) - return self._media_recording - - @property - def player_streamer(self) -> PlayerStreamerList: - if self._player_streamer is None: - self._player_streamer = PlayerStreamerList(self) - return self._player_streamer - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/media/v1/media_processor.py b/twilio/rest/media/v1/media_processor.py deleted file mode 100644 index 7f1d2825b1..0000000000 --- a/twilio/rest/media/v1/media_processor.py +++ /dev/null @@ -1,622 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Media - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class MediaProcessorInstance(InstanceResource): - - class Order(object): - ASC = "asc" - DESC = "desc" - - class Status(object): - FAILED = "failed" - STARTED = "started" - ENDED = "ended" - - class UpdateStatus(object): - ENDED = "ended" - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MediaProcessor resource. - :ivar sid: The unique string generated to identify the MediaProcessor resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar extension: The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2` - :ivar extension_context: The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send. - :ivar status: - :ivar url: The absolute URL of the resource. - :ivar ended_reason: The reason why a MediaProcessor ended. When a MediaProcessor is in progress, will be `null`. When a MediaProcessor is completed, can be `ended-via-api`, `max-duration-exceeded`, `error-loading-extension`, `error-streaming-media` or `internal-service-error`. See [ended reasons](/docs/live/api/mediaprocessors#mediaprocessor-ended-reason-values) for more details. - :ivar status_callback: The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details. - :ivar status_callback_method: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. - :ivar max_duration: The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.sid: Optional[str] = payload.get("sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.extension: Optional[str] = payload.get("extension") - self.extension_context: Optional[str] = payload.get("extension_context") - self.status: Optional["MediaProcessorInstance.Status"] = payload.get("status") - self.url: Optional[str] = payload.get("url") - self.ended_reason: Optional[str] = payload.get("ended_reason") - self.status_callback: Optional[str] = payload.get("status_callback") - self.status_callback_method: Optional[str] = payload.get( - "status_callback_method" - ) - self.max_duration: Optional[int] = deserialize.integer( - payload.get("max_duration") - ) - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[MediaProcessorContext] = None - - @property - def _proxy(self) -> "MediaProcessorContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: MediaProcessorContext for this MediaProcessorInstance - """ - if self._context is None: - self._context = MediaProcessorContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def fetch(self) -> "MediaProcessorInstance": - """ - Fetch the MediaProcessorInstance - - - :returns: The fetched MediaProcessorInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "MediaProcessorInstance": - """ - Asynchronous coroutine to fetch the MediaProcessorInstance - - - :returns: The fetched MediaProcessorInstance - """ - return await self._proxy.fetch_async() - - def update( - self, status: "MediaProcessorInstance.UpdateStatus" - ) -> "MediaProcessorInstance": - """ - Update the MediaProcessorInstance - - :param status: - - :returns: The updated MediaProcessorInstance - """ - return self._proxy.update( - status=status, - ) - - async def update_async( - self, status: "MediaProcessorInstance.UpdateStatus" - ) -> "MediaProcessorInstance": - """ - Asynchronous coroutine to update the MediaProcessorInstance - - :param status: - - :returns: The updated MediaProcessorInstance - """ - return await self._proxy.update_async( - status=status, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class MediaProcessorContext(InstanceContext): - - def __init__(self, version: Version, sid: str): - """ - Initialize the MediaProcessorContext - - :param version: Version that contains the resource - :param sid: The SID of the MediaProcessor resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/MediaProcessors/{sid}".format(**self._solution) - - def fetch(self) -> MediaProcessorInstance: - """ - Fetch the MediaProcessorInstance - - - :returns: The fetched MediaProcessorInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return MediaProcessorInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> MediaProcessorInstance: - """ - Asynchronous coroutine to fetch the MediaProcessorInstance - - - :returns: The fetched MediaProcessorInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return MediaProcessorInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def update( - self, status: "MediaProcessorInstance.UpdateStatus" - ) -> MediaProcessorInstance: - """ - Update the MediaProcessorInstance - - :param status: - - :returns: The updated MediaProcessorInstance - """ - data = values.of( - { - "Status": status, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return MediaProcessorInstance(self._version, payload, sid=self._solution["sid"]) - - async def update_async( - self, status: "MediaProcessorInstance.UpdateStatus" - ) -> MediaProcessorInstance: - """ - Asynchronous coroutine to update the MediaProcessorInstance - - :param status: - - :returns: The updated MediaProcessorInstance - """ - data = values.of( - { - "Status": status, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return MediaProcessorInstance(self._version, payload, sid=self._solution["sid"]) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class MediaProcessorPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> MediaProcessorInstance: - """ - Build an instance of MediaProcessorInstance - - :param payload: Payload response from the API - """ - return MediaProcessorInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class MediaProcessorList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the MediaProcessorList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/MediaProcessors" - - def create( - self, - extension: str, - extension_context: str, - extension_environment: Union[object, object] = values.unset, - status_callback: Union[str, object] = values.unset, - status_callback_method: Union[str, object] = values.unset, - max_duration: Union[int, object] = values.unset, - ) -> MediaProcessorInstance: - """ - Create the MediaProcessorInstance - - :param extension: The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2` - :param extension_context: The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send. - :param extension_environment: User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about whether you need to provide this. - :param status_callback: The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details. - :param status_callback_method: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. - :param max_duration: The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. - - :returns: The created MediaProcessorInstance - """ - - data = values.of( - { - "Extension": extension, - "ExtensionContext": extension_context, - "ExtensionEnvironment": serialize.object(extension_environment), - "StatusCallback": status_callback, - "StatusCallbackMethod": status_callback_method, - "MaxDuration": max_duration, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return MediaProcessorInstance(self._version, payload) - - async def create_async( - self, - extension: str, - extension_context: str, - extension_environment: Union[object, object] = values.unset, - status_callback: Union[str, object] = values.unset, - status_callback_method: Union[str, object] = values.unset, - max_duration: Union[int, object] = values.unset, - ) -> MediaProcessorInstance: - """ - Asynchronously create the MediaProcessorInstance - - :param extension: The [Media Extension](/docs/live/media-extensions-overview) name or URL. Ex: `video-composer-v2` - :param extension_context: The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about the context to send. - :param extension_environment: User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/media-extensions-overview) you are using for more information about whether you need to provide this. - :param status_callback: The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/api/status-callbacks) for details. - :param status_callback_method: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. - :param max_duration: The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. - - :returns: The created MediaProcessorInstance - """ - - data = values.of( - { - "Extension": extension, - "ExtensionContext": extension_context, - "ExtensionEnvironment": serialize.object(extension_environment), - "StatusCallback": status_callback, - "StatusCallbackMethod": status_callback_method, - "MaxDuration": max_duration, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return MediaProcessorInstance(self._version, payload) - - def stream( - self, - order: Union["MediaProcessorInstance.Order", object] = values.unset, - status: Union["MediaProcessorInstance.Status", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[MediaProcessorInstance]: - """ - Streams MediaProcessorInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param "MediaProcessorInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "MediaProcessorInstance.Status" status: Status to filter by, with possible values `started`, `ended` or `failed`. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(order=order, status=status, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - order: Union["MediaProcessorInstance.Order", object] = values.unset, - status: Union["MediaProcessorInstance.Status", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[MediaProcessorInstance]: - """ - Asynchronously streams MediaProcessorInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param "MediaProcessorInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "MediaProcessorInstance.Status" status: Status to filter by, with possible values `started`, `ended` or `failed`. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - order=order, status=status, page_size=limits["page_size"] - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - order: Union["MediaProcessorInstance.Order", object] = values.unset, - status: Union["MediaProcessorInstance.Status", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[MediaProcessorInstance]: - """ - Lists MediaProcessorInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param "MediaProcessorInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "MediaProcessorInstance.Status" status: Status to filter by, with possible values `started`, `ended` or `failed`. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - order=order, - status=status, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - order: Union["MediaProcessorInstance.Order", object] = values.unset, - status: Union["MediaProcessorInstance.Status", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[MediaProcessorInstance]: - """ - Asynchronously lists MediaProcessorInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param "MediaProcessorInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "MediaProcessorInstance.Status" status: Status to filter by, with possible values `started`, `ended` or `failed`. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - order=order, - status=status, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - order: Union["MediaProcessorInstance.Order", object] = values.unset, - status: Union["MediaProcessorInstance.Status", object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> MediaProcessorPage: - """ - Retrieve a single page of MediaProcessorInstance records from the API. - Request is executed immediately - - :param order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param status: Status to filter by, with possible values `started`, `ended` or `failed`. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of MediaProcessorInstance - """ - data = values.of( - { - "Order": order, - "Status": status, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return MediaProcessorPage(self._version, response) - - async def page_async( - self, - order: Union["MediaProcessorInstance.Order", object] = values.unset, - status: Union["MediaProcessorInstance.Status", object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> MediaProcessorPage: - """ - Asynchronously retrieve a single page of MediaProcessorInstance records from the API. - Request is executed immediately - - :param order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param status: Status to filter by, with possible values `started`, `ended` or `failed`. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of MediaProcessorInstance - """ - data = values.of( - { - "Order": order, - "Status": status, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return MediaProcessorPage(self._version, response) - - def get_page(self, target_url: str) -> MediaProcessorPage: - """ - Retrieve a specific page of MediaProcessorInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of MediaProcessorInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return MediaProcessorPage(self._version, response) - - async def get_page_async(self, target_url: str) -> MediaProcessorPage: - """ - Asynchronously retrieve a specific page of MediaProcessorInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of MediaProcessorInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return MediaProcessorPage(self._version, response) - - def get(self, sid: str) -> MediaProcessorContext: - """ - Constructs a MediaProcessorContext - - :param sid: The SID of the MediaProcessor resource to update. - """ - return MediaProcessorContext(self._version, sid=sid) - - def __call__(self, sid: str) -> MediaProcessorContext: - """ - Constructs a MediaProcessorContext - - :param sid: The SID of the MediaProcessor resource to update. - """ - return MediaProcessorContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/media/v1/media_recording.py b/twilio/rest/media/v1/media_recording.py deleted file mode 100644 index fb916e5278..0000000000 --- a/twilio/rest/media/v1/media_recording.py +++ /dev/null @@ -1,554 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Media - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class MediaRecordingInstance(InstanceResource): - - class Format(object): - MP4 = "mp4" - WEBM = "webm" - - class Order(object): - ASC = "asc" - DESC = "desc" - - class Status(object): - PROCESSING = "processing" - COMPLETED = "completed" - DELETED = "deleted" - FAILED = "failed" - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the MediaRecording resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar duration: The duration of the MediaRecording in seconds. - :ivar format: - :ivar links: The URLs of related resources. - :ivar processor_sid: The SID of the MediaProcessor resource which produced the MediaRecording. - :ivar resolution: The dimensions of the video image in pixels expressed as columns (width) and rows (height). - :ivar source_sid: The SID of the resource that generated the original media track(s) of the MediaRecording. - :ivar sid: The unique string generated to identify the MediaRecording resource. - :ivar media_size: The size of the recording media in bytes. - :ivar status: - :ivar status_callback: The URL to which Twilio will send asynchronous webhook requests for every MediaRecording event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. - :ivar status_callback_method: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. - :ivar url: The absolute URL of the resource. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.duration: Optional[int] = deserialize.integer(payload.get("duration")) - self.format: Optional["MediaRecordingInstance.Format"] = payload.get("format") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.processor_sid: Optional[str] = payload.get("processor_sid") - self.resolution: Optional[str] = payload.get("resolution") - self.source_sid: Optional[str] = payload.get("source_sid") - self.sid: Optional[str] = payload.get("sid") - self.media_size: Optional[int] = payload.get("media_size") - self.status: Optional["MediaRecordingInstance.Status"] = payload.get("status") - self.status_callback: Optional[str] = payload.get("status_callback") - self.status_callback_method: Optional[str] = payload.get( - "status_callback_method" - ) - self.url: Optional[str] = payload.get("url") - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[MediaRecordingContext] = None - - @property - def _proxy(self) -> "MediaRecordingContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: MediaRecordingContext for this MediaRecordingInstance - """ - if self._context is None: - self._context = MediaRecordingContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the MediaRecordingInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the MediaRecordingInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "MediaRecordingInstance": - """ - Fetch the MediaRecordingInstance - - - :returns: The fetched MediaRecordingInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "MediaRecordingInstance": - """ - Asynchronous coroutine to fetch the MediaRecordingInstance - - - :returns: The fetched MediaRecordingInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class MediaRecordingContext(InstanceContext): - - def __init__(self, version: Version, sid: str): - """ - Initialize the MediaRecordingContext - - :param version: Version that contains the resource - :param sid: The SID of the MediaRecording resource to fetch. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/MediaRecordings/{sid}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the MediaRecordingInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the MediaRecordingInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> MediaRecordingInstance: - """ - Fetch the MediaRecordingInstance - - - :returns: The fetched MediaRecordingInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return MediaRecordingInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> MediaRecordingInstance: - """ - Asynchronous coroutine to fetch the MediaRecordingInstance - - - :returns: The fetched MediaRecordingInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return MediaRecordingInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class MediaRecordingPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> MediaRecordingInstance: - """ - Build an instance of MediaRecordingInstance - - :param payload: Payload response from the API - """ - return MediaRecordingInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class MediaRecordingList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the MediaRecordingList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/MediaRecordings" - - def stream( - self, - order: Union["MediaRecordingInstance.Order", object] = values.unset, - status: Union["MediaRecordingInstance.Status", object] = values.unset, - processor_sid: Union[str, object] = values.unset, - source_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[MediaRecordingInstance]: - """ - Streams MediaRecordingInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param "MediaRecordingInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "MediaRecordingInstance.Status" status: Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. - :param str processor_sid: SID of a MediaProcessor to filter by. - :param str source_sid: SID of a MediaRecording source to filter by. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page( - order=order, - status=status, - processor_sid=processor_sid, - source_sid=source_sid, - page_size=limits["page_size"], - ) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - order: Union["MediaRecordingInstance.Order", object] = values.unset, - status: Union["MediaRecordingInstance.Status", object] = values.unset, - processor_sid: Union[str, object] = values.unset, - source_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[MediaRecordingInstance]: - """ - Asynchronously streams MediaRecordingInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param "MediaRecordingInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "MediaRecordingInstance.Status" status: Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. - :param str processor_sid: SID of a MediaProcessor to filter by. - :param str source_sid: SID of a MediaRecording source to filter by. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - order=order, - status=status, - processor_sid=processor_sid, - source_sid=source_sid, - page_size=limits["page_size"], - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - order: Union["MediaRecordingInstance.Order", object] = values.unset, - status: Union["MediaRecordingInstance.Status", object] = values.unset, - processor_sid: Union[str, object] = values.unset, - source_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[MediaRecordingInstance]: - """ - Lists MediaRecordingInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param "MediaRecordingInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "MediaRecordingInstance.Status" status: Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. - :param str processor_sid: SID of a MediaProcessor to filter by. - :param str source_sid: SID of a MediaRecording source to filter by. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - order=order, - status=status, - processor_sid=processor_sid, - source_sid=source_sid, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - order: Union["MediaRecordingInstance.Order", object] = values.unset, - status: Union["MediaRecordingInstance.Status", object] = values.unset, - processor_sid: Union[str, object] = values.unset, - source_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[MediaRecordingInstance]: - """ - Asynchronously lists MediaRecordingInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param "MediaRecordingInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "MediaRecordingInstance.Status" status: Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. - :param str processor_sid: SID of a MediaProcessor to filter by. - :param str source_sid: SID of a MediaRecording source to filter by. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - order=order, - status=status, - processor_sid=processor_sid, - source_sid=source_sid, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - order: Union["MediaRecordingInstance.Order", object] = values.unset, - status: Union["MediaRecordingInstance.Status", object] = values.unset, - processor_sid: Union[str, object] = values.unset, - source_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> MediaRecordingPage: - """ - Retrieve a single page of MediaRecordingInstance records from the API. - Request is executed immediately - - :param order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param status: Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. - :param processor_sid: SID of a MediaProcessor to filter by. - :param source_sid: SID of a MediaRecording source to filter by. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of MediaRecordingInstance - """ - data = values.of( - { - "Order": order, - "Status": status, - "ProcessorSid": processor_sid, - "SourceSid": source_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return MediaRecordingPage(self._version, response) - - async def page_async( - self, - order: Union["MediaRecordingInstance.Order", object] = values.unset, - status: Union["MediaRecordingInstance.Status", object] = values.unset, - processor_sid: Union[str, object] = values.unset, - source_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> MediaRecordingPage: - """ - Asynchronously retrieve a single page of MediaRecordingInstance records from the API. - Request is executed immediately - - :param order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param status: Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. - :param processor_sid: SID of a MediaProcessor to filter by. - :param source_sid: SID of a MediaRecording source to filter by. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of MediaRecordingInstance - """ - data = values.of( - { - "Order": order, - "Status": status, - "ProcessorSid": processor_sid, - "SourceSid": source_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return MediaRecordingPage(self._version, response) - - def get_page(self, target_url: str) -> MediaRecordingPage: - """ - Retrieve a specific page of MediaRecordingInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of MediaRecordingInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return MediaRecordingPage(self._version, response) - - async def get_page_async(self, target_url: str) -> MediaRecordingPage: - """ - Asynchronously retrieve a specific page of MediaRecordingInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of MediaRecordingInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return MediaRecordingPage(self._version, response) - - def get(self, sid: str) -> MediaRecordingContext: - """ - Constructs a MediaRecordingContext - - :param sid: The SID of the MediaRecording resource to fetch. - """ - return MediaRecordingContext(self._version, sid=sid) - - def __call__(self, sid: str) -> MediaRecordingContext: - """ - Constructs a MediaRecordingContext - - :param sid: The SID of the MediaRecording resource to fetch. - """ - return MediaRecordingContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/media/v1/player_streamer/__init__.py b/twilio/rest/media/v1/player_streamer/__init__.py deleted file mode 100644 index 86832ba990..0000000000 --- a/twilio/rest/media/v1/player_streamer/__init__.py +++ /dev/null @@ -1,641 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Media - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.media.v1.player_streamer.playback_grant import PlaybackGrantList - - -class PlayerStreamerInstance(InstanceResource): - - class EndedReason(object): - ENDED_VIA_API = "ended-via-api" - MAX_DURATION_EXCEEDED = "max-duration-exceeded" - STREAM_DISCONNECTED_BY_SOURCE = "stream-disconnected-by-source" - UNEXPECTED_FAILURE = "unexpected-failure" - - class Order(object): - ASC = "asc" - DESC = "desc" - - class Status(object): - CREATED = "created" - STARTED = "started" - ENDED = "ended" - FAILED = "failed" - - class UpdateStatus(object): - ENDED = "ended" - - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the PlayerStreamer resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar video: Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. - :ivar links: The URLs of related resources. - :ivar sid: The unique string generated to identify the PlayerStreamer resource. - :ivar status: - :ivar url: The absolute URL of the resource. - :ivar status_callback: The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. - :ivar status_callback_method: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. - :ivar ended_reason: - :ivar max_duration: The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.video: Optional[bool] = payload.get("video") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.sid: Optional[str] = payload.get("sid") - self.status: Optional["PlayerStreamerInstance.Status"] = payload.get("status") - self.url: Optional[str] = payload.get("url") - self.status_callback: Optional[str] = payload.get("status_callback") - self.status_callback_method: Optional[str] = payload.get( - "status_callback_method" - ) - self.ended_reason: Optional["PlayerStreamerInstance.EndedReason"] = payload.get( - "ended_reason" - ) - self.max_duration: Optional[int] = deserialize.integer( - payload.get("max_duration") - ) - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[PlayerStreamerContext] = None - - @property - def _proxy(self) -> "PlayerStreamerContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: PlayerStreamerContext for this PlayerStreamerInstance - """ - if self._context is None: - self._context = PlayerStreamerContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def fetch(self) -> "PlayerStreamerInstance": - """ - Fetch the PlayerStreamerInstance - - - :returns: The fetched PlayerStreamerInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "PlayerStreamerInstance": - """ - Asynchronous coroutine to fetch the PlayerStreamerInstance - - - :returns: The fetched PlayerStreamerInstance - """ - return await self._proxy.fetch_async() - - def update( - self, status: "PlayerStreamerInstance.UpdateStatus" - ) -> "PlayerStreamerInstance": - """ - Update the PlayerStreamerInstance - - :param status: - - :returns: The updated PlayerStreamerInstance - """ - return self._proxy.update( - status=status, - ) - - async def update_async( - self, status: "PlayerStreamerInstance.UpdateStatus" - ) -> "PlayerStreamerInstance": - """ - Asynchronous coroutine to update the PlayerStreamerInstance - - :param status: - - :returns: The updated PlayerStreamerInstance - """ - return await self._proxy.update_async( - status=status, - ) - - @property - def playback_grant(self) -> PlaybackGrantList: - """ - Access the playback_grant - """ - return self._proxy.playback_grant - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class PlayerStreamerContext(InstanceContext): - - def __init__(self, version: Version, sid: str): - """ - Initialize the PlayerStreamerContext - - :param version: Version that contains the resource - :param sid: The SID of the PlayerStreamer resource to update. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/PlayerStreamers/{sid}".format(**self._solution) - - self._playback_grant: Optional[PlaybackGrantList] = None - - def fetch(self) -> PlayerStreamerInstance: - """ - Fetch the PlayerStreamerInstance - - - :returns: The fetched PlayerStreamerInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return PlayerStreamerInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> PlayerStreamerInstance: - """ - Asynchronous coroutine to fetch the PlayerStreamerInstance - - - :returns: The fetched PlayerStreamerInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return PlayerStreamerInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def update( - self, status: "PlayerStreamerInstance.UpdateStatus" - ) -> PlayerStreamerInstance: - """ - Update the PlayerStreamerInstance - - :param status: - - :returns: The updated PlayerStreamerInstance - """ - data = values.of( - { - "Status": status, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return PlayerStreamerInstance(self._version, payload, sid=self._solution["sid"]) - - async def update_async( - self, status: "PlayerStreamerInstance.UpdateStatus" - ) -> PlayerStreamerInstance: - """ - Asynchronous coroutine to update the PlayerStreamerInstance - - :param status: - - :returns: The updated PlayerStreamerInstance - """ - data = values.of( - { - "Status": status, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return PlayerStreamerInstance(self._version, payload, sid=self._solution["sid"]) - - @property - def playback_grant(self) -> PlaybackGrantList: - """ - Access the playback_grant - """ - if self._playback_grant is None: - self._playback_grant = PlaybackGrantList( - self._version, - self._solution["sid"], - ) - return self._playback_grant - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class PlayerStreamerPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> PlayerStreamerInstance: - """ - Build an instance of PlayerStreamerInstance - - :param payload: Payload response from the API - """ - return PlayerStreamerInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class PlayerStreamerList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the PlayerStreamerList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/PlayerStreamers" - - def create( - self, - video: Union[bool, object] = values.unset, - status_callback: Union[str, object] = values.unset, - status_callback_method: Union[str, object] = values.unset, - max_duration: Union[int, object] = values.unset, - ) -> PlayerStreamerInstance: - """ - Create the PlayerStreamerInstance - - :param video: Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. - :param status_callback: The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. - :param status_callback_method: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. - :param max_duration: The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. - - :returns: The created PlayerStreamerInstance - """ - - data = values.of( - { - "Video": serialize.boolean_to_string(video), - "StatusCallback": status_callback, - "StatusCallbackMethod": status_callback_method, - "MaxDuration": max_duration, - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return PlayerStreamerInstance(self._version, payload) - - async def create_async( - self, - video: Union[bool, object] = values.unset, - status_callback: Union[str, object] = values.unset, - status_callback_method: Union[str, object] = values.unset, - max_duration: Union[int, object] = values.unset, - ) -> PlayerStreamerInstance: - """ - Asynchronously create the PlayerStreamerInstance - - :param video: Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. - :param status_callback: The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/api/status-callbacks) for more details. - :param status_callback_method: The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. - :param max_duration: The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. - - :returns: The created PlayerStreamerInstance - """ - - data = values.of( - { - "Video": serialize.boolean_to_string(video), - "StatusCallback": status_callback, - "StatusCallbackMethod": status_callback_method, - "MaxDuration": max_duration, - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return PlayerStreamerInstance(self._version, payload) - - def stream( - self, - order: Union["PlayerStreamerInstance.Order", object] = values.unset, - status: Union["PlayerStreamerInstance.Status", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[PlayerStreamerInstance]: - """ - Streams PlayerStreamerInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param "PlayerStreamerInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "PlayerStreamerInstance.Status" status: Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(order=order, status=status, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - order: Union["PlayerStreamerInstance.Order", object] = values.unset, - status: Union["PlayerStreamerInstance.Status", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[PlayerStreamerInstance]: - """ - Asynchronously streams PlayerStreamerInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param "PlayerStreamerInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "PlayerStreamerInstance.Status" status: Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - order=order, status=status, page_size=limits["page_size"] - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - order: Union["PlayerStreamerInstance.Order", object] = values.unset, - status: Union["PlayerStreamerInstance.Status", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[PlayerStreamerInstance]: - """ - Lists PlayerStreamerInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param "PlayerStreamerInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "PlayerStreamerInstance.Status" status: Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - order=order, - status=status, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - order: Union["PlayerStreamerInstance.Order", object] = values.unset, - status: Union["PlayerStreamerInstance.Status", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[PlayerStreamerInstance]: - """ - Asynchronously lists PlayerStreamerInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param "PlayerStreamerInstance.Order" order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param "PlayerStreamerInstance.Status" status: Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - order=order, - status=status, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - order: Union["PlayerStreamerInstance.Order", object] = values.unset, - status: Union["PlayerStreamerInstance.Status", object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> PlayerStreamerPage: - """ - Retrieve a single page of PlayerStreamerInstance records from the API. - Request is executed immediately - - :param order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param status: Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of PlayerStreamerInstance - """ - data = values.of( - { - "Order": order, - "Status": status, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return PlayerStreamerPage(self._version, response) - - async def page_async( - self, - order: Union["PlayerStreamerInstance.Order", object] = values.unset, - status: Union["PlayerStreamerInstance.Status", object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> PlayerStreamerPage: - """ - Asynchronously retrieve a single page of PlayerStreamerInstance records from the API. - Request is executed immediately - - :param order: The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. - :param status: Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of PlayerStreamerInstance - """ - data = values.of( - { - "Order": order, - "Status": status, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return PlayerStreamerPage(self._version, response) - - def get_page(self, target_url: str) -> PlayerStreamerPage: - """ - Retrieve a specific page of PlayerStreamerInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of PlayerStreamerInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return PlayerStreamerPage(self._version, response) - - async def get_page_async(self, target_url: str) -> PlayerStreamerPage: - """ - Asynchronously retrieve a specific page of PlayerStreamerInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of PlayerStreamerInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return PlayerStreamerPage(self._version, response) - - def get(self, sid: str) -> PlayerStreamerContext: - """ - Constructs a PlayerStreamerContext - - :param sid: The SID of the PlayerStreamer resource to update. - """ - return PlayerStreamerContext(self._version, sid=sid) - - def __call__(self, sid: str) -> PlayerStreamerContext: - """ - Constructs a PlayerStreamerContext - - :param sid: The SID of the PlayerStreamer resource to update. - """ - return PlayerStreamerContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/media/v1/player_streamer/playback_grant.py b/twilio/rest/media/v1/player_streamer/playback_grant.py deleted file mode 100644 index a4cdbb4026..0000000000 --- a/twilio/rest/media/v1/player_streamer/playback_grant.py +++ /dev/null @@ -1,280 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Media - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, Optional, Union -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class PlaybackGrantInstance(InstanceResource): - """ - :ivar sid: The unique string generated to identify the PlayerStreamer resource that this PlaybackGrant authorizes views for. - :ivar url: The absolute URL of the resource. - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this resource. - :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar grant: The grant that authorizes the player sdk to connect to the livestream - """ - - def __init__(self, version: Version, payload: Dict[str, Any], sid: str): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.url: Optional[str] = payload.get("url") - self.account_sid: Optional[str] = payload.get("account_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.grant: Optional[Dict[str, object]] = payload.get("grant") - - self._solution = { - "sid": sid, - } - self._context: Optional[PlaybackGrantContext] = None - - @property - def _proxy(self) -> "PlaybackGrantContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: PlaybackGrantContext for this PlaybackGrantInstance - """ - if self._context is None: - self._context = PlaybackGrantContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def create( - self, - ttl: Union[int, object] = values.unset, - access_control_allow_origin: Union[str, object] = values.unset, - ) -> "PlaybackGrantInstance": - """ - Create the PlaybackGrantInstance - - :param ttl: The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. - :param access_control_allow_origin: The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. - - :returns: The created PlaybackGrantInstance - """ - return self._proxy.create( - ttl=ttl, - access_control_allow_origin=access_control_allow_origin, - ) - - async def create_async( - self, - ttl: Union[int, object] = values.unset, - access_control_allow_origin: Union[str, object] = values.unset, - ) -> "PlaybackGrantInstance": - """ - Asynchronous coroutine to create the PlaybackGrantInstance - - :param ttl: The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. - :param access_control_allow_origin: The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. - - :returns: The created PlaybackGrantInstance - """ - return await self._proxy.create_async( - ttl=ttl, - access_control_allow_origin=access_control_allow_origin, - ) - - def fetch(self) -> "PlaybackGrantInstance": - """ - Fetch the PlaybackGrantInstance - - - :returns: The fetched PlaybackGrantInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "PlaybackGrantInstance": - """ - Asynchronous coroutine to fetch the PlaybackGrantInstance - - - :returns: The fetched PlaybackGrantInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class PlaybackGrantContext(InstanceContext): - - def __init__(self, version: Version, sid: str): - """ - Initialize the PlaybackGrantContext - - :param version: Version that contains the resource - :param sid: The SID of the PlayerStreamer resource to fetch. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/PlayerStreamers/{sid}/PlaybackGrant".format(**self._solution) - - def create( - self, - ttl: Union[int, object] = values.unset, - access_control_allow_origin: Union[str, object] = values.unset, - ) -> PlaybackGrantInstance: - """ - Create the PlaybackGrantInstance - - :param ttl: The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. - :param access_control_allow_origin: The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. - - :returns: The created PlaybackGrantInstance - """ - data = values.of( - { - "Ttl": ttl, - "AccessControlAllowOrigin": access_control_allow_origin, - } - ) - - payload = self._version.create(method="POST", uri=self._uri, data=data) - - return PlaybackGrantInstance(self._version, payload, sid=self._solution["sid"]) - - async def create_async( - self, - ttl: Union[int, object] = values.unset, - access_control_allow_origin: Union[str, object] = values.unset, - ) -> PlaybackGrantInstance: - """ - Asynchronous coroutine to create the PlaybackGrantInstance - - :param ttl: The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. - :param access_control_allow_origin: The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. - - :returns: The created PlaybackGrantInstance - """ - data = values.of( - { - "Ttl": ttl, - "AccessControlAllowOrigin": access_control_allow_origin, - } - ) - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data - ) - - return PlaybackGrantInstance(self._version, payload, sid=self._solution["sid"]) - - def fetch(self) -> PlaybackGrantInstance: - """ - Fetch the PlaybackGrantInstance - - - :returns: The fetched PlaybackGrantInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return PlaybackGrantInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> PlaybackGrantInstance: - """ - Asynchronous coroutine to fetch the PlaybackGrantInstance - - - :returns: The fetched PlaybackGrantInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return PlaybackGrantInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class PlaybackGrantList(ListResource): - - def __init__(self, version: Version, sid: str): - """ - Initialize the PlaybackGrantList - - :param version: Version that contains the resource - :param sid: The unique string generated to identify the PlayerStreamer resource associated with this PlaybackGrant - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - - def get(self) -> PlaybackGrantContext: - """ - Constructs a PlaybackGrantContext - - """ - return PlaybackGrantContext(self._version, sid=self._solution["sid"]) - - def __call__(self) -> PlaybackGrantContext: - """ - Constructs a PlaybackGrantContext - - """ - return PlaybackGrantContext(self._version, sid=self._solution["sid"]) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index 3915116416..0e92b5b076 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -193,6 +193,7 @@ def create( data = body.to_dict() headers = {"Content-Type": "application/json"} + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -209,8 +210,8 @@ async def create_async( :returns: The created BulkEligibilityInstance """ - data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = await self._version.create_async( diff --git a/twilio/rest/numbers/v1/eligibility.py b/twilio/rest/numbers/v1/eligibility.py index 3b8b5be345..91a2c73261 100644 --- a/twilio/rest/numbers/v1/eligibility.py +++ b/twilio/rest/numbers/v1/eligibility.py @@ -64,6 +64,7 @@ def create(self, body: Union[object, object] = values.unset) -> EligibilityInsta data = body.to_dict() headers = {"Content-Type": "application/json"} + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -80,8 +81,8 @@ async def create_async( :returns: The created EligibilityInstance """ - data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = await self._version.create_async( diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index b0cd0fdfc1..086c630c65 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -68,6 +68,7 @@ def create( data = body.to_dict() headers = {"Content-Type": "application/json"} + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -84,8 +85,8 @@ async def create_async( :returns: The created PortingPortInInstance """ - data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = await self._version.create_async( diff --git a/twilio/rest/numbers/v1/porting_port_in_fetch.py b/twilio/rest/numbers/v1/porting_port_in_fetch.py index 78e31afbd8..dc0b79c252 100644 --- a/twilio/rest/numbers/v1/porting_port_in_fetch.py +++ b/twilio/rest/numbers/v1/porting_port_in_fetch.py @@ -30,6 +30,7 @@ class PortingPortInFetchInstance(InstanceResource): :ivar target_port_in_date: Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. :ivar target_port_in_time_range_start: Minimum hour in the future needs to be established with the Ops team for validation. :ivar target_port_in_time_range_end: Maximum hour in the future needs to be established with the Ops team for validation. + :ivar port_in_request_status: The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled. :ivar losing_carrier_information: The information for the losing carrier. :ivar phone_numbers: The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). :ivar documents: The list of documents SID referencing a utility bills @@ -58,6 +59,9 @@ def __init__( self.target_port_in_time_range_end: Optional[str] = payload.get( "target_port_in_time_range_end" ) + self.port_in_request_status: Optional[str] = payload.get( + "port_in_request_status" + ) self.losing_carrier_information: Optional[Dict[str, object]] = payload.get( "losing_carrier_information" ) diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index 0e75a5067b..30a57e28f4 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -231,6 +231,7 @@ def create( data = body.to_dict() headers = {"Content-Type": "application/json"} + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -247,8 +248,8 @@ async def create_async( :returns: The created BulkHostedNumberOrderInstance """ - data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = await self._version.create_async( diff --git a/twilio/rest/oauth/v1/token.py b/twilio/rest/oauth/v1/token.py index eb6d9d1b74..42884f0896 100644 --- a/twilio/rest/oauth/v1/token.py +++ b/twilio/rest/oauth/v1/token.py @@ -12,9 +12,8 @@ Do not edit the class manually. """ -from datetime import datetime from typing import Any, Dict, Optional, Union -from twilio.base import deserialize, values +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -37,9 +36,7 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.refresh_token: Optional[str] = payload.get("refresh_token") self.id_token: Optional[str] = payload.get("id_token") self.token_type: Optional[str] = payload.get("token_type") - self.expires_in: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("expires_in") - ) + self.expires_in: Optional[int] = payload.get("expires_in") def __repr__(self) -> str: """ @@ -68,10 +65,12 @@ def create( self, grant_type: str, client_id: str, - client_secret: str, + client_secret: Union[str, object] = values.unset, code: Union[str, object] = values.unset, redirect_uri: Union[str, object] = values.unset, audience: Union[str, object] = values.unset, + refresh_token: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, ) -> TokenInstance: """ Create the TokenInstance @@ -82,6 +81,8 @@ def create( :param code: JWT token related to the authorization code grant type. :param redirect_uri: The redirect uri :param audience: The targeted audience uri + :param refresh_token: JWT token related to refresh access token. + :param scope: The scope of token :returns: The created TokenInstance """ @@ -94,6 +95,8 @@ def create( "Code": code, "RedirectUri": redirect_uri, "Audience": audience, + "RefreshToken": refresh_token, + "Scope": scope, } ) @@ -109,10 +112,12 @@ async def create_async( self, grant_type: str, client_id: str, - client_secret: str, + client_secret: Union[str, object] = values.unset, code: Union[str, object] = values.unset, redirect_uri: Union[str, object] = values.unset, audience: Union[str, object] = values.unset, + refresh_token: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, ) -> TokenInstance: """ Asynchronously create the TokenInstance @@ -123,6 +128,8 @@ async def create_async( :param code: JWT token related to the authorization code grant type. :param redirect_uri: The redirect uri :param audience: The targeted audience uri + :param refresh_token: JWT token related to refresh access token. + :param scope: The scope of token :returns: The created TokenInstance """ @@ -135,6 +142,8 @@ async def create_async( "Code": code, "RedirectUri": redirect_uri, "Audience": audience, + "RefreshToken": refresh_token, + "Scope": scope, } ) diff --git a/twilio/rest/preview_messaging/v1/message.py b/twilio/rest/preview_messaging/v1/message.py index c6212c7f4f..0d2822e002 100644 --- a/twilio/rest/preview_messaging/v1/message.py +++ b/twilio/rest/preview_messaging/v1/message.py @@ -168,6 +168,7 @@ def create(self, create_messages_request: CreateMessagesRequest) -> MessageInsta data = create_messages_request.to_dict() headers = {"Content-Type": "application/json"} + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -184,8 +185,8 @@ async def create_async( :returns: The created MessageInstance """ - data = create_messages_request.to_dict() + headers = {"Content-Type": "application/json"} payload = await self._version.create_async( diff --git a/twilio/rest/serverless/v1/service/build/__init__.py b/twilio/rest/serverless/v1/service/build/__init__.py index 25997bec2e..fa7a7947ac 100644 --- a/twilio/rest/serverless/v1/service/build/__init__.py +++ b/twilio/rest/serverless/v1/service/build/__init__.py @@ -315,6 +315,7 @@ def create(self, asset_versions: Union[List[str], object]=values.unset, function }) + payload = self._version.create(method='POST', uri=self._uri, data=data,) return BuildInstance(self._version, payload, service_sid=self._solution['service_sid']) @@ -339,6 +340,7 @@ async def create_async(self, asset_versions: Union[List[str], object]=values.uns }) + payload = await self._version.create_async(method='POST', uri=self._uri, data=data,) return BuildInstance(self._version, payload, service_sid=self._solution['service_sid']) diff --git a/twilio/rest/studio/v2/flow_validate.py b/twilio/rest/studio/v2/flow_validate.py index 6994e6af14..43f226e154 100644 --- a/twilio/rest/studio/v2/flow_validate.py +++ b/twilio/rest/studio/v2/flow_validate.py @@ -75,6 +75,7 @@ def update( :returns: The created FlowValidateInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -109,6 +110,7 @@ async def update_async( :returns: The created FlowValidateInstance """ + data = values.of( { "FriendlyName": friendly_name, diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py index 0556e6bb4a..a1c44b1644 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py @@ -93,6 +93,7 @@ def create( data = body.to_dict() headers = {"Content-Type": "application/json"} + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -111,8 +112,8 @@ async def create_async( :returns: The created TaskQueueBulkRealTimeStatisticsInstance """ - data = body.to_dict() + headers = {"Content-Type": "application/json"} payload = await self._version.create_async( diff --git a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py index d86b72db01..c279bce12b 100644 --- a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py @@ -14,7 +14,7 @@ from typing import Any, Dict, Optional, Union from twilio.base import serialize, values - +from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base.version import Version @@ -51,7 +51,12 @@ class PhoneNumberType(object): :ivar url: The URL of this resource. """ - def __init__(self, version: Version, payload: Dict[str, Any]): + def __init__( + self, + version: Version, + payload: Dict[str, Any], + registration_id: Optional[str] = None, + ): super().__init__(version) self.inquiry_id: Optional[str] = payload.get("inquiry_id") @@ -59,14 +64,163 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.registration_id: Optional[str] = payload.get("registration_id") self.url: Optional[str] = payload.get("url") + self._solution = { + "registration_id": registration_id or self.registration_id, + } + self._context: Optional[ComplianceRegistrationInquiriesContext] = None + + @property + def _proxy(self) -> "ComplianceRegistrationInquiriesContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: ComplianceRegistrationInquiriesContext for this ComplianceRegistrationInquiriesInstance + """ + if self._context is None: + self._context = ComplianceRegistrationInquiriesContext( + self._version, + registration_id=self._solution["registration_id"], + ) + return self._context + + def update( + self, + is_isv_embed: Union[bool, object] = values.unset, + theme_set_id: Union[str, object] = values.unset, + ) -> "ComplianceRegistrationInquiriesInstance": + """ + Update the ComplianceRegistrationInquiriesInstance + + :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. + :param theme_set_id: Theme id for styling the inquiry form. + + :returns: The updated ComplianceRegistrationInquiriesInstance + """ + return self._proxy.update( + is_isv_embed=is_isv_embed, + theme_set_id=theme_set_id, + ) + + async def update_async( + self, + is_isv_embed: Union[bool, object] = values.unset, + theme_set_id: Union[str, object] = values.unset, + ) -> "ComplianceRegistrationInquiriesInstance": + """ + Asynchronous coroutine to update the ComplianceRegistrationInquiriesInstance + + :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. + :param theme_set_id: Theme id for styling the inquiry form. + + :returns: The updated ComplianceRegistrationInquiriesInstance + """ + return await self._proxy.update_async( + is_isv_embed=is_isv_embed, + theme_set_id=theme_set_id, + ) + def __repr__(self) -> str: """ Provide a friendly representation :returns: Machine friendly representation """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class ComplianceRegistrationInquiriesContext(InstanceContext): + + def __init__(self, version: Version, registration_id: str): + """ + Initialize the ComplianceRegistrationInquiriesContext + + :param version: Version that contains the resource + :param registration_id: The unique RegistrationId matching the Regulatory Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Regulatory Compliance Inquiry creation call. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "registration_id": registration_id, + } + self._uri = "/ComplianceInquiries/Registration/{registration_id}/RegulatoryCompliance/GB/Initialize".format( + **self._solution + ) + + def update( + self, + is_isv_embed: Union[bool, object] = values.unset, + theme_set_id: Union[str, object] = values.unset, + ) -> ComplianceRegistrationInquiriesInstance: + """ + Update the ComplianceRegistrationInquiriesInstance + + :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. + :param theme_set_id: Theme id for styling the inquiry form. + + :returns: The updated ComplianceRegistrationInquiriesInstance + """ + data = values.of( + { + "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), + "ThemeSetId": theme_set_id, + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceRegistrationInquiriesInstance( + self._version, payload, registration_id=self._solution["registration_id"] + ) + + async def update_async( + self, + is_isv_embed: Union[bool, object] = values.unset, + theme_set_id: Union[str, object] = values.unset, + ) -> ComplianceRegistrationInquiriesInstance: + """ + Asynchronous coroutine to update the ComplianceRegistrationInquiriesInstance - return "" + :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. + :param theme_set_id: Theme id for styling the inquiry form. + + :returns: The updated ComplianceRegistrationInquiriesInstance + """ + data = values.of( + { + "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), + "ThemeSetId": theme_set_id, + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ComplianceRegistrationInquiriesInstance( + self._version, payload, registration_id=self._solution["registration_id"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) class ComplianceRegistrationInquiriesList(ListResource): @@ -129,6 +283,7 @@ def create( is_isv_embed: Union[bool, object] = values.unset, isv_registering_for_self_or_tenant: Union[str, object] = values.unset, status_callback_url: Union[str, object] = values.unset, + theme_set_id: Union[str, object] = values.unset, ) -> ComplianceRegistrationInquiriesInstance: """ Create the ComplianceRegistrationInquiriesInstance @@ -171,6 +326,7 @@ def create( :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. :param isv_registering_for_self_or_tenant: Indicates if the isv registering for self or tenant. :param status_callback_url: The url we call to inform you of bundle changes. + :param theme_set_id: Theme id for styling the inquiry form. :returns: The created ComplianceRegistrationInquiriesInstance """ @@ -219,6 +375,7 @@ def create( "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), "IsvRegisteringForSelfOrTenant": isv_registering_for_self_or_tenant, "StatusCallbackUrl": status_callback_url, + "ThemeSetId": theme_set_id, } ) @@ -275,6 +432,7 @@ async def create_async( is_isv_embed: Union[bool, object] = values.unset, isv_registering_for_self_or_tenant: Union[str, object] = values.unset, status_callback_url: Union[str, object] = values.unset, + theme_set_id: Union[str, object] = values.unset, ) -> ComplianceRegistrationInquiriesInstance: """ Asynchronously create the ComplianceRegistrationInquiriesInstance @@ -317,6 +475,7 @@ async def create_async( :param is_isv_embed: Indicates if the inquiry is being started from an ISV embedded component. :param isv_registering_for_self_or_tenant: Indicates if the isv registering for self or tenant. :param status_callback_url: The url we call to inform you of bundle changes. + :param theme_set_id: Theme id for styling the inquiry form. :returns: The created ComplianceRegistrationInquiriesInstance """ @@ -365,6 +524,7 @@ async def create_async( "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), "IsvRegisteringForSelfOrTenant": isv_registering_for_self_or_tenant, "StatusCallbackUrl": status_callback_url, + "ThemeSetId": theme_set_id, } ) @@ -376,6 +536,26 @@ async def create_async( return ComplianceRegistrationInquiriesInstance(self._version, payload) + def get(self, registration_id: str) -> ComplianceRegistrationInquiriesContext: + """ + Constructs a ComplianceRegistrationInquiriesContext + + :param registration_id: The unique RegistrationId matching the Regulatory Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Regulatory Compliance Inquiry creation call. + """ + return ComplianceRegistrationInquiriesContext( + self._version, registration_id=registration_id + ) + + def __call__(self, registration_id: str) -> ComplianceRegistrationInquiriesContext: + """ + Constructs a ComplianceRegistrationInquiriesContext + + :param registration_id: The unique RegistrationId matching the Regulatory Compliance Inquiry that should be resumed or resubmitted. This value will have been returned by the initial Regulatory Compliance Inquiry creation call. + """ + return ComplianceRegistrationInquiriesContext( + self._version, registration_id=registration_id + ) + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/trusthub/v1/trust_products/__init__.py b/twilio/rest/trusthub/v1/trust_products/__init__.py index a638f680f0..b74e8e842e 100644 --- a/twilio/rest/trusthub/v1/trust_products/__init__.py +++ b/twilio/rest/trusthub/v1/trust_products/__init__.py @@ -41,18 +41,18 @@ class Status(object): TWILIO_APPROVED = "twilio-approved" """ - :ivar sid: The unique string that we created to identify the Customer-Profile resource. - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Customer-Profile resource. - :ivar policy_sid: The unique string of a policy that is associated to the Customer-Profile resource. + :ivar sid: The unique string that we created to identify the Trust Product resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Trust Product resource. + :ivar policy_sid: The unique string of the policy that is associated with the Trust Product resource. :ivar friendly_name: The string that you assigned to describe the resource. :ivar status: - :ivar valid_until: The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until. - :ivar email: The email address that will receive updates when the Customer-Profile resource changes status. + :ivar valid_until: The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format until which the resource will be valid. + :ivar email: The email address that will receive updates when the Trust Product resource changes status. :ivar status_callback: The URL we call to inform your application of status changes. :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar url: The absolute URL of the Customer-Profile resource. - :ivar links: The URLs of the Assigned Items of the Customer-Profile resource. + :ivar url: The absolute URL of the Trust Product resource. + :ivar links: The URLs of the Assigned Items of the Trust Product resource. """ def __init__( @@ -148,7 +148,7 @@ def update( :param status: :param status_callback: The URL we call to inform your application of status changes. :param friendly_name: The string that you assigned to describe the resource. - :param email: The email address that will receive updates when the Customer-Profile resource changes status. + :param email: The email address that will receive updates when the Trust Product resource changes status. :returns: The updated TrustProductsInstance """ @@ -172,7 +172,7 @@ async def update_async( :param status: :param status_callback: The URL we call to inform your application of status changes. :param friendly_name: The string that you assigned to describe the resource. - :param email: The email address that will receive updates when the Customer-Profile resource changes status. + :param email: The email address that will receive updates when the Trust Product resource changes status. :returns: The updated TrustProductsInstance """ @@ -223,7 +223,7 @@ def __init__(self, version: Version, sid: str): Initialize the TrustProductsContext :param version: Version that contains the resource - :param sid: The unique string that we created to identify the Customer-Profile resource. + :param sid: The unique string that we created to identify the Trust Product resource. """ super().__init__(version) @@ -316,7 +316,7 @@ def update( :param status: :param status_callback: The URL we call to inform your application of status changes. :param friendly_name: The string that you assigned to describe the resource. - :param email: The email address that will receive updates when the Customer-Profile resource changes status. + :param email: The email address that will receive updates when the Trust Product resource changes status. :returns: The updated TrustProductsInstance """ @@ -350,7 +350,7 @@ async def update_async( :param status: :param status_callback: The URL we call to inform your application of status changes. :param friendly_name: The string that you assigned to describe the resource. - :param email: The email address that will receive updates when the Customer-Profile resource changes status. + :param email: The email address that will receive updates when the Trust Product resource changes status. :returns: The updated TrustProductsInstance """ @@ -466,8 +466,8 @@ def create( Create the TrustProductsInstance :param friendly_name: The string that you assigned to describe the resource. - :param email: The email address that will receive updates when the Customer-Profile resource changes status. - :param policy_sid: The unique string of a policy that is associated to the Customer-Profile resource. + :param email: The email address that will receive updates when the Trust Product resource changes status. + :param policy_sid: The unique string of a policy that is associated to the Trust Product resource. :param status_callback: The URL we call to inform your application of status changes. :returns: The created TrustProductsInstance @@ -501,8 +501,8 @@ async def create_async( Asynchronously create the TrustProductsInstance :param friendly_name: The string that you assigned to describe the resource. - :param email: The email address that will receive updates when the Customer-Profile resource changes status. - :param policy_sid: The unique string of a policy that is associated to the Customer-Profile resource. + :param email: The email address that will receive updates when the Trust Product resource changes status. + :param policy_sid: The unique string of a policy that is associated to the Trust Product resource. :param status_callback: The URL we call to inform your application of status changes. :returns: The created TrustProductsInstance @@ -539,9 +539,9 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. - :param "TrustProductsInstance.Status" status: The verification status of the Customer-Profile resource. + :param "TrustProductsInstance.Status" status: The verification status of the Trust Product resource. :param str friendly_name: The string that you assigned to describe the resource. - :param str policy_sid: The unique string of a policy that is associated to the Customer-Profile resource. + :param str policy_sid: The unique string of a policy that is associated to the Trust Product resource. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -575,9 +575,9 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. - :param "TrustProductsInstance.Status" status: The verification status of the Customer-Profile resource. + :param "TrustProductsInstance.Status" status: The verification status of the Trust Product resource. :param str friendly_name: The string that you assigned to describe the resource. - :param str policy_sid: The unique string of a policy that is associated to the Customer-Profile resource. + :param str policy_sid: The unique string of a policy that is associated to the Trust Product resource. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -610,9 +610,9 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param "TrustProductsInstance.Status" status: The verification status of the Customer-Profile resource. + :param "TrustProductsInstance.Status" status: The verification status of the Trust Product resource. :param str friendly_name: The string that you assigned to describe the resource. - :param str policy_sid: The unique string of a policy that is associated to the Customer-Profile resource. + :param str policy_sid: The unique string of a policy that is associated to the Trust Product resource. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -645,9 +645,9 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param "TrustProductsInstance.Status" status: The verification status of the Customer-Profile resource. + :param "TrustProductsInstance.Status" status: The verification status of the Trust Product resource. :param str friendly_name: The string that you assigned to describe the resource. - :param str policy_sid: The unique string of a policy that is associated to the Customer-Profile resource. + :param str policy_sid: The unique string of a policy that is associated to the Trust Product resource. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -681,9 +681,9 @@ def page( Retrieve a single page of TrustProductsInstance records from the API. Request is executed immediately - :param status: The verification status of the Customer-Profile resource. + :param status: The verification status of the Trust Product resource. :param friendly_name: The string that you assigned to describe the resource. - :param policy_sid: The unique string of a policy that is associated to the Customer-Profile resource. + :param policy_sid: The unique string of a policy that is associated to the Trust Product resource. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -717,9 +717,9 @@ async def page_async( Asynchronously retrieve a single page of TrustProductsInstance records from the API. Request is executed immediately - :param status: The verification status of the Customer-Profile resource. + :param status: The verification status of the Trust Product resource. :param friendly_name: The string that you assigned to describe the resource. - :param policy_sid: The unique string of a policy that is associated to the Customer-Profile resource. + :param policy_sid: The unique string of a policy that is associated to the Trust Product resource. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -770,7 +770,7 @@ def get(self, sid: str) -> TrustProductsContext: """ Constructs a TrustProductsContext - :param sid: The unique string that we created to identify the Customer-Profile resource. + :param sid: The unique string that we created to identify the Trust Product resource. """ return TrustProductsContext(self._version, sid=sid) @@ -778,7 +778,7 @@ def __call__(self, sid: str) -> TrustProductsContext: """ Constructs a TrustProductsContext - :param sid: The unique string that we created to identify the Customer-Profile resource. + :param sid: The unique string that we created to identify the Trust Product resource. """ return TrustProductsContext(self._version, sid=sid) diff --git a/twilio/rest/video/v1/room/participant/subscribe_rules.py b/twilio/rest/video/v1/room/participant/subscribe_rules.py index 3015163e6d..e07d3b5ff9 100644 --- a/twilio/rest/video/v1/room/participant/subscribe_rules.py +++ b/twilio/rest/video/v1/room/participant/subscribe_rules.py @@ -132,6 +132,7 @@ def update( :returns: The created SubscribeRulesInstance """ + data = values.of( { "Rules": serialize.object(rules), @@ -161,6 +162,7 @@ async def update_async( :returns: The created SubscribeRulesInstance """ + data = values.of( { "Rules": serialize.object(rules), diff --git a/twilio/rest/video/v1/room/recording_rules.py b/twilio/rest/video/v1/room/recording_rules.py index 6e731a1458..c94bbf1497 100644 --- a/twilio/rest/video/v1/room/recording_rules.py +++ b/twilio/rest/video/v1/room/recording_rules.py @@ -111,6 +111,7 @@ def update( :returns: The created RecordingRulesInstance """ + data = values.of( { "Rules": serialize.object(rules), @@ -137,6 +138,7 @@ async def update_async( :returns: The created RecordingRulesInstance """ + data = values.of( { "Rules": serialize.object(rules), From 31b6560644143d0bee8bcabc108614b4940cf0e3 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 1 Apr 2024 15:00:53 +0000 Subject: [PATCH 017/113] Release 9.0.3 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 625c210413..1a14afcb7a 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.2", + version="9.0.3", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 698515090a..6a60af8330 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "0", "2") +__version_info__ = ("9", "0", "3") __version__ = ".".join(__version_info__) From 3318ec17c97c6f1ac5923059460c059fe431b271 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 4 Apr 2024 14:52:04 +0000 Subject: [PATCH 018/113] [Librarian] Regenerated @ b894abe9525247ea4345d78891244817d397f6de f80058eb415516baff0287784518c3a22be1b1b6 --- CHANGES.md | 25 ++++++ twilio/rest/api/v2010/account/call/payment.py | 1 + .../api/v2010/account/conference/__init__.py | 80 +++++++++---------- .../conversations/v1/conversation/__init__.py | 24 +++--- twilio/rest/flex_api/v1/plugin/__init__.py | 12 --- .../flex_api/v1/plugin/plugin_versions.py | 12 +++ twilio/rest/lookups/v2/phone_number.py | 22 ++++- twilio/rest/messaging/v1/service/__init__.py | 4 + twilio/rest/verify/v2/service/__init__.py | 38 +++++++++ 9 files changed, 150 insertions(+), 68 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1bc063569b..f35fbb4c48 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,31 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-04-04] Version 9.0.4 +-------------------------- +**Api** +- Correct conference filtering by date_created and date_updated documentation, clarifying that times are UTC. + +**Flex** +- Remove optional parameter from `plugins` and it to `plugin_versions` + +**Lookups** +- Add new `pre_fill` package to the lookup response + +**Messaging** +- Cleanup api.messaging.next-gen from Messaging Services endpoints +- Readd Sending-Window after fixing test failure + +**Verify** +- Add `whatsapp.msg_service_sid` and `whatsapp.from` parameters to create, update, get and list of services endpoints + +**Voice** +- Correct conference filtering by date_created and date_updated documentation, clarifying that times are UTC. + +**Twiml** +- Add new `token_type` value `payment-method` for `Pay` verb + + [2024-04-01] Version 9.0.3 -------------------------- **Api** diff --git a/twilio/rest/api/v2010/account/call/payment.py b/twilio/rest/api/v2010/account/call/payment.py index d6252f5277..08619588de 100644 --- a/twilio/rest/api/v2010/account/call/payment.py +++ b/twilio/rest/api/v2010/account/call/payment.py @@ -47,6 +47,7 @@ class Status(object): class TokenType(object): ONE_TIME = "one-time" REUSABLE = "reusable" + PAYMENT_METHOD = "payment-method" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index fff75dea5d..074ce8a587 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -47,12 +47,12 @@ class UpdateStatus(object): """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Conference resource. - :ivar date_created: The date and time in GMT that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_created: The date and time in UTC that this resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_updated: The date and time in UTC that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar api_version: The API version used to create this conference. - :ivar friendly_name: A string that you assigned to describe this conference room. Maxiumum length is 128 characters. + :ivar friendly_name: A string that you assigned to describe this conference room. Maximum length is 128 characters. :ivar region: A string that represents the Twilio Region where the conference audio was mixed. May be `us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will always be mixed in `us1`. Global Conference audio will be mixed nearest to the majority of participants. - :ivar sid: The unique string that that we created to identify this Conference resource. + :ivar sid: The unique, Twilio-provided string used to identify this Conference resource. :ivar status: :ivar uri: The URI of this resource, relative to `https://api.twilio.com`. :ivar subresource_uris: A list of related resources identified by their URIs relative to `https://api.twilio.com`. @@ -428,12 +428,12 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. - :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_created: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_created_before: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_created_after: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_updated: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. stream() @@ -479,12 +479,12 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. - :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_created: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_created_before: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_created_after: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_updated: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. stream() @@ -529,12 +529,12 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_created: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_created_before: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_created_after: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_updated: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. list() guarantees @@ -579,12 +579,12 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param date date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date date_created: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_created_before: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_created_after: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date date_updated: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param str friendly_name: The string that identifies the Conference resources to read. :param "ConferenceInstance.Status" status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param limit: Upper limit for the number of records to return. list() guarantees @@ -630,12 +630,12 @@ def page( Retrieve a single page of ConferenceInstance records from the API. Request is executed immediately - :param date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date_created: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date_created_before: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date_created_after: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date_updated: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param friendly_name: The string that identifies the Conference resources to read. :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param page_token: PageToken provided by the API @@ -681,12 +681,12 @@ async def page_async( Asynchronously retrieve a single page of ConferenceInstance records from the API. Request is executed immediately - :param date_created: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_before: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_created_after: The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. - :param date_updated: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_before: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. - :param date_updated_after: The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + :param date_created: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date_created_before: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date_created_after: Only include conferences that were created on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read conferences that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read conferences that were created on or after midnight of this date. + :param date_updated: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date_updated_before: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. + :param date_updated_after: Only include conferences that were last updated on this date. Specify a date as `YYYY-MM-DD` in UTC, for example: `2009-07-06`, to read only conferences that were last updated on this date. You can also specify an inequality, such as `DateUpdated<=YYYY-MM-DD`, to read conferences that were last updated on or before midnight of this date, and `DateUpdated>=YYYY-MM-DD` to read conferences that were last updated on or after midnight of this date. :param friendly_name: The string that identifies the Conference resources to read. :param status: The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. :param page_token: PageToken provided by the API diff --git a/twilio/rest/conversations/v1/conversation/__init__.py b/twilio/rest/conversations/v1/conversation/__init__.py index bdb4bda324..4c9b8809ac 100644 --- a/twilio/rest/conversations/v1/conversation/__init__.py +++ b/twilio/rest/conversations/v1/conversation/__init__.py @@ -725,8 +725,8 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. - :param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param str start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param str end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -761,8 +761,8 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. - :param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param str start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param str end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -796,8 +796,8 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param str start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param str end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -831,8 +831,8 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. - :param str start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param str end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param str start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param str end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param "ConversationInstance.State" state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -867,8 +867,8 @@ def page( Retrieve a single page of ConversationInstance records from the API. Request is executed immediately - :param start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state @@ -903,8 +903,8 @@ async def page_async( Asynchronously retrieve a single page of ConversationInstance records from the API. Request is executed immediately - :param start_date: Start date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the start time of the date is used (YYYY-MM-DDT00:00:00Z). Can be combined with other filters. - :param end_date: End date or time in ISO8601 format for filtering list of Conversations. If a date is provided, the end time of the date is used (YYYY-MM-DDT23:59:59Z). Can be combined with other filters. + :param start_date: Specifies the beginning of the date range for filtering Conversations based on their creation date. Conversations that were created on or after this date will be included in the results. The date must be in ISO8601 format, specifically starting at the beginning of the specified date (YYYY-MM-DDT00:00:00Z), for precise filtering. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. + :param end_date: Defines the end of the date range for filtering conversations by their creation date. Only conversations that were created on or before this date will appear in the results. The date must be in ISO8601 format, specifically capturing up to the end of the specified date (YYYY-MM-DDT23:59:59Z), to ensure that conversations from the entire end day are included. This parameter can be combined with other filters. If this filter is used, the returned list is sorted by latest conversation creation date in descending order. :param state: State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state diff --git a/twilio/rest/flex_api/v1/plugin/__init__.py b/twilio/rest/flex_api/v1/plugin/__init__.py index 90697d1845..09244d42de 100644 --- a/twilio/rest/flex_api/v1/plugin/__init__.py +++ b/twilio/rest/flex_api/v1/plugin/__init__.py @@ -359,8 +359,6 @@ def create( flex_metadata: Union[str, object] = values.unset, friendly_name: Union[str, object] = values.unset, description: Union[str, object] = values.unset, - cli_version: Union[str, object] = values.unset, - validate_status: Union[str, object] = values.unset, ) -> PluginInstance: """ Create the PluginInstance @@ -369,8 +367,6 @@ def create( :param flex_metadata: The Flex-Metadata HTTP request header :param friendly_name: The Flex Plugin's friendly name. :param description: A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long - :param cli_version: The version of Flex Plugins CLI used to create this plugin - :param validate_status: The validation status of the plugin, indicating whether it has been validated :returns: The created PluginInstance """ @@ -380,8 +376,6 @@ def create( "UniqueName": unique_name, "FriendlyName": friendly_name, "Description": description, - "CliVersion": cli_version, - "ValidateStatus": validate_status, } ) headers = values.of( @@ -402,8 +396,6 @@ async def create_async( flex_metadata: Union[str, object] = values.unset, friendly_name: Union[str, object] = values.unset, description: Union[str, object] = values.unset, - cli_version: Union[str, object] = values.unset, - validate_status: Union[str, object] = values.unset, ) -> PluginInstance: """ Asynchronously create the PluginInstance @@ -412,8 +404,6 @@ async def create_async( :param flex_metadata: The Flex-Metadata HTTP request header :param friendly_name: The Flex Plugin's friendly name. :param description: A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long - :param cli_version: The version of Flex Plugins CLI used to create this plugin - :param validate_status: The validation status of the plugin, indicating whether it has been validated :returns: The created PluginInstance """ @@ -423,8 +413,6 @@ async def create_async( "UniqueName": unique_name, "FriendlyName": friendly_name, "Description": description, - "CliVersion": cli_version, - "ValidateStatus": validate_status, } ) headers = values.of( diff --git a/twilio/rest/flex_api/v1/plugin/plugin_versions.py b/twilio/rest/flex_api/v1/plugin/plugin_versions.py index 6f492dbad6..96313c84dd 100644 --- a/twilio/rest/flex_api/v1/plugin/plugin_versions.py +++ b/twilio/rest/flex_api/v1/plugin/plugin_versions.py @@ -251,6 +251,8 @@ def create( flex_metadata: Union[str, object] = values.unset, changelog: Union[str, object] = values.unset, private: Union[bool, object] = values.unset, + cli_version: Union[str, object] = values.unset, + validate_status: Union[str, object] = values.unset, ) -> PluginVersionsInstance: """ Create the PluginVersionsInstance @@ -260,6 +262,8 @@ def create( :param flex_metadata: The Flex-Metadata HTTP request header :param changelog: The changelog of the Flex Plugin Version. :param private: Whether this Flex Plugin Version requires authorization. + :param cli_version: The version of Flex Plugins CLI used to create this plugin + :param validate_status: The validation status of the plugin, indicating whether it has been validated :returns: The created PluginVersionsInstance """ @@ -270,6 +274,8 @@ def create( "PluginUrl": plugin_url, "Changelog": changelog, "Private": serialize.boolean_to_string(private), + "CliVersion": cli_version, + "ValidateStatus": validate_status, } ) headers = values.of( @@ -293,6 +299,8 @@ async def create_async( flex_metadata: Union[str, object] = values.unset, changelog: Union[str, object] = values.unset, private: Union[bool, object] = values.unset, + cli_version: Union[str, object] = values.unset, + validate_status: Union[str, object] = values.unset, ) -> PluginVersionsInstance: """ Asynchronously create the PluginVersionsInstance @@ -302,6 +310,8 @@ async def create_async( :param flex_metadata: The Flex-Metadata HTTP request header :param changelog: The changelog of the Flex Plugin Version. :param private: Whether this Flex Plugin Version requires authorization. + :param cli_version: The version of Flex Plugins CLI used to create this plugin + :param validate_status: The validation status of the plugin, indicating whether it has been validated :returns: The created PluginVersionsInstance """ @@ -312,6 +322,8 @@ async def create_async( "PluginUrl": plugin_url, "Changelog": changelog, "Private": serialize.boolean_to_string(private), + "CliVersion": cli_version, + "ValidateStatus": validate_status, } ) headers = values.of( diff --git a/twilio/rest/lookups/v2/phone_number.py b/twilio/rest/lookups/v2/phone_number.py index 57491aa0a9..d9c73c22d8 100644 --- a/twilio/rest/lookups/v2/phone_number.py +++ b/twilio/rest/lookups/v2/phone_number.py @@ -46,6 +46,7 @@ class ValidationError(object): :ivar reassigned_number: An object that contains reassigned number information. Reassigned Numbers will return a phone number's reassignment status given a phone number and date :ivar sms_pumping_risk: An object that contains information on if a phone number has been currently or previously blocked by Verify Fraud Guard for receiving malicious SMS pumping traffic as well as other signals associated with risky carriers and low conversion rates. :ivar phone_number_quality_score: An object that contains information of a mobile phone number quality score. Quality score will return a risk score about the phone number. + :ivar pre_fill: An object that contains pre fill information. pre_fill will return PII information associated with the phone number like first name, last name, address line, country code, state and postal code. :ivar url: The absolute URL of the resource. """ @@ -84,6 +85,7 @@ def __init__( self.phone_number_quality_score: Optional[Dict[str, object]] = payload.get( "phone_number_quality_score" ) + self.pre_fill: Optional[Dict[str, object]] = payload.get("pre_fill") self.url: Optional[str] = payload.get("url") self._solution = { @@ -121,11 +123,12 @@ def fetch( national_id: Union[str, object] = values.unset, date_of_birth: Union[str, object] = values.unset, last_verified_date: Union[str, object] = values.unset, + verification_sid: Union[str, object] = values.unset, ) -> "PhoneNumberInstance": """ Fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score, pre_fill. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -138,6 +141,7 @@ def fetch( :param national_id: User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. :param date_of_birth: User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. :param last_verified_date: The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. + :param verification_sid: The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. :returns: The fetched PhoneNumberInstance """ @@ -155,6 +159,7 @@ def fetch( national_id=national_id, date_of_birth=date_of_birth, last_verified_date=last_verified_date, + verification_sid=verification_sid, ) async def fetch_async( @@ -172,11 +177,12 @@ async def fetch_async( national_id: Union[str, object] = values.unset, date_of_birth: Union[str, object] = values.unset, last_verified_date: Union[str, object] = values.unset, + verification_sid: Union[str, object] = values.unset, ) -> "PhoneNumberInstance": """ Asynchronous coroutine to fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score, pre_fill. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -189,6 +195,7 @@ async def fetch_async( :param national_id: User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. :param date_of_birth: User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. :param last_verified_date: The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. + :param verification_sid: The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. :returns: The fetched PhoneNumberInstance """ @@ -206,6 +213,7 @@ async def fetch_async( national_id=national_id, date_of_birth=date_of_birth, last_verified_date=last_verified_date, + verification_sid=verification_sid, ) def __repr__(self) -> str: @@ -250,11 +258,12 @@ def fetch( national_id: Union[str, object] = values.unset, date_of_birth: Union[str, object] = values.unset, last_verified_date: Union[str, object] = values.unset, + verification_sid: Union[str, object] = values.unset, ) -> PhoneNumberInstance: """ Fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score, pre_fill. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -267,6 +276,7 @@ def fetch( :param national_id: User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. :param date_of_birth: User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. :param last_verified_date: The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. + :param verification_sid: The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. :returns: The fetched PhoneNumberInstance """ @@ -286,6 +296,7 @@ def fetch( "NationalId": national_id, "DateOfBirth": date_of_birth, "LastVerifiedDate": last_verified_date, + "VerificationSid": verification_sid, } ) @@ -312,11 +323,12 @@ async def fetch_async( national_id: Union[str, object] = values.unset, date_of_birth: Union[str, object] = values.unset, last_verified_date: Union[str, object] = values.unset, + verification_sid: Union[str, object] = values.unset, ) -> PhoneNumberInstance: """ Asynchronous coroutine to fetch the PhoneNumberInstance - :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score. + :param fields: A comma-separated list of fields to return. Possible values are validation, caller_name, sim_swap, call_forwarding, line_status, line_type_intelligence, identity_match, reassigned_number, sms_pumping_risk, phone_number_quality_score, pre_fill. :param country_code: The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. :param first_name: User’s first name. This query parameter is only used (optionally) for identity_match package requests. :param last_name: User’s last name. This query parameter is only used (optionally) for identity_match package requests. @@ -329,6 +341,7 @@ async def fetch_async( :param national_id: User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. :param date_of_birth: User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. :param last_verified_date: The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. + :param verification_sid: The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. :returns: The fetched PhoneNumberInstance """ @@ -348,6 +361,7 @@ async def fetch_async( "NationalId": national_id, "DateOfBirth": date_of_birth, "LastVerifiedDate": last_verified_date, + "VerificationSid": verification_sid, } ) diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 75c798f4c4..f7351843b6 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -61,6 +61,7 @@ class ScanMessageContent(object): :ivar usecase: A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. :ivar us_app_to_person_registered: Whether US A2P campaign is registered for this Service. :ivar use_inbound_webhook_on_number: A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + :ivar sending_windows: A list of Sending Windows, which indicate defined time ranges in which a message can be sent, in the UTC time zone. Each window is defined by two strings, labeled \"start_time\" and \"end_time\". """ def __init__( @@ -107,6 +108,9 @@ def __init__( self.use_inbound_webhook_on_number: Optional[bool] = payload.get( "use_inbound_webhook_on_number" ) + self.sending_windows: Optional[Dict[str, object]] = payload.get( + "sending_windows" + ) self._solution = { "sid": sid or self.sid, diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 9e4d69d52b..7ea0b0ab56 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -47,6 +47,7 @@ class ServiceInstance(InstanceResource): :ivar push: Configurations for the Push factors (channel) created under this Service. :ivar totp: Configurations for the TOTP factors (channel) created under this Service. :ivar default_template_sid: + :ivar whatsapp: :ivar verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :ivar date_created: The date and time in GMT when the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT when the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -79,6 +80,7 @@ def __init__( self.push: Optional[Dict[str, object]] = payload.get("push") self.totp: Optional[Dict[str, object]] = payload.get("totp") self.default_template_sid: Optional[str] = payload.get("default_template_sid") + self.whatsapp: Optional[Dict[str, object]] = payload.get("whatsapp") self.verify_event_subscription_enabled: Optional[bool] = payload.get( "verify_event_subscription_enabled" ) @@ -166,6 +168,8 @@ def update( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + whatsapp_msg_service_sid: Union[str, object] = values.unset, + whatsapp_from: Union[str, object] = values.unset, verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> "ServiceInstance": """ @@ -188,6 +192,8 @@ def update( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param whatsapp_msg_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) to associate with the Verification Service. + :param whatsapp_from: The WhatsApp number to use as the sender of the verification messages. This number must be associated with the WhatsApp Message Service. :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance @@ -210,6 +216,8 @@ def update( totp_code_length=totp_code_length, totp_skew=totp_skew, default_template_sid=default_template_sid, + whatsapp_msg_service_sid=whatsapp_msg_service_sid, + whatsapp_from=whatsapp_from, verify_event_subscription_enabled=verify_event_subscription_enabled, ) @@ -232,6 +240,8 @@ async def update_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + whatsapp_msg_service_sid: Union[str, object] = values.unset, + whatsapp_from: Union[str, object] = values.unset, verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> "ServiceInstance": """ @@ -254,6 +264,8 @@ async def update_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param whatsapp_msg_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) to associate with the Verification Service. + :param whatsapp_from: The WhatsApp number to use as the sender of the verification messages. This number must be associated with the WhatsApp Message Service. :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance @@ -276,6 +288,8 @@ async def update_async( totp_code_length=totp_code_length, totp_skew=totp_skew, default_template_sid=default_template_sid, + whatsapp_msg_service_sid=whatsapp_msg_service_sid, + whatsapp_from=whatsapp_from, verify_event_subscription_enabled=verify_event_subscription_enabled, ) @@ -444,6 +458,8 @@ def update( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + whatsapp_msg_service_sid: Union[str, object] = values.unset, + whatsapp_from: Union[str, object] = values.unset, verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ @@ -466,6 +482,8 @@ def update( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param whatsapp_msg_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) to associate with the Verification Service. + :param whatsapp_from: The WhatsApp number to use as the sender of the verification messages. This number must be associated with the WhatsApp Message Service. :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance @@ -493,6 +511,8 @@ def update( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "Whatsapp.MsgServiceSid": whatsapp_msg_service_sid, + "Whatsapp.From": whatsapp_from, "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( verify_event_subscription_enabled ), @@ -526,6 +546,8 @@ async def update_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + whatsapp_msg_service_sid: Union[str, object] = values.unset, + whatsapp_from: Union[str, object] = values.unset, verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ @@ -548,6 +570,8 @@ async def update_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param whatsapp_msg_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services) to associate with the Verification Service. + :param whatsapp_from: The WhatsApp number to use as the sender of the verification messages. This number must be associated with the WhatsApp Message Service. :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The updated ServiceInstance @@ -575,6 +599,8 @@ async def update_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "Whatsapp.MsgServiceSid": whatsapp_msg_service_sid, + "Whatsapp.From": whatsapp_from, "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( verify_event_subscription_enabled ), @@ -734,6 +760,8 @@ def create( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + whatsapp_msg_service_sid: Union[str, object] = values.unset, + whatsapp_from: Union[str, object] = values.unset, verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ @@ -756,6 +784,8 @@ def create( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param whatsapp_msg_service_sid: The SID of the Messaging Service containing WhatsApp Sender(s) that Verify will use to send WhatsApp messages to your users. + :param whatsapp_from: The number to use as the WhatsApp Sender that Verify will use to send WhatsApp messages to your users.This WhatsApp Sender must be associated with a Messaging Service SID. :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The created ServiceInstance @@ -784,6 +814,8 @@ def create( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "Whatsapp.MsgServiceSid": whatsapp_msg_service_sid, + "Whatsapp.From": whatsapp_from, "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( verify_event_subscription_enabled ), @@ -817,6 +849,8 @@ async def create_async( totp_code_length: Union[int, object] = values.unset, totp_skew: Union[int, object] = values.unset, default_template_sid: Union[str, object] = values.unset, + whatsapp_msg_service_sid: Union[str, object] = values.unset, + whatsapp_from: Union[str, object] = values.unset, verify_event_subscription_enabled: Union[bool, object] = values.unset, ) -> ServiceInstance: """ @@ -839,6 +873,8 @@ async def create_async( :param totp_code_length: Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 :param totp_skew: Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 :param default_template_sid: The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + :param whatsapp_msg_service_sid: The SID of the Messaging Service containing WhatsApp Sender(s) that Verify will use to send WhatsApp messages to your users. + :param whatsapp_from: The number to use as the WhatsApp Sender that Verify will use to send WhatsApp messages to your users.This WhatsApp Sender must be associated with a Messaging Service SID. :param verify_event_subscription_enabled: Whether to allow verifications from the service to reach the stream-events sinks if configured :returns: The created ServiceInstance @@ -867,6 +903,8 @@ async def create_async( "Totp.CodeLength": totp_code_length, "Totp.Skew": totp_skew, "DefaultTemplateSid": default_template_sid, + "Whatsapp.MsgServiceSid": whatsapp_msg_service_sid, + "Whatsapp.From": whatsapp_from, "VerifyEventSubscriptionEnabled": serialize.boolean_to_string( verify_event_subscription_enabled ), From d244c079933934e8322086b546ba0e8b25cca85e Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 4 Apr 2024 14:56:38 +0000 Subject: [PATCH 019/113] Release 9.0.4 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 1a14afcb7a..91945bfd86 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.3", + version="9.0.4", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 6a60af8330..5ed1a81015 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "0", "3") +__version_info__ = ("9", "0", "4") __version__ = ".".join(__version_info__) From 60e09a5d18e446aad2a73b416604ddeaa1f8e350 Mon Sep 17 00:00:00 2001 From: twilio-product-security <67294289+twilio-product-security@users.noreply.github.com> Date: Fri, 5 Apr 2024 07:09:40 -0400 Subject: [PATCH 020/113] fix: requirements.txt to reduce vulnerabilities (#742) The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-CERTIFI-3164749 - https://snyk.io/vuln/SNYK-PYTHON-CERTIFI-5805047 - https://snyk.io/vuln/SNYK-PYTHON-REQUESTS-5595532 Co-authored-by: snyk-bot Co-authored-by: Shubham --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index f2b815e854..c633981931 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability -requests>=2.0.0 +requests>=2.31.0 PyJWT>=2.0.0, <3.0.0 aiohttp>=3.9.0 aiohttp-retry>=2.8.3 +certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability From 27e3f6f4f386111b9bba98679920b27e6be52c2a Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 18 Apr 2024 11:10:12 +0000 Subject: [PATCH 021/113] [Librarian] Regenerated @ bd01257c5bef8696988f5e9f18d803d8ccdb5a0f 0d301f7b8858e2f9dc391bd6803943499955b8f0 --- CHANGES.md | 15 + twilio/rest/api/v2010/account/call/stream.py | 24 +- twilio/rest/content/v1/content/__init__.py | 522 +++++++++++++++++- twilio/rest/flex_api/v2/__init__.py | 8 + twilio/rest/flex_api/v2/flex_user.py | 234 ++++++++ twilio/rest/flex_api/v2/web_channels.py | 22 +- twilio/rest/numbers/v1/__init__.py | 12 + twilio/rest/numbers/v1/porting_port_in.py | 120 +++- .../v1/porting_port_in_phone_number.py | 125 +++++ 9 files changed, 1060 insertions(+), 22 deletions(-) create mode 100644 twilio/rest/flex_api/v2/flex_user.py create mode 100644 twilio/rest/numbers/v1/porting_port_in_phone_number.py diff --git a/CHANGES.md b/CHANGES.md index f35fbb4c48..6af9e1d3f7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,21 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-04-18] Version 9.0.5 +-------------------------- +**Library - Chore** +- [PR #742](https://github.com/twilio/twilio-python/pull/742): [Snyk] Fix for 3 vulnerabilities. Thanks to [@twilio-product-security](https://github.com/twilio-product-security)! + +**Flex** +- Add header `ui_version` to `web_channels` API + +**Messaging** +- Redeploy after failed pipeline + +**Numbers** +- Add Delete Port In request phone number api and Add Delete Port In request api + + [2024-04-04] Version 9.0.4 -------------------------- **Api** diff --git a/twilio/rest/api/v2010/account/call/stream.py b/twilio/rest/api/v2010/account/call/stream.py index a46d8f9757..3975f52d49 100644 --- a/twilio/rest/api/v2010/account/call/stream.py +++ b/twilio/rest/api/v2010/account/call/stream.py @@ -39,7 +39,7 @@ class UpdateStatus(object): :ivar sid: The SID of the Stream resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Stream resource. :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Stream resource is associated with. - :ivar name: The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. + :ivar name: The user-specified name of this Stream, if one was given when the Stream was created. This can be used to stop the Stream. :ivar status: :ivar date_updated: The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar uri: The URI of the resource, relative to `https://api.twilio.com`. @@ -134,7 +134,7 @@ def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): :param version: Version that contains the resource :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Stream resource. :param call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Stream resource is associated with. - :param sid: The SID of the Stream resource, or the `name` used when creating the resource + :param sid: The SID or the `name` of the Stream resource to be stopped """ super().__init__(version) @@ -449,11 +449,11 @@ def create( """ Create the StreamInstance - :param url: Relative or absolute url where WebSocket connection will be established. - :param name: The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. + :param url: Relative or absolute URL where WebSocket connection will be established. + :param name: The user-specified name of this Stream, if one was given when the Stream was created. This can be used to stop the Stream. :param track: - :param status_callback: Absolute URL of the status callback. - :param status_callback_method: The http method for the status_callback (one of GET, POST). + :param status_callback: Absolute URL to which Twilio sends status callback HTTP requests. + :param status_callback_method: The HTTP method Twilio uses when sending `status_callback` requests. Possible values are `GET` and `POST`. Default is `POST`. :param parameter1_name: Parameter name :param parameter1_value: Parameter value :param parameter2_name: Parameter name @@ -1086,11 +1086,11 @@ async def create_async( """ Asynchronously create the StreamInstance - :param url: Relative or absolute url where WebSocket connection will be established. - :param name: The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. + :param url: Relative or absolute URL where WebSocket connection will be established. + :param name: The user-specified name of this Stream, if one was given when the Stream was created. This can be used to stop the Stream. :param track: - :param status_callback: Absolute URL of the status callback. - :param status_callback_method: The http method for the status_callback (one of GET, POST). + :param status_callback: Absolute URL to which Twilio sends status callback HTTP requests. + :param status_callback_method: The HTTP method Twilio uses when sending `status_callback` requests. Possible values are `GET` and `POST`. Default is `POST`. :param parameter1_name: Parameter name :param parameter1_value: Parameter value :param parameter2_name: Parameter name @@ -1518,7 +1518,7 @@ def get(self, sid: str) -> StreamContext: """ Constructs a StreamContext - :param sid: The SID of the Stream resource, or the `name` used when creating the resource + :param sid: The SID or the `name` of the Stream resource to be stopped """ return StreamContext( self._version, @@ -1531,7 +1531,7 @@ def __call__(self, sid: str) -> StreamContext: """ Constructs a StreamContext - :param sid: The SID of the Stream resource, or the `name` used when creating the resource + :param sid: The SID or the `name` of the Stream resource to be stopped """ return StreamContext( self._version, diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index b057cb4f86..72e1e82141 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -20,10 +20,27 @@ from twilio.base.list_resource import ListResource from twilio.base.version import Version from twilio.base.page import Page +from twilio.rest.content.v1.content.approval_create import ApprovalCreateList from twilio.rest.content.v1.content.approval_fetch import ApprovalFetchList class ContentInstance(InstanceResource): + + class AuthenticationActionType(object): + COPY_CODE = "COPY_CODE" + + class CallToActionActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + + class CardActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + QUICK_REPLY = "QUICK_REPLY" + + class QuickReplyActionType(object): + QUICK_REPLY = "QUICK_REPLY" + """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -32,7 +49,7 @@ class ContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar url: The URL of the resource, relative to `https://content.twilio.com`. :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create """ @@ -113,6 +130,13 @@ async def fetch_async(self) -> "ContentInstance": """ return await self._proxy.fetch_async() + @property + def approval_create(self) -> ApprovalCreateList: + """ + Access the approval_create + """ + return self._proxy.approval_create + @property def approval_fetch(self) -> ApprovalFetchList: """ @@ -147,6 +171,7 @@ def __init__(self, version: Version, sid: str): } self._uri = "/Content/{sid}".format(**self._solution) + self._approval_create: Optional[ApprovalCreateList] = None self._approval_fetch: Optional[ApprovalFetchList] = None def delete(self) -> bool: @@ -211,6 +236,18 @@ async def fetch_async(self) -> ContentInstance: sid=self._solution["sid"], ) + @property + def approval_create(self) -> ApprovalCreateList: + """ + Access the approval_create + """ + if self._approval_create is None: + self._approval_create = ApprovalCreateList( + self._version, + self._solution["sid"], + ) + return self._approval_create + @property def approval_fetch(self) -> ApprovalFetchList: """ @@ -254,6 +291,451 @@ def __repr__(self) -> str: class ContentList(ListResource): + class AuthenticationAction(object): + """ + :ivar type: + :ivar copy_code_text: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.AuthenticationActionType"] = ( + payload.get("type") + ) + self.copy_code_text: Optional[str] = payload.get("copy_code_text") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "copy_code_text": self.copy_code_text, + } + + class CallToActionAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.CallToActionActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class CardAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.CardActionType"] = payload.get("type") + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class CatalogItem(object): + """ + :ivar id: + :ivar section_title: + :ivar name: + :ivar media_url: + :ivar price: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.id: Optional[str] = payload.get("id") + self.section_title: Optional[str] = payload.get("section_title") + self.name: Optional[str] = payload.get("name") + self.media_url: Optional[str] = payload.get("media_url") + self.price: Optional[float] = payload.get("price") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "section_title": self.section_title, + "name": self.name, + "media_url": self.media_url, + "price": self.price, + "description": self.description, + } + + class ContentCreateRequest(object): + """ + :ivar friendly_name: User defined name of the content + :ivar variables: Key value pairs of variable name to value + :ivar language: Language code for the content + :ivar types: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.variables: Optional[dict[str, str]] = payload.get("variables") + self.language: Optional[str] = payload.get("language") + self.types: Optional[ContentList.Types] = payload.get("types") + + def to_dict(self): + return { + "friendly_name": self.friendly_name, + "variables": self.variables, + "language": self.language, + "types": self.types.to_dict(), + } + + class ListItem(object): + """ + :ivar id: + :ivar item: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.id: Optional[str] = payload.get("id") + self.item: Optional[str] = payload.get("item") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "item": self.item, + "description": self.description, + } + + class QuickReplyAction(object): + """ + :ivar type: + :ivar title: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.QuickReplyActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "id": self.id, + } + + class TwilioCallToAction(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.CallToActionAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioCard(object): + """ + :ivar title: + :ivar subtitle: + :ivar media: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.title: Optional[str] = payload.get("title") + self.subtitle: Optional[str] = payload.get("subtitle") + self.media: Optional[List[str]] = payload.get("media") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "title": self.title, + "subtitle": self.subtitle, + "media": self.media, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioCatalog(object): + """ + :ivar title: + :ivar body: + :ivar subtitle: + :ivar id: + :ivar items: + :ivar dynamic_items: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.title: Optional[str] = payload.get("title") + self.body: Optional[str] = payload.get("body") + self.subtitle: Optional[str] = payload.get("subtitle") + self.id: Optional[str] = payload.get("id") + self.items: Optional[List[ContentList.CatalogItem]] = payload.get("items") + self.dynamic_items: Optional[str] = payload.get("dynamic_items") + + def to_dict(self): + return { + "title": self.title, + "body": self.body, + "subtitle": self.subtitle, + "id": self.id, + "items": [items.to_dict() for items in self.items], + "dynamic_items": self.dynamic_items, + } + + class TwilioListPicker(object): + """ + :ivar body: + :ivar button: + :ivar items: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.button: Optional[str] = payload.get("button") + self.items: Optional[List[ContentList.ListItem]] = payload.get("items") + + def to_dict(self): + return { + "body": self.body, + "button": self.button, + "items": [items.to_dict() for items in self.items], + } + + class TwilioLocation(object): + """ + :ivar latitude: + :ivar longitude: + :ivar label: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.latitude: Optional[float] = payload.get("latitude") + self.longitude: Optional[float] = payload.get("longitude") + self.label: Optional[str] = payload.get("label") + + def to_dict(self): + return { + "latitude": self.latitude, + "longitude": self.longitude, + "label": self.label, + } + + class TwilioMedia(object): + """ + :ivar body: + :ivar media: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.media: Optional[List[str]] = payload.get("media") + + def to_dict(self): + return { + "body": self.body, + "media": self.media, + } + + class TwilioQuickReply(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.QuickReplyAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioText(object): + """ + :ivar body: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + + def to_dict(self): + return { + "body": self.body, + } + + class Types(object): + """ + :ivar twilio_text: + :ivar twilio_media: + :ivar twilio_location: + :ivar twilio_list_picker: + :ivar twilio_call_to_action: + :ivar twilio_quick_reply: + :ivar twilio_card: + :ivar twilio_catalog: + :ivar whatsapp_card: + :ivar whatsapp_authentication: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.twilio_text: Optional[ContentList.TwilioText] = payload.get( + "twilio_text" + ) + self.twilio_media: Optional[ContentList.TwilioMedia] = payload.get( + "twilio_media" + ) + self.twilio_location: Optional[ContentList.TwilioLocation] = payload.get( + "twilio_location" + ) + self.twilio_list_picker: Optional[ContentList.TwilioListPicker] = ( + payload.get("twilio_list_picker") + ) + self.twilio_call_to_action: Optional[ContentList.TwilioCallToAction] = ( + payload.get("twilio_call_to_action") + ) + self.twilio_quick_reply: Optional[ContentList.TwilioQuickReply] = ( + payload.get("twilio_quick_reply") + ) + self.twilio_card: Optional[ContentList.TwilioCard] = payload.get( + "twilio_card" + ) + self.twilio_catalog: Optional[ContentList.TwilioCatalog] = payload.get( + "twilio_catalog" + ) + self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( + "whatsapp_card" + ) + self.whatsapp_authentication: Optional[ + ContentList.WhatsappAuthentication + ] = payload.get("whatsapp_authentication") + + def to_dict(self): + return { + "twilio_text": self.twilio_text.to_dict(), + "twilio_media": self.twilio_media.to_dict(), + "twilio_location": self.twilio_location.to_dict(), + "twilio_list_picker": self.twilio_list_picker.to_dict(), + "twilio_call_to_action": self.twilio_call_to_action.to_dict(), + "twilio_quick_reply": self.twilio_quick_reply.to_dict(), + "twilio_card": self.twilio_card.to_dict(), + "twilio_catalog": self.twilio_catalog.to_dict(), + "whatsapp_card": self.whatsapp_card.to_dict(), + "whatsapp_authentication": self.whatsapp_authentication.to_dict(), + } + + class WhatsappAuthentication(object): + """ + :ivar add_security_recommendation: + :ivar code_expiration_minutes: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.add_security_recommendation: Optional[bool] = payload.get( + "add_security_recommendation" + ) + self.code_expiration_minutes: Optional[float] = payload.get( + "code_expiration_minutes" + ) + self.actions: Optional[List[ContentList.AuthenticationAction]] = ( + payload.get("actions") + ) + + def to_dict(self): + return { + "add_security_recommendation": self.add_security_recommendation, + "code_expiration_minutes": self.code_expiration_minutes, + "actions": [actions.to_dict() for actions in self.actions], + } + + class WhatsappCard(object): + """ + :ivar body: + :ivar footer: + :ivar media: + :ivar header_text: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.footer: Optional[str] = payload.get("footer") + self.media: Optional[List[str]] = payload.get("media") + self.header_text: Optional[str] = payload.get("header_text") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "footer": self.footer, + "media": self.media, + "header_text": self.header_text, + "actions": [actions.to_dict() for actions in self.actions], + } + def __init__(self, version: Version): """ Initialize the ContentList @@ -265,6 +747,44 @@ def __init__(self, version: Version): self._uri = "/Content" + def create(self, content_create_request: ContentCreateRequest) -> ContentInstance: + """ + Create the ContentInstance + + :param content_create_request: + + :returns: The created ContentInstance + """ + data = content_create_request.to_dict() + + headers = {"Content-Type": "application/json"} + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ContentInstance(self._version, payload) + + async def create_async( + self, content_create_request: ContentCreateRequest + ) -> ContentInstance: + """ + Asynchronously create the ContentInstance + + :param content_create_request: + + :returns: The created ContentInstance + """ + data = content_create_request.to_dict() + + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ContentInstance(self._version, payload) + def stream( self, limit: Optional[int] = None, diff --git a/twilio/rest/flex_api/v2/__init__.py b/twilio/rest/flex_api/v2/__init__.py index 021615e19f..e05ffcdfb5 100644 --- a/twilio/rest/flex_api/v2/__init__.py +++ b/twilio/rest/flex_api/v2/__init__.py @@ -15,6 +15,7 @@ from typing import Optional from twilio.base.version import Version from twilio.base.domain import Domain +from twilio.rest.flex_api.v2.flex_user import FlexUserList from twilio.rest.flex_api.v2.web_channels import WebChannelsList @@ -27,8 +28,15 @@ def __init__(self, domain: Domain): :param domain: The Twilio.flex_api domain """ super().__init__(domain, "v2") + self._flex_user: Optional[FlexUserList] = None self._web_channels: Optional[WebChannelsList] = None + @property + def flex_user(self) -> FlexUserList: + if self._flex_user is None: + self._flex_user = FlexUserList(self) + return self._flex_user + @property def web_channels(self) -> WebChannelsList: if self._web_channels is None: diff --git a/twilio/rest/flex_api/v2/flex_user.py b/twilio/rest/flex_api/v2/flex_user.py new file mode 100644 index 0000000000..1acc75a8a8 --- /dev/null +++ b/twilio/rest/flex_api/v2/flex_user.py @@ -0,0 +1,234 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional +from twilio.base import deserialize +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class FlexUserInstance(InstanceResource): + """ + :ivar account_sid: The unique SID of the account that created the resource. + :ivar instance_sid: The unique ID created by Twilio to identify a Flex instance. + :ivar user_sid: The unique SID identifier of the Twilio Unified User. + :ivar flex_user_sid: The unique SID identifier of the Flex User. + :ivar worker_sid: The unique SID identifier of the worker. + :ivar workspace_sid: The unique SID identifier of the workspace. + :ivar flex_team_sid: The unique SID identifier of the Flex Team. + :ivar first_name: First name of the User. + :ivar last_name: Last name of the User. + :ivar username: Username of the User. + :ivar email: Email of the User. + :ivar friendly_name: Friendly name of the User. + :ivar created_date: The date that this user was created, given in ISO 8601 format. + :ivar updated_date: The date that this user was updated, given in ISO 8601 format. + :ivar version: The current version of the user. + :ivar url: + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + instance_sid: Optional[str] = None, + flex_user_sid: Optional[str] = None, + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.instance_sid: Optional[str] = payload.get("instance_sid") + self.user_sid: Optional[str] = payload.get("user_sid") + self.flex_user_sid: Optional[str] = payload.get("flex_user_sid") + self.worker_sid: Optional[str] = payload.get("worker_sid") + self.workspace_sid: Optional[str] = payload.get("workspace_sid") + self.flex_team_sid: Optional[str] = payload.get("flex_team_sid") + self.first_name: Optional[str] = payload.get("first_name") + self.last_name: Optional[str] = payload.get("last_name") + self.username: Optional[str] = payload.get("username") + self.email: Optional[str] = payload.get("email") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.created_date: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("created_date") + ) + self.updated_date: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("updated_date") + ) + self.version: Optional[int] = deserialize.integer(payload.get("version")) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "instance_sid": instance_sid or self.instance_sid, + "flex_user_sid": flex_user_sid or self.flex_user_sid, + } + self._context: Optional[FlexUserContext] = None + + @property + def _proxy(self) -> "FlexUserContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: FlexUserContext for this FlexUserInstance + """ + if self._context is None: + self._context = FlexUserContext( + self._version, + instance_sid=self._solution["instance_sid"], + flex_user_sid=self._solution["flex_user_sid"], + ) + return self._context + + def fetch(self) -> "FlexUserInstance": + """ + Fetch the FlexUserInstance + + + :returns: The fetched FlexUserInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "FlexUserInstance": + """ + Asynchronous coroutine to fetch the FlexUserInstance + + + :returns: The fetched FlexUserInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class FlexUserContext(InstanceContext): + + def __init__(self, version: Version, instance_sid: str, flex_user_sid: str): + """ + Initialize the FlexUserContext + + :param version: Version that contains the resource + :param instance_sid: The unique ID created by Twilio to identify a Flex instance. + :param flex_user_sid: The unique id for the flex user to be retrieved. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "instance_sid": instance_sid, + "flex_user_sid": flex_user_sid, + } + self._uri = "/Instances/{instance_sid}/Users/{flex_user_sid}".format( + **self._solution + ) + + def fetch(self) -> FlexUserInstance: + """ + Fetch the FlexUserInstance + + + :returns: The fetched FlexUserInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return FlexUserInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + flex_user_sid=self._solution["flex_user_sid"], + ) + + async def fetch_async(self) -> FlexUserInstance: + """ + Asynchronous coroutine to fetch the FlexUserInstance + + + :returns: The fetched FlexUserInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return FlexUserInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + flex_user_sid=self._solution["flex_user_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class FlexUserList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the FlexUserList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, instance_sid: str, flex_user_sid: str) -> FlexUserContext: + """ + Constructs a FlexUserContext + + :param instance_sid: The unique ID created by Twilio to identify a Flex instance. + :param flex_user_sid: The unique id for the flex user to be retrieved. + """ + return FlexUserContext( + self._version, instance_sid=instance_sid, flex_user_sid=flex_user_sid + ) + + def __call__(self, instance_sid: str, flex_user_sid: str) -> FlexUserContext: + """ + Constructs a FlexUserContext + + :param instance_sid: The unique ID created by Twilio to identify a Flex instance. + :param flex_user_sid: The unique id for the flex user to be retrieved. + """ + return FlexUserContext( + self._version, instance_sid=instance_sid, flex_user_sid=flex_user_sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v2/web_channels.py b/twilio/rest/flex_api/v2/web_channels.py index 13e5b28d7a..a4b7b0c31d 100644 --- a/twilio/rest/flex_api/v2/web_channels.py +++ b/twilio/rest/flex_api/v2/web_channels.py @@ -58,6 +58,7 @@ def __init__(self, version: Version): def create( self, address_sid: str, + ui_version: Union[str, object] = values.unset, chat_friendly_name: Union[str, object] = values.unset, customer_friendly_name: Union[str, object] = values.unset, pre_engagement_data: Union[str, object] = values.unset, @@ -66,6 +67,7 @@ def create( Create the WebChannelsInstance :param address_sid: The SID of the Conversations Address. See [Address Configuration Resource](https://www.twilio.com/docs/conversations/api/address-configuration-resource) for configuration details. When a conversation is created on the Flex backend, the callback URL will be set to the corresponding Studio Flow SID or webhook URL in your address configuration. + :param ui_version: The Ui-Version HTTP request header :param chat_friendly_name: The Conversation's friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example. :param customer_friendly_name: The Conversation participant's friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example. :param pre_engagement_data: The pre-engagement data. @@ -81,11 +83,14 @@ def create( "PreEngagementData": pre_engagement_data, } ) + headers = values.of( + { + "Ui-Version": ui_version, + } + ) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebChannelsInstance(self._version, payload) @@ -93,6 +98,7 @@ def create( async def create_async( self, address_sid: str, + ui_version: Union[str, object] = values.unset, chat_friendly_name: Union[str, object] = values.unset, customer_friendly_name: Union[str, object] = values.unset, pre_engagement_data: Union[str, object] = values.unset, @@ -101,6 +107,7 @@ async def create_async( Asynchronously create the WebChannelsInstance :param address_sid: The SID of the Conversations Address. See [Address Configuration Resource](https://www.twilio.com/docs/conversations/api/address-configuration-resource) for configuration details. When a conversation is created on the Flex backend, the callback URL will be set to the corresponding Studio Flow SID or webhook URL in your address configuration. + :param ui_version: The Ui-Version HTTP request header :param chat_friendly_name: The Conversation's friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example. :param customer_friendly_name: The Conversation participant's friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example. :param pre_engagement_data: The pre-engagement data. @@ -116,11 +123,14 @@ async def create_async( "PreEngagementData": pre_engagement_data, } ) + headers = values.of( + { + "Ui-Version": ui_version, + } + ) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebChannelsInstance(self._version, payload) diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 9da80f3a34..0bacabb722 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -20,6 +20,9 @@ from twilio.rest.numbers.v1.porting_bulk_portability import PortingBulkPortabilityList from twilio.rest.numbers.v1.porting_port_in import PortingPortInList from twilio.rest.numbers.v1.porting_port_in_fetch import PortingPortInFetchList +from twilio.rest.numbers.v1.porting_port_in_phone_number import ( + PortingPortInPhoneNumberList, +) from twilio.rest.numbers.v1.porting_portability import PortingPortabilityList @@ -37,6 +40,9 @@ def __init__(self, domain: Domain): self._porting_bulk_portabilities: Optional[PortingBulkPortabilityList] = None self._porting_port_ins: Optional[PortingPortInList] = None self._porting_port_ins_fetch: Optional[PortingPortInFetchList] = None + self._porting_port_in_phone_number: Optional[PortingPortInPhoneNumberList] = ( + None + ) self._porting_portabilities: Optional[PortingPortabilityList] = None @property @@ -69,6 +75,12 @@ def porting_port_ins_fetch(self) -> PortingPortInFetchList: self._porting_port_ins_fetch = PortingPortInFetchList(self) return self._porting_port_ins_fetch + @property + def porting_port_in_phone_number(self) -> PortingPortInPhoneNumberList: + if self._porting_port_in_phone_number is None: + self._porting_port_in_phone_number = PortingPortInPhoneNumberList(self) + return self._porting_port_in_phone_number + @property def porting_portabilities(self) -> PortingPortabilityList: if self._porting_portabilities is None: diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index 086c630c65..862f578bff 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -14,7 +14,7 @@ from typing import Any, Dict, Optional, Union from twilio.base import values - +from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base.version import Version @@ -26,20 +26,114 @@ class PortingPortInInstance(InstanceResource): :ivar url: """ - def __init__(self, version: Version, payload: Dict[str, Any]): + def __init__( + self, + version: Version, + payload: Dict[str, Any], + port_in_request_sid: Optional[str] = None, + ): super().__init__(version) self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") self.url: Optional[str] = payload.get("url") + self._solution = { + "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, + } + self._context: Optional[PortingPortInContext] = None + + @property + def _proxy(self) -> "PortingPortInContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PortingPortInContext for this PortingPortInInstance + """ + if self._context is None: + self._context = PortingPortInContext( + self._version, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the PortingPortInInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the PortingPortInInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + def __repr__(self) -> str: """ Provide a friendly representation :returns: Machine friendly representation """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PortingPortInContext(InstanceContext): + + def __init__(self, version: Version, port_in_request_sid: str): + """ + Initialize the PortingPortInContext + + :param version: Version that contains the resource + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "port_in_request_sid": port_in_request_sid, + } + self._uri = "/Porting/PortIn/{port_in_request_sid}".format(**self._solution) + + def delete(self) -> bool: + """ + Deletes the PortingPortInInstance - return "" + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the PortingPortInInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) class PortingPortInList(ListResource): @@ -95,6 +189,26 @@ async def create_async( return PortingPortInInstance(self._version, payload) + def get(self, port_in_request_sid: str) -> PortingPortInContext: + """ + Constructs a PortingPortInContext + + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + return PortingPortInContext( + self._version, port_in_request_sid=port_in_request_sid + ) + + def __call__(self, port_in_request_sid: str) -> PortingPortInContext: + """ + Constructs a PortingPortInContext + + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + """ + return PortingPortInContext( + self._version, port_in_request_sid=port_in_request_sid + ) + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/porting_port_in_phone_number.py b/twilio/rest/numbers/v1/porting_port_in_phone_number.py new file mode 100644 index 0000000000..41296c6b65 --- /dev/null +++ b/twilio/rest/numbers/v1/porting_port_in_phone_number.py @@ -0,0 +1,125 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from twilio.base.instance_context import InstanceContext + +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PortingPortInPhoneNumberContext(InstanceContext): + + def __init__( + self, version: Version, port_in_request_sid: str, phone_number_sid: str + ): + """ + Initialize the PortingPortInPhoneNumberContext + + :param version: Version that contains the resource + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + :param phone_number_sid: The SID of the Port In request phone number. This is a unique identifier of the phone number. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "port_in_request_sid": port_in_request_sid, + "phone_number_sid": phone_number_sid, + } + self._uri = "/Porting/PortIn/{port_in_request_sid}/PhoneNumber/{phone_number_sid}".format( + **self._solution + ) + + def delete(self) -> bool: + """ + Deletes the PortingPortInPhoneNumberInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the PortingPortInPhoneNumberInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PortingPortInPhoneNumberList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PortingPortInPhoneNumberList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get( + self, port_in_request_sid: str, phone_number_sid: str + ) -> PortingPortInPhoneNumberContext: + """ + Constructs a PortingPortInPhoneNumberContext + + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + :param phone_number_sid: The SID of the Port In request phone number. This is a unique identifier of the phone number. + """ + return PortingPortInPhoneNumberContext( + self._version, + port_in_request_sid=port_in_request_sid, + phone_number_sid=phone_number_sid, + ) + + def __call__( + self, port_in_request_sid: str, phone_number_sid: str + ) -> PortingPortInPhoneNumberContext: + """ + Constructs a PortingPortInPhoneNumberContext + + :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + :param phone_number_sid: The SID of the Port In request phone number. This is a unique identifier of the phone number. + """ + return PortingPortInPhoneNumberContext( + self._version, + port_in_request_sid=port_in_request_sid, + phone_number_sid=phone_number_sid, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" From 1fb82e5cb84dac237a15a61034278135b6693ac3 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 18 Apr 2024 11:14:44 +0000 Subject: [PATCH 022/113] Release 9.0.5 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 91945bfd86..ed82dddb26 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.4", + version="9.0.5", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 5ed1a81015..a5d6bc795f 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "0", "4") +__version_info__ = ("9", "0", "5") __version__ = ".".join(__version_info__) From 4ed7fec29a5baccef722286033361b7092180e3c Mon Sep 17 00:00:00 2001 From: lightiverson <33266555+lightiverson@users.noreply.github.com> Date: Mon, 22 Apr 2024 13:26:24 +0200 Subject: [PATCH 023/113] fix: increase pool_maxsize (#714) (#716) Co-authored-by: Kawish Gajadien Co-authored-by: Shubham --- twilio/http/http_client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/twilio/http/http_client.py b/twilio/http/http_client.py index 7a1715ad49..9d329c6aa7 100644 --- a/twilio/http/http_client.py +++ b/twilio/http/http_client.py @@ -1,3 +1,4 @@ +import os import logging from typing import Dict, Optional, Tuple @@ -39,7 +40,10 @@ def __init__( self.session = Session() if pool_connections else None if self.session and max_retries is not None: self.session.mount("https://", HTTPAdapter(max_retries=max_retries)) - + if self.session is not None: + self.session.mount( + "https://", HTTPAdapter(pool_maxsize=min(32, os.cpu_count() + 4)) + ) self.request_hooks = request_hooks or hooks.default_hooks() self.proxy = proxy if proxy else {} From 386320522ce86b66ee49a845d2bcaefb904ab595 Mon Sep 17 00:00:00 2001 From: twilio-product-security <67294289+twilio-product-security@users.noreply.github.com> Date: Wed, 22 May 2024 13:53:42 -0400 Subject: [PATCH 024/113] fix: requirements.txt to reduce vulnerabilities (#789) The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-AIOHTTP-6645291 Co-authored-by: snyk-bot Co-authored-by: Shubham --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index c633981931..a29abc4d1e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability requests>=2.31.0 PyJWT>=2.0.0, <3.0.0 -aiohttp>=3.9.0 +aiohttp>=3.9.4 aiohttp-retry>=2.8.3 certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability From 663ca134ddb46cd285790ca7a9c4e14b58f65f3d Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 24 May 2024 11:02:53 +0000 Subject: [PATCH 025/113] [Librarian] Regenerated @ 1baa147fbfa3bf2798f86ec43796ef1df42570d4 a3170b07f36450c6d179edf9b044cbf5f6b94e3a --- CHANGES.md | 46 ++ twilio/rest/__init__.py | 15 - .../api/v2010/account/message/__init__.py | 2 +- twilio/rest/content/ContentBase.py | 11 + twilio/rest/content/v2/__init__.py | 51 ++ twilio/rest/content/v2/content.py | 288 ++++++++ .../rest/content/v2/content_and_approvals.py | 288 ++++++++ .../rest/flex_api/v1/interaction/__init__.py | 4 +- .../flex_api/v1/plugin/plugin_versions.py | 4 +- twilio/rest/intelligence/v2/__init__.py | 48 ++ .../rest/intelligence/v2/custom_operator.py | 682 ++++++++++++++++++ twilio/rest/intelligence/v2/operator.py | 462 ++++++++++++ .../intelligence/v2/operator_attachment.py | 245 +++++++ .../intelligence/v2/operator_attachments.py | 187 +++++ twilio/rest/intelligence/v2/operator_type.py | 443 ++++++++++++ .../rest/intelligence/v2/prebuilt_operator.py | 474 ++++++++++++ twilio/rest/intelligence/v2/service.py | 22 +- twilio/rest/messaging/v1/service/__init__.py | 4 - twilio/rest/numbers/v1/__init__.py | 60 +- .../numbers/v1/porting_bulk_portability.py | 252 ------- twilio/rest/numbers/v1/porting_port_in.py | 95 ++- .../rest/numbers/v1/porting_port_in_fetch.py | 223 ------ .../v1/porting_port_in_phone_number.py | 175 ++++- .../v1/porting_webhook_configuration.py | 108 +++ .../porting_webhook_configuration_delete.py | 121 ++++ .../v1/porting_webhook_configuration_fetch.py | 101 +++ .../preview_messaging/PreviewMessagingBase.py | 44 -- twilio/rest/preview_messaging/v1/__init__.py | 51 -- twilio/rest/preview_messaging/v1/broadcast.py | 125 ---- twilio/rest/preview_messaging/v1/message.py | 204 ------ .../taskrouter/v1/workspace/task/__init__.py | 40 + .../v1/compliance_tollfree_inquiries.py | 6 + .../trusthub/v1/customer_profiles/__init__.py | 2 + .../trusthub/v1/trust_products/__init__.py | 2 + twilio/rest/verify/v2/service/__init__.py | 2 +- twilio/rest/verify/v2/service/verification.py | 2 +- .../verify/v2/service/verification_check.py | 2 +- 37 files changed, 3928 insertions(+), 963 deletions(-) create mode 100644 twilio/rest/content/v2/__init__.py create mode 100644 twilio/rest/content/v2/content.py create mode 100644 twilio/rest/content/v2/content_and_approvals.py create mode 100644 twilio/rest/intelligence/v2/custom_operator.py create mode 100644 twilio/rest/intelligence/v2/operator.py create mode 100644 twilio/rest/intelligence/v2/operator_attachment.py create mode 100644 twilio/rest/intelligence/v2/operator_attachments.py create mode 100644 twilio/rest/intelligence/v2/operator_type.py create mode 100644 twilio/rest/intelligence/v2/prebuilt_operator.py delete mode 100644 twilio/rest/numbers/v1/porting_bulk_portability.py delete mode 100644 twilio/rest/numbers/v1/porting_port_in_fetch.py create mode 100644 twilio/rest/numbers/v1/porting_webhook_configuration.py create mode 100644 twilio/rest/numbers/v1/porting_webhook_configuration_delete.py create mode 100644 twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py delete mode 100644 twilio/rest/preview_messaging/PreviewMessagingBase.py delete mode 100644 twilio/rest/preview_messaging/v1/__init__.py delete mode 100644 twilio/rest/preview_messaging/v1/broadcast.py delete mode 100644 twilio/rest/preview_messaging/v1/message.py diff --git a/CHANGES.md b/CHANGES.md index 6af9e1d3f7..a6c5a45f2d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,52 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-05-24] Version 9.1.0 +-------------------------- +**Library - Chore** +- [PR #789](https://github.com/twilio/twilio-python/pull/789): [Snyk] Security upgrade aiohttp from 3.8.6 to 3.9.4. Thanks to [@twilio-product-security](https://github.com/twilio-product-security)! + +**Library - Fix** +- [PR #716](https://github.com/twilio/twilio-python/pull/716): Connection pool is full, discarding connection. Thanks to [@lightiverson](https://github.com/lightiverson)! + +**Api** +- Add ie1 as supported region for UserDefinedMessage and UserDefinedMessageSubscription. + +**Flex** +- Adding validated field to `plugin_versions` +- Corrected the data type for `runtime_domain`, `call_recording_webhook_url`, `crm_callback_url`, `crm_fallback_url`, `flex_url` in Flex Configuration +- Making `routing` optional in Create Interactions endpoint + +**Intelligence** +- Expose operator authoring apis to public visibility +- Deleted `language_code` parameter from updating service in v2 **(breaking change)** +- Add read_only_attached_operator_sids to v2 services + +**Numbers** +- Add API endpoint for GET Porting Webhook Configurations By Account SID +- Remove bulk portability api under version `/v1`. **(breaking change)** +- Removed porting_port_in_fetch.json files and move the content into porting_port_in.json files +- Add API endpoint to deleting Webhook Configurations +- Add Get Phone Number by Port in request SID and Phone Number SID api +- Add Create Porting webhook configuration API +- Added bundle_sid and losing_carrier_information fields to Create PortInRequest api to support Japan porting + +**Taskrouter** +- Add back `routing_target` property to tasks +- Add back `ignore_capacity` property to tasks +- Removing `routing_target` property to tasks due to revert +- Removing `ignore_capacity` property to tasks due to revert +- Add `routing_target` property to tasks +- Add `ignore_capacity` property to tasks + +**Trusthub** +- Add new field errors to bundle as part of public API response in customer_profile.json and trust_product.json **(breaking change)** +- Add themeSetId field in compliance_tollfree_inquiry. + +**Verify** +- Update `friendly_name` description on service docs + + [2024-04-18] Version 9.0.5 -------------------------- **Library - Chore** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index c7f722642a..0d3d96bfec 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -27,7 +27,6 @@ from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging from twilio.rest.lookups import Lookups - from twilio.rest.preview_messaging import PreviewMessaging from twilio.rest.messaging import Messaging from twilio.rest.microvisor import Microvisor from twilio.rest.monitor import Monitor @@ -135,7 +134,6 @@ def __init__( self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None self._lookups: Optional["Lookups"] = None - self._preview_messaging: Optional["PreviewMessaging"] = None self._messaging: Optional["Messaging"] = None self._microvisor: Optional["Microvisor"] = None self._monitor: Optional["Monitor"] = None @@ -327,19 +325,6 @@ def lookups(self) -> "Lookups": self._lookups = Lookups(self) return self._lookups - @property - def preview_messaging(self) -> "PreviewMessaging": - """ - Access the PreviewMessaging Twilio Domain - - :returns: PreviewMessaging Twilio Domain - """ - if self._preview_messaging is None: - from twilio.rest.preview_messaging import PreviewMessaging - - self._preview_messaging = PreviewMessaging(self) - return self._preview_messaging - @property def messaging(self) -> "Messaging": """ diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 972d80b172..953d3d8008 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -78,7 +78,7 @@ class UpdateStatus(object): :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with the Message resource :ivar num_media: The number of media files associated with the Message resource. :ivar status: - :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) associated with the Message resource. The value is `null` if a Messaging Service was not used. + :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) associated with the Message resource. A unique default value is assigned if a Messaging Service is not used. :ivar sid: The unique, Twilio-provided string that identifies the Message resource. :ivar date_sent: The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message was sent. For an outgoing message, this is when Twilio sent the message. For an incoming message, this is when Twilio sent the HTTP request to your incoming message webhook URL. :ivar date_created: The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message resource was created diff --git a/twilio/rest/content/ContentBase.py b/twilio/rest/content/ContentBase.py index a8511f9fff..8a1ccd5d94 100644 --- a/twilio/rest/content/ContentBase.py +++ b/twilio/rest/content/ContentBase.py @@ -14,6 +14,7 @@ from twilio.base.domain import Domain from twilio.rest import Client from twilio.rest.content.v1 import V1 +from twilio.rest.content.v2 import V2 class ContentBase(Domain): @@ -26,6 +27,7 @@ def __init__(self, twilio: Client): """ super().__init__(twilio, "https://content.twilio.com") self._v1: Optional[V1] = None + self._v2: Optional[V2] = None @property def v1(self) -> V1: @@ -36,6 +38,15 @@ def v1(self) -> V1: self._v1 = V1(self) return self._v1 + @property + def v2(self) -> V2: + """ + :returns: Versions v2 of Content + """ + if self._v2 is None: + self._v2 = V2(self) + return self._v2 + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/content/v2/__init__.py b/twilio/rest/content/v2/__init__.py new file mode 100644 index 0000000000..ca6d8bcd74 --- /dev/null +++ b/twilio/rest/content/v2/__init__.py @@ -0,0 +1,51 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Content + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.content.v2.content import ContentList +from twilio.rest.content.v2.content_and_approvals import ContentAndApprovalsList + + +class V2(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V2 version of Content + + :param domain: The Twilio.content domain + """ + super().__init__(domain, "v2") + self._contents: Optional[ContentList] = None + self._content_and_approvals: Optional[ContentAndApprovalsList] = None + + @property + def contents(self) -> ContentList: + if self._contents is None: + self._contents = ContentList(self) + return self._contents + + @property + def content_and_approvals(self) -> ContentAndApprovalsList: + if self._content_and_approvals is None: + self._content_and_approvals = ContentAndApprovalsList(self) + return self._content_and_approvals + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/content/v2/content.py b/twilio/rest/content/v2/content.py new file mode 100644 index 0000000000..88ae80f1c0 --- /dev/null +++ b/twilio/rest/content/v2/content.py @@ -0,0 +1,288 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Content + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class ContentInstance(InstanceResource): + """ + :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar sid: The unique string that that we created to identify the Content resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. + :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. + :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. + :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar url: The URL of the resource, relative to `https://content.twilio.com`. + :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.language: Optional[str] = payload.get("language") + self.variables: Optional[Dict[str, object]] = payload.get("variables") + self.types: Optional[Dict[str, object]] = payload.get("types") + self.url: Optional[str] = payload.get("url") + self.links: Optional[Dict[str, object]] = payload.get("links") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ContentPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> ContentInstance: + """ + Build an instance of ContentInstance + + :param payload: Payload response from the API + """ + return ContentInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class ContentList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the ContentList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Content" + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[ContentInstance]: + """ + Streams ContentInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[ContentInstance]: + """ + Asynchronously streams ContentInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ContentInstance]: + """ + Lists ContentInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ContentInstance]: + """ + Asynchronously lists ContentInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ContentPage: + """ + Retrieve a single page of ContentInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ContentInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return ContentPage(self._version, response) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ContentPage: + """ + Asynchronously retrieve a single page of ContentInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ContentInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return ContentPage(self._version, response) + + def get_page(self, target_url: str) -> ContentPage: + """ + Retrieve a specific page of ContentInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ContentInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return ContentPage(self._version, response) + + async def get_page_async(self, target_url: str) -> ContentPage: + """ + Asynchronously retrieve a specific page of ContentInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ContentInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return ContentPage(self._version, response) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/content/v2/content_and_approvals.py b/twilio/rest/content/v2/content_and_approvals.py new file mode 100644 index 0000000000..7a3e6d9ccf --- /dev/null +++ b/twilio/rest/content/v2/content_and_approvals.py @@ -0,0 +1,288 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Content + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class ContentAndApprovalsInstance(InstanceResource): + """ + :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar sid: The unique string that that we created to identify the Content resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. + :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. + :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. + :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar approval_requests: The submitted information and approval request status of the Content resource. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.language: Optional[str] = payload.get("language") + self.variables: Optional[Dict[str, object]] = payload.get("variables") + self.types: Optional[Dict[str, object]] = payload.get("types") + self.approval_requests: Optional[Dict[str, object]] = payload.get( + "approval_requests" + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ContentAndApprovalsPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> ContentAndApprovalsInstance: + """ + Build an instance of ContentAndApprovalsInstance + + :param payload: Payload response from the API + """ + return ContentAndApprovalsInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class ContentAndApprovalsList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the ContentAndApprovalsList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/ContentAndApprovals" + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[ContentAndApprovalsInstance]: + """ + Streams ContentAndApprovalsInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[ContentAndApprovalsInstance]: + """ + Asynchronously streams ContentAndApprovalsInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ContentAndApprovalsInstance]: + """ + Lists ContentAndApprovalsInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ContentAndApprovalsInstance]: + """ + Asynchronously lists ContentAndApprovalsInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ContentAndApprovalsPage: + """ + Retrieve a single page of ContentAndApprovalsInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ContentAndApprovalsInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return ContentAndApprovalsPage(self._version, response) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ContentAndApprovalsPage: + """ + Asynchronously retrieve a single page of ContentAndApprovalsInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ContentAndApprovalsInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return ContentAndApprovalsPage(self._version, response) + + def get_page(self, target_url: str) -> ContentAndApprovalsPage: + """ + Retrieve a specific page of ContentAndApprovalsInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ContentAndApprovalsInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return ContentAndApprovalsPage(self._version, response) + + async def get_page_async(self, target_url: str) -> ContentAndApprovalsPage: + """ + Asynchronously retrieve a specific page of ContentAndApprovalsInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ContentAndApprovalsInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return ContentAndApprovalsPage(self._version, response) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/flex_api/v1/interaction/__init__.py b/twilio/rest/flex_api/v1/interaction/__init__.py index 992cc9b015..069b05309f 100644 --- a/twilio/rest/flex_api/v1/interaction/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/__init__.py @@ -198,7 +198,7 @@ def __init__(self, version: Version): def create( self, channel: object, - routing: object, + routing: Union[object, object] = values.unset, interaction_context_sid: Union[str, object] = values.unset, ) -> InteractionInstance: """ @@ -230,7 +230,7 @@ def create( async def create_async( self, channel: object, - routing: object, + routing: Union[object, object] = values.unset, interaction_context_sid: Union[str, object] = values.unset, ) -> InteractionInstance: """ diff --git a/twilio/rest/flex_api/v1/plugin/plugin_versions.py b/twilio/rest/flex_api/v1/plugin/plugin_versions.py index 96313c84dd..1e5b5683b6 100644 --- a/twilio/rest/flex_api/v1/plugin/plugin_versions.py +++ b/twilio/rest/flex_api/v1/plugin/plugin_versions.py @@ -30,8 +30,9 @@ class PluginVersionsInstance(InstanceResource): :ivar version: The unique version of this Flex Plugin Version. :ivar plugin_url: The URL of where the Flex Plugin Version JavaScript bundle is hosted on. :ivar changelog: A changelog that describes the changes this Flex Plugin Version brings. - :ivar private: Whether to inject credentials while accessing this Plugin Version. The default value is false. + :ivar private: Whether the Flex Plugin Version is validated. The default value is false. :ivar archived: Whether the Flex Plugin Version is archived. The default value is false. + :ivar validated: :ivar date_created: The date and time in GMT when the Flex Plugin Version was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar url: The absolute URL of the Flex Plugin Version resource. """ @@ -53,6 +54,7 @@ def __init__( self.changelog: Optional[str] = payload.get("changelog") self.private: Optional[bool] = payload.get("private") self.archived: Optional[bool] = payload.get("archived") + self.validated: Optional[bool] = payload.get("validated") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) diff --git a/twilio/rest/intelligence/v2/__init__.py b/twilio/rest/intelligence/v2/__init__.py index e20b125ced..4999146f93 100644 --- a/twilio/rest/intelligence/v2/__init__.py +++ b/twilio/rest/intelligence/v2/__init__.py @@ -15,6 +15,12 @@ from typing import Optional from twilio.base.version import Version from twilio.base.domain import Domain +from twilio.rest.intelligence.v2.custom_operator import CustomOperatorList +from twilio.rest.intelligence.v2.operator import OperatorList +from twilio.rest.intelligence.v2.operator_attachment import OperatorAttachmentList +from twilio.rest.intelligence.v2.operator_attachments import OperatorAttachmentsList +from twilio.rest.intelligence.v2.operator_type import OperatorTypeList +from twilio.rest.intelligence.v2.prebuilt_operator import PrebuiltOperatorList from twilio.rest.intelligence.v2.service import ServiceList from twilio.rest.intelligence.v2.transcript import TranscriptList @@ -28,9 +34,51 @@ def __init__(self, domain: Domain): :param domain: The Twilio.intelligence domain """ super().__init__(domain, "v2") + self._custom_operators: Optional[CustomOperatorList] = None + self._operators: Optional[OperatorList] = None + self._operator_attachment: Optional[OperatorAttachmentList] = None + self._operator_attachments: Optional[OperatorAttachmentsList] = None + self._operator_type: Optional[OperatorTypeList] = None + self._prebuilt_operators: Optional[PrebuiltOperatorList] = None self._services: Optional[ServiceList] = None self._transcripts: Optional[TranscriptList] = None + @property + def custom_operators(self) -> CustomOperatorList: + if self._custom_operators is None: + self._custom_operators = CustomOperatorList(self) + return self._custom_operators + + @property + def operators(self) -> OperatorList: + if self._operators is None: + self._operators = OperatorList(self) + return self._operators + + @property + def operator_attachment(self) -> OperatorAttachmentList: + if self._operator_attachment is None: + self._operator_attachment = OperatorAttachmentList(self) + return self._operator_attachment + + @property + def operator_attachments(self) -> OperatorAttachmentsList: + if self._operator_attachments is None: + self._operator_attachments = OperatorAttachmentsList(self) + return self._operator_attachments + + @property + def operator_type(self) -> OperatorTypeList: + if self._operator_type is None: + self._operator_type = OperatorTypeList(self) + return self._operator_type + + @property + def prebuilt_operators(self) -> PrebuiltOperatorList: + if self._prebuilt_operators is None: + self._prebuilt_operators = PrebuiltOperatorList(self) + return self._prebuilt_operators + @property def services(self) -> ServiceList: if self._services is None: diff --git a/twilio/rest/intelligence/v2/custom_operator.py b/twilio/rest/intelligence/v2/custom_operator.py new file mode 100644 index 0000000000..6966dc5d08 --- /dev/null +++ b/twilio/rest/intelligence/v2/custom_operator.py @@ -0,0 +1,682 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Intelligence + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class CustomOperatorInstance(InstanceResource): + + class Availability(object): + INTERNAL = "internal" + BETA = "beta" + PUBLIC = "public" + RETIRED = "retired" + + """ + :ivar account_sid: The unique SID identifier of the Account the Custom Operator belongs to. + :ivar sid: A 34 character string that uniquely identifies this Custom Operator. + :ivar friendly_name: A human-readable name of this resource, up to 64 characters. + :ivar description: A human-readable description of this resource, longer than the friendly name. + :ivar author: The creator of the Custom Operator. Custom Operators can only be created by a Twilio Account. + :ivar operator_type: Operator Type for this Operator. References an existing Operator Type resource. + :ivar version: Numeric Custom Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Custom Operator. + :ivar availability: + :ivar config: Operator configuration, following the schema defined by the Operator Type. Only available on Operators created by the Account. + :ivar date_created: The date that this Custom Operator was created, given in ISO 8601 format. + :ivar date_updated: The date that this Custom Operator was updated, given in ISO 8601 format. + :ivar url: The URL of this resource. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.sid: Optional[str] = payload.get("sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.description: Optional[str] = payload.get("description") + self.author: Optional[str] = payload.get("author") + self.operator_type: Optional[str] = payload.get("operator_type") + self.version: Optional[int] = deserialize.integer(payload.get("version")) + self.availability: Optional["CustomOperatorInstance.Availability"] = ( + payload.get("availability") + ) + self.config: Optional[Dict[str, object]] = payload.get("config") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[CustomOperatorContext] = None + + @property + def _proxy(self) -> "CustomOperatorContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: CustomOperatorContext for this CustomOperatorInstance + """ + if self._context is None: + self._context = CustomOperatorContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the CustomOperatorInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the CustomOperatorInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "CustomOperatorInstance": + """ + Fetch the CustomOperatorInstance + + + :returns: The fetched CustomOperatorInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "CustomOperatorInstance": + """ + Asynchronous coroutine to fetch the CustomOperatorInstance + + + :returns: The fetched CustomOperatorInstance + """ + return await self._proxy.fetch_async() + + def update( + self, + friendly_name: str, + config: object, + if_match: Union[str, object] = values.unset, + ) -> "CustomOperatorInstance": + """ + Update the CustomOperatorInstance + + :param friendly_name: A human-readable name of this resource, up to 64 characters. + :param config: Operator configuration, following the schema defined by the Operator Type. + :param if_match: The If-Match HTTP request header + + :returns: The updated CustomOperatorInstance + """ + return self._proxy.update( + friendly_name=friendly_name, + config=config, + if_match=if_match, + ) + + async def update_async( + self, + friendly_name: str, + config: object, + if_match: Union[str, object] = values.unset, + ) -> "CustomOperatorInstance": + """ + Asynchronous coroutine to update the CustomOperatorInstance + + :param friendly_name: A human-readable name of this resource, up to 64 characters. + :param config: Operator configuration, following the schema defined by the Operator Type. + :param if_match: The If-Match HTTP request header + + :returns: The updated CustomOperatorInstance + """ + return await self._proxy.update_async( + friendly_name=friendly_name, + config=config, + if_match=if_match, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class CustomOperatorContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the CustomOperatorContext + + :param version: Version that contains the resource + :param sid: A 34 character string that uniquely identifies this Custom Operator. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/Operators/Custom/{sid}".format(**self._solution) + + def delete(self) -> bool: + """ + Deletes the CustomOperatorInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the CustomOperatorInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def fetch(self) -> CustomOperatorInstance: + """ + Fetch the CustomOperatorInstance + + + :returns: The fetched CustomOperatorInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return CustomOperatorInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> CustomOperatorInstance: + """ + Asynchronous coroutine to fetch the CustomOperatorInstance + + + :returns: The fetched CustomOperatorInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return CustomOperatorInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + def update( + self, + friendly_name: str, + config: object, + if_match: Union[str, object] = values.unset, + ) -> CustomOperatorInstance: + """ + Update the CustomOperatorInstance + + :param friendly_name: A human-readable name of this resource, up to 64 characters. + :param config: Operator configuration, following the schema defined by the Operator Type. + :param if_match: The If-Match HTTP request header + + :returns: The updated CustomOperatorInstance + """ + data = values.of( + { + "FriendlyName": friendly_name, + "Config": serialize.object(config), + } + ) + headers = values.of( + { + "If-Match": if_match, + } + ) + + payload = self._version.update( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return CustomOperatorInstance(self._version, payload, sid=self._solution["sid"]) + + async def update_async( + self, + friendly_name: str, + config: object, + if_match: Union[str, object] = values.unset, + ) -> CustomOperatorInstance: + """ + Asynchronous coroutine to update the CustomOperatorInstance + + :param friendly_name: A human-readable name of this resource, up to 64 characters. + :param config: Operator configuration, following the schema defined by the Operator Type. + :param if_match: The If-Match HTTP request header + + :returns: The updated CustomOperatorInstance + """ + data = values.of( + { + "FriendlyName": friendly_name, + "Config": serialize.object(config), + } + ) + headers = values.of( + { + "If-Match": if_match, + } + ) + + payload = await self._version.update_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return CustomOperatorInstance(self._version, payload, sid=self._solution["sid"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class CustomOperatorPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> CustomOperatorInstance: + """ + Build an instance of CustomOperatorInstance + + :param payload: Payload response from the API + """ + return CustomOperatorInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class CustomOperatorList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the CustomOperatorList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Operators/Custom" + + def create( + self, friendly_name: str, operator_type: str, config: object + ) -> CustomOperatorInstance: + """ + Create the CustomOperatorInstance + + :param friendly_name: A human readable description of the new Operator, up to 64 characters. + :param operator_type: Operator Type for this Operator. References an existing Operator Type resource. + :param config: Operator configuration, following the schema defined by the Operator Type. + + :returns: The created CustomOperatorInstance + """ + + data = values.of( + { + "FriendlyName": friendly_name, + "OperatorType": operator_type, + "Config": serialize.object(config), + } + ) + + payload = self._version.create( + method="POST", + uri=self._uri, + data=data, + ) + + return CustomOperatorInstance(self._version, payload) + + async def create_async( + self, friendly_name: str, operator_type: str, config: object + ) -> CustomOperatorInstance: + """ + Asynchronously create the CustomOperatorInstance + + :param friendly_name: A human readable description of the new Operator, up to 64 characters. + :param operator_type: Operator Type for this Operator. References an existing Operator Type resource. + :param config: Operator configuration, following the schema defined by the Operator Type. + + :returns: The created CustomOperatorInstance + """ + + data = values.of( + { + "FriendlyName": friendly_name, + "OperatorType": operator_type, + "Config": serialize.object(config), + } + ) + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + data=data, + ) + + return CustomOperatorInstance(self._version, payload) + + def stream( + self, + availability: Union[ + "CustomOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[CustomOperatorInstance]: + """ + Streams CustomOperatorInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param "CustomOperatorInstance.Availability" availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Custom Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page( + availability=availability, + language_code=language_code, + page_size=limits["page_size"], + ) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + availability: Union[ + "CustomOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[CustomOperatorInstance]: + """ + Asynchronously streams CustomOperatorInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param "CustomOperatorInstance.Availability" availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Custom Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + availability=availability, + language_code=language_code, + page_size=limits["page_size"], + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + availability: Union[ + "CustomOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[CustomOperatorInstance]: + """ + Lists CustomOperatorInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param "CustomOperatorInstance.Availability" availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Custom Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + availability=availability, + language_code=language_code, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + availability: Union[ + "CustomOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[CustomOperatorInstance]: + """ + Asynchronously lists CustomOperatorInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param "CustomOperatorInstance.Availability" availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Custom Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + availability=availability, + language_code=language_code, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + availability: Union[ + "CustomOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> CustomOperatorPage: + """ + Retrieve a single page of CustomOperatorInstance records from the API. + Request is executed immediately + + :param availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param language_code: Returns Custom Operators that support the provided language code. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of CustomOperatorInstance + """ + data = values.of( + { + "Availability": availability, + "LanguageCode": language_code, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return CustomOperatorPage(self._version, response) + + async def page_async( + self, + availability: Union[ + "CustomOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> CustomOperatorPage: + """ + Asynchronously retrieve a single page of CustomOperatorInstance records from the API. + Request is executed immediately + + :param availability: Returns Custom Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param language_code: Returns Custom Operators that support the provided language code. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of CustomOperatorInstance + """ + data = values.of( + { + "Availability": availability, + "LanguageCode": language_code, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return CustomOperatorPage(self._version, response) + + def get_page(self, target_url: str) -> CustomOperatorPage: + """ + Retrieve a specific page of CustomOperatorInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of CustomOperatorInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return CustomOperatorPage(self._version, response) + + async def get_page_async(self, target_url: str) -> CustomOperatorPage: + """ + Asynchronously retrieve a specific page of CustomOperatorInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of CustomOperatorInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return CustomOperatorPage(self._version, response) + + def get(self, sid: str) -> CustomOperatorContext: + """ + Constructs a CustomOperatorContext + + :param sid: A 34 character string that uniquely identifies this Custom Operator. + """ + return CustomOperatorContext(self._version, sid=sid) + + def __call__(self, sid: str) -> CustomOperatorContext: + """ + Constructs a CustomOperatorContext + + :param sid: A 34 character string that uniquely identifies this Custom Operator. + """ + return CustomOperatorContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/intelligence/v2/operator.py b/twilio/rest/intelligence/v2/operator.py new file mode 100644 index 0000000000..6618c4a6c0 --- /dev/null +++ b/twilio/rest/intelligence/v2/operator.py @@ -0,0 +1,462 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Intelligence + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class OperatorInstance(InstanceResource): + + class Availability(object): + INTERNAL = "internal" + BETA = "beta" + PUBLIC = "public" + RETIRED = "retired" + + """ + :ivar account_sid: The unique SID identifier of the Account the Operator belongs to. + :ivar sid: A 34 character string that uniquely identifies this Operator. + :ivar friendly_name: A human-readable name of this resource, up to 64 characters. + :ivar description: A human-readable description of this resource, longer than the friendly name. + :ivar author: The creator of the Operator. Either Twilio or the creating Account. + :ivar operator_type: Operator Type for this Operator. References an existing Operator Type resource. + :ivar version: Numeric Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Operator. + :ivar availability: + :ivar config: Operator configuration, following the schema defined by the Operator Type. Only available on Custom Operators created by the Account. + :ivar date_created: The date that this Operator was created, given in ISO 8601 format. + :ivar date_updated: The date that this Operator was updated, given in ISO 8601 format. + :ivar url: The URL of this resource. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.sid: Optional[str] = payload.get("sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.description: Optional[str] = payload.get("description") + self.author: Optional[str] = payload.get("author") + self.operator_type: Optional[str] = payload.get("operator_type") + self.version: Optional[int] = deserialize.integer(payload.get("version")) + self.availability: Optional["OperatorInstance.Availability"] = payload.get( + "availability" + ) + self.config: Optional[Dict[str, object]] = payload.get("config") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[OperatorContext] = None + + @property + def _proxy(self) -> "OperatorContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: OperatorContext for this OperatorInstance + """ + if self._context is None: + self._context = OperatorContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def fetch(self) -> "OperatorInstance": + """ + Fetch the OperatorInstance + + + :returns: The fetched OperatorInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "OperatorInstance": + """ + Asynchronous coroutine to fetch the OperatorInstance + + + :returns: The fetched OperatorInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class OperatorContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the OperatorContext + + :param version: Version that contains the resource + :param sid: A 34 character string that uniquely identifies this Operator. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/Operators/{sid}".format(**self._solution) + + def fetch(self) -> OperatorInstance: + """ + Fetch the OperatorInstance + + + :returns: The fetched OperatorInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return OperatorInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> OperatorInstance: + """ + Asynchronous coroutine to fetch the OperatorInstance + + + :returns: The fetched OperatorInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return OperatorInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class OperatorPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> OperatorInstance: + """ + Build an instance of OperatorInstance + + :param payload: Payload response from the API + """ + return OperatorInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class OperatorList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the OperatorList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Operators" + + def stream( + self, + availability: Union["OperatorInstance.Availability", object] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[OperatorInstance]: + """ + Streams OperatorInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param "OperatorInstance.Availability" availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page( + availability=availability, + language_code=language_code, + page_size=limits["page_size"], + ) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + availability: Union["OperatorInstance.Availability", object] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[OperatorInstance]: + """ + Asynchronously streams OperatorInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param "OperatorInstance.Availability" availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + availability=availability, + language_code=language_code, + page_size=limits["page_size"], + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + availability: Union["OperatorInstance.Availability", object] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[OperatorInstance]: + """ + Lists OperatorInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param "OperatorInstance.Availability" availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + availability=availability, + language_code=language_code, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + availability: Union["OperatorInstance.Availability", object] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[OperatorInstance]: + """ + Asynchronously lists OperatorInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param "OperatorInstance.Availability" availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + availability=availability, + language_code=language_code, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + availability: Union["OperatorInstance.Availability", object] = values.unset, + language_code: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> OperatorPage: + """ + Retrieve a single page of OperatorInstance records from the API. + Request is executed immediately + + :param availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param language_code: Returns Operators that support the provided language code. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of OperatorInstance + """ + data = values.of( + { + "Availability": availability, + "LanguageCode": language_code, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return OperatorPage(self._version, response) + + async def page_async( + self, + availability: Union["OperatorInstance.Availability", object] = values.unset, + language_code: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> OperatorPage: + """ + Asynchronously retrieve a single page of OperatorInstance records from the API. + Request is executed immediately + + :param availability: Returns Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param language_code: Returns Operators that support the provided language code. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of OperatorInstance + """ + data = values.of( + { + "Availability": availability, + "LanguageCode": language_code, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return OperatorPage(self._version, response) + + def get_page(self, target_url: str) -> OperatorPage: + """ + Retrieve a specific page of OperatorInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of OperatorInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return OperatorPage(self._version, response) + + async def get_page_async(self, target_url: str) -> OperatorPage: + """ + Asynchronously retrieve a specific page of OperatorInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of OperatorInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return OperatorPage(self._version, response) + + def get(self, sid: str) -> OperatorContext: + """ + Constructs a OperatorContext + + :param sid: A 34 character string that uniquely identifies this Operator. + """ + return OperatorContext(self._version, sid=sid) + + def __call__(self, sid: str) -> OperatorContext: + """ + Constructs a OperatorContext + + :param sid: A 34 character string that uniquely identifies this Operator. + """ + return OperatorContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/intelligence/v2/operator_attachment.py b/twilio/rest/intelligence/v2/operator_attachment.py new file mode 100644 index 0000000000..4ab8b48c10 --- /dev/null +++ b/twilio/rest/intelligence/v2/operator_attachment.py @@ -0,0 +1,245 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Intelligence + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional +from twilio.base import values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class OperatorAttachmentInstance(InstanceResource): + """ + :ivar service_sid: The unique SID identifier of the Service. + :ivar operator_sid: The unique SID identifier of the Operator. + :ivar url: The URL of this resource. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + service_sid: Optional[str] = None, + operator_sid: Optional[str] = None, + ): + super().__init__(version) + + self.service_sid: Optional[str] = payload.get("service_sid") + self.operator_sid: Optional[str] = payload.get("operator_sid") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "service_sid": service_sid or self.service_sid, + "operator_sid": operator_sid or self.operator_sid, + } + self._context: Optional[OperatorAttachmentContext] = None + + @property + def _proxy(self) -> "OperatorAttachmentContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: OperatorAttachmentContext for this OperatorAttachmentInstance + """ + if self._context is None: + self._context = OperatorAttachmentContext( + self._version, + service_sid=self._solution["service_sid"], + operator_sid=self._solution["operator_sid"], + ) + return self._context + + def create(self) -> "OperatorAttachmentInstance": + """ + Create the OperatorAttachmentInstance + + + :returns: The created OperatorAttachmentInstance + """ + return self._proxy.create() + + async def create_async(self) -> "OperatorAttachmentInstance": + """ + Asynchronous coroutine to create the OperatorAttachmentInstance + + + :returns: The created OperatorAttachmentInstance + """ + return await self._proxy.create_async() + + def delete(self) -> bool: + """ + Deletes the OperatorAttachmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the OperatorAttachmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class OperatorAttachmentContext(InstanceContext): + + def __init__(self, version: Version, service_sid: str, operator_sid: str): + """ + Initialize the OperatorAttachmentContext + + :param version: Version that contains the resource + :param service_sid: The unique SID identifier of the Service. + :param operator_sid: The unique SID identifier of the Operator. Allows both Custom and Pre-built Operators. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "service_sid": service_sid, + "operator_sid": operator_sid, + } + self._uri = "/Services/{service_sid}/Operators/{operator_sid}".format( + **self._solution + ) + + def create(self) -> OperatorAttachmentInstance: + """ + Create the OperatorAttachmentInstance + + + :returns: The created OperatorAttachmentInstance + """ + data = values.of({}) + + payload = self._version.create(method="POST", uri=self._uri, data=data) + + return OperatorAttachmentInstance( + self._version, + payload, + service_sid=self._solution["service_sid"], + operator_sid=self._solution["operator_sid"], + ) + + async def create_async(self) -> OperatorAttachmentInstance: + """ + Asynchronous coroutine to create the OperatorAttachmentInstance + + + :returns: The created OperatorAttachmentInstance + """ + data = values.of({}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data + ) + + return OperatorAttachmentInstance( + self._version, + payload, + service_sid=self._solution["service_sid"], + operator_sid=self._solution["operator_sid"], + ) + + def delete(self) -> bool: + """ + Deletes the OperatorAttachmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the OperatorAttachmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class OperatorAttachmentList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the OperatorAttachmentList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, service_sid: str, operator_sid: str) -> OperatorAttachmentContext: + """ + Constructs a OperatorAttachmentContext + + :param service_sid: The unique SID identifier of the Service. + :param operator_sid: The unique SID identifier of the Operator. Allows both Custom and Pre-built Operators. + """ + return OperatorAttachmentContext( + self._version, service_sid=service_sid, operator_sid=operator_sid + ) + + def __call__( + self, service_sid: str, operator_sid: str + ) -> OperatorAttachmentContext: + """ + Constructs a OperatorAttachmentContext + + :param service_sid: The unique SID identifier of the Service. + :param operator_sid: The unique SID identifier of the Operator. Allows both Custom and Pre-built Operators. + """ + return OperatorAttachmentContext( + self._version, service_sid=service_sid, operator_sid=operator_sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/intelligence/v2/operator_attachments.py b/twilio/rest/intelligence/v2/operator_attachments.py new file mode 100644 index 0000000000..2500ef7224 --- /dev/null +++ b/twilio/rest/intelligence/v2/operator_attachments.py @@ -0,0 +1,187 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Intelligence + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class OperatorAttachmentsInstance(InstanceResource): + """ + :ivar service_sid: The unique SID identifier of the Service. + :ivar operator_sids: List of Operator SIDs attached to the service. Includes both Custom and Pre-built Operators. + :ivar url: The URL of this resource. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + service_sid: Optional[str] = None, + ): + super().__init__(version) + + self.service_sid: Optional[str] = payload.get("service_sid") + self.operator_sids: Optional[List[str]] = payload.get("operator_sids") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "service_sid": service_sid or self.service_sid, + } + self._context: Optional[OperatorAttachmentsContext] = None + + @property + def _proxy(self) -> "OperatorAttachmentsContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: OperatorAttachmentsContext for this OperatorAttachmentsInstance + """ + if self._context is None: + self._context = OperatorAttachmentsContext( + self._version, + service_sid=self._solution["service_sid"], + ) + return self._context + + def fetch(self) -> "OperatorAttachmentsInstance": + """ + Fetch the OperatorAttachmentsInstance + + + :returns: The fetched OperatorAttachmentsInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "OperatorAttachmentsInstance": + """ + Asynchronous coroutine to fetch the OperatorAttachmentsInstance + + + :returns: The fetched OperatorAttachmentsInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class OperatorAttachmentsContext(InstanceContext): + + def __init__(self, version: Version, service_sid: str): + """ + Initialize the OperatorAttachmentsContext + + :param version: Version that contains the resource + :param service_sid: The unique SID identifier of the Service. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "service_sid": service_sid, + } + self._uri = "/Services/{service_sid}/Operators".format(**self._solution) + + def fetch(self) -> OperatorAttachmentsInstance: + """ + Fetch the OperatorAttachmentsInstance + + + :returns: The fetched OperatorAttachmentsInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return OperatorAttachmentsInstance( + self._version, + payload, + service_sid=self._solution["service_sid"], + ) + + async def fetch_async(self) -> OperatorAttachmentsInstance: + """ + Asynchronous coroutine to fetch the OperatorAttachmentsInstance + + + :returns: The fetched OperatorAttachmentsInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return OperatorAttachmentsInstance( + self._version, + payload, + service_sid=self._solution["service_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class OperatorAttachmentsList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the OperatorAttachmentsList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, service_sid: str) -> OperatorAttachmentsContext: + """ + Constructs a OperatorAttachmentsContext + + :param service_sid: The unique SID identifier of the Service. + """ + return OperatorAttachmentsContext(self._version, service_sid=service_sid) + + def __call__(self, service_sid: str) -> OperatorAttachmentsContext: + """ + Constructs a OperatorAttachmentsContext + + :param service_sid: The unique SID identifier of the Service. + """ + return OperatorAttachmentsContext(self._version, service_sid=service_sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/intelligence/v2/operator_type.py b/twilio/rest/intelligence/v2/operator_type.py new file mode 100644 index 0000000000..9884df0aee --- /dev/null +++ b/twilio/rest/intelligence/v2/operator_type.py @@ -0,0 +1,443 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Intelligence + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class OperatorTypeInstance(InstanceResource): + + class Availability(object): + INTERNAL = "internal" + BETA = "beta" + PUBLIC = "public" + RETIRED = "retired" + + class OutputType(object): + TEXT_CLASSIFICATION = "text-classification" + TEXT_EXTRACTION = "text-extraction" + TEXT_EXTRACTION_NORMALIZED = "text-extraction-normalized" + TEXT_GENERATION = "text-generation" + + class Provider(object): + TWILIO = "twilio" + AMAZON = "amazon" + OPENAI = "openai" + + """ + :ivar name: A unique name that references an Operator's Operator Type. + :ivar sid: A 34 character string that uniquely identifies this Operator Type. + :ivar friendly_name: A human-readable name of this resource, up to 64 characters. + :ivar description: A human-readable description of this resource, longer than the friendly name. + :ivar docs_link: Additional documentation for the Operator Type. + :ivar output_type: + :ivar supported_languages: List of languages this Operator Type supports. + :ivar provider: + :ivar availability: + :ivar configurable: Operators can be created from configurable Operator Types. + :ivar config_schema: JSON Schema for configuring an Operator with this Operator Type. Following https://json-schema.org/ + :ivar date_created: The date that this Operator Type was created, given in ISO 8601 format. + :ivar date_updated: The date that this Operator Type was updated, given in ISO 8601 format. + :ivar url: The URL of this resource. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.name: Optional[str] = payload.get("name") + self.sid: Optional[str] = payload.get("sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.description: Optional[str] = payload.get("description") + self.docs_link: Optional[str] = payload.get("docs_link") + self.output_type: Optional["OperatorTypeInstance.OutputType"] = payload.get( + "output_type" + ) + self.supported_languages: Optional[List[str]] = payload.get( + "supported_languages" + ) + self.provider: Optional["OperatorTypeInstance.Provider"] = payload.get( + "provider" + ) + self.availability: Optional["OperatorTypeInstance.Availability"] = payload.get( + "availability" + ) + self.configurable: Optional[bool] = payload.get("configurable") + self.config_schema: Optional[Dict[str, object]] = payload.get("config_schema") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[OperatorTypeContext] = None + + @property + def _proxy(self) -> "OperatorTypeContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: OperatorTypeContext for this OperatorTypeInstance + """ + if self._context is None: + self._context = OperatorTypeContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def fetch(self) -> "OperatorTypeInstance": + """ + Fetch the OperatorTypeInstance + + + :returns: The fetched OperatorTypeInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "OperatorTypeInstance": + """ + Asynchronous coroutine to fetch the OperatorTypeInstance + + + :returns: The fetched OperatorTypeInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class OperatorTypeContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the OperatorTypeContext + + :param version: Version that contains the resource + :param sid: A 34 character string that uniquely identifies this Operator Type. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/OperatorTypes/{sid}".format(**self._solution) + + def fetch(self) -> OperatorTypeInstance: + """ + Fetch the OperatorTypeInstance + + + :returns: The fetched OperatorTypeInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return OperatorTypeInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> OperatorTypeInstance: + """ + Asynchronous coroutine to fetch the OperatorTypeInstance + + + :returns: The fetched OperatorTypeInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return OperatorTypeInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class OperatorTypePage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> OperatorTypeInstance: + """ + Build an instance of OperatorTypeInstance + + :param payload: Payload response from the API + """ + return OperatorTypeInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class OperatorTypeList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the OperatorTypeList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/OperatorTypes" + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[OperatorTypeInstance]: + """ + Streams OperatorTypeInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[OperatorTypeInstance]: + """ + Asynchronously streams OperatorTypeInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[OperatorTypeInstance]: + """ + Lists OperatorTypeInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[OperatorTypeInstance]: + """ + Asynchronously lists OperatorTypeInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> OperatorTypePage: + """ + Retrieve a single page of OperatorTypeInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of OperatorTypeInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return OperatorTypePage(self._version, response) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> OperatorTypePage: + """ + Asynchronously retrieve a single page of OperatorTypeInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of OperatorTypeInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return OperatorTypePage(self._version, response) + + def get_page(self, target_url: str) -> OperatorTypePage: + """ + Retrieve a specific page of OperatorTypeInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of OperatorTypeInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return OperatorTypePage(self._version, response) + + async def get_page_async(self, target_url: str) -> OperatorTypePage: + """ + Asynchronously retrieve a specific page of OperatorTypeInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of OperatorTypeInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return OperatorTypePage(self._version, response) + + def get(self, sid: str) -> OperatorTypeContext: + """ + Constructs a OperatorTypeContext + + :param sid: A 34 character string that uniquely identifies this Operator Type. + """ + return OperatorTypeContext(self._version, sid=sid) + + def __call__(self, sid: str) -> OperatorTypeContext: + """ + Constructs a OperatorTypeContext + + :param sid: A 34 character string that uniquely identifies this Operator Type. + """ + return OperatorTypeContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/intelligence/v2/prebuilt_operator.py b/twilio/rest/intelligence/v2/prebuilt_operator.py new file mode 100644 index 0000000000..e00ceecac5 --- /dev/null +++ b/twilio/rest/intelligence/v2/prebuilt_operator.py @@ -0,0 +1,474 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Intelligence + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class PrebuiltOperatorInstance(InstanceResource): + + class Availability(object): + INTERNAL = "internal" + BETA = "beta" + PUBLIC = "public" + RETIRED = "retired" + + """ + :ivar account_sid: The unique SID identifier of the Account the Pre-built Operator belongs to. + :ivar sid: A 34 character string that uniquely identifies this Pre-built Operator. + :ivar friendly_name: A human-readable name of this resource, up to 64 characters. + :ivar description: A human-readable description of this resource, longer than the friendly name. + :ivar author: The creator of the Operator. Pre-built Operators can only be created by Twilio. + :ivar operator_type: Operator Type for this Operator. References an existing Operator Type resource. + :ivar version: Numeric Operator version. Incremented with each update on the resource, used to ensure integrity when updating the Operator. + :ivar availability: + :ivar config: Operator configuration, following the schema defined by the Operator Type. Only available on Custom Operators created by the Account, will be empty for Pre-Built Operators. + :ivar date_created: The date that this Pre-built Operator was created, given in ISO 8601 format. + :ivar date_updated: The date that this Pre-built Operator was updated, given in ISO 8601 format. + :ivar url: The URL of this resource. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.sid: Optional[str] = payload.get("sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.description: Optional[str] = payload.get("description") + self.author: Optional[str] = payload.get("author") + self.operator_type: Optional[str] = payload.get("operator_type") + self.version: Optional[int] = deserialize.integer(payload.get("version")) + self.availability: Optional["PrebuiltOperatorInstance.Availability"] = ( + payload.get("availability") + ) + self.config: Optional[Dict[str, object]] = payload.get("config") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[PrebuiltOperatorContext] = None + + @property + def _proxy(self) -> "PrebuiltOperatorContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PrebuiltOperatorContext for this PrebuiltOperatorInstance + """ + if self._context is None: + self._context = PrebuiltOperatorContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def fetch(self) -> "PrebuiltOperatorInstance": + """ + Fetch the PrebuiltOperatorInstance + + + :returns: The fetched PrebuiltOperatorInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "PrebuiltOperatorInstance": + """ + Asynchronous coroutine to fetch the PrebuiltOperatorInstance + + + :returns: The fetched PrebuiltOperatorInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PrebuiltOperatorContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the PrebuiltOperatorContext + + :param version: Version that contains the resource + :param sid: A 34 character string that uniquely identifies this Pre-built Operator. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/Operators/PreBuilt/{sid}".format(**self._solution) + + def fetch(self) -> PrebuiltOperatorInstance: + """ + Fetch the PrebuiltOperatorInstance + + + :returns: The fetched PrebuiltOperatorInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return PrebuiltOperatorInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> PrebuiltOperatorInstance: + """ + Asynchronous coroutine to fetch the PrebuiltOperatorInstance + + + :returns: The fetched PrebuiltOperatorInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return PrebuiltOperatorInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class PrebuiltOperatorPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> PrebuiltOperatorInstance: + """ + Build an instance of PrebuiltOperatorInstance + + :param payload: Payload response from the API + """ + return PrebuiltOperatorInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class PrebuiltOperatorList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PrebuiltOperatorList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Operators/PreBuilt" + + def stream( + self, + availability: Union[ + "PrebuiltOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[PrebuiltOperatorInstance]: + """ + Streams PrebuiltOperatorInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param "PrebuiltOperatorInstance.Availability" availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Pre-built Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page( + availability=availability, + language_code=language_code, + page_size=limits["page_size"], + ) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + availability: Union[ + "PrebuiltOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[PrebuiltOperatorInstance]: + """ + Asynchronously streams PrebuiltOperatorInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param "PrebuiltOperatorInstance.Availability" availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Pre-built Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + availability=availability, + language_code=language_code, + page_size=limits["page_size"], + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + availability: Union[ + "PrebuiltOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PrebuiltOperatorInstance]: + """ + Lists PrebuiltOperatorInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param "PrebuiltOperatorInstance.Availability" availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Pre-built Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + availability=availability, + language_code=language_code, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + availability: Union[ + "PrebuiltOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PrebuiltOperatorInstance]: + """ + Asynchronously lists PrebuiltOperatorInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param "PrebuiltOperatorInstance.Availability" availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param str language_code: Returns Pre-built Operators that support the provided language code. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + availability=availability, + language_code=language_code, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + availability: Union[ + "PrebuiltOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PrebuiltOperatorPage: + """ + Retrieve a single page of PrebuiltOperatorInstance records from the API. + Request is executed immediately + + :param availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param language_code: Returns Pre-built Operators that support the provided language code. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PrebuiltOperatorInstance + """ + data = values.of( + { + "Availability": availability, + "LanguageCode": language_code, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return PrebuiltOperatorPage(self._version, response) + + async def page_async( + self, + availability: Union[ + "PrebuiltOperatorInstance.Availability", object + ] = values.unset, + language_code: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PrebuiltOperatorPage: + """ + Asynchronously retrieve a single page of PrebuiltOperatorInstance records from the API. + Request is executed immediately + + :param availability: Returns Pre-built Operators with the provided availability type. Possible values: internal, beta, public, retired. + :param language_code: Returns Pre-built Operators that support the provided language code. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PrebuiltOperatorInstance + """ + data = values.of( + { + "Availability": availability, + "LanguageCode": language_code, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return PrebuiltOperatorPage(self._version, response) + + def get_page(self, target_url: str) -> PrebuiltOperatorPage: + """ + Retrieve a specific page of PrebuiltOperatorInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PrebuiltOperatorInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return PrebuiltOperatorPage(self._version, response) + + async def get_page_async(self, target_url: str) -> PrebuiltOperatorPage: + """ + Asynchronously retrieve a specific page of PrebuiltOperatorInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PrebuiltOperatorInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return PrebuiltOperatorPage(self._version, response) + + def get(self, sid: str) -> PrebuiltOperatorContext: + """ + Constructs a PrebuiltOperatorContext + + :param sid: A 34 character string that uniquely identifies this Pre-built Operator. + """ + return PrebuiltOperatorContext(self._version, sid=sid) + + def __call__(self, sid: str) -> PrebuiltOperatorContext: + """ + Constructs a PrebuiltOperatorContext + + :param sid: A 34 character string that uniquely identifies this Pre-built Operator. + """ + return PrebuiltOperatorContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/intelligence/v2/service.py b/twilio/rest/intelligence/v2/service.py index d983be5b2e..7ded7b9b77 100644 --- a/twilio/rest/intelligence/v2/service.py +++ b/twilio/rest/intelligence/v2/service.py @@ -38,12 +38,13 @@ class HttpMethod(object): :ivar date_created: The date that this Service was created, given in ISO 8601 format. :ivar date_updated: The date that this Service was updated, given in ISO 8601 format. :ivar friendly_name: A human readable description of this resource, up to 64 characters. - :ivar language_code: The default language code of the audio. + :ivar language_code: The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it's set. :ivar sid: A 34 character string that uniquely identifies this Service. :ivar unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :ivar url: The URL of this resource. :ivar webhook_url: The URL Twilio will request when executing the Webhook. :ivar webhook_http_method: + :ivar read_only_attached_operator_sids: Operator sids attached to this service, read only :ivar version: The version number of this Service. """ @@ -72,6 +73,9 @@ def __init__( self.webhook_http_method: Optional["ServiceInstance.HttpMethod"] = payload.get( "webhook_http_method" ) + self.read_only_attached_operator_sids: Optional[List[str]] = payload.get( + "read_only_attached_operator_sids" + ) self.version: Optional[int] = deserialize.integer(payload.get("version")) self._solution = { @@ -136,7 +140,6 @@ def update( auto_transcribe: Union[bool, object] = values.unset, data_logging: Union[bool, object] = values.unset, friendly_name: Union[str, object] = values.unset, - language_code: Union[str, object] = values.unset, unique_name: Union[str, object] = values.unset, auto_redaction: Union[bool, object] = values.unset, media_redaction: Union[bool, object] = values.unset, @@ -150,7 +153,6 @@ def update( :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. - :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. :param media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. @@ -164,7 +166,6 @@ def update( auto_transcribe=auto_transcribe, data_logging=data_logging, friendly_name=friendly_name, - language_code=language_code, unique_name=unique_name, auto_redaction=auto_redaction, media_redaction=media_redaction, @@ -178,7 +179,6 @@ async def update_async( auto_transcribe: Union[bool, object] = values.unset, data_logging: Union[bool, object] = values.unset, friendly_name: Union[str, object] = values.unset, - language_code: Union[str, object] = values.unset, unique_name: Union[str, object] = values.unset, auto_redaction: Union[bool, object] = values.unset, media_redaction: Union[bool, object] = values.unset, @@ -192,7 +192,6 @@ async def update_async( :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. - :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. :param media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. @@ -206,7 +205,6 @@ async def update_async( auto_transcribe=auto_transcribe, data_logging=data_logging, friendly_name=friendly_name, - language_code=language_code, unique_name=unique_name, auto_redaction=auto_redaction, media_redaction=media_redaction, @@ -309,7 +307,6 @@ def update( auto_transcribe: Union[bool, object] = values.unset, data_logging: Union[bool, object] = values.unset, friendly_name: Union[str, object] = values.unset, - language_code: Union[str, object] = values.unset, unique_name: Union[str, object] = values.unset, auto_redaction: Union[bool, object] = values.unset, media_redaction: Union[bool, object] = values.unset, @@ -323,7 +320,6 @@ def update( :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. - :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. :param media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. @@ -337,7 +333,6 @@ def update( "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), "DataLogging": serialize.boolean_to_string(data_logging), "FriendlyName": friendly_name, - "LanguageCode": language_code, "UniqueName": unique_name, "AutoRedaction": serialize.boolean_to_string(auto_redaction), "MediaRedaction": serialize.boolean_to_string(media_redaction), @@ -363,7 +358,6 @@ async def update_async( auto_transcribe: Union[bool, object] = values.unset, data_logging: Union[bool, object] = values.unset, friendly_name: Union[str, object] = values.unset, - language_code: Union[str, object] = values.unset, unique_name: Union[str, object] = values.unset, auto_redaction: Union[bool, object] = values.unset, media_redaction: Union[bool, object] = values.unset, @@ -377,7 +371,6 @@ async def update_async( :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. - :param language_code: The default language code of the audio. :param unique_name: Provides a unique and addressable name to be assigned to this Service, assigned by the developer, to be optionally used in addition to SID. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. :param media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. @@ -391,7 +384,6 @@ async def update_async( "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), "DataLogging": serialize.boolean_to_string(data_logging), "FriendlyName": friendly_name, - "LanguageCode": language_code, "UniqueName": unique_name, "AutoRedaction": serialize.boolean_to_string(auto_redaction), "MediaRedaction": serialize.boolean_to_string(media_redaction), @@ -472,7 +464,7 @@ def create( :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. - :param language_code: The default language code of the audio. + :param language_code: The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it's set. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. :param media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. :param webhook_url: The URL Twilio will request when executing the Webhook. @@ -522,7 +514,7 @@ async def create_async( :param auto_transcribe: Instructs the Speech Recognition service to automatically transcribe all recordings made on the account. :param data_logging: Data logging allows Twilio to improve the quality of the speech recognition & language understanding services through using customer data to refine, fine tune and evaluate machine learning models. Note: Data logging cannot be activated via API, only via www.twilio.com, as it requires additional consent. :param friendly_name: A human readable description of this resource, up to 64 characters. - :param language_code: The default language code of the audio. + :param language_code: The language code set during Service creation determines the Transcription language for all call recordings processed by that Service. The default is en-US if no language code is set. A Service can only support one language code, and it cannot be updated once it's set. :param auto_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts made on this service. :param media_redaction: Instructs the Speech Recognition service to automatically redact PII from all transcripts media made on this service. The auto_redaction flag must be enabled, results in error otherwise. :param webhook_url: The URL Twilio will request when executing the Webhook. diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index f7351843b6..75c798f4c4 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -61,7 +61,6 @@ class ScanMessageContent(object): :ivar usecase: A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. :ivar us_app_to_person_registered: Whether US A2P campaign is registered for this Service. :ivar use_inbound_webhook_on_number: A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. - :ivar sending_windows: A list of Sending Windows, which indicate defined time ranges in which a message can be sent, in the UTC time zone. Each window is defined by two strings, labeled \"start_time\" and \"end_time\". """ def __init__( @@ -108,9 +107,6 @@ def __init__( self.use_inbound_webhook_on_number: Optional[bool] = payload.get( "use_inbound_webhook_on_number" ) - self.sending_windows: Optional[Dict[str, object]] = payload.get( - "sending_windows" - ) self._solution = { "sid": sid or self.sid, diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 0bacabb722..7466d170dd 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -17,13 +17,20 @@ from twilio.base.domain import Domain from twilio.rest.numbers.v1.bulk_eligibility import BulkEligibilityList from twilio.rest.numbers.v1.eligibility import EligibilityList -from twilio.rest.numbers.v1.porting_bulk_portability import PortingBulkPortabilityList from twilio.rest.numbers.v1.porting_port_in import PortingPortInList -from twilio.rest.numbers.v1.porting_port_in_fetch import PortingPortInFetchList from twilio.rest.numbers.v1.porting_port_in_phone_number import ( PortingPortInPhoneNumberList, ) from twilio.rest.numbers.v1.porting_portability import PortingPortabilityList +from twilio.rest.numbers.v1.porting_webhook_configuration import ( + PortingWebhookConfigurationList, +) +from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( + PortingWebhookConfigurationDeleteList, +) +from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( + PortingWebhookConfigurationFetchList, +) class V1(Version): @@ -37,13 +44,20 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._bulk_eligibilities: Optional[BulkEligibilityList] = None self._eligibilities: Optional[EligibilityList] = None - self._porting_bulk_portabilities: Optional[PortingBulkPortabilityList] = None self._porting_port_ins: Optional[PortingPortInList] = None - self._porting_port_ins_fetch: Optional[PortingPortInFetchList] = None self._porting_port_in_phone_number: Optional[PortingPortInPhoneNumberList] = ( None ) self._porting_portabilities: Optional[PortingPortabilityList] = None + self._porting_webhook_configurations: Optional[ + PortingWebhookConfigurationList + ] = None + self._porting_webhook_configurations_delete: Optional[ + PortingWebhookConfigurationDeleteList + ] = None + self._porting_webhook_configuration_fetch: Optional[ + PortingWebhookConfigurationFetchList + ] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -57,24 +71,12 @@ def eligibilities(self) -> EligibilityList: self._eligibilities = EligibilityList(self) return self._eligibilities - @property - def porting_bulk_portabilities(self) -> PortingBulkPortabilityList: - if self._porting_bulk_portabilities is None: - self._porting_bulk_portabilities = PortingBulkPortabilityList(self) - return self._porting_bulk_portabilities - @property def porting_port_ins(self) -> PortingPortInList: if self._porting_port_ins is None: self._porting_port_ins = PortingPortInList(self) return self._porting_port_ins - @property - def porting_port_ins_fetch(self) -> PortingPortInFetchList: - if self._porting_port_ins_fetch is None: - self._porting_port_ins_fetch = PortingPortInFetchList(self) - return self._porting_port_ins_fetch - @property def porting_port_in_phone_number(self) -> PortingPortInPhoneNumberList: if self._porting_port_in_phone_number is None: @@ -87,6 +89,32 @@ def porting_portabilities(self) -> PortingPortabilityList: self._porting_portabilities = PortingPortabilityList(self) return self._porting_portabilities + @property + def porting_webhook_configurations(self) -> PortingWebhookConfigurationList: + if self._porting_webhook_configurations is None: + self._porting_webhook_configurations = PortingWebhookConfigurationList(self) + return self._porting_webhook_configurations + + @property + def porting_webhook_configurations_delete( + self, + ) -> PortingWebhookConfigurationDeleteList: + if self._porting_webhook_configurations_delete is None: + self._porting_webhook_configurations_delete = ( + PortingWebhookConfigurationDeleteList(self) + ) + return self._porting_webhook_configurations_delete + + @property + def porting_webhook_configuration_fetch( + self, + ) -> PortingWebhookConfigurationFetchList: + if self._porting_webhook_configuration_fetch is None: + self._porting_webhook_configuration_fetch = ( + PortingWebhookConfigurationFetchList(self) + ) + return self._porting_webhook_configuration_fetch + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/porting_bulk_portability.py b/twilio/rest/numbers/v1/porting_bulk_portability.py deleted file mode 100644 index c3fedcd5bb..0000000000 --- a/twilio/rest/numbers/v1/porting_bulk_portability.py +++ /dev/null @@ -1,252 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Numbers - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class PortingBulkPortabilityInstance(InstanceResource): - - class Status(object): - IN_PROGRESS = "in-progress" - COMPLETED = "completed" - EXPIRED = "expired" - - """ - :ivar sid: A 34 character string that uniquely identifies this Portability check. - :ivar status: - :ivar datetime_created: The date that the Portability check was created, given in ISO 8601 format. - :ivar phone_numbers: Contains a list with all the information of the requested phone numbers. Each phone number contains the following properties: `phone_number`: The phone number which portability is to be checked. `portable`: Boolean flag specifying if phone number is portable or not. `not_portable_reason`: Reason why the phone number cannot be ported into Twilio, `null` otherwise. `not_portable_reason_code`: The Portability Reason Code for the phone number if it cannot be ported in Twilio, `null` otherwise. `pin_and_account_number_required`: Boolean flag specifying if PIN and account number is required for the phone number. `number_type`: The type of the requested phone number. `country` Country the phone number belongs to. `messaging_carrier` Current messaging carrier of the phone number. `voice_carrier` Current voice carrier of the phone number. - :ivar url: This is the url of the request that you're trying to reach out to locate the resource. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.status: Optional["PortingBulkPortabilityInstance.Status"] = payload.get( - "status" - ) - self.datetime_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("datetime_created") - ) - self.phone_numbers: Optional[List[Dict[str, object]]] = payload.get( - "phone_numbers" - ) - self.url: Optional[str] = payload.get("url") - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[PortingBulkPortabilityContext] = None - - @property - def _proxy(self) -> "PortingBulkPortabilityContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: PortingBulkPortabilityContext for this PortingBulkPortabilityInstance - """ - if self._context is None: - self._context = PortingBulkPortabilityContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def fetch(self) -> "PortingBulkPortabilityInstance": - """ - Fetch the PortingBulkPortabilityInstance - - - :returns: The fetched PortingBulkPortabilityInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "PortingBulkPortabilityInstance": - """ - Asynchronous coroutine to fetch the PortingBulkPortabilityInstance - - - :returns: The fetched PortingBulkPortabilityInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class PortingBulkPortabilityContext(InstanceContext): - - def __init__(self, version: Version, sid: str): - """ - Initialize the PortingBulkPortabilityContext - - :param version: Version that contains the resource - :param sid: A 34 character string that uniquely identifies the Portability check. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/Porting/Portability/{sid}".format(**self._solution) - - def fetch(self) -> PortingBulkPortabilityInstance: - """ - Fetch the PortingBulkPortabilityInstance - - - :returns: The fetched PortingBulkPortabilityInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return PortingBulkPortabilityInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> PortingBulkPortabilityInstance: - """ - Asynchronous coroutine to fetch the PortingBulkPortabilityInstance - - - :returns: The fetched PortingBulkPortabilityInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return PortingBulkPortabilityInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class PortingBulkPortabilityList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the PortingBulkPortabilityList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Porting/Portability" - - def create(self, phone_numbers: List[str]) -> PortingBulkPortabilityInstance: - """ - Create the PortingBulkPortabilityInstance - - :param phone_numbers: The phone numbers which portability is to be checked. This should be a list of strings. Phone numbers are in E.164 format (e.g. +16175551212). . - - :returns: The created PortingBulkPortabilityInstance - """ - - data = values.of( - { - "PhoneNumbers": serialize.map(phone_numbers, lambda e: e), - } - ) - - payload = self._version.create( - method="POST", - uri=self._uri, - data=data, - ) - - return PortingBulkPortabilityInstance(self._version, payload) - - async def create_async( - self, phone_numbers: List[str] - ) -> PortingBulkPortabilityInstance: - """ - Asynchronously create the PortingBulkPortabilityInstance - - :param phone_numbers: The phone numbers which portability is to be checked. This should be a list of strings. Phone numbers are in E.164 format (e.g. +16175551212). . - - :returns: The created PortingBulkPortabilityInstance - """ - - data = values.of( - { - "PhoneNumbers": serialize.map(phone_numbers, lambda e: e), - } - ) - - payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, - ) - - return PortingBulkPortabilityInstance(self._version, payload) - - def get(self, sid: str) -> PortingBulkPortabilityContext: - """ - Constructs a PortingBulkPortabilityContext - - :param sid: A 34 character string that uniquely identifies the Portability check. - """ - return PortingBulkPortabilityContext(self._version, sid=sid) - - def __call__(self, sid: str) -> PortingBulkPortabilityContext: - """ - Constructs a PortingBulkPortabilityContext - - :param sid: A 34 character string that uniquely identifies the Portability check. - """ - return PortingBulkPortabilityContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index 862f578bff..e9988a7d6b 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -12,8 +12,9 @@ Do not edit the class manually. """ -from typing import Any, Dict, Optional, Union -from twilio.base import values +from datetime import date +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -23,7 +24,16 @@ class PortingPortInInstance(InstanceResource): """ :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - :ivar url: + :ivar url: The URL of this Port In request + :ivar account_sid: The Account SID that the numbers will be added to after they are ported into Twilio. + :ivar notification_emails: List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. + :ivar target_port_in_date: Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. + :ivar target_port_in_time_range_start: Minimum hour in the future needs to be established with the Ops team for validation. + :ivar target_port_in_time_range_end: Maximum hour in the future needs to be established with the Ops team for validation. + :ivar port_in_request_status: The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled. + :ivar losing_carrier_information: The information for the losing carrier. + :ivar phone_numbers: The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). + :ivar documents: The list of documents SID referencing a utility bills """ def __init__( @@ -36,6 +46,29 @@ def __init__( self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") self.url: Optional[str] = payload.get("url") + self.account_sid: Optional[str] = payload.get("account_sid") + self.notification_emails: Optional[List[str]] = payload.get( + "notification_emails" + ) + self.target_port_in_date: Optional[date] = deserialize.iso8601_date( + payload.get("target_port_in_date") + ) + self.target_port_in_time_range_start: Optional[str] = payload.get( + "target_port_in_time_range_start" + ) + self.target_port_in_time_range_end: Optional[str] = payload.get( + "target_port_in_time_range_end" + ) + self.port_in_request_status: Optional[str] = payload.get( + "port_in_request_status" + ) + self.losing_carrier_information: Optional[Dict[str, object]] = payload.get( + "losing_carrier_information" + ) + self.phone_numbers: Optional[List[Dict[str, object]]] = payload.get( + "phone_numbers" + ) + self.documents: Optional[List[str]] = payload.get("documents") self._solution = { "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, @@ -75,6 +108,24 @@ async def delete_async(self) -> bool: """ return await self._proxy.delete_async() + def fetch(self) -> "PortingPortInInstance": + """ + Fetch the PortingPortInInstance + + + :returns: The fetched PortingPortInInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "PortingPortInInstance": + """ + Asynchronous coroutine to fetch the PortingPortInInstance + + + :returns: The fetched PortingPortInInstance + """ + return await self._proxy.fetch_async() + def __repr__(self) -> str: """ Provide a friendly representation @@ -126,6 +177,44 @@ async def delete_async(self) -> bool: uri=self._uri, ) + def fetch(self) -> PortingPortInInstance: + """ + Fetch the PortingPortInInstance + + + :returns: The fetched PortingPortInInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return PortingPortInInstance( + self._version, + payload, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + + async def fetch_async(self) -> PortingPortInInstance: + """ + Asynchronous coroutine to fetch the PortingPortInInstance + + + :returns: The fetched PortingPortInInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return PortingPortInInstance( + self._version, + payload, + port_in_request_sid=self._solution["port_in_request_sid"], + ) + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/porting_port_in_fetch.py b/twilio/rest/numbers/v1/porting_port_in_fetch.py deleted file mode 100644 index dc0b79c252..0000000000 --- a/twilio/rest/numbers/v1/porting_port_in_fetch.py +++ /dev/null @@ -1,223 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Numbers - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import date -from typing import Any, Dict, List, Optional -from twilio.base import deserialize -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class PortingPortInFetchInstance(InstanceResource): - """ - :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - :ivar url: The URL of this Port In request - :ivar account_sid: The Account SID that the numbers will be added to after they are ported into Twilio. - :ivar notification_emails: List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. - :ivar target_port_in_date: Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. - :ivar target_port_in_time_range_start: Minimum hour in the future needs to be established with the Ops team for validation. - :ivar target_port_in_time_range_end: Maximum hour in the future needs to be established with the Ops team for validation. - :ivar port_in_request_status: The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled. - :ivar losing_carrier_information: The information for the losing carrier. - :ivar phone_numbers: The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). - :ivar documents: The list of documents SID referencing a utility bills - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - port_in_request_sid: Optional[str] = None, - ): - super().__init__(version) - - self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") - self.url: Optional[str] = payload.get("url") - self.account_sid: Optional[str] = payload.get("account_sid") - self.notification_emails: Optional[List[str]] = payload.get( - "notification_emails" - ) - self.target_port_in_date: Optional[date] = deserialize.iso8601_date( - payload.get("target_port_in_date") - ) - self.target_port_in_time_range_start: Optional[str] = payload.get( - "target_port_in_time_range_start" - ) - self.target_port_in_time_range_end: Optional[str] = payload.get( - "target_port_in_time_range_end" - ) - self.port_in_request_status: Optional[str] = payload.get( - "port_in_request_status" - ) - self.losing_carrier_information: Optional[Dict[str, object]] = payload.get( - "losing_carrier_information" - ) - self.phone_numbers: Optional[List[Dict[str, object]]] = payload.get( - "phone_numbers" - ) - self.documents: Optional[List[str]] = payload.get("documents") - - self._solution = { - "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, - } - self._context: Optional[PortingPortInFetchContext] = None - - @property - def _proxy(self) -> "PortingPortInFetchContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: PortingPortInFetchContext for this PortingPortInFetchInstance - """ - if self._context is None: - self._context = PortingPortInFetchContext( - self._version, - port_in_request_sid=self._solution["port_in_request_sid"], - ) - return self._context - - def fetch(self) -> "PortingPortInFetchInstance": - """ - Fetch the PortingPortInFetchInstance - - - :returns: The fetched PortingPortInFetchInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "PortingPortInFetchInstance": - """ - Asynchronous coroutine to fetch the PortingPortInFetchInstance - - - :returns: The fetched PortingPortInFetchInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class PortingPortInFetchContext(InstanceContext): - - def __init__(self, version: Version, port_in_request_sid: str): - """ - Initialize the PortingPortInFetchContext - - :param version: Version that contains the resource - :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "port_in_request_sid": port_in_request_sid, - } - self._uri = "/Porting/PortIn/{port_in_request_sid}".format(**self._solution) - - def fetch(self) -> PortingPortInFetchInstance: - """ - Fetch the PortingPortInFetchInstance - - - :returns: The fetched PortingPortInFetchInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return PortingPortInFetchInstance( - self._version, - payload, - port_in_request_sid=self._solution["port_in_request_sid"], - ) - - async def fetch_async(self) -> PortingPortInFetchInstance: - """ - Asynchronous coroutine to fetch the PortingPortInFetchInstance - - - :returns: The fetched PortingPortInFetchInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return PortingPortInFetchInstance( - self._version, - payload, - port_in_request_sid=self._solution["port_in_request_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class PortingPortInFetchList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the PortingPortInFetchList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - def get(self, port_in_request_sid: str) -> PortingPortInFetchContext: - """ - Constructs a PortingPortInFetchContext - - :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - """ - return PortingPortInFetchContext( - self._version, port_in_request_sid=port_in_request_sid - ) - - def __call__(self, port_in_request_sid: str) -> PortingPortInFetchContext: - """ - Constructs a PortingPortInFetchContext - - :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - """ - return PortingPortInFetchContext( - self._version, port_in_request_sid=port_in_request_sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/numbers/v1/porting_port_in_phone_number.py b/twilio/rest/numbers/v1/porting_port_in_phone_number.py index 41296c6b65..48b90eea4f 100644 --- a/twilio/rest/numbers/v1/porting_port_in_phone_number.py +++ b/twilio/rest/numbers/v1/porting_port_in_phone_number.py @@ -12,12 +12,139 @@ Do not edit the class manually. """ +from datetime import datetime +from typing import Any, Dict, Optional +from twilio.base import deserialize from twilio.base.instance_context import InstanceContext - +from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base.version import Version +class PortingPortInPhoneNumberInstance(InstanceResource): + """ + :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. + :ivar phone_number_sid: The SID of the Port In request phone number. This is a unique identifier of the phone number. + :ivar url: + :ivar account_sid: The SID of the account that the phone number belongs to. + :ivar phone_number_type: The type of the phone number. + :ivar date_created: The date when the phone number was created. + :ivar country: The country of the phone number. + :ivar missing_required_fields: The phone number is missing required fields. + :ivar status_last_time_updated_timestamp: The timestamp when the status was last updated. + :ivar phone_number: The phone number. + :ivar portable: The phone number is portable. + :ivar not_portability_reason: The reason why the phone number is not portable. + :ivar not_portability_reason_code: The code of the reason why the phone number is not portable. + :ivar port_in_phone_number_status: The status of the phone number in the port in request. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + port_in_request_sid: Optional[str] = None, + phone_number_sid: Optional[str] = None, + ): + super().__init__(version) + + self.port_in_request_sid: Optional[str] = payload.get("port_in_request_sid") + self.phone_number_sid: Optional[str] = payload.get("phone_number_sid") + self.url: Optional[str] = payload.get("url") + self.account_sid: Optional[str] = payload.get("account_sid") + self.phone_number_type: Optional[str] = payload.get("phone_number_type") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.country: Optional[str] = payload.get("country") + self.missing_required_fields: Optional[bool] = payload.get( + "missing_required_fields" + ) + self.status_last_time_updated_timestamp: Optional[datetime] = ( + deserialize.iso8601_datetime( + payload.get("status_last_time_updated_timestamp") + ) + ) + self.phone_number: Optional[str] = payload.get("phone_number") + self.portable: Optional[bool] = payload.get("portable") + self.not_portability_reason: Optional[str] = payload.get( + "not_portability_reason" + ) + self.not_portability_reason_code: Optional[str] = payload.get( + "not_portability_reason_code" + ) + self.port_in_phone_number_status: Optional[str] = payload.get( + "port_in_phone_number_status" + ) + + self._solution = { + "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, + "phone_number_sid": phone_number_sid or self.phone_number_sid, + } + self._context: Optional[PortingPortInPhoneNumberContext] = None + + @property + def _proxy(self) -> "PortingPortInPhoneNumberContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: PortingPortInPhoneNumberContext for this PortingPortInPhoneNumberInstance + """ + if self._context is None: + self._context = PortingPortInPhoneNumberContext( + self._version, + port_in_request_sid=self._solution["port_in_request_sid"], + phone_number_sid=self._solution["phone_number_sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the PortingPortInPhoneNumberInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the PortingPortInPhoneNumberInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "PortingPortInPhoneNumberInstance": + """ + Fetch the PortingPortInPhoneNumberInstance + + + :returns: The fetched PortingPortInPhoneNumberInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "PortingPortInPhoneNumberInstance": + """ + Asynchronous coroutine to fetch the PortingPortInPhoneNumberInstance + + + :returns: The fetched PortingPortInPhoneNumberInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + class PortingPortInPhoneNumberContext(InstanceContext): def __init__( @@ -28,7 +155,7 @@ def __init__( :param version: Version that contains the resource :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - :param phone_number_sid: The SID of the Port In request phone number. This is a unique identifier of the phone number. + :param phone_number_sid: The SID of the Phone number. This is a unique identifier of the phone number. """ super().__init__(version) @@ -65,6 +192,46 @@ async def delete_async(self) -> bool: uri=self._uri, ) + def fetch(self) -> PortingPortInPhoneNumberInstance: + """ + Fetch the PortingPortInPhoneNumberInstance + + + :returns: The fetched PortingPortInPhoneNumberInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return PortingPortInPhoneNumberInstance( + self._version, + payload, + port_in_request_sid=self._solution["port_in_request_sid"], + phone_number_sid=self._solution["phone_number_sid"], + ) + + async def fetch_async(self) -> PortingPortInPhoneNumberInstance: + """ + Asynchronous coroutine to fetch the PortingPortInPhoneNumberInstance + + + :returns: The fetched PortingPortInPhoneNumberInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return PortingPortInPhoneNumberInstance( + self._version, + payload, + port_in_request_sid=self._solution["port_in_request_sid"], + phone_number_sid=self._solution["phone_number_sid"], + ) + def __repr__(self) -> str: """ Provide a friendly representation @@ -93,7 +260,7 @@ def get( Constructs a PortingPortInPhoneNumberContext :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - :param phone_number_sid: The SID of the Port In request phone number. This is a unique identifier of the phone number. + :param phone_number_sid: The SID of the Phone number. This is a unique identifier of the phone number. """ return PortingPortInPhoneNumberContext( self._version, @@ -108,7 +275,7 @@ def __call__( Constructs a PortingPortInPhoneNumberContext :param port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - :param phone_number_sid: The SID of the Port In request phone number. This is a unique identifier of the phone number. + :param phone_number_sid: The SID of the Phone number. This is a unique identifier of the phone number. """ return PortingPortInPhoneNumberContext( self._version, diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration.py b/twilio/rest/numbers/v1/porting_webhook_configuration.py new file mode 100644 index 0000000000..d1daabfd7e --- /dev/null +++ b/twilio/rest/numbers/v1/porting_webhook_configuration.py @@ -0,0 +1,108 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional, Union +from twilio.base import values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PortingWebhookConfigurationInstance(InstanceResource): + """ + :ivar url: The URL of the webhook configuration request + :ivar port_in_target_url: Webhook URL to send a request when a port in request or port in phone number event happens + :ivar port_out_target_url: Webhook URL to send a request when a port out phone number event happens + :ivar notifications_of: List of notification events to send a request to the webhook URL + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.url: Optional[str] = payload.get("url") + self.port_in_target_url: Optional[str] = payload.get("port_in_target_url") + self.port_out_target_url: Optional[str] = payload.get("port_out_target_url") + self.notifications_of: Optional[List[str]] = payload.get("notifications_of") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class PortingWebhookConfigurationList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PortingWebhookConfigurationList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Porting/Configuration/Webhook" + + def create( + self, body: Union[object, object] = values.unset + ) -> PortingWebhookConfigurationInstance: + """ + Create the PortingWebhookConfigurationInstance + + :param body: + + :returns: The created PortingWebhookConfigurationInstance + """ + data = body.to_dict() + + headers = {"Content-Type": "application/json"} + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PortingWebhookConfigurationInstance(self._version, payload) + + async def create_async( + self, body: Union[object, object] = values.unset + ) -> PortingWebhookConfigurationInstance: + """ + Asynchronously create the PortingWebhookConfigurationInstance + + :param body: + + :returns: The created PortingWebhookConfigurationInstance + """ + data = body.to_dict() + + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return PortingWebhookConfigurationInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py b/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py new file mode 100644 index 0000000000..beb011128f --- /dev/null +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py @@ -0,0 +1,121 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from twilio.base.instance_context import InstanceContext + +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PortingWebhookConfigurationDeleteContext(InstanceContext): + + def __init__( + self, + version: Version, + webhook_type: "PortingWebhookConfigurationDeleteInstance.WebhookType", + ): + """ + Initialize the PortingWebhookConfigurationDeleteContext + + :param version: Version that contains the resource + :param webhook_type: The of the webhook type of the configuration to be deleted + """ + super().__init__(version) + + # Path Solution + self._solution = { + "webhook_type": webhook_type, + } + self._uri = "/Porting/Configuration/Webhook/{webhook_type}".format( + **self._solution + ) + + def delete(self) -> bool: + """ + Deletes the PortingWebhookConfigurationDeleteInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the PortingWebhookConfigurationDeleteInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class PortingWebhookConfigurationDeleteList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PortingWebhookConfigurationDeleteList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get( + self, webhook_type: "PortingWebhookConfigurationDeleteInstance.WebhookType" + ) -> PortingWebhookConfigurationDeleteContext: + """ + Constructs a PortingWebhookConfigurationDeleteContext + + :param webhook_type: The of the webhook type of the configuration to be deleted + """ + return PortingWebhookConfigurationDeleteContext( + self._version, webhook_type=webhook_type + ) + + def __call__( + self, webhook_type: "PortingWebhookConfigurationDeleteInstance.WebhookType" + ) -> PortingWebhookConfigurationDeleteContext: + """ + Constructs a PortingWebhookConfigurationDeleteContext + + :param webhook_type: The of the webhook type of the configuration to be deleted + """ + return PortingWebhookConfigurationDeleteContext( + self._version, webhook_type=webhook_type + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py new file mode 100644 index 0000000000..46c053b65a --- /dev/null +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -0,0 +1,101 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional +from twilio.base import deserialize + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class PortingWebhookConfigurationFetchInstance(InstanceResource): + """ + :ivar url: The URL of the webhook configuration request + :ivar port_in_target_url: Webhook URL to send a request when a port in request or port in phone number event happens + :ivar port_out_target_url: Webhook URL to send a request when a port out phone number event happens + :ivar notifications_of: List of notification events to send a request to the webhook URL + :ivar port_in_target_date_created: Creation date for the port in webhook configuration + :ivar port_out_target_date_created: Creation date for the port out webhook configuration + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.url: Optional[str] = payload.get("url") + self.port_in_target_url: Optional[str] = payload.get("port_in_target_url") + self.port_out_target_url: Optional[str] = payload.get("port_out_target_url") + self.notifications_of: Optional[List[str]] = payload.get("notifications_of") + self.port_in_target_date_created: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("port_in_target_date_created")) + ) + self.port_out_target_date_created: Optional[datetime] = ( + deserialize.iso8601_datetime(payload.get("port_out_target_date_created")) + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class PortingWebhookConfigurationFetchList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PortingWebhookConfigurationFetchList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Porting/Configuration/Webhook" + + def fetch(self) -> PortingWebhookConfigurationFetchInstance: + """ + Asynchronously fetch the PortingWebhookConfigurationFetchInstance + + + :returns: The fetched PortingWebhookConfigurationFetchInstance + """ + + payload = self._version.fetch(method="GET", uri=self._uri) + + return PortingWebhookConfigurationFetchInstance(self._version, payload) + + async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: + """ + Asynchronously fetch the PortingWebhookConfigurationFetchInstance + + + :returns: The fetched PortingWebhookConfigurationFetchInstance + """ + + payload = await self._version.fetch_async(method="GET", uri=self._uri) + + return PortingWebhookConfigurationFetchInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_messaging/PreviewMessagingBase.py b/twilio/rest/preview_messaging/PreviewMessagingBase.py deleted file mode 100644 index 12b19f4cf1..0000000000 --- a/twilio/rest/preview_messaging/PreviewMessagingBase.py +++ /dev/null @@ -1,44 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional - -from twilio.base.domain import Domain -from twilio.rest import Client -from twilio.rest.preview_messaging.v1 import V1 - - -class PreviewMessagingBase(Domain): - - def __init__(self, twilio: Client): - """ - Initialize the PreviewMessaging Domain - - :returns: Domain for PreviewMessaging - """ - super().__init__(twilio, "https://preview.messaging.twilio.com") - self._v1: Optional[V1] = None - - @property - def v1(self) -> V1: - """ - :returns: Versions v1 of PreviewMessaging - """ - if self._v1 is None: - self._v1 = V1(self) - return self._v1 - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview_messaging/v1/__init__.py b/twilio/rest/preview_messaging/v1/__init__.py deleted file mode 100644 index 424af648e8..0000000000 --- a/twilio/rest/preview_messaging/v1/__init__.py +++ /dev/null @@ -1,51 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Bulk Messaging and Broadcast - Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.preview_messaging.v1.broadcast import BroadcastList -from twilio.rest.preview_messaging.v1.message import MessageList - - -class V1(Version): - - def __init__(self, domain: Domain): - """ - Initialize the V1 version of PreviewMessaging - - :param domain: The Twilio.preview_messaging domain - """ - super().__init__(domain, "v1") - self._broadcasts: Optional[BroadcastList] = None - self._messages: Optional[MessageList] = None - - @property - def broadcasts(self) -> BroadcastList: - if self._broadcasts is None: - self._broadcasts = BroadcastList(self) - return self._broadcasts - - @property - def messages(self) -> MessageList: - if self._messages is None: - self._messages = MessageList(self) - return self._messages - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview_messaging/v1/broadcast.py b/twilio/rest/preview_messaging/v1/broadcast.py deleted file mode 100644 index e41e066bad..0000000000 --- a/twilio/rest/preview_messaging/v1/broadcast.py +++ /dev/null @@ -1,125 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Bulk Messaging and Broadcast - Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, Optional, Union -from twilio.base import deserialize, values - -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class BroadcastInstance(InstanceResource): - """ - :ivar broadcast_sid: Numeric ID indentifying individual Broadcast requests - :ivar created_date: Timestamp of when the Broadcast was created - :ivar updated_date: Timestamp of when the Broadcast was last updated - :ivar broadcast_status: Status of the Broadcast request. Valid values are None, Pending-Upload, Uploaded, Queued, Executing, Execution-Failure, Execution-Completed, Cancelation-Requested, and Canceled - :ivar execution_details: - :ivar results_file: Path to a file detailing successful requests and errors from Broadcast execution - """ - - def __init__(self, version: Version, payload: Dict[str, Any]): - super().__init__(version) - - self.broadcast_sid: Optional[str] = payload.get("broadcast_sid") - self.created_date: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("created_date") - ) - self.updated_date: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("updated_date") - ) - self.broadcast_status: Optional[str] = payload.get("broadcast_status") - self.execution_details: Optional[str] = payload.get("execution_details") - self.results_file: Optional[str] = payload.get("results_file") - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class BroadcastList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the BroadcastList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Broadcasts" - - def create( - self, x_twilio_request_key: Union[str, object] = values.unset - ) -> BroadcastInstance: - """ - Create the BroadcastInstance - - :param x_twilio_request_key: Idempotency key provided by the client - - :returns: The created BroadcastInstance - """ - - data = values.of({}) - headers = values.of( - { - "X-Twilio-Request-Key": x_twilio_request_key, - } - ) - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return BroadcastInstance(self._version, payload) - - async def create_async( - self, x_twilio_request_key: Union[str, object] = values.unset - ) -> BroadcastInstance: - """ - Asynchronously create the BroadcastInstance - - :param x_twilio_request_key: Idempotency key provided by the client - - :returns: The created BroadcastInstance - """ - - data = values.of({}) - headers = values.of( - { - "X-Twilio-Request-Key": x_twilio_request_key, - } - ) - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return BroadcastInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview_messaging/v1/message.py b/twilio/rest/preview_messaging/v1/message.py deleted file mode 100644 index 0d2822e002..0000000000 --- a/twilio/rest/preview_messaging/v1/message.py +++ /dev/null @@ -1,204 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Bulk Messaging and Broadcast - Bulk Sending is a public Twilio REST API for 1:Many Message creation up to 100 recipients. Broadcast is a public Twilio REST API for 1:Many Message creation up to 10,000 recipients via file upload. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, List, Optional -from twilio.base import deserialize - -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class MessageInstance(InstanceResource): - """ - :ivar total_message_count: The number of Messages processed in the request, equal to the sum of success_count and error_count. - :ivar success_count: The number of Messages successfully created. - :ivar error_count: The number of Messages unsuccessfully processed in the request. - :ivar message_receipts: - :ivar failed_message_receipts: - """ - - def __init__(self, version: Version, payload: Dict[str, Any]): - super().__init__(version) - - self.total_message_count: Optional[int] = deserialize.integer( - payload.get("total_message_count") - ) - self.success_count: Optional[int] = deserialize.integer( - payload.get("success_count") - ) - self.error_count: Optional[int] = deserialize.integer( - payload.get("error_count") - ) - self.message_receipts: Optional[List[str]] = payload.get("message_receipts") - self.failed_message_receipts: Optional[List[str]] = payload.get( - "failed_message_receipts" - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class MessageList(ListResource): - - class CreateMessagesRequest(object): - """ - :ivar messages: - :ivar from_: A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. - :ivar messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. - :ivar body: The text of the message you want to send. Can be up to 1,600 characters in length. - :ivar content_sid: The SID of the preconfigured [Content Template](https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template) you want to associate with the Message. Must be used in conjuction with a preconfigured [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) When this parameter is set, Twilio will use your configured content template and the provided `ContentVariables`. This Twilio product is currently in Private Beta. - :ivar media_url: The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. - :ivar status_callback: The URL we should call using the \"status_callback_method\" to send status information to your application. If specified, we POST these message status changes to the URL - queued, failed, sent, delivered, or undelivered. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/messaging/twiml#request-parameters) as well as some additional parameters including \"MessageSid\", \"MessageStatus\", and \"ErrorCode\". If you include this parameter with the \"messaging_service_sid\", we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api). URLs must contain a valid hostname and underscores are not allowed. - :ivar validity_period: How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. - :ivar send_at: The time at which Twilio will send the message. This parameter can be used to schedule a message to be sent at a particular time. Must be in ISO 8601 format. - :ivar schedule_type: This parameter indicates your intent to schedule a message. Pass the value `fixed` to schedule a message at a fixed time. This parameter works in conjuction with the `SendAt` parameter. - :ivar shorten_urls: Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`. - :ivar send_as_mms: If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media. - :ivar max_price: The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds max_price, the message will fail and a status of Failed is sent to the status callback. If MaxPrice is not set, the message cost is not checked. - :ivar attempt: Total number of attempts made ( including this ) to send out the message regardless of the provider used - :ivar smart_encoded: This parameter indicates whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be true or false. - :ivar force_delivery: This parameter allows Twilio to send SMS traffic to carriers without checking/caring whether the destination number is a mobile or a landline. - :ivar application_sid: The SID of the application that should receive message status. We POST a message_sid parameter and a message_status parameter with a value of sent or failed to the application's message_status_callback. If a status_callback parameter is also passed, it will be ignored and the application's message_status_callback parameter will be used. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.messages: Optional[List[MessageList.MessagingV1Message]] = payload.get( - "messages" - ) - self.from_: Optional[str] = payload.get("from_") - self.messaging_service_sid: Optional[str] = payload.get( - "messaging_service_sid" - ) - self.body: Optional[str] = payload.get("body") - self.content_sid: Optional[str] = payload.get("content_sid") - self.media_url: Optional[List[str]] = payload.get("media_url") - self.status_callback: Optional[str] = payload.get("status_callback") - self.validity_period: Optional[int] = payload.get("validity_period") - self.send_at: Optional[str] = payload.get("send_at") - self.schedule_type: Optional[str] = payload.get("schedule_type") - self.shorten_urls: Optional[bool] = payload.get("shorten_urls") - self.send_as_mms: Optional[bool] = payload.get("send_as_mms") - self.max_price: Optional[float] = payload.get("max_price") - self.attempt: Optional[int] = payload.get("attempt") - self.smart_encoded: Optional[bool] = payload.get("smart_encoded") - self.force_delivery: Optional[bool] = payload.get("force_delivery") - self.application_sid: Optional[str] = payload.get("application_sid") - - def to_dict(self): - return { - "messages": [messages.to_dict() for messages in self.messages], - "from": self.from_, - "messaging_service_sid": self.messaging_service_sid, - "body": self.body, - "content_sid": self.content_sid, - "media_url": self.media_url, - "status_callback": self.status_callback, - "validity_period": self.validity_period, - "send_at": self.send_at, - "schedule_type": self.schedule_type, - "shorten_urls": self.shorten_urls, - "send_as_mms": self.send_as_mms, - "max_price": self.max_price, - "attempt": self.attempt, - "smart_encoded": self.smart_encoded, - "force_delivery": self.force_delivery, - "application_sid": self.application_sid, - } - - class MessagingV1Message(object): - """ - :ivar to: The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels. - :ivar body: The text of the message you want to send. Can be up to 1,600 characters in length. Overrides the request-level body and content template if provided. - :ivar content_variables: Key-value pairs of variable names to substitution values. Refer to the [Twilio Content API Resources](https://www.twilio.com/docs/content-api/content-api-resources#send-a-message-with-preconfigured-content) for more details. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.to: Optional[str] = payload.get("to") - self.body: Optional[str] = payload.get("body") - self.content_variables: Optional[dict[str, str]] = payload.get( - "content_variables" - ) - - def to_dict(self): - return { - "to": self.to, - "body": self.body, - "content_variables": self.content_variables, - } - - def __init__(self, version: Version): - """ - Initialize the MessageList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Messages" - - def create(self, create_messages_request: CreateMessagesRequest) -> MessageInstance: - """ - Create the MessageInstance - - :param create_messages_request: - - :returns: The created MessageInstance - """ - data = create_messages_request.to_dict() - - headers = {"Content-Type": "application/json"} - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return MessageInstance(self._version, payload) - - async def create_async( - self, create_messages_request: CreateMessagesRequest - ) -> MessageInstance: - """ - Asynchronously create the MessageInstance - - :param create_messages_request: - - :returns: The created MessageInstance - """ - data = create_messages_request.to_dict() - - headers = {"Content-Type": "application/json"} - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return MessageInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index f5c306b65a..9d35415ae3 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -56,6 +56,8 @@ class Status(object): :ivar url: The absolute URL of the Task resource. :ivar links: The URLs of related resources. :ivar virtual_start_time: The date and time in GMT indicating the ordering for routing of the Task specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar ignore_capacity: A boolean indicating if a new task should respect a worker's capacity during assignment + :ivar routing_target: A SID of a Worker, Queue, or Workflow to route a Task to """ def __init__( @@ -105,6 +107,8 @@ def __init__( self.virtual_start_time: Optional[datetime] = deserialize.iso8601_datetime( payload.get("virtual_start_time") ) + self.ignore_capacity: Optional[bool] = payload.get("ignore_capacity") + self.routing_target: Optional[str] = payload.get("routing_target") self._solution = { "workspace_sid": workspace_sid, @@ -518,6 +522,9 @@ def create( workflow_sid: Union[str, object] = values.unset, attributes: Union[str, object] = values.unset, virtual_start_time: Union[datetime, object] = values.unset, + routing_target: Union[str, object] = values.unset, + ignore_capacity: Union[str, object] = values.unset, + task_queue_sid: Union[str, object] = values.unset, ) -> TaskInstance: """ Create the TaskInstance @@ -528,6 +535,9 @@ def create( :param workflow_sid: The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. :param attributes: A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. :param virtual_start_time: The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. + :param routing_target: A SID of a Worker, Queue, or Workflow to route a Task to + :param ignore_capacity: A boolean indicating if a new task should respect a worker's capacity during assignment + :param task_queue_sid: The SID of the TaskQueue in which the Task belongs :returns: The created TaskInstance """ @@ -540,6 +550,9 @@ def create( "WorkflowSid": workflow_sid, "Attributes": attributes, "VirtualStartTime": serialize.iso8601_datetime(virtual_start_time), + "RoutingTarget": routing_target, + "IgnoreCapacity": ignore_capacity, + "TaskQueueSid": task_queue_sid, } ) @@ -561,6 +574,9 @@ async def create_async( workflow_sid: Union[str, object] = values.unset, attributes: Union[str, object] = values.unset, virtual_start_time: Union[datetime, object] = values.unset, + routing_target: Union[str, object] = values.unset, + ignore_capacity: Union[str, object] = values.unset, + task_queue_sid: Union[str, object] = values.unset, ) -> TaskInstance: """ Asynchronously create the TaskInstance @@ -571,6 +587,9 @@ async def create_async( :param workflow_sid: The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. :param attributes: A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. :param virtual_start_time: The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. + :param routing_target: A SID of a Worker, Queue, or Workflow to route a Task to + :param ignore_capacity: A boolean indicating if a new task should respect a worker's capacity during assignment + :param task_queue_sid: The SID of the TaskQueue in which the Task belongs :returns: The created TaskInstance """ @@ -583,6 +602,9 @@ async def create_async( "WorkflowSid": workflow_sid, "Attributes": attributes, "VirtualStartTime": serialize.iso8601_datetime(virtual_start_time), + "RoutingTarget": routing_target, + "IgnoreCapacity": ignore_capacity, + "TaskQueueSid": task_queue_sid, } ) @@ -605,6 +627,7 @@ def stream( task_queue_sid: Union[str, object] = values.unset, task_queue_name: Union[str, object] = values.unset, evaluate_task_attributes: Union[str, object] = values.unset, + routing_target: Union[str, object] = values.unset, ordering: Union[str, object] = values.unset, has_addons: Union[bool, object] = values.unset, limit: Optional[int] = None, @@ -623,6 +646,7 @@ def stream( :param str task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + :param str routing_target: A SID of a Worker, Queue, or Workflow to route a Task to :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param bool has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param limit: Upper limit for the number of records to return. stream() @@ -643,6 +667,7 @@ def stream( task_queue_sid=task_queue_sid, task_queue_name=task_queue_name, evaluate_task_attributes=evaluate_task_attributes, + routing_target=routing_target, ordering=ordering, has_addons=has_addons, page_size=limits["page_size"], @@ -659,6 +684,7 @@ async def stream_async( task_queue_sid: Union[str, object] = values.unset, task_queue_name: Union[str, object] = values.unset, evaluate_task_attributes: Union[str, object] = values.unset, + routing_target: Union[str, object] = values.unset, ordering: Union[str, object] = values.unset, has_addons: Union[bool, object] = values.unset, limit: Optional[int] = None, @@ -677,6 +703,7 @@ async def stream_async( :param str task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + :param str routing_target: A SID of a Worker, Queue, or Workflow to route a Task to :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param bool has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param limit: Upper limit for the number of records to return. stream() @@ -697,6 +724,7 @@ async def stream_async( task_queue_sid=task_queue_sid, task_queue_name=task_queue_name, evaluate_task_attributes=evaluate_task_attributes, + routing_target=routing_target, ordering=ordering, has_addons=has_addons, page_size=limits["page_size"], @@ -713,6 +741,7 @@ def list( task_queue_sid: Union[str, object] = values.unset, task_queue_name: Union[str, object] = values.unset, evaluate_task_attributes: Union[str, object] = values.unset, + routing_target: Union[str, object] = values.unset, ordering: Union[str, object] = values.unset, has_addons: Union[bool, object] = values.unset, limit: Optional[int] = None, @@ -730,6 +759,7 @@ def list( :param str task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + :param str routing_target: A SID of a Worker, Queue, or Workflow to route a Task to :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param bool has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param limit: Upper limit for the number of records to return. list() guarantees @@ -750,6 +780,7 @@ def list( task_queue_sid=task_queue_sid, task_queue_name=task_queue_name, evaluate_task_attributes=evaluate_task_attributes, + routing_target=routing_target, ordering=ordering, has_addons=has_addons, limit=limit, @@ -766,6 +797,7 @@ async def list_async( task_queue_sid: Union[str, object] = values.unset, task_queue_name: Union[str, object] = values.unset, evaluate_task_attributes: Union[str, object] = values.unset, + routing_target: Union[str, object] = values.unset, ordering: Union[str, object] = values.unset, has_addons: Union[bool, object] = values.unset, limit: Optional[int] = None, @@ -783,6 +815,7 @@ async def list_async( :param str task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param str task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param str evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + :param str routing_target: A SID of a Worker, Queue, or Workflow to route a Task to :param str ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param bool has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param limit: Upper limit for the number of records to return. list() guarantees @@ -804,6 +837,7 @@ async def list_async( task_queue_sid=task_queue_sid, task_queue_name=task_queue_name, evaluate_task_attributes=evaluate_task_attributes, + routing_target=routing_target, ordering=ordering, has_addons=has_addons, limit=limit, @@ -820,6 +854,7 @@ def page( task_queue_sid: Union[str, object] = values.unset, task_queue_name: Union[str, object] = values.unset, evaluate_task_attributes: Union[str, object] = values.unset, + routing_target: Union[str, object] = values.unset, ordering: Union[str, object] = values.unset, has_addons: Union[bool, object] = values.unset, page_token: Union[str, object] = values.unset, @@ -837,6 +872,7 @@ def page( :param task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + :param routing_target: A SID of a Worker, Queue, or Workflow to route a Task to :param ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param page_token: PageToken provided by the API @@ -854,6 +890,7 @@ def page( "TaskQueueSid": task_queue_sid, "TaskQueueName": task_queue_name, "EvaluateTaskAttributes": evaluate_task_attributes, + "RoutingTarget": routing_target, "Ordering": ordering, "HasAddons": serialize.boolean_to_string(has_addons), "PageToken": page_token, @@ -874,6 +911,7 @@ async def page_async( task_queue_sid: Union[str, object] = values.unset, task_queue_name: Union[str, object] = values.unset, evaluate_task_attributes: Union[str, object] = values.unset, + routing_target: Union[str, object] = values.unset, ordering: Union[str, object] = values.unset, has_addons: Union[bool, object] = values.unset, page_token: Union[str, object] = values.unset, @@ -891,6 +929,7 @@ async def page_async( :param task_queue_sid: The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. :param task_queue_name: The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. :param evaluate_task_attributes: The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + :param routing_target: A SID of a Worker, Queue, or Workflow to route a Task to :param ordering: How to order the returned Task resources. By default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `DateCreated`, `Priority`, or `VirtualStartTime` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Pairings of sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. The only ordering pairing not allowed is DateCreated and VirtualStartTime. :param has_addons: Whether to read Tasks with Add-ons. If `true`, returns only Tasks with Add-ons. If `false`, returns only Tasks without Add-ons. :param page_token: PageToken provided by the API @@ -908,6 +947,7 @@ async def page_async( "TaskQueueSid": task_queue_sid, "TaskQueueName": task_queue_name, "EvaluateTaskAttributes": evaluate_task_attributes, + "RoutingTarget": routing_target, "Ordering": ordering, "HasAddons": serialize.boolean_to_string(has_addons), "PageToken": page_token, diff --git a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py index 6c9d5b3d9b..490f68b4e6 100644 --- a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py @@ -92,6 +92,7 @@ def create( business_contact_last_name: Union[str, object] = values.unset, business_contact_email: Union[str, object] = values.unset, business_contact_phone: Union[str, object] = values.unset, + theme_set_id: Union[str, object] = values.unset, ) -> ComplianceTollfreeInquiriesInstance: """ Create the ComplianceTollfreeInquiriesInstance @@ -117,6 +118,7 @@ def create( :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param theme_set_id: Theme id for styling the inquiry form. :returns: The created ComplianceTollfreeInquiriesInstance """ @@ -144,6 +146,7 @@ def create( "BusinessContactLastName": business_contact_last_name, "BusinessContactEmail": business_contact_email, "BusinessContactPhone": business_contact_phone, + "ThemeSetId": theme_set_id, } ) @@ -180,6 +183,7 @@ async def create_async( business_contact_last_name: Union[str, object] = values.unset, business_contact_email: Union[str, object] = values.unset, business_contact_phone: Union[str, object] = values.unset, + theme_set_id: Union[str, object] = values.unset, ) -> ComplianceTollfreeInquiriesInstance: """ Asynchronously create the ComplianceTollfreeInquiriesInstance @@ -205,6 +209,7 @@ async def create_async( :param business_contact_last_name: The last name of the contact for the business or organization using the Tollfree number. :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. + :param theme_set_id: Theme id for styling the inquiry form. :returns: The created ComplianceTollfreeInquiriesInstance """ @@ -232,6 +237,7 @@ async def create_async( "BusinessContactLastName": business_contact_last_name, "BusinessContactEmail": business_contact_email, "BusinessContactPhone": business_contact_phone, + "ThemeSetId": theme_set_id, } ) diff --git a/twilio/rest/trusthub/v1/customer_profiles/__init__.py b/twilio/rest/trusthub/v1/customer_profiles/__init__.py index a16ae0e73b..5365092777 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/__init__.py +++ b/twilio/rest/trusthub/v1/customer_profiles/__init__.py @@ -53,6 +53,7 @@ class Status(object): :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar url: The absolute URL of the Customer-Profile resource. :ivar links: The URLs of the Assigned Items of the Customer-Profile resource. + :ivar errors: The error codes associated with the rejection of the Customer-Profile. """ def __init__( @@ -78,6 +79,7 @@ def __init__( ) self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") + self.errors: Optional[List[Dict[str, object]]] = payload.get("errors") self._solution = { "sid": sid or self.sid, diff --git a/twilio/rest/trusthub/v1/trust_products/__init__.py b/twilio/rest/trusthub/v1/trust_products/__init__.py index b74e8e842e..35f233cc7a 100644 --- a/twilio/rest/trusthub/v1/trust_products/__init__.py +++ b/twilio/rest/trusthub/v1/trust_products/__init__.py @@ -53,6 +53,7 @@ class Status(object): :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar url: The absolute URL of the Trust Product resource. :ivar links: The URLs of the Assigned Items of the Trust Product resource. + :ivar errors: The error codes associated with the rejection of the Trust Product. """ def __init__( @@ -78,6 +79,7 @@ def __init__( ) self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") + self.errors: Optional[List[Dict[str, object]]] = payload.get("errors") self._solution = { "sid": sid or self.sid, diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 7ea0b0ab56..36d7c1058b 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -35,7 +35,7 @@ class ServiceInstance(InstanceResource): """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. - :ivar friendly_name: The string that you assigned to describe the verification service. It can be up to 32 characters long. **This value should not contain PII.** + :ivar friendly_name: The name that appears in the body of your verification messages. It can be up to 30 characters long and can include letters, numbers, spaces, dashes, underscores. Phone numbers, special characters or links are NOT allowed. **This value should not contain PII.** :ivar code_length: The length of the verification code to generate. :ivar lookup_enabled: Whether to perform a lookup with each verification started and return info about the phone number. :ivar psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification. diff --git a/twilio/rest/verify/v2/service/verification.py b/twilio/rest/verify/v2/service/verification.py index 1c42043a3d..3ab719551b 100644 --- a/twilio/rest/verify/v2/service/verification.py +++ b/twilio/rest/verify/v2/service/verification.py @@ -44,7 +44,7 @@ class Status(object): :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Verification resource. :ivar to: The phone number or [email](https://www.twilio.com/docs/verify/email) being verified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :ivar channel: - :ivar status: The status of the verification. One of: `pending`, `approved`, or `canceled` + :ivar status: The status of the verification. Can be: `pending`, `approved`, `canceled`, `max_attempts_reached`, `deleted`, `failed` or `expired`. :ivar valid: Use \"status\" instead. Legacy property indicating whether the verification was successful. :ivar lookup: Information about the phone number being verified. :ivar amount: The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. diff --git a/twilio/rest/verify/v2/service/verification_check.py b/twilio/rest/verify/v2/service/verification_check.py index 9cd92487e4..9744b1bbab 100644 --- a/twilio/rest/verify/v2/service/verification_check.py +++ b/twilio/rest/verify/v2/service/verification_check.py @@ -36,7 +36,7 @@ class Channel(object): :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the VerificationCheck resource. :ivar to: The phone number or [email](https://www.twilio.com/docs/verify/email) being verified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :ivar channel: - :ivar status: The status of the verification. Can be: `pending`, `approved`, or `canceled`. + :ivar status: The status of the verification. Can be: `pending`, `approved`, `canceled`, `max_attempts_reached`, `deleted`, `failed` or `expired`. :ivar valid: Use \"status\" instead. Legacy property indicating whether the verification was successful. :ivar amount: The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. :ivar payee: The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. From 6760ac2b5ffb0a6b54636a3ad3a81a220a6b4c52 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 24 May 2024 11:07:39 +0000 Subject: [PATCH 026/113] Release 9.1.0 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ed82dddb26..6745e08343 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.0.5", + version="9.1.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index a5d6bc795f..f6647e7a8f 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "0", "5") +__version_info__ = ("9", "1", "0") __version__ = ".".join(__version_info__) From f20b62e6e6a5c8138cc848d51f041e65e2e8394d Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 6 Jun 2024 11:41:18 +0000 Subject: [PATCH 027/113] [Librarian] Regenerated @ b8a450aff168b5449d658833256ca2354e3ecbbc df505752cdef00170b029d7b720bbc359933bf82 --- CHANGES.md | 12 + twilio/rest/__init__.py | 15 + .../api/v2010/account/message/__init__.py | 8 +- twilio/rest/content/v1/legacy_content.py | 2 +- twilio/rest/content/v2/content.py | 172 ++++- .../rest/content/v2/content_and_approvals.py | 172 ++++- twilio/rest/marketplace/MarketplaceBase.py | 44 ++ twilio/rest/marketplace/v1/__init__.py | 59 ++ .../v1/available_add_on/__init__.py | 424 +++++++++++ .../available_add_on_extension.py | 431 ++++++++++++ .../v1/installed_add_on/__init__.py | 664 ++++++++++++++++++ .../installed_add_on_extension.py | 511 ++++++++++++++ .../installed_add_on_usage.py | 166 +++++ .../marketplace/v1/module_data_management.py | 325 +++++++++ .../messaging/v1/tollfree_verification.py | 37 + twilio/rest/numbers/v1/__init__.py | 12 + .../v1/signing_request_configuration.py | 116 +++ 17 files changed, 3159 insertions(+), 11 deletions(-) create mode 100644 twilio/rest/marketplace/MarketplaceBase.py create mode 100644 twilio/rest/marketplace/v1/__init__.py create mode 100644 twilio/rest/marketplace/v1/available_add_on/__init__.py create mode 100644 twilio/rest/marketplace/v1/available_add_on/available_add_on_extension.py create mode 100644 twilio/rest/marketplace/v1/installed_add_on/__init__.py create mode 100644 twilio/rest/marketplace/v1/installed_add_on/installed_add_on_extension.py create mode 100644 twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py create mode 100644 twilio/rest/marketplace/v1/module_data_management.py create mode 100644 twilio/rest/numbers/v1/signing_request_configuration.py diff --git a/CHANGES.md b/CHANGES.md index a6c5a45f2d..1dfa5043a6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,18 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-06-06] Version 9.1.1 +-------------------------- +**Api** +- Mark MaxPrice as obsolete + +**Lookups** +- Update examples for `phone_number_quality_score` + +**Messaging** +- List tollfree verifications on parent account and all sub-accounts + + [2024-05-24] Version 9.1.0 -------------------------- **Library - Chore** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 0d3d96bfec..2dc0a4930f 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -27,6 +27,7 @@ from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging from twilio.rest.lookups import Lookups + from twilio.rest.marketplace import Marketplace from twilio.rest.messaging import Messaging from twilio.rest.microvisor import Microvisor from twilio.rest.monitor import Monitor @@ -134,6 +135,7 @@ def __init__( self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None self._lookups: Optional["Lookups"] = None + self._marketplace: Optional["Marketplace"] = None self._messaging: Optional["Messaging"] = None self._microvisor: Optional["Microvisor"] = None self._monitor: Optional["Monitor"] = None @@ -325,6 +327,19 @@ def lookups(self) -> "Lookups": self._lookups = Lookups(self) return self._lookups + @property + def marketplace(self) -> "Marketplace": + """ + Access the Marketplace Twilio Domain + + :returns: Marketplace Twilio Domain + """ + if self._marketplace is None: + from twilio.rest.marketplace import Marketplace + + self._marketplace = Marketplace(self) + return self._marketplace + @property def messaging(self) -> "Messaging": """ diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 953d3d8008..ff0ed8561f 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -509,10 +509,10 @@ def create( :param to: The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`. :param status_callback: The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). :param application_sid: The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. - :param max_price: [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03. + :param max_price: [OBSOLETE] This parameter will no longer have any effect as of 2024-06-03. :param provide_feedback: Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. :param attempt: Total number of attempts made (including this request) to send the message regardless of the provider used - :param validity_period: The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) + :param validity_period: The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) :param force_delivery: Reserved :param content_retention: :param address_retention: @@ -607,10 +607,10 @@ async def create_async( :param to: The recipient's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (for SMS/MMS) or [channel address](https://www.twilio.com/docs/messaging/channels), e.g. `whatsapp:+15552229999`. :param status_callback: The URL of the endpoint to which Twilio sends [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url). URL must contain a valid hostname and underscores are not allowed. If you include this parameter with the `messaging_service_sid`, Twilio uses this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource). :param application_sid: The SID of the associated [TwiML Application](https://www.twilio.com/docs/usage/api/applications). [Message status callback requests](https://www.twilio.com/docs/sms/api/message-resource#twilios-request-to-the-statuscallback-url) are sent to the TwiML App's `message_status_callback` URL. Note that the `status_callback` parameter of a request takes priority over the `application_sid` parameter; if both are included `application_sid` is ignored. - :param max_price: [DEPRECATED] This parameter will no longer have any effect as of 2024-06-03. + :param max_price: [OBSOLETE] This parameter will no longer have any effect as of 2024-06-03. :param provide_feedback: Boolean indicating whether or not you intend to provide delivery confirmation feedback to Twilio (used in conjunction with the [Message Feedback subresource](https://www.twilio.com/docs/sms/api/message-feedback-resource)). Default value is `false`. :param attempt: Total number of attempts made (including this request) to send the message regardless of the provider used - :param validity_period: The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `14400`. Default value is `14400`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) + :param validity_period: The maximum length in seconds that the Message can remain in Twilio's outgoing message queue. If a queued Message exceeds the `validity_period`, the Message is not sent. Accepted values are integers from `1` to `36000`. Default value is `36000`. A `validity_period` greater than `5` is recommended. [Learn more about the validity period](https://www.twilio.com/blog/take-more-control-of-outbound-messages-using-validity-period-html) :param force_delivery: Reserved :param content_retention: :param address_retention: diff --git a/twilio/rest/content/v1/legacy_content.py b/twilio/rest/content/v1/legacy_content.py index cfb4ac698d..5705c33b0b 100644 --- a/twilio/rest/content/v1/legacy_content.py +++ b/twilio/rest/content/v1/legacy_content.py @@ -31,7 +31,7 @@ class LegacyContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar legacy_template_name: The string name of the legacy content template associated with this Content resource, unique across all template names for its account. Only lowercase letters, numbers and underscores are allowed :ivar legacy_body: The string body field of the legacy content template associated with this Content resource :ivar url: The URL of the resource, relative to `https://content.twilio.com`. diff --git a/twilio/rest/content/v2/content.py b/twilio/rest/content/v2/content.py index 88ae80f1c0..c8abf4dcda 100644 --- a/twilio/rest/content/v2/content.py +++ b/twilio/rest/content/v2/content.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -98,6 +98,15 @@ def __init__(self, version: Version): def stream( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[ContentInstance]: @@ -107,6 +116,15 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. + :param str sort_by_date: Whether to sort by ascending or descending date updated + :param str sort_by_content_name: Whether to sort by ascending or descending content name + :param datetime date_created_after: Filter by >=[date-time] + :param datetime date_created_before: Filter by <=[date-time] + :param str content_name: Filter by Regex Pattern in content name + :param str content: Filter by Regex Pattern in template content + :param List[str] language: Filter by array of valid language(s) + :param List[str] content_type: Filter by array of contentType(s) + :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -117,12 +135,32 @@ def stream( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) + page = self.page( + sort_by_date=sort_by_date, + sort_by_content_name=sort_by_content_name, + date_created_after=date_created_after, + date_created_before=date_created_before, + content_name=content_name, + content=content, + language=language, + content_type=content_type, + channel_eligibility=channel_eligibility, + page_size=limits["page_size"], + ) return self._version.stream(page, limits["limit"]) async def stream_async( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[ContentInstance]: @@ -132,6 +170,15 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. + :param str sort_by_date: Whether to sort by ascending or descending date updated + :param str sort_by_content_name: Whether to sort by ascending or descending content name + :param datetime date_created_after: Filter by >=[date-time] + :param datetime date_created_before: Filter by <=[date-time] + :param str content_name: Filter by Regex Pattern in content name + :param str content: Filter by Regex Pattern in template content + :param List[str] language: Filter by array of valid language(s) + :param List[str] content_type: Filter by array of contentType(s) + :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -142,12 +189,32 @@ async def stream_async( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) + page = await self.page_async( + sort_by_date=sort_by_date, + sort_by_content_name=sort_by_content_name, + date_created_after=date_created_after, + date_created_before=date_created_before, + content_name=content_name, + content=content, + language=language, + content_type=content_type, + channel_eligibility=channel_eligibility, + page_size=limits["page_size"], + ) return self._version.stream_async(page, limits["limit"]) def list( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[ContentInstance]: @@ -156,6 +223,15 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param str sort_by_date: Whether to sort by ascending or descending date updated + :param str sort_by_content_name: Whether to sort by ascending or descending content name + :param datetime date_created_after: Filter by >=[date-time] + :param datetime date_created_before: Filter by <=[date-time] + :param str content_name: Filter by Regex Pattern in content name + :param str content: Filter by Regex Pattern in template content + :param List[str] language: Filter by array of valid language(s) + :param List[str] content_type: Filter by array of contentType(s) + :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -167,6 +243,15 @@ def list( """ return list( self.stream( + sort_by_date=sort_by_date, + sort_by_content_name=sort_by_content_name, + date_created_after=date_created_after, + date_created_before=date_created_before, + content_name=content_name, + content=content, + language=language, + content_type=content_type, + channel_eligibility=channel_eligibility, limit=limit, page_size=page_size, ) @@ -174,6 +259,15 @@ def list( async def list_async( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[ContentInstance]: @@ -182,6 +276,15 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param str sort_by_date: Whether to sort by ascending or descending date updated + :param str sort_by_content_name: Whether to sort by ascending or descending content name + :param datetime date_created_after: Filter by >=[date-time] + :param datetime date_created_before: Filter by <=[date-time] + :param str content_name: Filter by Regex Pattern in content name + :param str content: Filter by Regex Pattern in template content + :param List[str] language: Filter by array of valid language(s) + :param List[str] content_type: Filter by array of contentType(s) + :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -194,6 +297,15 @@ async def list_async( return [ record async for record in await self.stream_async( + sort_by_date=sort_by_date, + sort_by_content_name=sort_by_content_name, + date_created_after=date_created_after, + date_created_before=date_created_before, + content_name=content_name, + content=content, + language=language, + content_type=content_type, + channel_eligibility=channel_eligibility, limit=limit, page_size=page_size, ) @@ -201,6 +313,15 @@ async def list_async( def page( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -209,6 +330,15 @@ def page( Retrieve a single page of ContentInstance records from the API. Request is executed immediately + :param sort_by_date: Whether to sort by ascending or descending date updated + :param sort_by_content_name: Whether to sort by ascending or descending content name + :param date_created_after: Filter by >=[date-time] + :param date_created_before: Filter by <=[date-time] + :param content_name: Filter by Regex Pattern in content name + :param content: Filter by Regex Pattern in template content + :param language: Filter by array of valid language(s) + :param content_type: Filter by array of contentType(s) + :param channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -217,6 +347,15 @@ def page( """ data = values.of( { + "SortByDate": sort_by_date, + "SortByContentName": sort_by_content_name, + "DateCreatedAfter": serialize.iso8601_datetime(date_created_after), + "DateCreatedBefore": serialize.iso8601_datetime(date_created_before), + "ContentName": content_name, + "Content": content, + "Language": serialize.map(language, lambda e: e), + "ContentType": serialize.map(content_type, lambda e: e), + "ChannelEligibility": serialize.map(channel_eligibility, lambda e: e), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -228,6 +367,15 @@ def page( async def page_async( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -236,6 +384,15 @@ async def page_async( Asynchronously retrieve a single page of ContentInstance records from the API. Request is executed immediately + :param sort_by_date: Whether to sort by ascending or descending date updated + :param sort_by_content_name: Whether to sort by ascending or descending content name + :param date_created_after: Filter by >=[date-time] + :param date_created_before: Filter by <=[date-time] + :param content_name: Filter by Regex Pattern in content name + :param content: Filter by Regex Pattern in template content + :param language: Filter by array of valid language(s) + :param content_type: Filter by array of contentType(s) + :param channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -244,6 +401,15 @@ async def page_async( """ data = values.of( { + "SortByDate": sort_by_date, + "SortByContentName": sort_by_content_name, + "DateCreatedAfter": serialize.iso8601_datetime(date_created_after), + "DateCreatedBefore": serialize.iso8601_datetime(date_created_before), + "ContentName": content_name, + "Content": content, + "Language": serialize.map(language, lambda e: e), + "ContentType": serialize.map(content_type, lambda e: e), + "ChannelEligibility": serialize.map(channel_eligibility, lambda e: e), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/content/v2/content_and_approvals.py b/twilio/rest/content/v2/content_and_approvals.py index 7a3e6d9ccf..4c081b9e22 100644 --- a/twilio/rest/content/v2/content_and_approvals.py +++ b/twilio/rest/content/v2/content_and_approvals.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -98,6 +98,15 @@ def __init__(self, version: Version): def stream( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[ContentAndApprovalsInstance]: @@ -107,6 +116,15 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. + :param str sort_by_date: Whether to sort by ascending or descending date updated + :param str sort_by_content_name: Whether to sort by ascending or descending content name + :param datetime date_created_after: Filter by >=[date-time] + :param datetime date_created_before: Filter by <=[date-time] + :param str content_name: Filter by Regex Pattern in content name + :param str content: Filter by Regex Pattern in template content + :param List[str] language: Filter by array of valid language(s) + :param List[str] content_type: Filter by array of contentType(s) + :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -117,12 +135,32 @@ def stream( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) + page = self.page( + sort_by_date=sort_by_date, + sort_by_content_name=sort_by_content_name, + date_created_after=date_created_after, + date_created_before=date_created_before, + content_name=content_name, + content=content, + language=language, + content_type=content_type, + channel_eligibility=channel_eligibility, + page_size=limits["page_size"], + ) return self._version.stream(page, limits["limit"]) async def stream_async( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[ContentAndApprovalsInstance]: @@ -132,6 +170,15 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. + :param str sort_by_date: Whether to sort by ascending or descending date updated + :param str sort_by_content_name: Whether to sort by ascending or descending content name + :param datetime date_created_after: Filter by >=[date-time] + :param datetime date_created_before: Filter by <=[date-time] + :param str content_name: Filter by Regex Pattern in content name + :param str content: Filter by Regex Pattern in template content + :param List[str] language: Filter by array of valid language(s) + :param List[str] content_type: Filter by array of contentType(s) + :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -142,12 +189,32 @@ async def stream_async( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) + page = await self.page_async( + sort_by_date=sort_by_date, + sort_by_content_name=sort_by_content_name, + date_created_after=date_created_after, + date_created_before=date_created_before, + content_name=content_name, + content=content, + language=language, + content_type=content_type, + channel_eligibility=channel_eligibility, + page_size=limits["page_size"], + ) return self._version.stream_async(page, limits["limit"]) def list( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[ContentAndApprovalsInstance]: @@ -156,6 +223,15 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param str sort_by_date: Whether to sort by ascending or descending date updated + :param str sort_by_content_name: Whether to sort by ascending or descending content name + :param datetime date_created_after: Filter by >=[date-time] + :param datetime date_created_before: Filter by <=[date-time] + :param str content_name: Filter by Regex Pattern in content name + :param str content: Filter by Regex Pattern in template content + :param List[str] language: Filter by array of valid language(s) + :param List[str] content_type: Filter by array of contentType(s) + :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -167,6 +243,15 @@ def list( """ return list( self.stream( + sort_by_date=sort_by_date, + sort_by_content_name=sort_by_content_name, + date_created_after=date_created_after, + date_created_before=date_created_before, + content_name=content_name, + content=content, + language=language, + content_type=content_type, + channel_eligibility=channel_eligibility, limit=limit, page_size=page_size, ) @@ -174,6 +259,15 @@ def list( async def list_async( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[ContentAndApprovalsInstance]: @@ -182,6 +276,15 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param str sort_by_date: Whether to sort by ascending or descending date updated + :param str sort_by_content_name: Whether to sort by ascending or descending content name + :param datetime date_created_after: Filter by >=[date-time] + :param datetime date_created_before: Filter by <=[date-time] + :param str content_name: Filter by Regex Pattern in content name + :param str content: Filter by Regex Pattern in template content + :param List[str] language: Filter by array of valid language(s) + :param List[str] content_type: Filter by array of contentType(s) + :param List[str] channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -194,6 +297,15 @@ async def list_async( return [ record async for record in await self.stream_async( + sort_by_date=sort_by_date, + sort_by_content_name=sort_by_content_name, + date_created_after=date_created_after, + date_created_before=date_created_before, + content_name=content_name, + content=content, + language=language, + content_type=content_type, + channel_eligibility=channel_eligibility, limit=limit, page_size=page_size, ) @@ -201,6 +313,15 @@ async def list_async( def page( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -209,6 +330,15 @@ def page( Retrieve a single page of ContentAndApprovalsInstance records from the API. Request is executed immediately + :param sort_by_date: Whether to sort by ascending or descending date updated + :param sort_by_content_name: Whether to sort by ascending or descending content name + :param date_created_after: Filter by >=[date-time] + :param date_created_before: Filter by <=[date-time] + :param content_name: Filter by Regex Pattern in content name + :param content: Filter by Regex Pattern in template content + :param language: Filter by array of valid language(s) + :param content_type: Filter by array of contentType(s) + :param channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -217,6 +347,15 @@ def page( """ data = values.of( { + "SortByDate": sort_by_date, + "SortByContentName": sort_by_content_name, + "DateCreatedAfter": serialize.iso8601_datetime(date_created_after), + "DateCreatedBefore": serialize.iso8601_datetime(date_created_before), + "ContentName": content_name, + "Content": content, + "Language": serialize.map(language, lambda e: e), + "ContentType": serialize.map(content_type, lambda e: e), + "ChannelEligibility": serialize.map(channel_eligibility, lambda e: e), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -228,6 +367,15 @@ def page( async def page_async( self, + sort_by_date: Union[str, object] = values.unset, + sort_by_content_name: Union[str, object] = values.unset, + date_created_after: Union[datetime, object] = values.unset, + date_created_before: Union[datetime, object] = values.unset, + content_name: Union[str, object] = values.unset, + content: Union[str, object] = values.unset, + language: Union[List[str], object] = values.unset, + content_type: Union[List[str], object] = values.unset, + channel_eligibility: Union[List[str], object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -236,6 +384,15 @@ async def page_async( Asynchronously retrieve a single page of ContentAndApprovalsInstance records from the API. Request is executed immediately + :param sort_by_date: Whether to sort by ascending or descending date updated + :param sort_by_content_name: Whether to sort by ascending or descending content name + :param date_created_after: Filter by >=[date-time] + :param date_created_before: Filter by <=[date-time] + :param content_name: Filter by Regex Pattern in content name + :param content: Filter by Regex Pattern in template content + :param language: Filter by array of valid language(s) + :param content_type: Filter by array of contentType(s) + :param channel_eligibility: Filter by array of ChannelEligibility(s), where ChannelEligibility=: :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -244,6 +401,15 @@ async def page_async( """ data = values.of( { + "SortByDate": sort_by_date, + "SortByContentName": sort_by_content_name, + "DateCreatedAfter": serialize.iso8601_datetime(date_created_after), + "DateCreatedBefore": serialize.iso8601_datetime(date_created_before), + "ContentName": content_name, + "Content": content, + "Language": serialize.map(language, lambda e: e), + "ContentType": serialize.map(content_type, lambda e: e), + "ChannelEligibility": serialize.map(channel_eligibility, lambda e: e), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/marketplace/MarketplaceBase.py b/twilio/rest/marketplace/MarketplaceBase.py new file mode 100644 index 0000000000..9fbe193d99 --- /dev/null +++ b/twilio/rest/marketplace/MarketplaceBase.py @@ -0,0 +1,44 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional + +from twilio.base.domain import Domain +from twilio.rest import Client +from twilio.rest.marketplace.v1 import V1 + + +class MarketplaceBase(Domain): + + def __init__(self, twilio: Client): + """ + Initialize the Marketplace Domain + + :returns: Domain for Marketplace + """ + super().__init__(twilio, "https://marketplace.twilio.com") + self._v1: Optional[V1] = None + + @property + def v1(self) -> V1: + """ + :returns: Versions v1 of Marketplace + """ + if self._v1 is None: + self._v1 = V1(self) + return self._v1 + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/marketplace/v1/__init__.py b/twilio/rest/marketplace/v1/__init__.py new file mode 100644 index 0000000000..49fc490396 --- /dev/null +++ b/twilio/rest/marketplace/v1/__init__.py @@ -0,0 +1,59 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Marketplace + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.marketplace.v1.available_add_on import AvailableAddOnList +from twilio.rest.marketplace.v1.installed_add_on import InstalledAddOnList +from twilio.rest.marketplace.v1.module_data_management import ModuleDataManagementList + + +class V1(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V1 version of Marketplace + + :param domain: The Twilio.marketplace domain + """ + super().__init__(domain, "v1") + self._available_add_ons: Optional[AvailableAddOnList] = None + self._installed_add_ons: Optional[InstalledAddOnList] = None + self._module_data_management: Optional[ModuleDataManagementList] = None + + @property + def available_add_ons(self) -> AvailableAddOnList: + if self._available_add_ons is None: + self._available_add_ons = AvailableAddOnList(self) + return self._available_add_ons + + @property + def installed_add_ons(self) -> InstalledAddOnList: + if self._installed_add_ons is None: + self._installed_add_ons = InstalledAddOnList(self) + return self._installed_add_ons + + @property + def module_data_management(self) -> ModuleDataManagementList: + if self._module_data_management is None: + self._module_data_management = ModuleDataManagementList(self) + return self._module_data_management + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/marketplace/v1/available_add_on/__init__.py b/twilio/rest/marketplace/v1/available_add_on/__init__.py new file mode 100644 index 0000000000..6f6713ee17 --- /dev/null +++ b/twilio/rest/marketplace/v1/available_add_on/__init__.py @@ -0,0 +1,424 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Marketplace + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page +from twilio.rest.marketplace.v1.available_add_on.available_add_on_extension import ( + AvailableAddOnExtensionList, +) + + +class AvailableAddOnInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the AvailableAddOn resource. + :ivar friendly_name: The string that you assigned to describe the resource. + :ivar description: A short description of the Add-on's functionality. + :ivar pricing_type: How customers are charged for using this Add-on. + :ivar configuration_schema: The JSON object with the configuration that must be provided when installing a given Add-on. + :ivar url: The absolute URL of the resource. + :ivar links: The URLs of related resources. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.description: Optional[str] = payload.get("description") + self.pricing_type: Optional[str] = payload.get("pricing_type") + self.configuration_schema: Optional[Dict[str, object]] = payload.get( + "configuration_schema" + ) + self.url: Optional[str] = payload.get("url") + self.links: Optional[Dict[str, object]] = payload.get("links") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[AvailableAddOnContext] = None + + @property + def _proxy(self) -> "AvailableAddOnContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: AvailableAddOnContext for this AvailableAddOnInstance + """ + if self._context is None: + self._context = AvailableAddOnContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def fetch(self) -> "AvailableAddOnInstance": + """ + Fetch the AvailableAddOnInstance + + + :returns: The fetched AvailableAddOnInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "AvailableAddOnInstance": + """ + Asynchronous coroutine to fetch the AvailableAddOnInstance + + + :returns: The fetched AvailableAddOnInstance + """ + return await self._proxy.fetch_async() + + @property + def extensions(self) -> AvailableAddOnExtensionList: + """ + Access the extensions + """ + return self._proxy.extensions + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AvailableAddOnContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the AvailableAddOnContext + + :param version: Version that contains the resource + :param sid: The SID of the AvailableAddOn resource to fetch. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/AvailableAddOns/{sid}".format(**self._solution) + + self._extensions: Optional[AvailableAddOnExtensionList] = None + + def fetch(self) -> AvailableAddOnInstance: + """ + Fetch the AvailableAddOnInstance + + + :returns: The fetched AvailableAddOnInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return AvailableAddOnInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> AvailableAddOnInstance: + """ + Asynchronous coroutine to fetch the AvailableAddOnInstance + + + :returns: The fetched AvailableAddOnInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return AvailableAddOnInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + @property + def extensions(self) -> AvailableAddOnExtensionList: + """ + Access the extensions + """ + if self._extensions is None: + self._extensions = AvailableAddOnExtensionList( + self._version, + self._solution["sid"], + ) + return self._extensions + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AvailableAddOnPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> AvailableAddOnInstance: + """ + Build an instance of AvailableAddOnInstance + + :param payload: Payload response from the API + """ + return AvailableAddOnInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class AvailableAddOnList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the AvailableAddOnList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/AvailableAddOns" + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[AvailableAddOnInstance]: + """ + Streams AvailableAddOnInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[AvailableAddOnInstance]: + """ + Asynchronously streams AvailableAddOnInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AvailableAddOnInstance]: + """ + Lists AvailableAddOnInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AvailableAddOnInstance]: + """ + Asynchronously lists AvailableAddOnInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AvailableAddOnPage: + """ + Retrieve a single page of AvailableAddOnInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AvailableAddOnInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return AvailableAddOnPage(self._version, response) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AvailableAddOnPage: + """ + Asynchronously retrieve a single page of AvailableAddOnInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AvailableAddOnInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return AvailableAddOnPage(self._version, response) + + def get_page(self, target_url: str) -> AvailableAddOnPage: + """ + Retrieve a specific page of AvailableAddOnInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AvailableAddOnInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return AvailableAddOnPage(self._version, response) + + async def get_page_async(self, target_url: str) -> AvailableAddOnPage: + """ + Asynchronously retrieve a specific page of AvailableAddOnInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AvailableAddOnInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return AvailableAddOnPage(self._version, response) + + def get(self, sid: str) -> AvailableAddOnContext: + """ + Constructs a AvailableAddOnContext + + :param sid: The SID of the AvailableAddOn resource to fetch. + """ + return AvailableAddOnContext(self._version, sid=sid) + + def __call__(self, sid: str) -> AvailableAddOnContext: + """ + Constructs a AvailableAddOnContext + + :param sid: The SID of the AvailableAddOn resource to fetch. + """ + return AvailableAddOnContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/marketplace/v1/available_add_on/available_add_on_extension.py b/twilio/rest/marketplace/v1/available_add_on/available_add_on_extension.py new file mode 100644 index 0000000000..1113d9313c --- /dev/null +++ b/twilio/rest/marketplace/v1/available_add_on/available_add_on_extension.py @@ -0,0 +1,431 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Marketplace + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class AvailableAddOnExtensionInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the AvailableAddOnExtension resource. + :ivar available_add_on_sid: The SID of the AvailableAddOn resource to which this extension applies. + :ivar friendly_name: The string that you assigned to describe the resource. + :ivar product_name: The name of the Product this Extension is used within. + :ivar unique_name: An application-defined string that uniquely identifies the resource. + :ivar url: The absolute URL of the resource. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + available_add_on_sid: str, + sid: Optional[str] = None, + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.available_add_on_sid: Optional[str] = payload.get("available_add_on_sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.product_name: Optional[str] = payload.get("product_name") + self.unique_name: Optional[str] = payload.get("unique_name") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "available_add_on_sid": available_add_on_sid, + "sid": sid or self.sid, + } + self._context: Optional[AvailableAddOnExtensionContext] = None + + @property + def _proxy(self) -> "AvailableAddOnExtensionContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: AvailableAddOnExtensionContext for this AvailableAddOnExtensionInstance + """ + if self._context is None: + self._context = AvailableAddOnExtensionContext( + self._version, + available_add_on_sid=self._solution["available_add_on_sid"], + sid=self._solution["sid"], + ) + return self._context + + def fetch(self) -> "AvailableAddOnExtensionInstance": + """ + Fetch the AvailableAddOnExtensionInstance + + + :returns: The fetched AvailableAddOnExtensionInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "AvailableAddOnExtensionInstance": + """ + Asynchronous coroutine to fetch the AvailableAddOnExtensionInstance + + + :returns: The fetched AvailableAddOnExtensionInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class AvailableAddOnExtensionContext(InstanceContext): + + def __init__(self, version: Version, available_add_on_sid: str, sid: str): + """ + Initialize the AvailableAddOnExtensionContext + + :param version: Version that contains the resource + :param available_add_on_sid: The SID of the AvailableAddOn resource with the extension to fetch. + :param sid: The SID of the AvailableAddOn Extension resource to fetch. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "available_add_on_sid": available_add_on_sid, + "sid": sid, + } + self._uri = "/AvailableAddOns/{available_add_on_sid}/Extensions/{sid}".format( + **self._solution + ) + + def fetch(self) -> AvailableAddOnExtensionInstance: + """ + Fetch the AvailableAddOnExtensionInstance + + + :returns: The fetched AvailableAddOnExtensionInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return AvailableAddOnExtensionInstance( + self._version, + payload, + available_add_on_sid=self._solution["available_add_on_sid"], + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> AvailableAddOnExtensionInstance: + """ + Asynchronous coroutine to fetch the AvailableAddOnExtensionInstance + + + :returns: The fetched AvailableAddOnExtensionInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return AvailableAddOnExtensionInstance( + self._version, + payload, + available_add_on_sid=self._solution["available_add_on_sid"], + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class AvailableAddOnExtensionPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> AvailableAddOnExtensionInstance: + """ + Build an instance of AvailableAddOnExtensionInstance + + :param payload: Payload response from the API + """ + return AvailableAddOnExtensionInstance( + self._version, + payload, + available_add_on_sid=self._solution["available_add_on_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class AvailableAddOnExtensionList(ListResource): + + def __init__(self, version: Version, available_add_on_sid: str): + """ + Initialize the AvailableAddOnExtensionList + + :param version: Version that contains the resource + :param available_add_on_sid: The SID of the AvailableAddOn resource with the extensions to read. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "available_add_on_sid": available_add_on_sid, + } + self._uri = "/AvailableAddOns/{available_add_on_sid}/Extensions".format( + **self._solution + ) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[AvailableAddOnExtensionInstance]: + """ + Streams AvailableAddOnExtensionInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[AvailableAddOnExtensionInstance]: + """ + Asynchronously streams AvailableAddOnExtensionInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AvailableAddOnExtensionInstance]: + """ + Lists AvailableAddOnExtensionInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AvailableAddOnExtensionInstance]: + """ + Asynchronously lists AvailableAddOnExtensionInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AvailableAddOnExtensionPage: + """ + Retrieve a single page of AvailableAddOnExtensionInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AvailableAddOnExtensionInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return AvailableAddOnExtensionPage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AvailableAddOnExtensionPage: + """ + Asynchronously retrieve a single page of AvailableAddOnExtensionInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AvailableAddOnExtensionInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return AvailableAddOnExtensionPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> AvailableAddOnExtensionPage: + """ + Retrieve a specific page of AvailableAddOnExtensionInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AvailableAddOnExtensionInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return AvailableAddOnExtensionPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> AvailableAddOnExtensionPage: + """ + Asynchronously retrieve a specific page of AvailableAddOnExtensionInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AvailableAddOnExtensionInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return AvailableAddOnExtensionPage(self._version, response, self._solution) + + def get(self, sid: str) -> AvailableAddOnExtensionContext: + """ + Constructs a AvailableAddOnExtensionContext + + :param sid: The SID of the AvailableAddOn Extension resource to fetch. + """ + return AvailableAddOnExtensionContext( + self._version, + available_add_on_sid=self._solution["available_add_on_sid"], + sid=sid, + ) + + def __call__(self, sid: str) -> AvailableAddOnExtensionContext: + """ + Constructs a AvailableAddOnExtensionContext + + :param sid: The SID of the AvailableAddOn Extension resource to fetch. + """ + return AvailableAddOnExtensionContext( + self._version, + available_add_on_sid=self._solution["available_add_on_sid"], + sid=sid, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/marketplace/v1/installed_add_on/__init__.py b/twilio/rest/marketplace/v1/installed_add_on/__init__.py new file mode 100644 index 0000000000..0aad53d8ee --- /dev/null +++ b/twilio/rest/marketplace/v1/installed_add_on/__init__.py @@ -0,0 +1,664 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Marketplace + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page +from twilio.rest.marketplace.v1.installed_add_on.installed_add_on_extension import ( + InstalledAddOnExtensionList, +) +from twilio.rest.marketplace.v1.installed_add_on.installed_add_on_usage import ( + InstalledAddOnUsageList, +) + + +class InstalledAddOnInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the InstalledAddOn resource. This Sid can also be found in the Console on that specific Add-ons page as the 'Available Add-on Sid'. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the InstalledAddOn resource. + :ivar friendly_name: The string that you assigned to describe the resource. + :ivar description: A short description of the Add-on's functionality. + :ivar configuration: The JSON object that represents the current configuration of installed Add-on. + :ivar unique_name: An application-defined string that uniquely identifies the resource. + :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar url: The absolute URL of the resource. + :ivar links: The URLs of related resources. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.description: Optional[str] = payload.get("description") + self.configuration: Optional[Dict[str, object]] = payload.get("configuration") + self.unique_name: Optional[str] = payload.get("unique_name") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.url: Optional[str] = payload.get("url") + self.links: Optional[Dict[str, object]] = payload.get("links") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[InstalledAddOnContext] = None + + @property + def _proxy(self) -> "InstalledAddOnContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: InstalledAddOnContext for this InstalledAddOnInstance + """ + if self._context is None: + self._context = InstalledAddOnContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the InstalledAddOnInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the InstalledAddOnInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "InstalledAddOnInstance": + """ + Fetch the InstalledAddOnInstance + + + :returns: The fetched InstalledAddOnInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "InstalledAddOnInstance": + """ + Asynchronous coroutine to fetch the InstalledAddOnInstance + + + :returns: The fetched InstalledAddOnInstance + """ + return await self._proxy.fetch_async() + + def update( + self, + configuration: Union[object, object] = values.unset, + unique_name: Union[str, object] = values.unset, + ) -> "InstalledAddOnInstance": + """ + Update the InstalledAddOnInstance + + :param configuration: Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + :param unique_name: An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + + :returns: The updated InstalledAddOnInstance + """ + return self._proxy.update( + configuration=configuration, + unique_name=unique_name, + ) + + async def update_async( + self, + configuration: Union[object, object] = values.unset, + unique_name: Union[str, object] = values.unset, + ) -> "InstalledAddOnInstance": + """ + Asynchronous coroutine to update the InstalledAddOnInstance + + :param configuration: Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + :param unique_name: An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + + :returns: The updated InstalledAddOnInstance + """ + return await self._proxy.update_async( + configuration=configuration, + unique_name=unique_name, + ) + + @property + def extensions(self) -> InstalledAddOnExtensionList: + """ + Access the extensions + """ + return self._proxy.extensions + + @property + def usage(self) -> InstalledAddOnUsageList: + """ + Access the usage + """ + return self._proxy.usage + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class InstalledAddOnContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the InstalledAddOnContext + + :param version: Version that contains the resource + :param sid: The SID of the InstalledAddOn resource to update. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/InstalledAddOns/{sid}".format(**self._solution) + + self._extensions: Optional[InstalledAddOnExtensionList] = None + self._usage: Optional[InstalledAddOnUsageList] = None + + def delete(self) -> bool: + """ + Deletes the InstalledAddOnInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the InstalledAddOnInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def fetch(self) -> InstalledAddOnInstance: + """ + Fetch the InstalledAddOnInstance + + + :returns: The fetched InstalledAddOnInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return InstalledAddOnInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> InstalledAddOnInstance: + """ + Asynchronous coroutine to fetch the InstalledAddOnInstance + + + :returns: The fetched InstalledAddOnInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return InstalledAddOnInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + def update( + self, + configuration: Union[object, object] = values.unset, + unique_name: Union[str, object] = values.unset, + ) -> InstalledAddOnInstance: + """ + Update the InstalledAddOnInstance + + :param configuration: Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + :param unique_name: An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + + :returns: The updated InstalledAddOnInstance + """ + data = values.of( + { + "Configuration": serialize.object(configuration), + "UniqueName": unique_name, + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return InstalledAddOnInstance(self._version, payload, sid=self._solution["sid"]) + + async def update_async( + self, + configuration: Union[object, object] = values.unset, + unique_name: Union[str, object] = values.unset, + ) -> InstalledAddOnInstance: + """ + Asynchronous coroutine to update the InstalledAddOnInstance + + :param configuration: Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + :param unique_name: An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + + :returns: The updated InstalledAddOnInstance + """ + data = values.of( + { + "Configuration": serialize.object(configuration), + "UniqueName": unique_name, + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return InstalledAddOnInstance(self._version, payload, sid=self._solution["sid"]) + + @property + def extensions(self) -> InstalledAddOnExtensionList: + """ + Access the extensions + """ + if self._extensions is None: + self._extensions = InstalledAddOnExtensionList( + self._version, + self._solution["sid"], + ) + return self._extensions + + @property + def usage(self) -> InstalledAddOnUsageList: + """ + Access the usage + """ + if self._usage is None: + self._usage = InstalledAddOnUsageList( + self._version, + self._solution["sid"], + ) + return self._usage + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class InstalledAddOnPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> InstalledAddOnInstance: + """ + Build an instance of InstalledAddOnInstance + + :param payload: Payload response from the API + """ + return InstalledAddOnInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class InstalledAddOnList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the InstalledAddOnList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/InstalledAddOns" + + def create( + self, + available_add_on_sid: str, + accept_terms_of_service: bool, + configuration: Union[object, object] = values.unset, + unique_name: Union[str, object] = values.unset, + ) -> InstalledAddOnInstance: + """ + Create the InstalledAddOnInstance + + :param available_add_on_sid: The SID of the AvaliableAddOn to install. + :param accept_terms_of_service: Whether the Terms of Service were accepted. + :param configuration: The JSON object that represents the configuration of the new Add-on being installed. + :param unique_name: An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + + :returns: The created InstalledAddOnInstance + """ + + data = values.of( + { + "AvailableAddOnSid": available_add_on_sid, + "AcceptTermsOfService": serialize.boolean_to_string( + accept_terms_of_service + ), + "Configuration": serialize.object(configuration), + "UniqueName": unique_name, + } + ) + + payload = self._version.create( + method="POST", + uri=self._uri, + data=data, + ) + + return InstalledAddOnInstance(self._version, payload) + + async def create_async( + self, + available_add_on_sid: str, + accept_terms_of_service: bool, + configuration: Union[object, object] = values.unset, + unique_name: Union[str, object] = values.unset, + ) -> InstalledAddOnInstance: + """ + Asynchronously create the InstalledAddOnInstance + + :param available_add_on_sid: The SID of the AvaliableAddOn to install. + :param accept_terms_of_service: Whether the Terms of Service were accepted. + :param configuration: The JSON object that represents the configuration of the new Add-on being installed. + :param unique_name: An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + + :returns: The created InstalledAddOnInstance + """ + + data = values.of( + { + "AvailableAddOnSid": available_add_on_sid, + "AcceptTermsOfService": serialize.boolean_to_string( + accept_terms_of_service + ), + "Configuration": serialize.object(configuration), + "UniqueName": unique_name, + } + ) + + payload = await self._version.create_async( + method="POST", + uri=self._uri, + data=data, + ) + + return InstalledAddOnInstance(self._version, payload) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[InstalledAddOnInstance]: + """ + Streams InstalledAddOnInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[InstalledAddOnInstance]: + """ + Asynchronously streams InstalledAddOnInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[InstalledAddOnInstance]: + """ + Lists InstalledAddOnInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[InstalledAddOnInstance]: + """ + Asynchronously lists InstalledAddOnInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> InstalledAddOnPage: + """ + Retrieve a single page of InstalledAddOnInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of InstalledAddOnInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return InstalledAddOnPage(self._version, response) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> InstalledAddOnPage: + """ + Asynchronously retrieve a single page of InstalledAddOnInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of InstalledAddOnInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return InstalledAddOnPage(self._version, response) + + def get_page(self, target_url: str) -> InstalledAddOnPage: + """ + Retrieve a specific page of InstalledAddOnInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of InstalledAddOnInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return InstalledAddOnPage(self._version, response) + + async def get_page_async(self, target_url: str) -> InstalledAddOnPage: + """ + Asynchronously retrieve a specific page of InstalledAddOnInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of InstalledAddOnInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return InstalledAddOnPage(self._version, response) + + def get(self, sid: str) -> InstalledAddOnContext: + """ + Constructs a InstalledAddOnContext + + :param sid: The SID of the InstalledAddOn resource to update. + """ + return InstalledAddOnContext(self._version, sid=sid) + + def __call__(self, sid: str) -> InstalledAddOnContext: + """ + Constructs a InstalledAddOnContext + + :param sid: The SID of the InstalledAddOn resource to update. + """ + return InstalledAddOnContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_extension.py b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_extension.py new file mode 100644 index 0000000000..c53a6ca510 --- /dev/null +++ b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_extension.py @@ -0,0 +1,511 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Marketplace + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class InstalledAddOnExtensionInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the InstalledAddOn Extension resource. + :ivar installed_add_on_sid: The SID of the InstalledAddOn resource to which this extension applies. + :ivar friendly_name: The string that you assigned to describe the resource. + :ivar product_name: The name of the Product this Extension is used within. + :ivar unique_name: An application-defined string that uniquely identifies the resource. + :ivar enabled: Whether the Extension will be invoked. + :ivar url: The absolute URL of the resource. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + installed_add_on_sid: str, + sid: Optional[str] = None, + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.installed_add_on_sid: Optional[str] = payload.get("installed_add_on_sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.product_name: Optional[str] = payload.get("product_name") + self.unique_name: Optional[str] = payload.get("unique_name") + self.enabled: Optional[bool] = payload.get("enabled") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "installed_add_on_sid": installed_add_on_sid, + "sid": sid or self.sid, + } + self._context: Optional[InstalledAddOnExtensionContext] = None + + @property + def _proxy(self) -> "InstalledAddOnExtensionContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: InstalledAddOnExtensionContext for this InstalledAddOnExtensionInstance + """ + if self._context is None: + self._context = InstalledAddOnExtensionContext( + self._version, + installed_add_on_sid=self._solution["installed_add_on_sid"], + sid=self._solution["sid"], + ) + return self._context + + def fetch(self) -> "InstalledAddOnExtensionInstance": + """ + Fetch the InstalledAddOnExtensionInstance + + + :returns: The fetched InstalledAddOnExtensionInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "InstalledAddOnExtensionInstance": + """ + Asynchronous coroutine to fetch the InstalledAddOnExtensionInstance + + + :returns: The fetched InstalledAddOnExtensionInstance + """ + return await self._proxy.fetch_async() + + def update(self, enabled: bool) -> "InstalledAddOnExtensionInstance": + """ + Update the InstalledAddOnExtensionInstance + + :param enabled: Whether the Extension should be invoked. + + :returns: The updated InstalledAddOnExtensionInstance + """ + return self._proxy.update( + enabled=enabled, + ) + + async def update_async(self, enabled: bool) -> "InstalledAddOnExtensionInstance": + """ + Asynchronous coroutine to update the InstalledAddOnExtensionInstance + + :param enabled: Whether the Extension should be invoked. + + :returns: The updated InstalledAddOnExtensionInstance + """ + return await self._proxy.update_async( + enabled=enabled, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class InstalledAddOnExtensionContext(InstanceContext): + + def __init__(self, version: Version, installed_add_on_sid: str, sid: str): + """ + Initialize the InstalledAddOnExtensionContext + + :param version: Version that contains the resource + :param installed_add_on_sid: The SID of the InstalledAddOn resource with the extension to update. + :param sid: The SID of the InstalledAddOn Extension resource to update. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "installed_add_on_sid": installed_add_on_sid, + "sid": sid, + } + self._uri = "/InstalledAddOns/{installed_add_on_sid}/Extensions/{sid}".format( + **self._solution + ) + + def fetch(self) -> InstalledAddOnExtensionInstance: + """ + Fetch the InstalledAddOnExtensionInstance + + + :returns: The fetched InstalledAddOnExtensionInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return InstalledAddOnExtensionInstance( + self._version, + payload, + installed_add_on_sid=self._solution["installed_add_on_sid"], + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> InstalledAddOnExtensionInstance: + """ + Asynchronous coroutine to fetch the InstalledAddOnExtensionInstance + + + :returns: The fetched InstalledAddOnExtensionInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return InstalledAddOnExtensionInstance( + self._version, + payload, + installed_add_on_sid=self._solution["installed_add_on_sid"], + sid=self._solution["sid"], + ) + + def update(self, enabled: bool) -> InstalledAddOnExtensionInstance: + """ + Update the InstalledAddOnExtensionInstance + + :param enabled: Whether the Extension should be invoked. + + :returns: The updated InstalledAddOnExtensionInstance + """ + data = values.of( + { + "Enabled": serialize.boolean_to_string(enabled), + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return InstalledAddOnExtensionInstance( + self._version, + payload, + installed_add_on_sid=self._solution["installed_add_on_sid"], + sid=self._solution["sid"], + ) + + async def update_async(self, enabled: bool) -> InstalledAddOnExtensionInstance: + """ + Asynchronous coroutine to update the InstalledAddOnExtensionInstance + + :param enabled: Whether the Extension should be invoked. + + :returns: The updated InstalledAddOnExtensionInstance + """ + data = values.of( + { + "Enabled": serialize.boolean_to_string(enabled), + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return InstalledAddOnExtensionInstance( + self._version, + payload, + installed_add_on_sid=self._solution["installed_add_on_sid"], + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class InstalledAddOnExtensionPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> InstalledAddOnExtensionInstance: + """ + Build an instance of InstalledAddOnExtensionInstance + + :param payload: Payload response from the API + """ + return InstalledAddOnExtensionInstance( + self._version, + payload, + installed_add_on_sid=self._solution["installed_add_on_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class InstalledAddOnExtensionList(ListResource): + + def __init__(self, version: Version, installed_add_on_sid: str): + """ + Initialize the InstalledAddOnExtensionList + + :param version: Version that contains the resource + :param installed_add_on_sid: The SID of the InstalledAddOn resource with the extensions to read. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "installed_add_on_sid": installed_add_on_sid, + } + self._uri = "/InstalledAddOns/{installed_add_on_sid}/Extensions".format( + **self._solution + ) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[InstalledAddOnExtensionInstance]: + """ + Streams InstalledAddOnExtensionInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[InstalledAddOnExtensionInstance]: + """ + Asynchronously streams InstalledAddOnExtensionInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[InstalledAddOnExtensionInstance]: + """ + Lists InstalledAddOnExtensionInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[InstalledAddOnExtensionInstance]: + """ + Asynchronously lists InstalledAddOnExtensionInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> InstalledAddOnExtensionPage: + """ + Retrieve a single page of InstalledAddOnExtensionInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of InstalledAddOnExtensionInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return InstalledAddOnExtensionPage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> InstalledAddOnExtensionPage: + """ + Asynchronously retrieve a single page of InstalledAddOnExtensionInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of InstalledAddOnExtensionInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return InstalledAddOnExtensionPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> InstalledAddOnExtensionPage: + """ + Retrieve a specific page of InstalledAddOnExtensionInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of InstalledAddOnExtensionInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return InstalledAddOnExtensionPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> InstalledAddOnExtensionPage: + """ + Asynchronously retrieve a specific page of InstalledAddOnExtensionInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of InstalledAddOnExtensionInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return InstalledAddOnExtensionPage(self._version, response, self._solution) + + def get(self, sid: str) -> InstalledAddOnExtensionContext: + """ + Constructs a InstalledAddOnExtensionContext + + :param sid: The SID of the InstalledAddOn Extension resource to update. + """ + return InstalledAddOnExtensionContext( + self._version, + installed_add_on_sid=self._solution["installed_add_on_sid"], + sid=sid, + ) + + def __call__(self, sid: str) -> InstalledAddOnExtensionContext: + """ + Constructs a InstalledAddOnExtensionContext + + :param sid: The SID of the InstalledAddOn Extension resource to update. + """ + return InstalledAddOnExtensionContext( + self._version, + installed_add_on_sid=self._solution["installed_add_on_sid"], + sid=sid, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py new file mode 100644 index 0000000000..6fff4979f4 --- /dev/null +++ b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py @@ -0,0 +1,166 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Marketplace + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional +from twilio.base import deserialize + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class InstalledAddOnUsageInstance(InstanceResource): + """ + :ivar billable_items: + :ivar total_submitted: Represents the total quantity submitted. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], installed_add_on_sid: str + ): + super().__init__(version) + + self.billable_items: Optional[List[str]] = payload.get("billable_items") + self.total_submitted: Optional[float] = deserialize.decimal( + payload.get("total_submitted") + ) + + self._solution = { + "installed_add_on_sid": installed_add_on_sid, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class InstalledAddOnUsageList(ListResource): + + class CreateMarketplaceBillingUsageRequest(object): + """ + :ivar billable_items: + """ + + def __init__(self, payload: Dict[str, Any], installed_add_on_sid: str): + + self.billable_items: Optional[ + List[ + InstalledAddOnUsageList.CreateMarketplaceBillingUsageRequestBillableItems + ] + ] = payload.get("billable_items") + + def to_dict(self): + return { + "billable_items": [ + billable_items.to_dict() for billable_items in self.billable_items + ], + } + + class CreateMarketplaceBillingUsageRequestBillableItems(object): + """ + :ivar quantity: + :ivar sid: + """ + + def __init__(self, payload: Dict[str, Any], installed_add_on_sid: str): + + self.quantity: Optional[float] = payload.get("quantity") + self.sid: Optional[str] = payload.get("sid") + + def to_dict(self): + return { + "quantity": self.quantity, + "sid": self.sid, + } + + def __init__(self, version: Version, installed_add_on_sid: str): + """ + Initialize the InstalledAddOnUsageList + + :param version: Version that contains the resource + :param installed_add_on_sid: + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "installed_add_on_sid": installed_add_on_sid, + } + self._uri = "/InstalledAddOns/{installed_add_on_sid}/Usage".format( + **self._solution + ) + + def create( + self, + create_marketplace_billing_usage_request: CreateMarketplaceBillingUsageRequest, + ) -> InstalledAddOnUsageInstance: + """ + Create the InstalledAddOnUsageInstance + + :param create_marketplace_billing_usage_request: + + :returns: The created InstalledAddOnUsageInstance + """ + data = create_marketplace_billing_usage_request.to_dict() + + headers = {"Content-Type": "application/json"} + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return InstalledAddOnUsageInstance( + self._version, + payload, + installed_add_on_sid=self._solution["installed_add_on_sid"], + ) + + async def create_async( + self, + create_marketplace_billing_usage_request: CreateMarketplaceBillingUsageRequest, + ) -> InstalledAddOnUsageInstance: + """ + Asynchronously create the InstalledAddOnUsageInstance + + :param create_marketplace_billing_usage_request: + + :returns: The created InstalledAddOnUsageInstance + """ + data = create_marketplace_billing_usage_request.to_dict() + + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return InstalledAddOnUsageInstance( + self._version, + payload, + installed_add_on_sid=self._solution["installed_add_on_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/marketplace/v1/module_data_management.py b/twilio/rest/marketplace/v1/module_data_management.py new file mode 100644 index 0000000000..079a1a3343 --- /dev/null +++ b/twilio/rest/marketplace/v1/module_data_management.py @@ -0,0 +1,325 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Marketplace + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional, Union +from twilio.base import values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ModuleDataManagementInstance(InstanceResource): + """ + :ivar url: + :ivar sid: + :ivar description: + :ivar support: + :ivar policies: + :ivar module_info: + :ivar documentation: + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.url: Optional[str] = payload.get("url") + self.sid: Optional[str] = payload.get("sid") + self.description: Optional[Dict[str, object]] = payload.get("description") + self.support: Optional[Dict[str, object]] = payload.get("support") + self.policies: Optional[Dict[str, object]] = payload.get("policies") + self.module_info: Optional[Dict[str, object]] = payload.get("module_info") + self.documentation: Optional[Dict[str, object]] = payload.get("documentation") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[ModuleDataManagementContext] = None + + @property + def _proxy(self) -> "ModuleDataManagementContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: ModuleDataManagementContext for this ModuleDataManagementInstance + """ + if self._context is None: + self._context = ModuleDataManagementContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def fetch(self) -> "ModuleDataManagementInstance": + """ + Fetch the ModuleDataManagementInstance + + + :returns: The fetched ModuleDataManagementInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "ModuleDataManagementInstance": + """ + Asynchronous coroutine to fetch the ModuleDataManagementInstance + + + :returns: The fetched ModuleDataManagementInstance + """ + return await self._proxy.fetch_async() + + def update( + self, + module_info: Union[str, object] = values.unset, + description: Union[str, object] = values.unset, + documentation: Union[str, object] = values.unset, + policies: Union[str, object] = values.unset, + support: Union[str, object] = values.unset, + ) -> "ModuleDataManagementInstance": + """ + Update the ModuleDataManagementInstance + + :param module_info: + :param description: + :param documentation: + :param policies: + :param support: + + :returns: The updated ModuleDataManagementInstance + """ + return self._proxy.update( + module_info=module_info, + description=description, + documentation=documentation, + policies=policies, + support=support, + ) + + async def update_async( + self, + module_info: Union[str, object] = values.unset, + description: Union[str, object] = values.unset, + documentation: Union[str, object] = values.unset, + policies: Union[str, object] = values.unset, + support: Union[str, object] = values.unset, + ) -> "ModuleDataManagementInstance": + """ + Asynchronous coroutine to update the ModuleDataManagementInstance + + :param module_info: + :param description: + :param documentation: + :param policies: + :param support: + + :returns: The updated ModuleDataManagementInstance + """ + return await self._proxy.update_async( + module_info=module_info, + description=description, + documentation=documentation, + policies=policies, + support=support, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ModuleDataManagementContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the ModuleDataManagementContext + + :param version: Version that contains the resource + :param sid: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/Listing/{sid}".format(**self._solution) + + def fetch(self) -> ModuleDataManagementInstance: + """ + Fetch the ModuleDataManagementInstance + + + :returns: The fetched ModuleDataManagementInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return ModuleDataManagementInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> ModuleDataManagementInstance: + """ + Asynchronous coroutine to fetch the ModuleDataManagementInstance + + + :returns: The fetched ModuleDataManagementInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return ModuleDataManagementInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + def update( + self, + module_info: Union[str, object] = values.unset, + description: Union[str, object] = values.unset, + documentation: Union[str, object] = values.unset, + policies: Union[str, object] = values.unset, + support: Union[str, object] = values.unset, + ) -> ModuleDataManagementInstance: + """ + Update the ModuleDataManagementInstance + + :param module_info: + :param description: + :param documentation: + :param policies: + :param support: + + :returns: The updated ModuleDataManagementInstance + """ + data = values.of( + { + "ModuleInfo": module_info, + "Description": description, + "Documentation": documentation, + "Policies": policies, + "Support": support, + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return ModuleDataManagementInstance( + self._version, payload, sid=self._solution["sid"] + ) + + async def update_async( + self, + module_info: Union[str, object] = values.unset, + description: Union[str, object] = values.unset, + documentation: Union[str, object] = values.unset, + policies: Union[str, object] = values.unset, + support: Union[str, object] = values.unset, + ) -> ModuleDataManagementInstance: + """ + Asynchronous coroutine to update the ModuleDataManagementInstance + + :param module_info: + :param description: + :param documentation: + :param policies: + :param support: + + :returns: The updated ModuleDataManagementInstance + """ + data = values.of( + { + "ModuleInfo": module_info, + "Description": description, + "Documentation": documentation, + "Policies": policies, + "Support": support, + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ModuleDataManagementInstance( + self._version, payload, sid=self._solution["sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ModuleDataManagementList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the ModuleDataManagementList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, sid: str) -> ModuleDataManagementContext: + """ + Constructs a ModuleDataManagementContext + + :param sid: + """ + return ModuleDataManagementContext(self._version, sid=sid) + + def __call__(self, sid: str) -> ModuleDataManagementContext: + """ + Constructs a ModuleDataManagementContext + + :param sid: + """ + return ModuleDataManagementContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index e742c57191..f8c639286b 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -30,6 +30,7 @@ class OptInType(object): PAPER_FORM = "PAPER_FORM" VIA_TEXT = "VIA_TEXT" MOBILE_QR_CODE = "MOBILE_QR_CODE" + IMPORT = "IMPORT" class Status(object): PENDING_REVIEW = "PENDING_REVIEW" @@ -861,6 +862,8 @@ def stream( self, tollfree_phone_number_sid: Union[str, object] = values.unset, status: Union["TollfreeVerificationInstance.Status", object] = values.unset, + external_reference_id: Union[str, object] = values.unset, + include_sub_accounts: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[TollfreeVerificationInstance]: @@ -872,6 +875,8 @@ def stream( :param str tollfree_phone_number_sid: The SID of the Phone Number associated with the Tollfree Verification. :param "TollfreeVerificationInstance.Status" status: The compliance status of the Tollfree Verification record. + :param str external_reference_id: Customer supplied reference id for the Tollfree Verification record. + :param bool include_sub_accounts: Whether to include Tollfree Verifications from sub accounts in list response. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -885,6 +890,8 @@ def stream( page = self.page( tollfree_phone_number_sid=tollfree_phone_number_sid, status=status, + external_reference_id=external_reference_id, + include_sub_accounts=include_sub_accounts, page_size=limits["page_size"], ) @@ -894,6 +901,8 @@ async def stream_async( self, tollfree_phone_number_sid: Union[str, object] = values.unset, status: Union["TollfreeVerificationInstance.Status", object] = values.unset, + external_reference_id: Union[str, object] = values.unset, + include_sub_accounts: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[TollfreeVerificationInstance]: @@ -905,6 +914,8 @@ async def stream_async( :param str tollfree_phone_number_sid: The SID of the Phone Number associated with the Tollfree Verification. :param "TollfreeVerificationInstance.Status" status: The compliance status of the Tollfree Verification record. + :param str external_reference_id: Customer supplied reference id for the Tollfree Verification record. + :param bool include_sub_accounts: Whether to include Tollfree Verifications from sub accounts in list response. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -918,6 +929,8 @@ async def stream_async( page = await self.page_async( tollfree_phone_number_sid=tollfree_phone_number_sid, status=status, + external_reference_id=external_reference_id, + include_sub_accounts=include_sub_accounts, page_size=limits["page_size"], ) @@ -927,6 +940,8 @@ def list( self, tollfree_phone_number_sid: Union[str, object] = values.unset, status: Union["TollfreeVerificationInstance.Status", object] = values.unset, + external_reference_id: Union[str, object] = values.unset, + include_sub_accounts: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[TollfreeVerificationInstance]: @@ -937,6 +952,8 @@ def list( :param str tollfree_phone_number_sid: The SID of the Phone Number associated with the Tollfree Verification. :param "TollfreeVerificationInstance.Status" status: The compliance status of the Tollfree Verification record. + :param str external_reference_id: Customer supplied reference id for the Tollfree Verification record. + :param bool include_sub_accounts: Whether to include Tollfree Verifications from sub accounts in list response. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -950,6 +967,8 @@ def list( self.stream( tollfree_phone_number_sid=tollfree_phone_number_sid, status=status, + external_reference_id=external_reference_id, + include_sub_accounts=include_sub_accounts, limit=limit, page_size=page_size, ) @@ -959,6 +978,8 @@ async def list_async( self, tollfree_phone_number_sid: Union[str, object] = values.unset, status: Union["TollfreeVerificationInstance.Status", object] = values.unset, + external_reference_id: Union[str, object] = values.unset, + include_sub_accounts: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[TollfreeVerificationInstance]: @@ -969,6 +990,8 @@ async def list_async( :param str tollfree_phone_number_sid: The SID of the Phone Number associated with the Tollfree Verification. :param "TollfreeVerificationInstance.Status" status: The compliance status of the Tollfree Verification record. + :param str external_reference_id: Customer supplied reference id for the Tollfree Verification record. + :param bool include_sub_accounts: Whether to include Tollfree Verifications from sub accounts in list response. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -983,6 +1006,8 @@ async def list_async( async for record in await self.stream_async( tollfree_phone_number_sid=tollfree_phone_number_sid, status=status, + external_reference_id=external_reference_id, + include_sub_accounts=include_sub_accounts, limit=limit, page_size=page_size, ) @@ -992,6 +1017,8 @@ def page( self, tollfree_phone_number_sid: Union[str, object] = values.unset, status: Union["TollfreeVerificationInstance.Status", object] = values.unset, + external_reference_id: Union[str, object] = values.unset, + include_sub_accounts: Union[bool, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -1002,6 +1029,8 @@ def page( :param tollfree_phone_number_sid: The SID of the Phone Number associated with the Tollfree Verification. :param status: The compliance status of the Tollfree Verification record. + :param external_reference_id: Customer supplied reference id for the Tollfree Verification record. + :param include_sub_accounts: Whether to include Tollfree Verifications from sub accounts in list response. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1012,6 +1041,8 @@ def page( { "TollfreePhoneNumberSid": tollfree_phone_number_sid, "Status": status, + "ExternalReferenceId": external_reference_id, + "IncludeSubAccounts": serialize.boolean_to_string(include_sub_accounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -1025,6 +1056,8 @@ async def page_async( self, tollfree_phone_number_sid: Union[str, object] = values.unset, status: Union["TollfreeVerificationInstance.Status", object] = values.unset, + external_reference_id: Union[str, object] = values.unset, + include_sub_accounts: Union[bool, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -1035,6 +1068,8 @@ async def page_async( :param tollfree_phone_number_sid: The SID of the Phone Number associated with the Tollfree Verification. :param status: The compliance status of the Tollfree Verification record. + :param external_reference_id: Customer supplied reference id for the Tollfree Verification record. + :param include_sub_accounts: Whether to include Tollfree Verifications from sub accounts in list response. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -1045,6 +1080,8 @@ async def page_async( { "TollfreePhoneNumberSid": tollfree_phone_number_sid, "Status": status, + "ExternalReferenceId": external_reference_id, + "IncludeSubAccounts": serialize.boolean_to_string(include_sub_accounts), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 7466d170dd..043364c3d5 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -31,6 +31,9 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( PortingWebhookConfigurationFetchList, ) +from twilio.rest.numbers.v1.signing_request_configuration import ( + SigningRequestConfigurationList, +) class V1(Version): @@ -58,6 +61,9 @@ def __init__(self, domain: Domain): self._porting_webhook_configuration_fetch: Optional[ PortingWebhookConfigurationFetchList ] = None + self._signing_request_configurations: Optional[ + SigningRequestConfigurationList + ] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -115,6 +121,12 @@ def porting_webhook_configuration_fetch( ) return self._porting_webhook_configuration_fetch + @property + def signing_request_configurations(self) -> SigningRequestConfigurationList: + if self._signing_request_configurations is None: + self._signing_request_configurations = SigningRequestConfigurationList(self) + return self._signing_request_configurations + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/signing_request_configuration.py b/twilio/rest/numbers/v1/signing_request_configuration.py new file mode 100644 index 0000000000..1b70ba88c0 --- /dev/null +++ b/twilio/rest/numbers/v1/signing_request_configuration.py @@ -0,0 +1,116 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional, Union +from twilio.base import values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class SigningRequestConfigurationInstance(InstanceResource): + """ + :ivar logo_sid: The SID of the document that includes the logo that will appear in the LOA. To upload documents follow the following guide: https://www.twilio.com/docs/phone-numbers/regulatory/getting-started/create-new-bundle-public-rest-apis#supporting-document-create + :ivar friendly_name: This is the string that you assigned as a friendly name for describing the creation of the configuration. + :ivar product: The product or service for which is requesting the signature. + :ivar country: The country ISO code to apply the configuration. + :ivar email_subject: Subject of the email that the end client will receive ex: “Twilio Hosting Request”, maximum length of 255 characters. + :ivar email_message: Content of the email that the end client will receive ex: “This is a Hosting request from Twilio, please check the document and sign it”, maximum length of 5,000 characters. + :ivar url_redirection: Url the end client will be redirected after signing a document. + :ivar url: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.logo_sid: Optional[str] = payload.get("logo_sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.product: Optional[str] = payload.get("product") + self.country: Optional[str] = payload.get("country") + self.email_subject: Optional[str] = payload.get("email_subject") + self.email_message: Optional[str] = payload.get("email_message") + self.url_redirection: Optional[str] = payload.get("url_redirection") + self.url: Optional[str] = payload.get("url") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class SigningRequestConfigurationList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the SigningRequestConfigurationList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/SigningRequest/Configuration" + + def create( + self, body: Union[object, object] = values.unset + ) -> SigningRequestConfigurationInstance: + """ + Create the SigningRequestConfigurationInstance + + :param body: + + :returns: The created SigningRequestConfigurationInstance + """ + data = body.to_dict() + + headers = {"Content-Type": "application/json"} + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return SigningRequestConfigurationInstance(self._version, payload) + + async def create_async( + self, body: Union[object, object] = values.unset + ) -> SigningRequestConfigurationInstance: + """ + Asynchronously create the SigningRequestConfigurationInstance + + :param body: + + :returns: The created SigningRequestConfigurationInstance + """ + data = body.to_dict() + + headers = {"Content-Type": "application/json"} + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return SigningRequestConfigurationInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" From 98ffc7eac860f3ceac87659d372c5db4823d1586 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 6 Jun 2024 11:45:35 +0000 Subject: [PATCH 028/113] Release 9.1.1 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6745e08343..9d80846085 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.1.0", + version="9.1.1", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index f6647e7a8f..00a5b6d726 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "1", "0") +__version_info__ = ("9", "1", "1") __version__ = ".".join(__version_info__) From ad1f20889c159cb2dbb7ad1327c5e3c79635ea70 Mon Sep 17 00:00:00 2001 From: Shubham Date: Tue, 18 Jun 2024 16:45:02 +0530 Subject: [PATCH 029/113] chore: adding contentType in post and put (#796) * chore: adding contentType in post and put --- twilio/base/client_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twilio/base/client_base.py b/twilio/base/client_base.py index c9e0f9c487..5f17c75406 100644 --- a/twilio/base/client_base.py +++ b/twilio/base/client_base.py @@ -184,7 +184,7 @@ def get_headers( # Types, encodings, etc. headers["Accept-Charset"] = "utf-8" - if method == "POST" and "Content-Type" not in headers: + if (method == "POST" or method == "PUT") and ("Content-Type" not in headers): headers["Content-Type"] = "application/x-www-form-urlencoded" if "Accept" not in headers: headers["Accept"] = "application/json" From 2c77186d16fee50650ac20942789bf39e49c60f6 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 18 Jun 2024 17:08:07 +0000 Subject: [PATCH 030/113] [Librarian] Regenerated @ 84b4cd4c23a96109c715a2512bbe8238fae5c394 27d8c0867df0f71947f6535d79d018c706950630 --- CHANGES.md | 24 + twilio/rest/accounts/v1/credential/aws.py | 10 +- .../rest/accounts/v1/credential/public_key.py | 10 +- twilio/rest/accounts/v1/safelist.py | 26 +- twilio/rest/api/v2010/account/__init__.py | 10 +- .../api/v2010/account/address/__init__.py | 10 +- twilio/rest/api/v2010/account/application.py | 10 +- twilio/rest/api/v2010/account/balance.py | 9 +- .../rest/api/v2010/account/call/__init__.py | 12 +- twilio/rest/api/v2010/account/call/payment.py | 10 +- .../rest/api/v2010/account/call/recording.py | 10 +- twilio/rest/api/v2010/account/call/siprec.py | 10 +- twilio/rest/api/v2010/account/call/stream.py | 10 +- .../account/call/user_defined_message.py | 10 +- .../call/user_defined_message_subscription.py | 10 +- .../v2010/account/conference/participant.py | 10 +- .../account/incoming_phone_number/__init__.py | 10 +- .../assigned_add_on/__init__.py | 10 +- .../account/incoming_phone_number/local.py | 10 +- .../account/incoming_phone_number/mobile.py | 10 +- .../incoming_phone_number/toll_free.py | 10 +- .../api/v2010/account/message/__init__.py | 10 +- .../api/v2010/account/message/feedback.py | 10 +- twilio/rest/api/v2010/account/new_key.py | 10 +- .../rest/api/v2010/account/new_signing_key.py | 10 +- .../rest/api/v2010/account/queue/__init__.py | 10 +- .../api/v2010/account/recording/__init__.py | 2 +- .../account/sip/credential_list/__init__.py | 10 +- .../account/sip/credential_list/credential.py | 10 +- .../api/v2010/account/sip/domain/__init__.py | 10 +- .../auth_calls_credential_list_mapping.py | 10 +- ...th_calls_ip_access_control_list_mapping.py | 10 +- ...h_registrations_credential_list_mapping.py | 10 +- .../sip/domain/credential_list_mapping.py | 10 +- .../domain/ip_access_control_list_mapping.py | 10 +- .../sip/ip_access_control_list/__init__.py | 10 +- .../sip/ip_access_control_list/ip_address.py | 10 +- twilio/rest/api/v2010/account/token.py | 10 +- .../rest/api/v2010/account/usage/trigger.py | 10 +- .../api/v2010/account/validation_request.py | 10 +- .../v1/export/export_custom_job.py | 10 +- twilio/rest/chat/v1/credential.py | 10 +- twilio/rest/chat/v1/service/__init__.py | 10 +- .../rest/chat/v1/service/channel/__init__.py | 10 +- twilio/rest/chat/v1/service/channel/invite.py | 10 +- twilio/rest/chat/v1/service/channel/member.py | 10 +- .../rest/chat/v1/service/channel/message.py | 10 +- twilio/rest/chat/v1/service/role.py | 10 +- twilio/rest/chat/v1/service/user/__init__.py | 10 +- twilio/rest/chat/v2/credential.py | 10 +- twilio/rest/chat/v2/service/__init__.py | 10 +- .../rest/chat/v2/service/channel/__init__.py | 2 + twilio/rest/chat/v2/service/channel/invite.py | 10 +- twilio/rest/chat/v2/service/channel/member.py | 2 + .../rest/chat/v2/service/channel/message.py | 2 + .../rest/chat/v2/service/channel/webhook.py | 10 +- twilio/rest/chat/v2/service/role.py | 10 +- twilio/rest/chat/v2/service/user/__init__.py | 2 + twilio/rest/content/v1/content/__init__.py | 481 +----------------- .../content/v1/content/approval_create.py | 60 +-- .../rest/content/v1/content/approval_fetch.py | 32 +- .../rest/content/v1/content_and_approvals.py | 2 +- .../conversations/v1/address_configuration.py | 10 +- .../conversations/v1/conversation/__init__.py | 2 + .../v1/conversation/message/__init__.py | 2 + .../v1/conversation/participant.py | 2 + .../conversations/v1/conversation/webhook.py | 10 +- twilio/rest/conversations/v1/credential.py | 10 +- twilio/rest/conversations/v1/role.py | 10 +- .../rest/conversations/v1/service/__init__.py | 10 +- .../v1/service/conversation/__init__.py | 2 + .../service/conversation/message/__init__.py | 2 + .../v1/service/conversation/participant.py | 2 + .../v1/service/conversation/webhook.py | 10 +- twilio/rest/conversations/v1/service/role.py | 10 +- .../conversations/v1/service/user/__init__.py | 2 + twilio/rest/conversations/v1/user/__init__.py | 2 + twilio/rest/events/v1/event_type.py | 4 + twilio/rest/events/v1/sink/__init__.py | 10 +- twilio/rest/events/v1/sink/sink_test.py | 13 +- twilio/rest/events/v1/sink/sink_validate.py | 10 +- .../rest/events/v1/subscription/__init__.py | 10 +- .../v1/subscription/subscribed_event.py | 10 +- twilio/rest/flex_api/v1/assessments.py | 2 + twilio/rest/flex_api/v1/channel.py | 10 +- twilio/rest/flex_api/v1/flex_flow.py | 10 +- .../v1/insights_assessments_comment.py | 2 + .../flex_api/v1/insights_questionnaires.py | 2 + .../v1/insights_questionnaires_category.py | 2 + .../v1/insights_questionnaires_question.py | 2 + .../v1/insights_settings_answer_sets.py | 2 + .../flex_api/v1/insights_settings_comment.py | 2 + .../rest/flex_api/v1/interaction/__init__.py | 10 +- .../interaction_channel_invite.py | 10 +- .../interaction_channel_participant.py | 10 +- twilio/rest/flex_api/v1/plugin/__init__.py | 2 + .../flex_api/v1/plugin/plugin_versions.py | 2 + .../v1/plugin_configuration/__init__.py | 2 + twilio/rest/flex_api/v1/plugin_release.py | 2 + twilio/rest/flex_api/v1/web_channel.py | 10 +- twilio/rest/flex_api/v2/web_channels.py | 2 + .../rest/intelligence/v2/custom_operator.py | 10 +- twilio/rest/intelligence/v2/service.py | 10 +- .../intelligence/v2/transcript/__init__.py | 10 +- twilio/rest/ip_messaging/v1/credential.py | 10 +- .../rest/ip_messaging/v1/service/__init__.py | 10 +- .../v1/service/channel/__init__.py | 10 +- .../ip_messaging/v1/service/channel/invite.py | 10 +- .../ip_messaging/v1/service/channel/member.py | 10 +- .../v1/service/channel/message.py | 10 +- twilio/rest/ip_messaging/v1/service/role.py | 10 +- .../ip_messaging/v1/service/user/__init__.py | 10 +- twilio/rest/ip_messaging/v2/credential.py | 10 +- .../rest/ip_messaging/v2/service/__init__.py | 10 +- .../v2/service/channel/__init__.py | 2 + .../ip_messaging/v2/service/channel/invite.py | 10 +- .../ip_messaging/v2/service/channel/member.py | 2 + .../v2/service/channel/message.py | 2 + .../v2/service/channel/webhook.py | 10 +- twilio/rest/ip_messaging/v2/service/role.py | 10 +- .../ip_messaging/v2/service/user/__init__.py | 2 + .../v1/installed_add_on/__init__.py | 10 +- .../installed_add_on_usage.py | 8 +- .../v1/brand_registration/__init__.py | 10 +- .../brand_registration_otp.py | 13 +- .../v1/brand_registration/brand_vetting.py | 10 +- twilio/rest/messaging/v1/external_campaign.py | 10 +- twilio/rest/messaging/v1/service/__init__.py | 10 +- .../rest/messaging/v1/service/alpha_sender.py | 10 +- .../rest/messaging/v1/service/phone_number.py | 10 +- .../rest/messaging/v1/service/short_code.py | 10 +- .../messaging/v1/service/us_app_to_person.py | 10 +- .../v1/service/us_app_to_person_usecase.py | 8 +- .../messaging/v1/tollfree_verification.py | 10 +- twilio/rest/messaging/v1/usecase.py | 9 +- twilio/rest/microvisor/v1/account_config.py | 10 +- twilio/rest/microvisor/v1/account_secret.py | 10 +- .../microvisor/v1/device/device_config.py | 10 +- .../microvisor/v1/device/device_secret.py | 10 +- twilio/rest/notify/v1/credential.py | 10 +- twilio/rest/notify/v1/service/__init__.py | 10 +- twilio/rest/notify/v1/service/binding.py | 10 +- twilio/rest/notify/v1/service/notification.py | 10 +- twilio/rest/numbers/v1/bulk_eligibility.py | 6 +- twilio/rest/numbers/v1/eligibility.py | 6 +- twilio/rest/numbers/v1/porting_port_in.py | 10 +- .../v1/porting_port_in_phone_number.py | 22 +- twilio/rest/numbers/v1/porting_portability.py | 4 - .../v1/porting_webhook_configuration.py | 6 +- .../v1/porting_webhook_configuration_fetch.py | 10 +- .../v1/signing_request_configuration.py | 6 +- .../v2/authorization_document/__init__.py | 10 +- .../numbers/v2/bulk_hosted_number_order.py | 6 +- twilio/rest/numbers/v2/hosted_number_order.py | 10 +- .../regulatory_compliance/bundle/__init__.py | 10 +- .../bundle/bundle_copy.py | 10 +- .../bundle/evaluation.py | 12 +- .../bundle/item_assignment.py | 10 +- .../bundle/replace_items.py | 10 +- .../v2/regulatory_compliance/end_user.py | 10 +- .../supporting_document.py | 10 +- twilio/rest/oauth/v1/authorize.py | 8 +- twilio/rest/oauth/v1/token.py | 10 +- .../deployed_devices/fleet/__init__.py | 10 +- .../deployed_devices/fleet/certificate.py | 10 +- .../deployed_devices/fleet/deployment.py | 10 +- .../preview/deployed_devices/fleet/device.py | 10 +- .../preview/deployed_devices/fleet/key.py | 10 +- .../authorization_document/__init__.py | 10 +- .../hosted_numbers/hosted_number_order.py | 10 +- .../marketplace/installed_add_on/__init__.py | 10 +- twilio/rest/preview/sync/service/__init__.py | 10 +- .../preview/sync/service/document/__init__.py | 10 +- .../sync/service/sync_list/__init__.py | 10 +- .../sync/service/sync_list/sync_list_item.py | 10 +- .../preview/sync/service/sync_map/__init__.py | 10 +- .../sync/service/sync_map/sync_map_item.py | 10 +- twilio/rest/preview/wireless/command.py | 10 +- twilio/rest/preview/wireless/rate_plan.py | 10 +- twilio/rest/proxy/v1/service/__init__.py | 10 +- twilio/rest/proxy/v1/service/phone_number.py | 10 +- .../rest/proxy/v1/service/session/__init__.py | 10 +- .../service/session/participant/__init__.py | 10 +- .../participant/message_interaction.py | 10 +- twilio/rest/proxy/v1/service/short_code.py | 10 +- twilio/rest/serverless/v1/service/__init__.py | 10 +- .../serverless/v1/service/asset/__init__.py | 10 +- .../serverless/v1/service/build/__init__.py | 12 +- .../v1/service/environment/__init__.py | 10 +- .../v1/service/environment/deployment.py | 10 +- .../v1/service/environment/variable.py | 10 +- .../v1/service/function/__init__.py | 10 +- .../studio/v1/flow/engagement/__init__.py | 10 +- .../rest/studio/v1/flow/execution/__init__.py | 10 +- twilio/rest/studio/v2/flow/__init__.py | 10 +- .../rest/studio/v2/flow/execution/__init__.py | 10 +- twilio/rest/studio/v2/flow_validate.py | 10 +- twilio/rest/supersim/v1/esim_profile.py | 10 +- twilio/rest/supersim/v1/fleet.py | 10 +- twilio/rest/supersim/v1/ip_command.py | 10 +- .../v1/network_access_profile/__init__.py | 10 +- .../network_access_profile_network.py | 10 +- twilio/rest/supersim/v1/sim/__init__.py | 10 +- twilio/rest/supersim/v1/sms_command.py | 10 +- twilio/rest/sync/v1/service/__init__.py | 10 +- .../rest/sync/v1/service/document/__init__.py | 10 +- .../sync/v1/service/sync_list/__init__.py | 10 +- .../v1/service/sync_list/sync_list_item.py | 10 +- .../rest/sync/v1/service/sync_map/__init__.py | 10 +- .../sync/v1/service/sync_map/sync_map_item.py | 10 +- .../sync/v1/service/sync_stream/__init__.py | 10 +- .../v1/service/sync_stream/stream_message.py | 10 +- .../rest/taskrouter/v1/workspace/__init__.py | 10 +- .../rest/taskrouter/v1/workspace/activity.py | 10 +- .../taskrouter/v1/workspace/task/__init__.py | 10 +- .../taskrouter/v1/workspace/task_channel.py | 10 +- .../v1/workspace/task_queue/__init__.py | 10 +- .../task_queue_bulk_real_time_statistics.py | 6 +- .../v1/workspace/worker/__init__.py | 10 +- .../v1/workspace/workflow/__init__.py | 10 +- twilio/rest/trunking/v1/trunk/__init__.py | 10 +- .../rest/trunking/v1/trunk/credential_list.py | 10 +- .../v1/trunk/ip_access_control_list.py | 10 +- .../rest/trunking/v1/trunk/origination_url.py | 10 +- twilio/rest/trunking/v1/trunk/phone_number.py | 10 +- .../rest/trusthub/v1/compliance_inquiries.py | 10 +- .../v1/compliance_registration_inquiries.py | 10 +- .../v1/compliance_tollfree_inquiries.py | 20 +- .../trusthub/v1/customer_profiles/__init__.py | 10 +- ...er_profiles_channel_endpoint_assignment.py | 10 +- .../customer_profiles_entity_assignments.py | 10 +- .../customer_profiles_evaluations.py | 10 +- twilio/rest/trusthub/v1/end_user.py | 10 +- .../rest/trusthub/v1/supporting_document.py | 10 +- .../trusthub/v1/trust_products/__init__.py | 10 +- ...st_products_channel_endpoint_assignment.py | 10 +- .../trust_products_entity_assignments.py | 10 +- .../trust_products_evaluations.py | 10 +- twilio/rest/verify/v2/safelist.py | 10 +- twilio/rest/verify/v2/service/__init__.py | 10 +- twilio/rest/verify/v2/service/access_token.py | 10 +- .../rest/verify/v2/service/entity/__init__.py | 10 +- .../v2/service/entity/challenge/__init__.py | 10 +- .../service/entity/challenge/notification.py | 10 +- .../verify/v2/service/entity/new_factor.py | 10 +- .../v2/service/messaging_configuration.py | 10 +- .../verify/v2/service/rate_limit/__init__.py | 10 +- .../verify/v2/service/rate_limit/bucket.py | 10 +- twilio/rest/verify/v2/service/verification.py | 10 +- .../verify/v2/service/verification_check.py | 10 +- twilio/rest/verify/v2/service/webhook.py | 10 +- twilio/rest/video/v1/composition.py | 10 +- twilio/rest/video/v1/composition_hook.py | 10 +- twilio/rest/video/v1/room/__init__.py | 10 +- .../v1/room/participant/subscribe_rules.py | 18 +- twilio/rest/video/v1/room/recording_rules.py | 18 +- twilio/rest/voice/v1/byoc_trunk.py | 10 +- .../voice/v1/connection_policy/__init__.py | 10 +- .../connection_policy_target.py | 10 +- .../bulk_country_update.py | 10 +- twilio/rest/voice/v1/ip_record.py | 10 +- twilio/rest/voice/v1/source_ip_mapping.py | 10 +- twilio/rest/wireless/v1/command.py | 10 +- twilio/rest/wireless/v1/rate_plan.py | 10 +- 264 files changed, 1119 insertions(+), 1860 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 1dfa5043a6..b76a6331be 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,30 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-06-18] Version 9.2.0 +-------------------------- +**Library - Chore** +- [PR #796](https://github.com/twilio/twilio-python/pull/796): adding contentType in post and put. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Events** +- Add `status` and `documentation_url` to Event Types + +**Lookups** +- Removed unused `fraud` lookups in V1 only to facilitate rest proxy migration + +**Numbers** +- Add date_created field to the Get Port In Request API +- Rename the `status_last_time_updated_timestamp` field to `last_updated` in the Get Port In Phone Number API **(breaking change)** +- Add Rejection reason and rejection reason code to the Get Port In Phone Number API +- Remove the carrier information from the Portability API + +**Proxy** +- Change property `type` from enum to ienum + +**Trusthub** +- Add skipMessagingUseCase field in compliance_tollfree_inquiry. + + [2024-06-06] Version 9.1.1 -------------------------- **Api** diff --git a/twilio/rest/accounts/v1/credential/aws.py b/twilio/rest/accounts/v1/credential/aws.py index ab75620920..05d92755c4 100644 --- a/twilio/rest/accounts/v1/credential/aws.py +++ b/twilio/rest/accounts/v1/credential/aws.py @@ -330,11 +330,10 @@ def create( "AccountSid": account_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AwsInstance(self._version, payload) @@ -362,11 +361,10 @@ async def create_async( "AccountSid": account_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AwsInstance(self._version, payload) diff --git a/twilio/rest/accounts/v1/credential/public_key.py b/twilio/rest/accounts/v1/credential/public_key.py index 09018d1d26..ec2a1f8660 100644 --- a/twilio/rest/accounts/v1/credential/public_key.py +++ b/twilio/rest/accounts/v1/credential/public_key.py @@ -334,11 +334,10 @@ def create( "AccountSid": account_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PublicKeyInstance(self._version, payload) @@ -366,11 +365,10 @@ async def create_async( "AccountSid": account_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PublicKeyInstance(self._version, payload) diff --git a/twilio/rest/accounts/v1/safelist.py b/twilio/rest/accounts/v1/safelist.py index ce5672caed..51f00fd8ca 100644 --- a/twilio/rest/accounts/v1/safelist.py +++ b/twilio/rest/accounts/v1/safelist.py @@ -69,11 +69,10 @@ def create(self, phone_number: str) -> SafelistInstance: "PhoneNumber": phone_number, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SafelistInstance(self._version, payload) @@ -92,11 +91,10 @@ async def create_async(self, phone_number: str) -> SafelistInstance: "PhoneNumber": phone_number, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SafelistInstance(self._version, payload) @@ -108,13 +106,16 @@ def delete(self, phone_number: Union[str, object] = values.unset) -> bool: :param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: True if delete succeeds, False otherwise """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { "PhoneNumber": phone_number, } ) - return self._version.delete(method="DELETE", uri=self._uri, params=params) + return self._version.delete( + method="DELETE", uri=self._uri, headers=headers, params=params + ) async def delete_async( self, phone_number: Union[str, object] = values.unset @@ -125,6 +126,7 @@ async def delete_async( :param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: True if delete succeeds, False otherwise """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -132,7 +134,7 @@ async def delete_async( } ) return await self._version.delete_async( - method="DELETE", uri=self._uri, params=params + method="DELETE", uri=self._uri, headers=headers, params=params ) def fetch( @@ -144,6 +146,7 @@ def fetch( :param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: The fetched SafelistInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -151,7 +154,9 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=params) + payload = self._version.fetch( + method="GET", uri=self._uri, headers=headers, params=params + ) return SafelistInstance(self._version, payload) @@ -164,6 +169,7 @@ async def fetch_async( :param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: The fetched SafelistInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -172,7 +178,7 @@ async def fetch_async( ) payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=params + method="GET", uri=self._uri, headers=headers, params=params ) return SafelistInstance(self._version, payload) diff --git a/twilio/rest/api/v2010/account/__init__.py b/twilio/rest/api/v2010/account/__init__.py index adf2458f2a..dc0c53c9c0 100644 --- a/twilio/rest/api/v2010/account/__init__.py +++ b/twilio/rest/api/v2010/account/__init__.py @@ -830,11 +830,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountInstance(self._version, payload) @@ -855,11 +854,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountInstance(self._version, payload) diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index fd77747102..36ee8f2231 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -529,11 +529,10 @@ def create( "StreetSecondary": street_secondary, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressInstance( @@ -584,11 +583,10 @@ async def create_async( "StreetSecondary": street_secondary, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressInstance( diff --git a/twilio/rest/api/v2010/account/application.py b/twilio/rest/api/v2010/account/application.py index a3b11f0282..d1e50c5f04 100644 --- a/twilio/rest/api/v2010/account/application.py +++ b/twilio/rest/api/v2010/account/application.py @@ -636,11 +636,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ApplicationInstance( @@ -713,11 +712,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ApplicationInstance( diff --git a/twilio/rest/api/v2010/account/balance.py b/twilio/rest/api/v2010/account/balance.py index 0e90cdaae0..97c7b33035 100644 --- a/twilio/rest/api/v2010/account/balance.py +++ b/twilio/rest/api/v2010/account/balance.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -72,8 +73,9 @@ def fetch(self) -> BalanceInstance: :returns: The fetched BalanceInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = self._version.fetch(method="GET", uri=self._uri) + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BalanceInstance( self._version, payload, account_sid=self._solution["account_sid"] @@ -86,8 +88,11 @@ async def fetch_async(self) -> BalanceInstance: :returns: The fetched BalanceInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = await self._version.fetch_async(method="GET", uri=self._uri) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return BalanceInstance( self._version, payload, account_sid=self._solution["account_sid"] diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index 2ba343f566..fa8e40707b 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -65,7 +65,7 @@ class UpdateStatus(object): :ivar start_time: The start time of the call, given as UTC in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call has not yet been dialed. :ivar end_time: The time the call ended, given as UTC in [RFC 2822](https://www.php.net/manual/en/class.datetime.php#datetime.constants.rfc2822) format. Empty if the call did not complete successfully. :ivar duration: The length of the call in seconds. This value is empty for busy, failed, unanswered, or ongoing calls. - :ivar price: The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. + :ivar price: The charge for this call, in the currency associated with the account. Populated after the call is completed. May not be immediately available. The price associated with a call only reflects the charge for connectivity. Charges for other call-related features such as Answering Machine Detection, Text-To-Speech, and SIP REFER are not included in this value. :ivar price_unit: The currency in which `Price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g., `USD`, `EUR`, `JPY`). Always capitalized for calls. :ivar direction: A string describing the direction of the call. Can be: `inbound` for inbound calls, `outbound-api` for calls initiated via the REST API or `outbound-dial` for calls initiated by a `` verb. Using [Elastic SIP Trunking](https://www.twilio.com/docs/sip-trunking), the values can be [`trunking-terminating`](https://www.twilio.com/docs/sip-trunking#termination) for outgoing calls from your communications infrastructure to the PSTN or [`trunking-originating`](https://www.twilio.com/docs/sip-trunking#origination) for incoming calls to your communications infrastructure from the PSTN. :ivar answered_by: Either `human` or `machine` if this call was initiated with answering machine detection. Empty otherwise. @@ -807,11 +807,10 @@ def create( "ApplicationSid": application_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CallInstance( @@ -941,11 +940,10 @@ async def create_async( "ApplicationSid": application_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CallInstance( diff --git a/twilio/rest/api/v2010/account/call/payment.py b/twilio/rest/api/v2010/account/call/payment.py index 08619588de..00f76be814 100644 --- a/twilio/rest/api/v2010/account/call/payment.py +++ b/twilio/rest/api/v2010/account/call/payment.py @@ -362,11 +362,10 @@ def create( "ValidCardTypes": valid_card_types, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PaymentInstance( @@ -440,11 +439,10 @@ async def create_async( "ValidCardTypes": valid_card_types, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PaymentInstance( diff --git a/twilio/rest/api/v2010/account/call/recording.py b/twilio/rest/api/v2010/account/call/recording.py index b9653c4b5b..71158a2fe8 100644 --- a/twilio/rest/api/v2010/account/call/recording.py +++ b/twilio/rest/api/v2010/account/call/recording.py @@ -454,11 +454,10 @@ def create( "RecordingTrack": recording_track, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingInstance( @@ -502,11 +501,10 @@ async def create_async( "RecordingTrack": recording_track, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingInstance( diff --git a/twilio/rest/api/v2010/account/call/siprec.py b/twilio/rest/api/v2010/account/call/siprec.py index bcb537071f..28a0734e19 100644 --- a/twilio/rest/api/v2010/account/call/siprec.py +++ b/twilio/rest/api/v2010/account/call/siprec.py @@ -861,11 +861,10 @@ def create( "Parameter99.Value": parameter99_value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SiprecInstance( @@ -1498,11 +1497,10 @@ async def create_async( "Parameter99.Value": parameter99_value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SiprecInstance( diff --git a/twilio/rest/api/v2010/account/call/stream.py b/twilio/rest/api/v2010/account/call/stream.py index 3975f52d49..b3fa197bf8 100644 --- a/twilio/rest/api/v2010/account/call/stream.py +++ b/twilio/rest/api/v2010/account/call/stream.py @@ -863,11 +863,10 @@ def create( "Parameter99.Value": parameter99_value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return StreamInstance( @@ -1500,11 +1499,10 @@ async def create_async( "Parameter99.Value": parameter99_value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return StreamInstance( diff --git a/twilio/rest/api/v2010/account/call/user_defined_message.py b/twilio/rest/api/v2010/account/call/user_defined_message.py index 0e9d1f0490..4b43383711 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message.py @@ -98,11 +98,10 @@ def create( "IdempotencyKey": idempotency_key, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserDefinedMessageInstance( @@ -130,11 +129,10 @@ async def create_async( "IdempotencyKey": idempotency_key, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserDefinedMessageInstance( diff --git a/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py b/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py index a0b7c18339..677042bd7c 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py @@ -206,11 +206,10 @@ def create( "Method": method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserDefinedMessageSubscriptionInstance( @@ -243,11 +242,10 @@ async def create_async( "Method": method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserDefinedMessageSubscriptionInstance( diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index 2c7ae5932c..3706cd24fa 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -701,11 +701,10 @@ def create( "CallToken": call_token, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( @@ -887,11 +886,10 @@ async def create_async( "CallToken": call_token, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py index 6fa4748b60..d1001a7cae 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py @@ -845,11 +845,10 @@ def create( "AreaCode": area_code, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IncomingPhoneNumberInstance( @@ -948,11 +947,10 @@ async def create_async( "AreaCode": area_code, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IncomingPhoneNumberInstance( diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py index 12c6f961e4..a6ced82856 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py @@ -320,11 +320,10 @@ def create(self, installed_add_on_sid: str) -> AssignedAddOnInstance: "InstalledAddOnSid": installed_add_on_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AssignedAddOnInstance( @@ -348,11 +347,10 @@ async def create_async(self, installed_add_on_sid: str) -> AssignedAddOnInstance "InstalledAddOnSid": installed_add_on_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AssignedAddOnInstance( diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/local.py b/twilio/rest/api/v2010/account/incoming_phone_number/local.py index 4548720329..ca7baa8552 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/local.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/local.py @@ -279,11 +279,10 @@ def create( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return LocalInstance( @@ -377,11 +376,10 @@ async def create_async( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return LocalInstance( diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py index 6147d4bfe7..830897b178 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py @@ -281,11 +281,10 @@ def create( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MobileInstance( @@ -381,11 +380,10 @@ async def create_async( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MobileInstance( diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py index 806b7c0500..8625e318c6 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py @@ -281,11 +281,10 @@ def create( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TollFreeInstance( @@ -381,11 +380,10 @@ async def create_async( "BundleSid": bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TollFreeInstance( diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index ff0ed8561f..7eb11d3889 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -560,11 +560,10 @@ def create( "ContentSid": content_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -658,11 +657,10 @@ async def create_async( "ContentSid": content_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( diff --git a/twilio/rest/api/v2010/account/message/feedback.py b/twilio/rest/api/v2010/account/message/feedback.py index 2ccce06a54..797c9a7331 100644 --- a/twilio/rest/api/v2010/account/message/feedback.py +++ b/twilio/rest/api/v2010/account/message/feedback.py @@ -111,11 +111,10 @@ def create( "Outcome": outcome, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FeedbackInstance( @@ -141,11 +140,10 @@ async def create_async( "Outcome": outcome, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FeedbackInstance( diff --git a/twilio/rest/api/v2010/account/new_key.py b/twilio/rest/api/v2010/account/new_key.py index 015249ddf8..fcefed5b62 100644 --- a/twilio/rest/api/v2010/account/new_key.py +++ b/twilio/rest/api/v2010/account/new_key.py @@ -91,11 +91,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewKeyInstance( @@ -118,11 +117,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewKeyInstance( diff --git a/twilio/rest/api/v2010/account/new_signing_key.py b/twilio/rest/api/v2010/account/new_signing_key.py index 6bfa32324b..bb9b0f2e2d 100644 --- a/twilio/rest/api/v2010/account/new_signing_key.py +++ b/twilio/rest/api/v2010/account/new_signing_key.py @@ -91,11 +91,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewSigningKeyInstance( @@ -118,11 +117,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewSigningKeyInstance( diff --git a/twilio/rest/api/v2010/account/queue/__init__.py b/twilio/rest/api/v2010/account/queue/__init__.py index 4e6c87baa9..4031ba8196 100644 --- a/twilio/rest/api/v2010/account/queue/__init__.py +++ b/twilio/rest/api/v2010/account/queue/__init__.py @@ -405,11 +405,10 @@ def create( "MaxSize": max_size, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return QueueInstance( @@ -434,11 +433,10 @@ async def create_async( "MaxSize": max_size, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return QueueInstance( diff --git a/twilio/rest/api/v2010/account/recording/__init__.py b/twilio/rest/api/v2010/account/recording/__init__.py index bc1ddccb76..1766600ec3 100644 --- a/twilio/rest/api/v2010/account/recording/__init__.py +++ b/twilio/rest/api/v2010/account/recording/__init__.py @@ -57,7 +57,7 @@ class Status(object): :ivar price: The one-time cost of creating the recording in the `price_unit` currency. :ivar price_unit: The currency used in the `price` property. Example: `USD`. :ivar status: - :ivar channels: The number of channels in the final recording file. Can be: `1` or `2`. You can split a call with two legs into two separate recording channels if you record using [TwiML Dial](https://www.twilio.com/docs/voice/twiml/dial#record) or the [Outbound Rest API](https://www.twilio.com/docs/voice/make-calls#manage-your-outbound-call). + :ivar channels: The number of channels in the final recording file. Can be: `1` or `2`. :ivar source: :ivar error_code: The error code that describes why the recording is `absent`. The error code is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). This value is null if the recording `status` is not `absent`. :ivar uri: The URI of the resource, relative to `https://api.twilio.com`. diff --git a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py index 634500f8cf..30bb7094e7 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py @@ -375,11 +375,10 @@ def create(self, friendly_name: str) -> CredentialListInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListInstance( @@ -400,11 +399,10 @@ async def create_async(self, friendly_name: str) -> CredentialListInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListInstance( diff --git a/twilio/rest/api/v2010/account/sip/credential_list/credential.py b/twilio/rest/api/v2010/account/sip/credential_list/credential.py index 3d2c24b999..1e46bfe16e 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/credential.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/credential.py @@ -374,11 +374,10 @@ def create(self, username: str, password: str) -> CredentialInstance: "Password": password, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance( @@ -404,11 +403,10 @@ async def create_async(self, username: str, password: str) -> CredentialInstance "Password": password, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/__init__.py b/twilio/rest/api/v2010/account/sip/domain/__init__.py index b469628388..9ea7260438 100644 --- a/twilio/rest/api/v2010/account/sip/domain/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/__init__.py @@ -658,11 +658,10 @@ def create( "EmergencyCallerSid": emergency_caller_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DomainInstance( @@ -724,11 +723,10 @@ async def create_async( "EmergencyCallerSid": emergency_caller_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DomainInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py index 81bb5b0b0c..ff6fd5136e 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py @@ -288,11 +288,10 @@ def create( "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthCallsCredentialListMappingInstance( @@ -318,11 +317,10 @@ async def create_async( "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthCallsCredentialListMappingInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py index a690ef4b10..82099164e7 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py @@ -292,11 +292,10 @@ def create( "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthCallsIpAccessControlListMappingInstance( @@ -322,11 +321,10 @@ async def create_async( "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthCallsIpAccessControlListMappingInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py index 2b03bb2998..22acb7ef10 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py @@ -288,11 +288,10 @@ def create( "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthRegistrationsCredentialListMappingInstance( @@ -318,11 +317,10 @@ async def create_async( "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthRegistrationsCredentialListMappingInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py index f7838bfc59..e20e08e0fb 100644 --- a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py @@ -284,11 +284,10 @@ def create(self, credential_list_sid: str) -> CredentialListMappingInstance: "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListMappingInstance( @@ -314,11 +313,10 @@ async def create_async( "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListMappingInstance( diff --git a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py index c619be386f..607bb6ce12 100644 --- a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py @@ -290,11 +290,10 @@ def create( "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListMappingInstance( @@ -320,11 +319,10 @@ async def create_async( "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListMappingInstance( diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py index 7c2fd8214a..cf75721a96 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py @@ -379,11 +379,10 @@ def create(self, friendly_name: str) -> IpAccessControlListInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListInstance( @@ -404,11 +403,10 @@ async def create_async(self, friendly_name: str) -> IpAccessControlListInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListInstance( diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py index 251bae9655..106bd7400e 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py @@ -425,11 +425,10 @@ def create( "CidrPrefixLength": cidr_prefix_length, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAddressInstance( @@ -462,11 +461,10 @@ async def create_async( "CidrPrefixLength": cidr_prefix_length, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAddressInstance( diff --git a/twilio/rest/api/v2010/account/token.py b/twilio/rest/api/v2010/account/token.py index ec5acac97f..6d5edcf3e8 100644 --- a/twilio/rest/api/v2010/account/token.py +++ b/twilio/rest/api/v2010/account/token.py @@ -93,11 +93,10 @@ def create(self, ttl: Union[int, object] = values.unset) -> TokenInstance: "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TokenInstance( @@ -120,11 +119,10 @@ async def create_async( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TokenInstance( diff --git a/twilio/rest/api/v2010/account/usage/trigger.py b/twilio/rest/api/v2010/account/usage/trigger.py index 66e86602af..c3a1b241ca 100644 --- a/twilio/rest/api/v2010/account/usage/trigger.py +++ b/twilio/rest/api/v2010/account/usage/trigger.py @@ -766,11 +766,10 @@ def create( "TriggerBy": trigger_by, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TriggerInstance( @@ -812,11 +811,10 @@ async def create_async( "TriggerBy": trigger_by, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TriggerInstance( diff --git a/twilio/rest/api/v2010/account/validation_request.py b/twilio/rest/api/v2010/account/validation_request.py index a949df2d0a..261322712f 100644 --- a/twilio/rest/api/v2010/account/validation_request.py +++ b/twilio/rest/api/v2010/account/validation_request.py @@ -104,11 +104,10 @@ def create( "StatusCallbackMethod": status_callback_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ValidationRequestInstance( @@ -147,11 +146,10 @@ async def create_async( "StatusCallbackMethod": status_callback_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ValidationRequestInstance( diff --git a/twilio/rest/bulkexports/v1/export/export_custom_job.py b/twilio/rest/bulkexports/v1/export/export_custom_job.py index 758398eba3..9a81fb23cb 100644 --- a/twilio/rest/bulkexports/v1/export/export_custom_job.py +++ b/twilio/rest/bulkexports/v1/export/export_custom_job.py @@ -138,11 +138,10 @@ def create( "Email": email, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExportCustomJobInstance( @@ -181,11 +180,10 @@ async def create_async( "Email": email, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExportCustomJobInstance( diff --git a/twilio/rest/chat/v1/credential.py b/twilio/rest/chat/v1/credential.py index 68ec9f4b46..6bb8b3f981 100644 --- a/twilio/rest/chat/v1/credential.py +++ b/twilio/rest/chat/v1/credential.py @@ -420,11 +420,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -464,11 +463,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/chat/v1/service/__init__.py b/twilio/rest/chat/v1/service/__init__.py index 1e2a5884a7..71825fe578 100644 --- a/twilio/rest/chat/v1/service/__init__.py +++ b/twilio/rest/chat/v1/service/__init__.py @@ -1089,11 +1089,10 @@ def create(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -1112,11 +1111,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/chat/v1/service/channel/__init__.py b/twilio/rest/chat/v1/service/channel/__init__.py index 1585613948..02c42f65cc 100644 --- a/twilio/rest/chat/v1/service/channel/__init__.py +++ b/twilio/rest/chat/v1/service/channel/__init__.py @@ -484,11 +484,10 @@ def create( "Type": type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( @@ -521,11 +520,10 @@ async def create_async( "Type": type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( diff --git a/twilio/rest/chat/v1/service/channel/invite.py b/twilio/rest/chat/v1/service/channel/invite.py index 6beccffae4..c80732a2c0 100644 --- a/twilio/rest/chat/v1/service/channel/invite.py +++ b/twilio/rest/chat/v1/service/channel/invite.py @@ -296,11 +296,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( @@ -328,11 +327,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( diff --git a/twilio/rest/chat/v1/service/channel/member.py b/twilio/rest/chat/v1/service/channel/member.py index f0cd21448f..405662f02d 100644 --- a/twilio/rest/chat/v1/service/channel/member.py +++ b/twilio/rest/chat/v1/service/channel/member.py @@ -406,11 +406,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( @@ -438,11 +437,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( diff --git a/twilio/rest/chat/v1/service/channel/message.py b/twilio/rest/chat/v1/service/channel/message.py index f524c92387..34d9e01fb3 100644 --- a/twilio/rest/chat/v1/service/channel/message.py +++ b/twilio/rest/chat/v1/service/channel/message.py @@ -416,11 +416,10 @@ def create( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -453,11 +452,10 @@ async def create_async( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( diff --git a/twilio/rest/chat/v1/service/role.py b/twilio/rest/chat/v1/service/role.py index 1913986a4a..3ed57a6ee2 100644 --- a/twilio/rest/chat/v1/service/role.py +++ b/twilio/rest/chat/v1/service/role.py @@ -361,11 +361,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -392,11 +391,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( diff --git a/twilio/rest/chat/v1/service/user/__init__.py b/twilio/rest/chat/v1/service/user/__init__.py index b06509668a..13c4b9bef6 100644 --- a/twilio/rest/chat/v1/service/user/__init__.py +++ b/twilio/rest/chat/v1/service/user/__init__.py @@ -433,11 +433,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( @@ -470,11 +469,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( diff --git a/twilio/rest/chat/v2/credential.py b/twilio/rest/chat/v2/credential.py index 8011ed0e1f..b098f6820c 100644 --- a/twilio/rest/chat/v2/credential.py +++ b/twilio/rest/chat/v2/credential.py @@ -420,11 +420,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -464,11 +463,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/chat/v2/service/__init__.py b/twilio/rest/chat/v2/service/__init__.py index f6fa9e2c49..376043aed6 100644 --- a/twilio/rest/chat/v2/service/__init__.py +++ b/twilio/rest/chat/v2/service/__init__.py @@ -858,11 +858,10 @@ def create(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -881,11 +880,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/chat/v2/service/channel/__init__.py b/twilio/rest/chat/v2/service/channel/__init__.py index 2b49faf266..b3796c30d8 100644 --- a/twilio/rest/chat/v2/service/channel/__init__.py +++ b/twilio/rest/chat/v2/service/channel/__init__.py @@ -622,6 +622,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -675,6 +676,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/chat/v2/service/channel/invite.py b/twilio/rest/chat/v2/service/channel/invite.py index 2c7333786d..d0ef32e345 100644 --- a/twilio/rest/chat/v2/service/channel/invite.py +++ b/twilio/rest/chat/v2/service/channel/invite.py @@ -296,11 +296,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( @@ -328,11 +327,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( diff --git a/twilio/rest/chat/v2/service/channel/member.py b/twilio/rest/chat/v2/service/channel/member.py index c71d3e3457..95e737b82a 100644 --- a/twilio/rest/chat/v2/service/channel/member.py +++ b/twilio/rest/chat/v2/service/channel/member.py @@ -551,6 +551,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -609,6 +610,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/chat/v2/service/channel/message.py b/twilio/rest/chat/v2/service/channel/message.py index e98f526c74..1b2892176e 100644 --- a/twilio/rest/chat/v2/service/channel/message.py +++ b/twilio/rest/chat/v2/service/channel/message.py @@ -553,6 +553,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -609,6 +610,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/chat/v2/service/channel/webhook.py b/twilio/rest/chat/v2/service/channel/webhook.py index ca738bac4a..bc38198256 100644 --- a/twilio/rest/chat/v2/service/channel/webhook.py +++ b/twilio/rest/chat/v2/service/channel/webhook.py @@ -485,11 +485,10 @@ def create( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -538,11 +537,10 @@ async def create_async( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/chat/v2/service/role.py b/twilio/rest/chat/v2/service/role.py index 5bb373c9a2..bcc0b6e5a9 100644 --- a/twilio/rest/chat/v2/service/role.py +++ b/twilio/rest/chat/v2/service/role.py @@ -361,11 +361,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -392,11 +391,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( diff --git a/twilio/rest/chat/v2/service/user/__init__.py b/twilio/rest/chat/v2/service/user/__init__.py index 2c4ac5a3bd..768b78876e 100644 --- a/twilio/rest/chat/v2/service/user/__init__.py +++ b/twilio/rest/chat/v2/service/user/__init__.py @@ -491,6 +491,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -535,6 +536,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 72e1e82141..8a1c4212d9 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -25,22 +25,6 @@ class ContentInstance(InstanceResource): - - class AuthenticationActionType(object): - COPY_CODE = "COPY_CODE" - - class CallToActionActionType(object): - URL = "URL" - PHONE_NUMBER = "PHONE_NUMBER" - - class CardActionType(object): - URL = "URL" - PHONE_NUMBER = "PHONE_NUMBER" - QUICK_REPLY = "QUICK_REPLY" - - class QuickReplyActionType(object): - QUICK_REPLY = "QUICK_REPLY" - """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -49,7 +33,7 @@ class QuickReplyActionType(object): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar url: The URL of the resource, relative to `https://content.twilio.com`. :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create """ @@ -291,451 +275,6 @@ def __repr__(self) -> str: class ContentList(ListResource): - class AuthenticationAction(object): - """ - :ivar type: - :ivar copy_code_text: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.type: Optional["ContentInstance.AuthenticationActionType"] = ( - payload.get("type") - ) - self.copy_code_text: Optional[str] = payload.get("copy_code_text") - - def to_dict(self): - return { - "type": self.type.to_dict(), - "copy_code_text": self.copy_code_text, - } - - class CallToActionAction(object): - """ - :ivar type: - :ivar title: - :ivar url: - :ivar phone: - :ivar id: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.type: Optional["ContentInstance.CallToActionActionType"] = payload.get( - "type" - ) - self.title: Optional[str] = payload.get("title") - self.url: Optional[str] = payload.get("url") - self.phone: Optional[str] = payload.get("phone") - self.id: Optional[str] = payload.get("id") - - def to_dict(self): - return { - "type": self.type.to_dict(), - "title": self.title, - "url": self.url, - "phone": self.phone, - "id": self.id, - } - - class CardAction(object): - """ - :ivar type: - :ivar title: - :ivar url: - :ivar phone: - :ivar id: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.type: Optional["ContentInstance.CardActionType"] = payload.get("type") - self.title: Optional[str] = payload.get("title") - self.url: Optional[str] = payload.get("url") - self.phone: Optional[str] = payload.get("phone") - self.id: Optional[str] = payload.get("id") - - def to_dict(self): - return { - "type": self.type.to_dict(), - "title": self.title, - "url": self.url, - "phone": self.phone, - "id": self.id, - } - - class CatalogItem(object): - """ - :ivar id: - :ivar section_title: - :ivar name: - :ivar media_url: - :ivar price: - :ivar description: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.id: Optional[str] = payload.get("id") - self.section_title: Optional[str] = payload.get("section_title") - self.name: Optional[str] = payload.get("name") - self.media_url: Optional[str] = payload.get("media_url") - self.price: Optional[float] = payload.get("price") - self.description: Optional[str] = payload.get("description") - - def to_dict(self): - return { - "id": self.id, - "section_title": self.section_title, - "name": self.name, - "media_url": self.media_url, - "price": self.price, - "description": self.description, - } - - class ContentCreateRequest(object): - """ - :ivar friendly_name: User defined name of the content - :ivar variables: Key value pairs of variable name to value - :ivar language: Language code for the content - :ivar types: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.variables: Optional[dict[str, str]] = payload.get("variables") - self.language: Optional[str] = payload.get("language") - self.types: Optional[ContentList.Types] = payload.get("types") - - def to_dict(self): - return { - "friendly_name": self.friendly_name, - "variables": self.variables, - "language": self.language, - "types": self.types.to_dict(), - } - - class ListItem(object): - """ - :ivar id: - :ivar item: - :ivar description: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.id: Optional[str] = payload.get("id") - self.item: Optional[str] = payload.get("item") - self.description: Optional[str] = payload.get("description") - - def to_dict(self): - return { - "id": self.id, - "item": self.item, - "description": self.description, - } - - class QuickReplyAction(object): - """ - :ivar type: - :ivar title: - :ivar id: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.type: Optional["ContentInstance.QuickReplyActionType"] = payload.get( - "type" - ) - self.title: Optional[str] = payload.get("title") - self.id: Optional[str] = payload.get("id") - - def to_dict(self): - return { - "type": self.type.to_dict(), - "title": self.title, - "id": self.id, - } - - class TwilioCallToAction(object): - """ - :ivar body: - :ivar actions: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - self.actions: Optional[List[ContentList.CallToActionAction]] = payload.get( - "actions" - ) - - def to_dict(self): - return { - "body": self.body, - "actions": [actions.to_dict() for actions in self.actions], - } - - class TwilioCard(object): - """ - :ivar title: - :ivar subtitle: - :ivar media: - :ivar actions: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.title: Optional[str] = payload.get("title") - self.subtitle: Optional[str] = payload.get("subtitle") - self.media: Optional[List[str]] = payload.get("media") - self.actions: Optional[List[ContentList.CardAction]] = payload.get( - "actions" - ) - - def to_dict(self): - return { - "title": self.title, - "subtitle": self.subtitle, - "media": self.media, - "actions": [actions.to_dict() for actions in self.actions], - } - - class TwilioCatalog(object): - """ - :ivar title: - :ivar body: - :ivar subtitle: - :ivar id: - :ivar items: - :ivar dynamic_items: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.title: Optional[str] = payload.get("title") - self.body: Optional[str] = payload.get("body") - self.subtitle: Optional[str] = payload.get("subtitle") - self.id: Optional[str] = payload.get("id") - self.items: Optional[List[ContentList.CatalogItem]] = payload.get("items") - self.dynamic_items: Optional[str] = payload.get("dynamic_items") - - def to_dict(self): - return { - "title": self.title, - "body": self.body, - "subtitle": self.subtitle, - "id": self.id, - "items": [items.to_dict() for items in self.items], - "dynamic_items": self.dynamic_items, - } - - class TwilioListPicker(object): - """ - :ivar body: - :ivar button: - :ivar items: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - self.button: Optional[str] = payload.get("button") - self.items: Optional[List[ContentList.ListItem]] = payload.get("items") - - def to_dict(self): - return { - "body": self.body, - "button": self.button, - "items": [items.to_dict() for items in self.items], - } - - class TwilioLocation(object): - """ - :ivar latitude: - :ivar longitude: - :ivar label: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.latitude: Optional[float] = payload.get("latitude") - self.longitude: Optional[float] = payload.get("longitude") - self.label: Optional[str] = payload.get("label") - - def to_dict(self): - return { - "latitude": self.latitude, - "longitude": self.longitude, - "label": self.label, - } - - class TwilioMedia(object): - """ - :ivar body: - :ivar media: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - self.media: Optional[List[str]] = payload.get("media") - - def to_dict(self): - return { - "body": self.body, - "media": self.media, - } - - class TwilioQuickReply(object): - """ - :ivar body: - :ivar actions: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - self.actions: Optional[List[ContentList.QuickReplyAction]] = payload.get( - "actions" - ) - - def to_dict(self): - return { - "body": self.body, - "actions": [actions.to_dict() for actions in self.actions], - } - - class TwilioText(object): - """ - :ivar body: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - - def to_dict(self): - return { - "body": self.body, - } - - class Types(object): - """ - :ivar twilio_text: - :ivar twilio_media: - :ivar twilio_location: - :ivar twilio_list_picker: - :ivar twilio_call_to_action: - :ivar twilio_quick_reply: - :ivar twilio_card: - :ivar twilio_catalog: - :ivar whatsapp_card: - :ivar whatsapp_authentication: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.twilio_text: Optional[ContentList.TwilioText] = payload.get( - "twilio_text" - ) - self.twilio_media: Optional[ContentList.TwilioMedia] = payload.get( - "twilio_media" - ) - self.twilio_location: Optional[ContentList.TwilioLocation] = payload.get( - "twilio_location" - ) - self.twilio_list_picker: Optional[ContentList.TwilioListPicker] = ( - payload.get("twilio_list_picker") - ) - self.twilio_call_to_action: Optional[ContentList.TwilioCallToAction] = ( - payload.get("twilio_call_to_action") - ) - self.twilio_quick_reply: Optional[ContentList.TwilioQuickReply] = ( - payload.get("twilio_quick_reply") - ) - self.twilio_card: Optional[ContentList.TwilioCard] = payload.get( - "twilio_card" - ) - self.twilio_catalog: Optional[ContentList.TwilioCatalog] = payload.get( - "twilio_catalog" - ) - self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( - "whatsapp_card" - ) - self.whatsapp_authentication: Optional[ - ContentList.WhatsappAuthentication - ] = payload.get("whatsapp_authentication") - - def to_dict(self): - return { - "twilio_text": self.twilio_text.to_dict(), - "twilio_media": self.twilio_media.to_dict(), - "twilio_location": self.twilio_location.to_dict(), - "twilio_list_picker": self.twilio_list_picker.to_dict(), - "twilio_call_to_action": self.twilio_call_to_action.to_dict(), - "twilio_quick_reply": self.twilio_quick_reply.to_dict(), - "twilio_card": self.twilio_card.to_dict(), - "twilio_catalog": self.twilio_catalog.to_dict(), - "whatsapp_card": self.whatsapp_card.to_dict(), - "whatsapp_authentication": self.whatsapp_authentication.to_dict(), - } - - class WhatsappAuthentication(object): - """ - :ivar add_security_recommendation: - :ivar code_expiration_minutes: - :ivar actions: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.add_security_recommendation: Optional[bool] = payload.get( - "add_security_recommendation" - ) - self.code_expiration_minutes: Optional[float] = payload.get( - "code_expiration_minutes" - ) - self.actions: Optional[List[ContentList.AuthenticationAction]] = ( - payload.get("actions") - ) - - def to_dict(self): - return { - "add_security_recommendation": self.add_security_recommendation, - "code_expiration_minutes": self.code_expiration_minutes, - "actions": [actions.to_dict() for actions in self.actions], - } - - class WhatsappCard(object): - """ - :ivar body: - :ivar footer: - :ivar media: - :ivar header_text: - :ivar actions: - """ - - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): - - self.body: Optional[str] = payload.get("body") - self.footer: Optional[str] = payload.get("footer") - self.media: Optional[List[str]] = payload.get("media") - self.header_text: Optional[str] = payload.get("header_text") - self.actions: Optional[List[ContentList.CardAction]] = payload.get( - "actions" - ) - - def to_dict(self): - return { - "body": self.body, - "footer": self.footer, - "media": self.media, - "header_text": self.header_text, - "actions": [actions.to_dict() for actions in self.actions], - } - def __init__(self, version: Version): """ Initialize the ContentList @@ -747,17 +286,18 @@ def __init__(self, version: Version): self._uri = "/Content" - def create(self, content_create_request: ContentCreateRequest) -> ContentInstance: + def create(self, body: Union[object, object] = values.unset) -> ContentInstance: """ Create the ContentInstance - :param content_create_request: + :param body: :returns: The created ContentInstance """ - data = content_create_request.to_dict() + data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -766,18 +306,19 @@ def create(self, content_create_request: ContentCreateRequest) -> ContentInstanc return ContentInstance(self._version, payload) async def create_async( - self, content_create_request: ContentCreateRequest + self, body: Union[object, object] = values.unset ) -> ContentInstance: """ Asynchronously create the ContentInstance - :param content_create_request: + :param body: :returns: The created ContentInstance """ - data = content_create_request.to_dict() + data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/content/v1/content/approval_create.py b/twilio/rest/content/v1/content/approval_create.py index ddd922afc2..137c0a6d0c 100644 --- a/twilio/rest/content/v1/content/approval_create.py +++ b/twilio/rest/content/v1/content/approval_create.py @@ -12,7 +12,8 @@ Do not edit the class manually. """ -from typing import Any, Dict, Optional +from typing import Any, Dict, Optional, Union +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -29,7 +30,7 @@ class ApprovalCreateInstance(InstanceResource): :ivar allow_category_change: """ - def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], sid: str): super().__init__(version) self.name: Optional[str] = payload.get("name") @@ -42,7 +43,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): ) self._solution = { - "content_sid": content_sid, + "sid": sid, } def __repr__(self) -> str: @@ -57,84 +58,63 @@ def __repr__(self) -> str: class ApprovalCreateList(ListResource): - class ContentApprovalRequest(object): - """ - :ivar name: Name of the template. - :ivar category: A WhatsApp recognized template category. - """ - - def __init__(self, payload: Dict[str, Any], content_sid: str): - - self.name: Optional[str] = payload.get("name") - self.category: Optional[str] = payload.get("category") - - def to_dict(self): - return { - "name": self.name, - "category": self.category, - } - - def __init__(self, version: Version, content_sid: str): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalCreateList :param version: Version that contains the resource - :param content_sid: + :param sid: """ super().__init__(version) # Path Solution self._solution = { - "content_sid": content_sid, + "sid": sid, } - self._uri = "/Content/{content_sid}/ApprovalRequests/whatsapp".format( - **self._solution - ) + self._uri = "/Content/{sid}/ApprovalRequests/whatsapp".format(**self._solution) def create( - self, content_approval_request: ContentApprovalRequest + self, body: Union[object, object] = values.unset ) -> ApprovalCreateInstance: """ Create the ApprovalCreateInstance - :param content_approval_request: + :param body: :returns: The created ApprovalCreateInstance """ - data = content_approval_request.to_dict() + data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) - return ApprovalCreateInstance( - self._version, payload, content_sid=self._solution["content_sid"] - ) + return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) async def create_async( - self, content_approval_request: ContentApprovalRequest + self, body: Union[object, object] = values.unset ) -> ApprovalCreateInstance: """ Asynchronously create the ApprovalCreateInstance - :param content_approval_request: + :param body: :returns: The created ApprovalCreateInstance """ - data = content_approval_request.to_dict() + data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) - return ApprovalCreateInstance( - self._version, payload, content_sid=self._solution["content_sid"] - ) + return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) def __repr__(self) -> str: """ diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index f679a920a1..f35ef6a48f 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -27,7 +27,7 @@ class ApprovalFetchInstance(InstanceResource): :ivar url: The URL of the resource, relative to `https://content.twilio.com`. """ - def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], sid: str): super().__init__(version) self.sid: Optional[str] = payload.get("sid") @@ -36,7 +36,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): self.url: Optional[str] = payload.get("url") self._solution = { - "content_sid": content_sid, + "sid": sid, } self._context: Optional[ApprovalFetchContext] = None @@ -51,7 +51,7 @@ def _proxy(self) -> "ApprovalFetchContext": if self._context is None: self._context = ApprovalFetchContext( self._version, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) return self._context @@ -85,20 +85,20 @@ def __repr__(self) -> str: class ApprovalFetchContext(InstanceContext): - def __init__(self, version: Version, content_sid: str): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchContext :param version: Version that contains the resource - :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "content_sid": content_sid, + "sid": sid, } - self._uri = "/Content/{content_sid}/ApprovalRequests".format(**self._solution) + self._uri = "/Content/{sid}/ApprovalRequests".format(**self._solution) def fetch(self) -> ApprovalFetchInstance: """ @@ -116,7 +116,7 @@ def fetch(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) async def fetch_async(self) -> ApprovalFetchInstance: @@ -135,7 +135,7 @@ async def fetch_async(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) def __repr__(self) -> str: @@ -150,19 +150,19 @@ def __repr__(self) -> str: class ApprovalFetchList(ListResource): - def __init__(self, version: Version, content_sid: str): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchList :param version: Version that contains the resource - :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "content_sid": content_sid, + "sid": sid, } def get(self) -> ApprovalFetchContext: @@ -170,18 +170,14 @@ def get(self) -> ApprovalFetchContext: Constructs a ApprovalFetchContext """ - return ApprovalFetchContext( - self._version, content_sid=self._solution["content_sid"] - ) + return ApprovalFetchContext(self._version, sid=self._solution["sid"]) def __call__(self) -> ApprovalFetchContext: """ Constructs a ApprovalFetchContext """ - return ApprovalFetchContext( - self._version, content_sid=self._solution["content_sid"] - ) + return ApprovalFetchContext(self._version, sid=self._solution["sid"]) def __repr__(self) -> str: """ diff --git a/twilio/rest/content/v1/content_and_approvals.py b/twilio/rest/content/v1/content_and_approvals.py index de40cfc172..e2d6d72aaf 100644 --- a/twilio/rest/content/v1/content_and_approvals.py +++ b/twilio/rest/content/v1/content_and_approvals.py @@ -31,7 +31,7 @@ class ContentAndApprovalsInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar approval_requests: The submitted information and approval request status of the Content resource. """ diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index 86cdb08066..58bd74be49 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -526,11 +526,10 @@ def create( "AddressCountry": address_country, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressConfigurationInstance(self._version, payload) @@ -593,11 +592,10 @@ async def create_async( "AddressCountry": address_country, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressConfigurationInstance(self._version, payload) diff --git a/twilio/rest/conversations/v1/conversation/__init__.py b/twilio/rest/conversations/v1/conversation/__init__.py index 4c9b8809ac..4eb14b769c 100644 --- a/twilio/rest/conversations/v1/conversation/__init__.py +++ b/twilio/rest/conversations/v1/conversation/__init__.py @@ -639,6 +639,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -702,6 +703,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/conversation/message/__init__.py b/twilio/rest/conversations/v1/conversation/message/__init__.py index e3e9dea1b2..8488bee004 100644 --- a/twilio/rest/conversations/v1/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/conversation/message/__init__.py @@ -566,6 +566,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -625,6 +626,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/conversation/participant.py b/twilio/rest/conversations/v1/conversation/participant.py index 499bdbf30a..92f8e5de40 100644 --- a/twilio/rest/conversations/v1/conversation/participant.py +++ b/twilio/rest/conversations/v1/conversation/participant.py @@ -568,6 +568,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -624,6 +625,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/conversation/webhook.py b/twilio/rest/conversations/v1/conversation/webhook.py index 623887986c..b961b832a5 100644 --- a/twilio/rest/conversations/v1/conversation/webhook.py +++ b/twilio/rest/conversations/v1/conversation/webhook.py @@ -455,11 +455,10 @@ def create( "Configuration.ReplayAfter": configuration_replay_after, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -505,11 +504,10 @@ async def create_async( "Configuration.ReplayAfter": configuration_replay_after, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/conversations/v1/credential.py b/twilio/rest/conversations/v1/credential.py index 120710f7e8..c8cd78ab05 100644 --- a/twilio/rest/conversations/v1/credential.py +++ b/twilio/rest/conversations/v1/credential.py @@ -432,11 +432,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -476,11 +475,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/conversations/v1/role.py b/twilio/rest/conversations/v1/role.py index b5d4d2c6db..301063800a 100644 --- a/twilio/rest/conversations/v1/role.py +++ b/twilio/rest/conversations/v1/role.py @@ -334,11 +334,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance(self._version, payload) @@ -363,11 +362,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance(self._version, payload) diff --git a/twilio/rest/conversations/v1/service/__init__.py b/twilio/rest/conversations/v1/service/__init__.py index 2a9f12090b..a06afa2f77 100644 --- a/twilio/rest/conversations/v1/service/__init__.py +++ b/twilio/rest/conversations/v1/service/__init__.py @@ -380,11 +380,10 @@ def create(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -403,11 +402,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/conversations/v1/service/conversation/__init__.py b/twilio/rest/conversations/v1/service/conversation/__init__.py index 69e87e5eef..139bdcb5ca 100644 --- a/twilio/rest/conversations/v1/service/conversation/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/__init__.py @@ -675,6 +675,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -740,6 +741,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/service/conversation/message/__init__.py b/twilio/rest/conversations/v1/service/conversation/message/__init__.py index 753df18352..32f480bc59 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/message/__init__.py @@ -585,6 +585,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -647,6 +648,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/service/conversation/participant.py b/twilio/rest/conversations/v1/service/conversation/participant.py index 6f6eee61e7..530bce26fc 100644 --- a/twilio/rest/conversations/v1/service/conversation/participant.py +++ b/twilio/rest/conversations/v1/service/conversation/participant.py @@ -586,6 +586,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -645,6 +646,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/service/conversation/webhook.py b/twilio/rest/conversations/v1/service/conversation/webhook.py index 83b267406e..327dc9f024 100644 --- a/twilio/rest/conversations/v1/service/conversation/webhook.py +++ b/twilio/rest/conversations/v1/service/conversation/webhook.py @@ -473,11 +473,10 @@ def create( "Configuration.ReplayAfter": configuration_replay_after, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -526,11 +525,10 @@ async def create_async( "Configuration.ReplayAfter": configuration_replay_after, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/conversations/v1/service/role.py b/twilio/rest/conversations/v1/service/role.py index 3c0a0fc909..170512a2b2 100644 --- a/twilio/rest/conversations/v1/service/role.py +++ b/twilio/rest/conversations/v1/service/role.py @@ -361,11 +361,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -392,11 +391,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( diff --git a/twilio/rest/conversations/v1/service/user/__init__.py b/twilio/rest/conversations/v1/service/user/__init__.py index 37a8d2e4fb..4d4df0398d 100644 --- a/twilio/rest/conversations/v1/service/user/__init__.py +++ b/twilio/rest/conversations/v1/service/user/__init__.py @@ -503,6 +503,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -547,6 +548,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/conversations/v1/user/__init__.py b/twilio/rest/conversations/v1/user/__init__.py index d8017c5102..a05deeda43 100644 --- a/twilio/rest/conversations/v1/user/__init__.py +++ b/twilio/rest/conversations/v1/user/__init__.py @@ -473,6 +473,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -515,6 +516,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/events/v1/event_type.py b/twilio/rest/events/v1/event_type.py index 7215df8f24..a019a82a9e 100644 --- a/twilio/rest/events/v1/event_type.py +++ b/twilio/rest/events/v1/event_type.py @@ -29,6 +29,8 @@ class EventTypeInstance(InstanceResource): :ivar date_created: The date that this Event Type was created, given in ISO 8601 format. :ivar date_updated: The date that this Event Type was updated, given in ISO 8601 format. :ivar description: A human readable description for this Event Type. + :ivar status: A string that describes how this Event Type can be used. For example: `available`, `deprecated`, `restricted`, `discontinued`. When the status is `available`, the Event Type can be used normally. + :ivar documentation_url: The URL to the documentation or to the most relevant Twilio Changelog entry of this Event Type. :ivar url: The URL of this resource. :ivar links: """ @@ -47,6 +49,8 @@ def __init__( payload.get("date_updated") ) self.description: Optional[str] = payload.get("description") + self.status: Optional[str] = payload.get("status") + self.documentation_url: Optional[str] = payload.get("documentation_url") self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") diff --git a/twilio/rest/events/v1/sink/__init__.py b/twilio/rest/events/v1/sink/__init__.py index b09b5edec3..9098c51bd7 100644 --- a/twilio/rest/events/v1/sink/__init__.py +++ b/twilio/rest/events/v1/sink/__init__.py @@ -389,11 +389,10 @@ def create( "SinkType": sink_type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SinkInstance(self._version, payload) @@ -421,11 +420,10 @@ async def create_async( "SinkType": sink_type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SinkInstance(self._version, payload) diff --git a/twilio/rest/events/v1/sink/sink_test.py b/twilio/rest/events/v1/sink/sink_test.py index adf04f582d..150e7deabc 100644 --- a/twilio/rest/events/v1/sink/sink_test.py +++ b/twilio/rest/events/v1/sink/sink_test.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -69,10 +70,9 @@ def create(self) -> SinkTestInstance: :returns: The created SinkTestInstance """ - payload = self._version.create( - method="POST", - uri=self._uri, - ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create(method="POST", uri=self._uri, headers=headers) return SinkTestInstance(self._version, payload, sid=self._solution["sid"]) @@ -84,9 +84,10 @@ async def create_async(self) -> SinkTestInstance: :returns: The created SinkTestInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, headers=headers ) return SinkTestInstance(self._version, payload, sid=self._solution["sid"]) diff --git a/twilio/rest/events/v1/sink/sink_validate.py b/twilio/rest/events/v1/sink/sink_validate.py index 4c24dd76b3..8c6565a007 100644 --- a/twilio/rest/events/v1/sink/sink_validate.py +++ b/twilio/rest/events/v1/sink/sink_validate.py @@ -76,11 +76,10 @@ def create(self, test_id: str) -> SinkValidateInstance: "TestId": test_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SinkValidateInstance(self._version, payload, sid=self._solution["sid"]) @@ -99,11 +98,10 @@ async def create_async(self, test_id: str) -> SinkValidateInstance: "TestId": test_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SinkValidateInstance(self._version, payload, sid=self._solution["sid"]) diff --git a/twilio/rest/events/v1/subscription/__init__.py b/twilio/rest/events/v1/subscription/__init__.py index 666b26aa70..2f6d7e91a2 100644 --- a/twilio/rest/events/v1/subscription/__init__.py +++ b/twilio/rest/events/v1/subscription/__init__.py @@ -373,11 +373,10 @@ def create( "Types": serialize.map(types, lambda e: serialize.object(e)), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscriptionInstance(self._version, payload) @@ -402,11 +401,10 @@ async def create_async( "Types": serialize.map(types, lambda e: serialize.object(e)), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscriptionInstance(self._version, payload) diff --git a/twilio/rest/events/v1/subscription/subscribed_event.py b/twilio/rest/events/v1/subscription/subscribed_event.py index 80c9ce1494..8547fd486b 100644 --- a/twilio/rest/events/v1/subscription/subscribed_event.py +++ b/twilio/rest/events/v1/subscription/subscribed_event.py @@ -355,11 +355,10 @@ def create( "SchemaVersion": schema_version, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscribedEventInstance( @@ -384,11 +383,10 @@ async def create_async( "SchemaVersion": schema_version, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscribedEventInstance( diff --git a/twilio/rest/flex_api/v1/assessments.py b/twilio/rest/flex_api/v1/assessments.py index 23648b1041..b24d9113d4 100644 --- a/twilio/rest/flex_api/v1/assessments.py +++ b/twilio/rest/flex_api/v1/assessments.py @@ -326,6 +326,7 @@ def create( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -384,6 +385,7 @@ async def create_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/channel.py b/twilio/rest/flex_api/v1/channel.py index f362d5b01b..bf4feb99e1 100644 --- a/twilio/rest/flex_api/v1/channel.py +++ b/twilio/rest/flex_api/v1/channel.py @@ -283,11 +283,10 @@ def create( "LongLived": serialize.boolean_to_string(long_lived), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance(self._version, payload) @@ -336,11 +335,10 @@ async def create_async( "LongLived": serialize.boolean_to_string(long_lived), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v1/flex_flow.py b/twilio/rest/flex_api/v1/flex_flow.py index b11482937e..531dd470b2 100644 --- a/twilio/rest/flex_api/v1/flex_flow.py +++ b/twilio/rest/flex_api/v1/flex_flow.py @@ -622,11 +622,10 @@ def create( "Integration.RetryCount": integration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlexFlowInstance(self._version, payload) @@ -700,11 +699,10 @@ async def create_async( "Integration.RetryCount": integration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlexFlowInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v1/insights_assessments_comment.py b/twilio/rest/flex_api/v1/insights_assessments_comment.py index eed32fefbc..faeb6ae62c 100644 --- a/twilio/rest/flex_api/v1/insights_assessments_comment.py +++ b/twilio/rest/flex_api/v1/insights_assessments_comment.py @@ -134,6 +134,7 @@ def create( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -180,6 +181,7 @@ async def create_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires.py b/twilio/rest/flex_api/v1/insights_questionnaires.py index 807f129955..1724e2a253 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires.py @@ -454,6 +454,7 @@ def create( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -494,6 +495,7 @@ async def create_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_category.py b/twilio/rest/flex_api/v1/insights_questionnaires_category.py index 28057dbc00..aba8eb8bdd 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_category.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_category.py @@ -313,6 +313,7 @@ def create( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -342,6 +343,7 @@ async def create_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_question.py b/twilio/rest/flex_api/v1/insights_questionnaires_question.py index e4f2f4a4f0..363d5c07b1 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_question.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_question.py @@ -395,6 +395,7 @@ def create( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -438,6 +439,7 @@ async def create_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py index 767737da67..d426e215a9 100644 --- a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py +++ b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py @@ -75,6 +75,7 @@ def fetch( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -94,6 +95,7 @@ async def fetch_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/insights_settings_comment.py b/twilio/rest/flex_api/v1/insights_settings_comment.py index 5d41e8d3b3..548b279181 100644 --- a/twilio/rest/flex_api/v1/insights_settings_comment.py +++ b/twilio/rest/flex_api/v1/insights_settings_comment.py @@ -69,6 +69,7 @@ def fetch( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -88,6 +89,7 @@ async def fetch_async( headers = values.of( { "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/interaction/__init__.py b/twilio/rest/flex_api/v1/interaction/__init__.py index 069b05309f..468b3134eb 100644 --- a/twilio/rest/flex_api/v1/interaction/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/__init__.py @@ -218,11 +218,10 @@ def create( "InteractionContextSid": interaction_context_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionInstance(self._version, payload) @@ -250,11 +249,10 @@ async def create_async( "InteractionContextSid": interaction_context_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py index 5292297b98..2ffa14b1df 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py @@ -122,11 +122,10 @@ def create(self, routing: object) -> InteractionChannelInviteInstance: "Routing": serialize.object(routing), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelInviteInstance( @@ -150,11 +149,10 @@ async def create_async(self, routing: object) -> InteractionChannelInviteInstanc "Routing": serialize.object(routing), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelInviteInstance( diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py index ba9f80f9a3..225ca3efaf 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py @@ -296,11 +296,10 @@ def create( "RoutingProperties": serialize.object(routing_properties), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelParticipantInstance( @@ -333,11 +332,10 @@ async def create_async( "RoutingProperties": serialize.object(routing_properties), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelParticipantInstance( diff --git a/twilio/rest/flex_api/v1/plugin/__init__.py b/twilio/rest/flex_api/v1/plugin/__init__.py index 09244d42de..b6baf8f935 100644 --- a/twilio/rest/flex_api/v1/plugin/__init__.py +++ b/twilio/rest/flex_api/v1/plugin/__init__.py @@ -381,6 +381,7 @@ def create( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -418,6 +419,7 @@ async def create_async( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/plugin/plugin_versions.py b/twilio/rest/flex_api/v1/plugin/plugin_versions.py index 1e5b5683b6..3da4de3ac7 100644 --- a/twilio/rest/flex_api/v1/plugin/plugin_versions.py +++ b/twilio/rest/flex_api/v1/plugin/plugin_versions.py @@ -283,6 +283,7 @@ def create( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -331,6 +332,7 @@ async def create_async( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/plugin_configuration/__init__.py b/twilio/rest/flex_api/v1/plugin_configuration/__init__.py index ebe173985b..9b76695243 100644 --- a/twilio/rest/flex_api/v1/plugin_configuration/__init__.py +++ b/twilio/rest/flex_api/v1/plugin_configuration/__init__.py @@ -271,6 +271,7 @@ def create( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -308,6 +309,7 @@ async def create_async( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/plugin_release.py b/twilio/rest/flex_api/v1/plugin_release.py index f2e8efd306..e339183297 100644 --- a/twilio/rest/flex_api/v1/plugin_release.py +++ b/twilio/rest/flex_api/v1/plugin_release.py @@ -233,6 +233,7 @@ def create( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -262,6 +263,7 @@ async def create_async( headers = values.of( { "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/flex_api/v1/web_channel.py b/twilio/rest/flex_api/v1/web_channel.py index ddf9c8f902..a96698f8cb 100644 --- a/twilio/rest/flex_api/v1/web_channel.py +++ b/twilio/rest/flex_api/v1/web_channel.py @@ -363,11 +363,10 @@ def create( "PreEngagementData": pre_engagement_data, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebChannelInstance(self._version, payload) @@ -404,11 +403,10 @@ async def create_async( "PreEngagementData": pre_engagement_data, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebChannelInstance(self._version, payload) diff --git a/twilio/rest/flex_api/v2/web_channels.py b/twilio/rest/flex_api/v2/web_channels.py index a4b7b0c31d..153f59cae9 100644 --- a/twilio/rest/flex_api/v2/web_channels.py +++ b/twilio/rest/flex_api/v2/web_channels.py @@ -86,6 +86,7 @@ def create( headers = values.of( { "Ui-Version": ui_version, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -126,6 +127,7 @@ async def create_async( headers = values.of( { "Ui-Version": ui_version, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/intelligence/v2/custom_operator.py b/twilio/rest/intelligence/v2/custom_operator.py index 6966dc5d08..af5239b124 100644 --- a/twilio/rest/intelligence/v2/custom_operator.py +++ b/twilio/rest/intelligence/v2/custom_operator.py @@ -384,11 +384,10 @@ def create( "Config": serialize.object(config), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomOperatorInstance(self._version, payload) @@ -413,11 +412,10 @@ async def create_async( "Config": serialize.object(config), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomOperatorInstance(self._version, payload) diff --git a/twilio/rest/intelligence/v2/service.py b/twilio/rest/intelligence/v2/service.py index 7ded7b9b77..8f5633d0fe 100644 --- a/twilio/rest/intelligence/v2/service.py +++ b/twilio/rest/intelligence/v2/service.py @@ -486,11 +486,10 @@ def create( "WebhookHttpMethod": webhook_http_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -536,11 +535,10 @@ async def create_async( "WebhookHttpMethod": webhook_http_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/intelligence/v2/transcript/__init__.py b/twilio/rest/intelligence/v2/transcript/__init__.py index 30b97f89bd..bc71542bc0 100644 --- a/twilio/rest/intelligence/v2/transcript/__init__.py +++ b/twilio/rest/intelligence/v2/transcript/__init__.py @@ -353,11 +353,10 @@ def create( "MediaStartTime": serialize.iso8601_datetime(media_start_time), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TranscriptInstance(self._version, payload) @@ -388,11 +387,10 @@ async def create_async( "MediaStartTime": serialize.iso8601_datetime(media_start_time), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TranscriptInstance(self._version, payload) diff --git a/twilio/rest/ip_messaging/v1/credential.py b/twilio/rest/ip_messaging/v1/credential.py index eac8e38cf5..279aef7860 100644 --- a/twilio/rest/ip_messaging/v1/credential.py +++ b/twilio/rest/ip_messaging/v1/credential.py @@ -420,11 +420,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -464,11 +463,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/ip_messaging/v1/service/__init__.py b/twilio/rest/ip_messaging/v1/service/__init__.py index ad4f002513..e0b52e2738 100644 --- a/twilio/rest/ip_messaging/v1/service/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/__init__.py @@ -1089,11 +1089,10 @@ def create(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -1112,11 +1111,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/ip_messaging/v1/service/channel/__init__.py b/twilio/rest/ip_messaging/v1/service/channel/__init__.py index ef469e97f2..57d2d245ec 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/channel/__init__.py @@ -484,11 +484,10 @@ def create( "Type": type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( @@ -521,11 +520,10 @@ async def create_async( "Type": type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( diff --git a/twilio/rest/ip_messaging/v1/service/channel/invite.py b/twilio/rest/ip_messaging/v1/service/channel/invite.py index 7078058a40..f4c3476edb 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v1/service/channel/invite.py @@ -296,11 +296,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( @@ -328,11 +327,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( diff --git a/twilio/rest/ip_messaging/v1/service/channel/member.py b/twilio/rest/ip_messaging/v1/service/channel/member.py index c52fde5a8e..4452699ceb 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/member.py +++ b/twilio/rest/ip_messaging/v1/service/channel/member.py @@ -406,11 +406,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( @@ -438,11 +437,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( diff --git a/twilio/rest/ip_messaging/v1/service/channel/message.py b/twilio/rest/ip_messaging/v1/service/channel/message.py index f9f2a2b1a6..5d3f2eb577 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/message.py +++ b/twilio/rest/ip_messaging/v1/service/channel/message.py @@ -416,11 +416,10 @@ def create( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -453,11 +452,10 @@ async def create_async( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( diff --git a/twilio/rest/ip_messaging/v1/service/role.py b/twilio/rest/ip_messaging/v1/service/role.py index 935a99e180..5f5b19cfe9 100644 --- a/twilio/rest/ip_messaging/v1/service/role.py +++ b/twilio/rest/ip_messaging/v1/service/role.py @@ -361,11 +361,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -392,11 +391,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( diff --git a/twilio/rest/ip_messaging/v1/service/user/__init__.py b/twilio/rest/ip_messaging/v1/service/user/__init__.py index ef24fa776f..91364d8f96 100644 --- a/twilio/rest/ip_messaging/v1/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/user/__init__.py @@ -433,11 +433,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( @@ -470,11 +469,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( diff --git a/twilio/rest/ip_messaging/v2/credential.py b/twilio/rest/ip_messaging/v2/credential.py index beec9fbebe..5d4e14f983 100644 --- a/twilio/rest/ip_messaging/v2/credential.py +++ b/twilio/rest/ip_messaging/v2/credential.py @@ -420,11 +420,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -464,11 +463,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/ip_messaging/v2/service/__init__.py b/twilio/rest/ip_messaging/v2/service/__init__.py index b107a11976..3475811625 100644 --- a/twilio/rest/ip_messaging/v2/service/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/__init__.py @@ -858,11 +858,10 @@ def create(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -881,11 +880,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/ip_messaging/v2/service/channel/__init__.py b/twilio/rest/ip_messaging/v2/service/channel/__init__.py index c4e03d4536..29ee9ddd64 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/channel/__init__.py @@ -622,6 +622,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -675,6 +676,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/ip_messaging/v2/service/channel/invite.py b/twilio/rest/ip_messaging/v2/service/channel/invite.py index 0f863d70f0..a40c47a125 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v2/service/channel/invite.py @@ -296,11 +296,10 @@ def create( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( @@ -328,11 +327,10 @@ async def create_async( "RoleSid": role_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InviteInstance( diff --git a/twilio/rest/ip_messaging/v2/service/channel/member.py b/twilio/rest/ip_messaging/v2/service/channel/member.py index 5de4520ed3..9511a2bf6b 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/member.py +++ b/twilio/rest/ip_messaging/v2/service/channel/member.py @@ -551,6 +551,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -609,6 +610,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/ip_messaging/v2/service/channel/message.py b/twilio/rest/ip_messaging/v2/service/channel/message.py index 057571c2ab..7420117113 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/message.py +++ b/twilio/rest/ip_messaging/v2/service/channel/message.py @@ -553,6 +553,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -609,6 +610,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/ip_messaging/v2/service/channel/webhook.py b/twilio/rest/ip_messaging/v2/service/channel/webhook.py index 633acfd51f..db23dd66af 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/webhook.py +++ b/twilio/rest/ip_messaging/v2/service/channel/webhook.py @@ -485,11 +485,10 @@ def create( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -538,11 +537,10 @@ async def create_async( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/ip_messaging/v2/service/role.py b/twilio/rest/ip_messaging/v2/service/role.py index 91fc1af939..0acf77983b 100644 --- a/twilio/rest/ip_messaging/v2/service/role.py +++ b/twilio/rest/ip_messaging/v2/service/role.py @@ -361,11 +361,10 @@ def create( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -392,11 +391,10 @@ async def create_async( "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( diff --git a/twilio/rest/ip_messaging/v2/service/user/__init__.py b/twilio/rest/ip_messaging/v2/service/user/__init__.py index 1b3ba1b391..3af3121fab 100644 --- a/twilio/rest/ip_messaging/v2/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/user/__init__.py @@ -491,6 +491,7 @@ def create( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) @@ -535,6 +536,7 @@ async def create_async( headers = values.of( { "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/twilio/rest/marketplace/v1/installed_add_on/__init__.py b/twilio/rest/marketplace/v1/installed_add_on/__init__.py index 0aad53d8ee..df67c01d8c 100644 --- a/twilio/rest/marketplace/v1/installed_add_on/__init__.py +++ b/twilio/rest/marketplace/v1/installed_add_on/__init__.py @@ -410,11 +410,10 @@ def create( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload) @@ -447,11 +446,10 @@ async def create_async( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload) diff --git a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py index 6fff4979f4..3d8d694a22 100644 --- a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py +++ b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional -from twilio.base import deserialize +from twilio.base import deserialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -120,7 +120,8 @@ def create( """ data = create_marketplace_billing_usage_request.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -145,7 +146,8 @@ async def create_async( """ data = create_marketplace_billing_usage_request.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index b02af94919..b6ac290064 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -390,11 +390,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BrandRegistrationInstance(self._version, payload) @@ -430,11 +429,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BrandRegistrationInstance(self._version, payload) diff --git a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py index 20ce245b37..74631cea78 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -77,10 +78,9 @@ def create(self) -> BrandRegistrationOtpInstance: :returns: The created BrandRegistrationOtpInstance """ - payload = self._version.create( - method="POST", - uri=self._uri, - ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create(method="POST", uri=self._uri, headers=headers) return BrandRegistrationOtpInstance( self._version, @@ -96,9 +96,10 @@ async def create_async(self) -> BrandRegistrationOtpInstance: :returns: The created BrandRegistrationOtpInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, headers=headers ) return BrandRegistrationOtpInstance( diff --git a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py index c801cb12b4..37fe4ed8d4 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py @@ -250,11 +250,10 @@ def create( "VettingId": vetting_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BrandVettingInstance( @@ -281,11 +280,10 @@ async def create_async( "VettingId": vetting_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BrandVettingInstance( diff --git a/twilio/rest/messaging/v1/external_campaign.py b/twilio/rest/messaging/v1/external_campaign.py index b70d8a4ee1..88262f978d 100644 --- a/twilio/rest/messaging/v1/external_campaign.py +++ b/twilio/rest/messaging/v1/external_campaign.py @@ -82,11 +82,10 @@ def create( "MessagingServiceSid": messaging_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExternalCampaignInstance(self._version, payload) @@ -109,11 +108,10 @@ async def create_async( "MessagingServiceSid": messaging_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExternalCampaignInstance(self._version, payload) diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 75c798f4c4..0fbb3dd10b 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -766,11 +766,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -845,11 +844,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/messaging/v1/service/alpha_sender.py b/twilio/rest/messaging/v1/service/alpha_sender.py index 38d2d0d5e9..0173c98099 100644 --- a/twilio/rest/messaging/v1/service/alpha_sender.py +++ b/twilio/rest/messaging/v1/service/alpha_sender.py @@ -272,11 +272,10 @@ def create(self, alpha_sender: str) -> AlphaSenderInstance: "AlphaSender": alpha_sender, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AlphaSenderInstance( @@ -297,11 +296,10 @@ async def create_async(self, alpha_sender: str) -> AlphaSenderInstance: "AlphaSender": alpha_sender, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AlphaSenderInstance( diff --git a/twilio/rest/messaging/v1/service/phone_number.py b/twilio/rest/messaging/v1/service/phone_number.py index 8b0b4c0900..10d30ab7fa 100644 --- a/twilio/rest/messaging/v1/service/phone_number.py +++ b/twilio/rest/messaging/v1/service/phone_number.py @@ -274,11 +274,10 @@ def create(self, phone_number_sid: str) -> PhoneNumberInstance: "PhoneNumberSid": phone_number_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( @@ -299,11 +298,10 @@ async def create_async(self, phone_number_sid: str) -> PhoneNumberInstance: "PhoneNumberSid": phone_number_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( diff --git a/twilio/rest/messaging/v1/service/short_code.py b/twilio/rest/messaging/v1/service/short_code.py index 6537875891..c8f1b3e3c8 100644 --- a/twilio/rest/messaging/v1/service/short_code.py +++ b/twilio/rest/messaging/v1/service/short_code.py @@ -272,11 +272,10 @@ def create(self, short_code_sid: str) -> ShortCodeInstance: "ShortCodeSid": short_code_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( @@ -297,11 +296,10 @@ async def create_async(self, short_code_sid: str) -> ShortCodeInstance: "ShortCodeSid": short_code_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( diff --git a/twilio/rest/messaging/v1/service/us_app_to_person.py b/twilio/rest/messaging/v1/service/us_app_to_person.py index 9034e4e2eb..ad31c6a4b7 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person.py @@ -532,11 +532,10 @@ def create( "DirectLending": serialize.boolean_to_string(direct_lending), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UsAppToPersonInstance( @@ -607,11 +606,10 @@ async def create_async( "DirectLending": serialize.boolean_to_string(direct_lending), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UsAppToPersonInstance( diff --git a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py index debcf940d9..1f0d857047 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py @@ -79,6 +79,7 @@ def fetch( :param brand_registration_sid: The unique string to identify the A2P brand. :returns: The fetched UsAppToPersonUsecaseInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -86,7 +87,9 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=params) + payload = self._version.fetch( + method="GET", uri=self._uri, headers=headers, params=params + ) return UsAppToPersonUsecaseInstance( self._version, @@ -103,6 +106,7 @@ async def fetch_async( :param brand_registration_sid: The unique string to identify the A2P brand. :returns: The fetched UsAppToPersonUsecaseInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -111,7 +115,7 @@ async def fetch_async( ) payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=params + method="GET", uri=self._uri, headers=headers, params=params ) return UsAppToPersonUsecaseInstance( diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index f8c639286b..98887c7663 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -757,11 +757,10 @@ def create( "ExternalReferenceId": external_reference_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TollfreeVerificationInstance(self._version, payload) @@ -849,11 +848,10 @@ async def create_async( "ExternalReferenceId": external_reference_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TollfreeVerificationInstance(self._version, payload) diff --git a/twilio/rest/messaging/v1/usecase.py b/twilio/rest/messaging/v1/usecase.py index d7223f3632..118c9c895e 100644 --- a/twilio/rest/messaging/v1/usecase.py +++ b/twilio/rest/messaging/v1/usecase.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, List, Optional +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -59,8 +60,9 @@ def fetch(self) -> UsecaseInstance: :returns: The fetched UsecaseInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = self._version.fetch(method="GET", uri=self._uri) + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UsecaseInstance(self._version, payload) @@ -71,8 +73,11 @@ async def fetch_async(self) -> UsecaseInstance: :returns: The fetched UsecaseInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = await self._version.fetch_async(method="GET", uri=self._uri) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return UsecaseInstance(self._version, payload) diff --git a/twilio/rest/microvisor/v1/account_config.py b/twilio/rest/microvisor/v1/account_config.py index 3d37b01cd2..0abe5f9288 100644 --- a/twilio/rest/microvisor/v1/account_config.py +++ b/twilio/rest/microvisor/v1/account_config.py @@ -313,11 +313,10 @@ def create(self, key: str, value: str) -> AccountConfigInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountConfigInstance(self._version, payload) @@ -338,11 +337,10 @@ async def create_async(self, key: str, value: str) -> AccountConfigInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountConfigInstance(self._version, payload) diff --git a/twilio/rest/microvisor/v1/account_secret.py b/twilio/rest/microvisor/v1/account_secret.py index cca0e1d773..e85a78bc58 100644 --- a/twilio/rest/microvisor/v1/account_secret.py +++ b/twilio/rest/microvisor/v1/account_secret.py @@ -311,11 +311,10 @@ def create(self, key: str, value: str) -> AccountSecretInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountSecretInstance(self._version, payload) @@ -336,11 +335,10 @@ async def create_async(self, key: str, value: str) -> AccountSecretInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountSecretInstance(self._version, payload) diff --git a/twilio/rest/microvisor/v1/device/device_config.py b/twilio/rest/microvisor/v1/device/device_config.py index 3607e971f2..b4759e90b0 100644 --- a/twilio/rest/microvisor/v1/device/device_config.py +++ b/twilio/rest/microvisor/v1/device/device_config.py @@ -342,11 +342,10 @@ def create(self, key: str, value: str) -> DeviceConfigInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceConfigInstance( @@ -369,11 +368,10 @@ async def create_async(self, key: str, value: str) -> DeviceConfigInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceConfigInstance( diff --git a/twilio/rest/microvisor/v1/device/device_secret.py b/twilio/rest/microvisor/v1/device/device_secret.py index 0ab9b1c721..f89a6c0e96 100644 --- a/twilio/rest/microvisor/v1/device/device_secret.py +++ b/twilio/rest/microvisor/v1/device/device_secret.py @@ -340,11 +340,10 @@ def create(self, key: str, value: str) -> DeviceSecretInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceSecretInstance( @@ -367,11 +366,10 @@ async def create_async(self, key: str, value: str) -> DeviceSecretInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceSecretInstance( diff --git a/twilio/rest/notify/v1/credential.py b/twilio/rest/notify/v1/credential.py index 5cb86363a3..d894a9a702 100644 --- a/twilio/rest/notify/v1/credential.py +++ b/twilio/rest/notify/v1/credential.py @@ -420,11 +420,10 @@ def create( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) @@ -464,11 +463,10 @@ async def create_async( "Secret": secret, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload) diff --git a/twilio/rest/notify/v1/service/__init__.py b/twilio/rest/notify/v1/service/__init__.py index 0cd9adb685..2654c97c14 100644 --- a/twilio/rest/notify/v1/service/__init__.py +++ b/twilio/rest/notify/v1/service/__init__.py @@ -616,11 +616,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -683,11 +682,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/notify/v1/service/binding.py b/twilio/rest/notify/v1/service/binding.py index a6b1e3f087..845f720dc2 100644 --- a/twilio/rest/notify/v1/service/binding.py +++ b/twilio/rest/notify/v1/service/binding.py @@ -314,11 +314,10 @@ def create( "Endpoint": endpoint, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BindingInstance( @@ -360,11 +359,10 @@ async def create_async( "Endpoint": endpoint, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BindingInstance( diff --git a/twilio/rest/notify/v1/service/notification.py b/twilio/rest/notify/v1/service/notification.py index e2482be109..ec31b423a1 100644 --- a/twilio/rest/notify/v1/service/notification.py +++ b/twilio/rest/notify/v1/service/notification.py @@ -180,11 +180,10 @@ def create( "Tag": serialize.map(tag, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NotificationInstance( @@ -259,11 +258,10 @@ async def create_async( "Tag": serialize.map(tag, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NotificationInstance( diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index 0e92b5b076..97b358b71e 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -192,7 +192,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -212,7 +213,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v1/eligibility.py b/twilio/rest/numbers/v1/eligibility.py index 91a2c73261..007a019f5b 100644 --- a/twilio/rest/numbers/v1/eligibility.py +++ b/twilio/rest/numbers/v1/eligibility.py @@ -63,7 +63,8 @@ def create(self, body: Union[object, object] = values.unset) -> EligibilityInsta """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -83,7 +84,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index e9988a7d6b..50b3e328ec 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -34,6 +34,7 @@ class PortingPortInInstance(InstanceResource): :ivar losing_carrier_information: The information for the losing carrier. :ivar phone_numbers: The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). :ivar documents: The list of documents SID referencing a utility bills + :ivar date_created: """ def __init__( @@ -69,6 +70,9 @@ def __init__( "phone_numbers" ) self.documents: Optional[List[str]] = payload.get("documents") + self.date_created: Optional[date] = deserialize.iso8601_date( + payload.get("date_created") + ) self._solution = { "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, @@ -250,7 +254,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -270,7 +275,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v1/porting_port_in_phone_number.py b/twilio/rest/numbers/v1/porting_port_in_phone_number.py index 48b90eea4f..f5d881a657 100644 --- a/twilio/rest/numbers/v1/porting_port_in_phone_number.py +++ b/twilio/rest/numbers/v1/porting_port_in_phone_number.py @@ -31,12 +31,15 @@ class PortingPortInPhoneNumberInstance(InstanceResource): :ivar date_created: The date when the phone number was created. :ivar country: The country of the phone number. :ivar missing_required_fields: The phone number is missing required fields. - :ivar status_last_time_updated_timestamp: The timestamp when the status was last updated. + :ivar last_updated: The timestamp when the status was last updated. :ivar phone_number: The phone number. :ivar portable: The phone number is portable. :ivar not_portability_reason: The reason why the phone number is not portable. :ivar not_portability_reason_code: The code of the reason why the phone number is not portable. :ivar port_in_phone_number_status: The status of the phone number in the port in request. + :ivar port_out_pin: The pin required for the losing carrier to port out the phone number. + :ivar rejection_reason: The rejection reason returned by the vendor. + :ivar rejection_reason_code: The rejection reason code returned by the vendor. """ def __init__( @@ -60,22 +63,27 @@ def __init__( self.missing_required_fields: Optional[bool] = payload.get( "missing_required_fields" ) - self.status_last_time_updated_timestamp: Optional[datetime] = ( - deserialize.iso8601_datetime( - payload.get("status_last_time_updated_timestamp") - ) + self.last_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("last_updated") ) self.phone_number: Optional[str] = payload.get("phone_number") self.portable: Optional[bool] = payload.get("portable") self.not_portability_reason: Optional[str] = payload.get( "not_portability_reason" ) - self.not_portability_reason_code: Optional[str] = payload.get( - "not_portability_reason_code" + self.not_portability_reason_code: Optional[int] = deserialize.integer( + payload.get("not_portability_reason_code") ) self.port_in_phone_number_status: Optional[str] = payload.get( "port_in_phone_number_status" ) + self.port_out_pin: Optional[int] = deserialize.integer( + payload.get("port_out_pin") + ) + self.rejection_reason: Optional[str] = payload.get("rejection_reason") + self.rejection_reason_code: Optional[int] = deserialize.integer( + payload.get("rejection_reason_code") + ) self._solution = { "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, diff --git a/twilio/rest/numbers/v1/porting_portability.py b/twilio/rest/numbers/v1/porting_portability.py index f1cf0cb8c9..d4f92ba7d5 100644 --- a/twilio/rest/numbers/v1/porting_portability.py +++ b/twilio/rest/numbers/v1/porting_portability.py @@ -37,8 +37,6 @@ class NumberType(object): :ivar not_portable_reason_code: The Portability Reason Code for the phone number if it cannot be ported into Twilio, `null` otherwise. One of `22131`, `22132`, `22130`, `22133`, `22102` or `22135`. :ivar number_type: :ivar country: Country the phone number belongs to. - :ivar messaging_carrier: Current messaging carrier of the phone number - :ivar voice_carrier: Current voice carrier of the phone number :ivar url: This is the url of the request that you're trying to reach out to locate the resource. """ @@ -64,8 +62,6 @@ def __init__( payload.get("number_type") ) self.country: Optional[str] = payload.get("country") - self.messaging_carrier: Optional[str] = payload.get("messaging_carrier") - self.voice_carrier: Optional[str] = payload.get("voice_carrier") self.url: Optional[str] = payload.get("url") self._solution = { diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration.py b/twilio/rest/numbers/v1/porting_webhook_configuration.py index d1daabfd7e..ea6d9bd2eb 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration.py @@ -71,7 +71,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -91,7 +92,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py index 46c053b65a..0119fe002f 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional -from twilio.base import deserialize +from twilio.base import deserialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -75,8 +75,9 @@ def fetch(self) -> PortingWebhookConfigurationFetchInstance: :returns: The fetched PortingWebhookConfigurationFetchInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = self._version.fetch(method="GET", uri=self._uri) + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PortingWebhookConfigurationFetchInstance(self._version, payload) @@ -87,8 +88,11 @@ async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: :returns: The fetched PortingWebhookConfigurationFetchInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = await self._version.fetch_async(method="GET", uri=self._uri) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return PortingWebhookConfigurationFetchInstance(self._version, payload) diff --git a/twilio/rest/numbers/v1/signing_request_configuration.py b/twilio/rest/numbers/v1/signing_request_configuration.py index 1b70ba88c0..541062ec6d 100644 --- a/twilio/rest/numbers/v1/signing_request_configuration.py +++ b/twilio/rest/numbers/v1/signing_request_configuration.py @@ -79,7 +79,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -99,7 +100,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v2/authorization_document/__init__.py b/twilio/rest/numbers/v2/authorization_document/__init__.py index 7e0a4d9184..f56071878e 100644 --- a/twilio/rest/numbers/v2/authorization_document/__init__.py +++ b/twilio/rest/numbers/v2/authorization_document/__init__.py @@ -313,11 +313,10 @@ def create( "CcEmails": serialize.map(cc_emails, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthorizationDocumentInstance(self._version, payload) @@ -356,11 +355,10 @@ async def create_async( "CcEmails": serialize.map(cc_emails, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthorizationDocumentInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index 30a57e28f4..325ffe8e73 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -230,7 +230,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -250,7 +251,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index 2063e7a87d..b2660cfc30 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -339,11 +339,10 @@ def create( "ContactTitle": contact_title, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance(self._version, payload) @@ -410,11 +409,10 @@ async def create_async( "ContactTitle": contact_title, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index d37caa0fb8..ccdcbb3f38 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -514,11 +514,10 @@ def create( "NumberType": number_type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BundleInstance(self._version, payload) @@ -558,11 +557,10 @@ async def create_async( "NumberType": number_type, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BundleInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py index a8cf77fd18..860a6f186e 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py @@ -136,11 +136,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BundleCopyInstance( @@ -163,11 +162,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BundleCopyInstance( diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py index 39aae3b6ed..83d061cda7 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py @@ -231,10 +231,9 @@ def create(self) -> EvaluationInstance: :returns: The created EvaluationInstance """ - payload = self._version.create( - method="POST", - uri=self._uri, - ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create(method="POST", uri=self._uri, headers=headers) return EvaluationInstance( self._version, payload, bundle_sid=self._solution["bundle_sid"] @@ -248,9 +247,10 @@ async def create_async(self) -> EvaluationInstance: :returns: The created EvaluationInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + payload = await self._version.create_async( - method="POST", - uri=self._uri, + method="POST", uri=self._uri, headers=headers ) return EvaluationInstance( diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py index d22fc31396..5fa77e7f95 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py @@ -270,11 +270,10 @@ def create(self, object_sid: str) -> ItemAssignmentInstance: "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ItemAssignmentInstance( @@ -295,11 +294,10 @@ async def create_async(self, object_sid: str) -> ItemAssignmentInstance: "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ItemAssignmentInstance( diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py index 09e2823ada..2e2bc6c293 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py @@ -112,11 +112,10 @@ def create(self, from_bundle_sid: str) -> ReplaceItemsInstance: "FromBundleSid": from_bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ReplaceItemsInstance( @@ -137,11 +136,10 @@ async def create_async(self, from_bundle_sid: str) -> ReplaceItemsInstance: "FromBundleSid": from_bundle_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ReplaceItemsInstance( diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py index 3f9e5ec856..7886494d54 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py @@ -359,11 +359,10 @@ def create( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload) @@ -391,11 +390,10 @@ async def create_async( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py index f2cd4e13d2..afa6579a13 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py @@ -377,11 +377,10 @@ def create( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance(self._version, payload) @@ -409,11 +408,10 @@ async def create_async( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance(self._version, payload) diff --git a/twilio/rest/oauth/v1/authorize.py b/twilio/rest/oauth/v1/authorize.py index 9798a73f3f..19341db74e 100644 --- a/twilio/rest/oauth/v1/authorize.py +++ b/twilio/rest/oauth/v1/authorize.py @@ -67,6 +67,7 @@ def fetch( :param response_type: Response Type:param client_id: The Client Identifier:param redirect_uri: The url to which response will be redirected to:param scope: The scope of the access request:param state: An opaque value which can be used to maintain state between the request and callback :returns: The fetched AuthorizeInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -78,7 +79,9 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=params) + payload = self._version.fetch( + method="GET", uri=self._uri, headers=headers, params=params + ) return AuthorizeInstance(self._version, payload) @@ -96,6 +99,7 @@ async def fetch_async( :param response_type: Response Type:param client_id: The Client Identifier:param redirect_uri: The url to which response will be redirected to:param scope: The scope of the access request:param state: An opaque value which can be used to maintain state between the request and callback :returns: The fetched AuthorizeInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) params = values.of( { @@ -108,7 +112,7 @@ async def fetch_async( ) payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=params + method="GET", uri=self._uri, headers=headers, params=params ) return AuthorizeInstance(self._version, payload) diff --git a/twilio/rest/oauth/v1/token.py b/twilio/rest/oauth/v1/token.py index 42884f0896..0d5377a9f9 100644 --- a/twilio/rest/oauth/v1/token.py +++ b/twilio/rest/oauth/v1/token.py @@ -99,11 +99,10 @@ def create( "Scope": scope, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TokenInstance(self._version, payload) @@ -146,11 +145,10 @@ async def create_async( "Scope": scope, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TokenInstance(self._version, payload) diff --git a/twilio/rest/preview/deployed_devices/fleet/__init__.py b/twilio/rest/preview/deployed_devices/fleet/__init__.py index 0f5c284468..f7321fdb2b 100644 --- a/twilio/rest/preview/deployed_devices/fleet/__init__.py +++ b/twilio/rest/preview/deployed_devices/fleet/__init__.py @@ -434,11 +434,10 @@ def create(self, friendly_name: Union[str, object] = values.unset) -> FleetInsta "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FleetInstance(self._version, payload) @@ -459,11 +458,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FleetInstance(self._version, payload) diff --git a/twilio/rest/preview/deployed_devices/fleet/certificate.py b/twilio/rest/preview/deployed_devices/fleet/certificate.py index 1511a06134..895bdc5682 100644 --- a/twilio/rest/preview/deployed_devices/fleet/certificate.py +++ b/twilio/rest/preview/deployed_devices/fleet/certificate.py @@ -383,11 +383,10 @@ def create( "DeviceSid": device_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CertificateInstance( @@ -417,11 +416,10 @@ async def create_async( "DeviceSid": device_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CertificateInstance( diff --git a/twilio/rest/preview/deployed_devices/fleet/deployment.py b/twilio/rest/preview/deployed_devices/fleet/deployment.py index 5c0d109eab..80f9f2372d 100644 --- a/twilio/rest/preview/deployed_devices/fleet/deployment.py +++ b/twilio/rest/preview/deployed_devices/fleet/deployment.py @@ -378,11 +378,10 @@ def create( "SyncServiceSid": sync_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeploymentInstance( @@ -409,11 +408,10 @@ async def create_async( "SyncServiceSid": sync_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeploymentInstance( diff --git a/twilio/rest/preview/deployed_devices/fleet/device.py b/twilio/rest/preview/deployed_devices/fleet/device.py index 7e9b818140..3cacc88f2b 100644 --- a/twilio/rest/preview/deployed_devices/fleet/device.py +++ b/twilio/rest/preview/deployed_devices/fleet/device.py @@ -421,11 +421,10 @@ def create( "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceInstance( @@ -461,11 +460,10 @@ async def create_async( "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceInstance( diff --git a/twilio/rest/preview/deployed_devices/fleet/key.py b/twilio/rest/preview/deployed_devices/fleet/key.py index eabfc456cc..1b7c06e1f9 100644 --- a/twilio/rest/preview/deployed_devices/fleet/key.py +++ b/twilio/rest/preview/deployed_devices/fleet/key.py @@ -380,11 +380,10 @@ def create( "DeviceSid": device_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return KeyInstance( @@ -411,11 +410,10 @@ async def create_async( "DeviceSid": device_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return KeyInstance( diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py index 162d0b11a5..79fe4beddd 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py @@ -433,11 +433,10 @@ def create( "CcEmails": serialize.map(cc_emails, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthorizationDocumentInstance(self._version, payload) @@ -476,11 +475,10 @@ async def create_async( "CcEmails": serialize.map(cc_emails, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthorizationDocumentInstance(self._version, payload) diff --git a/twilio/rest/preview/hosted_numbers/hosted_number_order.py b/twilio/rest/preview/hosted_numbers/hosted_number_order.py index 7e68f57b56..7010b1b3eb 100644 --- a/twilio/rest/preview/hosted_numbers/hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/hosted_number_order.py @@ -568,11 +568,10 @@ def create( "VerificationDocumentSid": verification_document_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance(self._version, payload) @@ -644,11 +643,10 @@ async def create_async( "VerificationDocumentSid": verification_document_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance(self._version, payload) diff --git a/twilio/rest/preview/marketplace/installed_add_on/__init__.py b/twilio/rest/preview/marketplace/installed_add_on/__init__.py index d067f9fe79..731e84c80c 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/installed_add_on/__init__.py @@ -387,11 +387,10 @@ def create( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload) @@ -424,11 +423,10 @@ async def create_async( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload) diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py index cb8cdf7910..23f805a875 100644 --- a/twilio/rest/preview/sync/service/__init__.py +++ b/twilio/rest/preview/sync/service/__init__.py @@ -457,11 +457,10 @@ def create( "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -494,11 +493,10 @@ async def create_async( "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/preview/sync/service/document/__init__.py b/twilio/rest/preview/sync/service/document/__init__.py index e7ab4ae8b8..c7033e2fd2 100644 --- a/twilio/rest/preview/sync/service/document/__init__.py +++ b/twilio/rest/preview/sync/service/document/__init__.py @@ -405,11 +405,10 @@ def create( "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentInstance( @@ -436,11 +435,10 @@ async def create_async( "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentInstance( diff --git a/twilio/rest/preview/sync/service/sync_list/__init__.py b/twilio/rest/preview/sync/service/sync_list/__init__.py index fcd2f28ffe..4b920e0194 100644 --- a/twilio/rest/preview/sync/service/sync_list/__init__.py +++ b/twilio/rest/preview/sync/service/sync_list/__init__.py @@ -323,11 +323,10 @@ def create( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListInstance( @@ -350,11 +349,10 @@ async def create_async( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListInstance( diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py index 0cefd6c66b..b84411e8a8 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py @@ -415,11 +415,10 @@ def create(self, data: object) -> SyncListItemInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListItemInstance( @@ -443,11 +442,10 @@ async def create_async(self, data: object) -> SyncListItemInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListItemInstance( diff --git a/twilio/rest/preview/sync/service/sync_map/__init__.py b/twilio/rest/preview/sync/service/sync_map/__init__.py index 1d79936240..19c29f3267 100644 --- a/twilio/rest/preview/sync/service/sync_map/__init__.py +++ b/twilio/rest/preview/sync/service/sync_map/__init__.py @@ -321,11 +321,10 @@ def create(self, unique_name: Union[str, object] = values.unset) -> SyncMapInsta "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapInstance( @@ -348,11 +347,10 @@ async def create_async( "UniqueName": unique_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapInstance( diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py index 322c8ed225..78682fe588 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py @@ -417,11 +417,10 @@ def create(self, key: str, data: object) -> SyncMapItemInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapItemInstance( @@ -447,11 +446,10 @@ async def create_async(self, key: str, data: object) -> SyncMapItemInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapItemInstance( diff --git a/twilio/rest/preview/wireless/command.py b/twilio/rest/preview/wireless/command.py index 755256bb6b..b91d1969e8 100644 --- a/twilio/rest/preview/wireless/command.py +++ b/twilio/rest/preview/wireless/command.py @@ -238,11 +238,10 @@ def create( "IncludeSid": include_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CommandInstance(self._version, payload) @@ -282,11 +281,10 @@ async def create_async( "IncludeSid": include_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CommandInstance(self._version, payload) diff --git a/twilio/rest/preview/wireless/rate_plan.py b/twilio/rest/preview/wireless/rate_plan.py index f3484efa66..b9ca020da6 100644 --- a/twilio/rest/preview/wireless/rate_plan.py +++ b/twilio/rest/preview/wireless/rate_plan.py @@ -395,11 +395,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload) @@ -452,11 +451,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload) diff --git a/twilio/rest/proxy/v1/service/__init__.py b/twilio/rest/proxy/v1/service/__init__.py index 6be2def24c..7337294a6c 100644 --- a/twilio/rest/proxy/v1/service/__init__.py +++ b/twilio/rest/proxy/v1/service/__init__.py @@ -548,11 +548,10 @@ def create( "ChatInstanceSid": chat_instance_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -597,11 +596,10 @@ async def create_async( "ChatInstanceSid": chat_instance_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/proxy/v1/service/phone_number.py b/twilio/rest/proxy/v1/service/phone_number.py index 366b9ba11f..05b9033602 100644 --- a/twilio/rest/proxy/v1/service/phone_number.py +++ b/twilio/rest/proxy/v1/service/phone_number.py @@ -375,11 +375,10 @@ def create( "IsReserved": serialize.boolean_to_string(is_reserved), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( @@ -409,11 +408,10 @@ async def create_async( "IsReserved": serialize.boolean_to_string(is_reserved), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( diff --git a/twilio/rest/proxy/v1/service/session/__init__.py b/twilio/rest/proxy/v1/service/session/__init__.py index 26ff177889..cfd547b1e7 100644 --- a/twilio/rest/proxy/v1/service/session/__init__.py +++ b/twilio/rest/proxy/v1/service/session/__init__.py @@ -486,11 +486,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SessionInstance( @@ -531,11 +530,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SessionInstance( diff --git a/twilio/rest/proxy/v1/service/session/participant/__init__.py b/twilio/rest/proxy/v1/service/session/participant/__init__.py index 266396f08f..e2eb3eaae8 100644 --- a/twilio/rest/proxy/v1/service/session/participant/__init__.py +++ b/twilio/rest/proxy/v1/service/session/participant/__init__.py @@ -340,11 +340,10 @@ def create( "ProxyIdentifierSid": proxy_identifier_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( @@ -380,11 +379,10 @@ async def create_async( "ProxyIdentifierSid": proxy_identifier_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( diff --git a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py index b260b4693f..55ff64074e 100644 --- a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py +++ b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py @@ -332,11 +332,10 @@ def create( "MediaUrl": serialize.map(media_url, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInteractionInstance( @@ -367,11 +366,10 @@ async def create_async( "MediaUrl": serialize.map(media_url, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInteractionInstance( diff --git a/twilio/rest/proxy/v1/service/short_code.py b/twilio/rest/proxy/v1/service/short_code.py index 712d6f82fa..e26514bff2 100644 --- a/twilio/rest/proxy/v1/service/short_code.py +++ b/twilio/rest/proxy/v1/service/short_code.py @@ -360,11 +360,10 @@ def create(self, sid: str) -> ShortCodeInstance: "Sid": sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( @@ -385,11 +384,10 @@ async def create_async(self, sid: str) -> ShortCodeInstance: "Sid": sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( diff --git a/twilio/rest/serverless/v1/service/__init__.py b/twilio/rest/serverless/v1/service/__init__.py index 0fe404c8f1..1658e671f4 100644 --- a/twilio/rest/serverless/v1/service/__init__.py +++ b/twilio/rest/serverless/v1/service/__init__.py @@ -460,11 +460,10 @@ def create( "UiEditable": serialize.boolean_to_string(ui_editable), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -495,11 +494,10 @@ async def create_async( "UiEditable": serialize.boolean_to_string(ui_editable), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/serverless/v1/service/asset/__init__.py b/twilio/rest/serverless/v1/service/asset/__init__.py index 2049c9d46b..4e413db1da 100644 --- a/twilio/rest/serverless/v1/service/asset/__init__.py +++ b/twilio/rest/serverless/v1/service/asset/__init__.py @@ -371,11 +371,10 @@ def create(self, friendly_name: str) -> AssetInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AssetInstance( @@ -396,11 +395,10 @@ async def create_async(self, friendly_name: str) -> AssetInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AssetInstance( diff --git a/twilio/rest/serverless/v1/service/build/__init__.py b/twilio/rest/serverless/v1/service/build/__init__.py index fa7a7947ac..90e5ccec41 100644 --- a/twilio/rest/serverless/v1/service/build/__init__.py +++ b/twilio/rest/serverless/v1/service/build/__init__.py @@ -313,10 +313,12 @@ def create(self, asset_versions: Union[List[str], object]=values.unset, function 'Dependencies': dependencies, 'Runtime': runtime, }) + headers = values.of({ + 'Content-Type': 'application/x-www-form-urlencoded' + }) - - payload = self._version.create(method='POST', uri=self._uri, data=data,) + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers) return BuildInstance(self._version, payload, service_sid=self._solution['service_sid']) @@ -338,10 +340,12 @@ async def create_async(self, asset_versions: Union[List[str], object]=values.uns 'Dependencies': dependencies, 'Runtime': runtime, }) + headers = values.of({ + 'Content-Type': 'application/x-www-form-urlencoded' + }) - - payload = await self._version.create_async(method='POST', uri=self._uri, data=data,) + payload = await self._version.create_async(method='POST', uri=self._uri, data=data, headers=headers) return BuildInstance(self._version, payload, service_sid=self._solution['service_sid']) diff --git a/twilio/rest/serverless/v1/service/environment/__init__.py b/twilio/rest/serverless/v1/service/environment/__init__.py index 46b7ddacf4..e9df6ecb2a 100644 --- a/twilio/rest/serverless/v1/service/environment/__init__.py +++ b/twilio/rest/serverless/v1/service/environment/__init__.py @@ -349,11 +349,10 @@ def create( "DomainSuffix": domain_suffix, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EnvironmentInstance( @@ -378,11 +377,10 @@ async def create_async( "DomainSuffix": domain_suffix, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EnvironmentInstance( diff --git a/twilio/rest/serverless/v1/service/environment/deployment.py b/twilio/rest/serverless/v1/service/environment/deployment.py index 1ff896f93a..63ef1b4610 100644 --- a/twilio/rest/serverless/v1/service/environment/deployment.py +++ b/twilio/rest/serverless/v1/service/environment/deployment.py @@ -250,11 +250,10 @@ def create( "BuildSid": build_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeploymentInstance( @@ -280,11 +279,10 @@ async def create_async( "BuildSid": build_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeploymentInstance( diff --git a/twilio/rest/serverless/v1/service/environment/variable.py b/twilio/rest/serverless/v1/service/environment/variable.py index f69c129f81..99027536f3 100644 --- a/twilio/rest/serverless/v1/service/environment/variable.py +++ b/twilio/rest/serverless/v1/service/environment/variable.py @@ -398,11 +398,10 @@ def create(self, key: str, value: str) -> VariableInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VariableInstance( @@ -428,11 +427,10 @@ async def create_async(self, key: str, value: str) -> VariableInstance: "Value": value, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VariableInstance( diff --git a/twilio/rest/serverless/v1/service/function/__init__.py b/twilio/rest/serverless/v1/service/function/__init__.py index 71bbad8466..25a3ef935f 100644 --- a/twilio/rest/serverless/v1/service/function/__init__.py +++ b/twilio/rest/serverless/v1/service/function/__init__.py @@ -373,11 +373,10 @@ def create(self, friendly_name: str) -> FunctionInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FunctionInstance( @@ -398,11 +397,10 @@ async def create_async(self, friendly_name: str) -> FunctionInstance: "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FunctionInstance( diff --git a/twilio/rest/studio/v1/flow/engagement/__init__.py b/twilio/rest/studio/v1/flow/engagement/__init__.py index f6d95abd5f..db0c846e5c 100644 --- a/twilio/rest/studio/v1/flow/engagement/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/__init__.py @@ -336,11 +336,10 @@ def create( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EngagementInstance( @@ -367,11 +366,10 @@ async def create_async( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EngagementInstance( diff --git a/twilio/rest/studio/v1/flow/execution/__init__.py b/twilio/rest/studio/v1/flow/execution/__init__.py index 57239e5154..6a32cb3020 100644 --- a/twilio/rest/studio/v1/flow/execution/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/__init__.py @@ -416,11 +416,10 @@ def create( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( @@ -447,11 +446,10 @@ async def create_async( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( diff --git a/twilio/rest/studio/v2/flow/__init__.py b/twilio/rest/studio/v2/flow/__init__.py index 21138d29cc..057c949696 100644 --- a/twilio/rest/studio/v2/flow/__init__.py +++ b/twilio/rest/studio/v2/flow/__init__.py @@ -464,11 +464,10 @@ def create( "CommitMessage": commit_message, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowInstance(self._version, payload) @@ -499,11 +498,10 @@ async def create_async( "CommitMessage": commit_message, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowInstance(self._version, payload) diff --git a/twilio/rest/studio/v2/flow/execution/__init__.py b/twilio/rest/studio/v2/flow/execution/__init__.py index 38d3b2b539..18dcbf0629 100644 --- a/twilio/rest/studio/v2/flow/execution/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/__init__.py @@ -414,11 +414,10 @@ def create( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( @@ -445,11 +444,10 @@ async def create_async( "Parameters": serialize.object(parameters), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( diff --git a/twilio/rest/studio/v2/flow_validate.py b/twilio/rest/studio/v2/flow_validate.py index 43f226e154..34f37e152f 100644 --- a/twilio/rest/studio/v2/flow_validate.py +++ b/twilio/rest/studio/v2/flow_validate.py @@ -84,11 +84,10 @@ def update( "CommitMessage": commit_message, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowValidateInstance(self._version, payload) @@ -119,11 +118,10 @@ async def update_async( "CommitMessage": commit_message, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowValidateInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/esim_profile.py b/twilio/rest/supersim/v1/esim_profile.py index 847bcae33a..7e176bba7f 100644 --- a/twilio/rest/supersim/v1/esim_profile.py +++ b/twilio/rest/supersim/v1/esim_profile.py @@ -244,11 +244,10 @@ def create( "Eid": eid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EsimProfileInstance(self._version, payload) @@ -279,11 +278,10 @@ async def create_async( "Eid": eid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EsimProfileInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/fleet.py b/twilio/rest/supersim/v1/fleet.py index 2003eb77b5..2b9fbff44e 100644 --- a/twilio/rest/supersim/v1/fleet.py +++ b/twilio/rest/supersim/v1/fleet.py @@ -412,11 +412,10 @@ def create( "SmsCommandsMethod": sms_commands_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FleetInstance(self._version, payload) @@ -462,11 +461,10 @@ async def create_async( "SmsCommandsMethod": sms_commands_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FleetInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/ip_command.py b/twilio/rest/supersim/v1/ip_command.py index b7610efec6..db6ac26432 100644 --- a/twilio/rest/supersim/v1/ip_command.py +++ b/twilio/rest/supersim/v1/ip_command.py @@ -260,11 +260,10 @@ def create( "CallbackMethod": callback_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpCommandInstance(self._version, payload) @@ -301,11 +300,10 @@ async def create_async( "CallbackMethod": callback_method, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpCommandInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/network_access_profile/__init__.py b/twilio/rest/supersim/v1/network_access_profile/__init__.py index d0b5374699..4937ac50dd 100644 --- a/twilio/rest/supersim/v1/network_access_profile/__init__.py +++ b/twilio/rest/supersim/v1/network_access_profile/__init__.py @@ -319,11 +319,10 @@ def create( "Networks": serialize.map(networks, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NetworkAccessProfileInstance(self._version, payload) @@ -348,11 +347,10 @@ async def create_async( "Networks": serialize.map(networks, lambda e: e), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NetworkAccessProfileInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py b/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py index 50a259550d..cbe4d5c0ea 100644 --- a/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py +++ b/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py @@ -279,11 +279,10 @@ def create(self, network: str) -> NetworkAccessProfileNetworkInstance: "Network": network, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NetworkAccessProfileNetworkInstance( @@ -306,11 +305,10 @@ async def create_async(self, network: str) -> NetworkAccessProfileNetworkInstanc "Network": network, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NetworkAccessProfileNetworkInstance( diff --git a/twilio/rest/supersim/v1/sim/__init__.py b/twilio/rest/supersim/v1/sim/__init__.py index b1ba647336..1452f1eac5 100644 --- a/twilio/rest/supersim/v1/sim/__init__.py +++ b/twilio/rest/supersim/v1/sim/__init__.py @@ -413,11 +413,10 @@ def create(self, iccid: str, registration_code: str) -> SimInstance: "RegistrationCode": registration_code, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SimInstance(self._version, payload) @@ -438,11 +437,10 @@ async def create_async(self, iccid: str, registration_code: str) -> SimInstance: "RegistrationCode": registration_code, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SimInstance(self._version, payload) diff --git a/twilio/rest/supersim/v1/sms_command.py b/twilio/rest/supersim/v1/sms_command.py index 0eb2094103..26d39a0bf8 100644 --- a/twilio/rest/supersim/v1/sms_command.py +++ b/twilio/rest/supersim/v1/sms_command.py @@ -239,11 +239,10 @@ def create( "CallbackUrl": callback_url, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SmsCommandInstance(self._version, payload) @@ -274,11 +273,10 @@ async def create_async( "CallbackUrl": callback_url, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SmsCommandInstance(self._version, payload) diff --git a/twilio/rest/sync/v1/service/__init__.py b/twilio/rest/sync/v1/service/__init__.py index 0bf1045f2b..02d4e8f7e0 100644 --- a/twilio/rest/sync/v1/service/__init__.py +++ b/twilio/rest/sync/v1/service/__init__.py @@ -549,11 +549,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -599,11 +598,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/sync/v1/service/document/__init__.py b/twilio/rest/sync/v1/service/document/__init__.py index f3b89cfe67..033f27cf42 100644 --- a/twilio/rest/sync/v1/service/document/__init__.py +++ b/twilio/rest/sync/v1/service/document/__init__.py @@ -432,11 +432,10 @@ def create( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentInstance( @@ -466,11 +465,10 @@ async def create_async( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentInstance( diff --git a/twilio/rest/sync/v1/service/sync_list/__init__.py b/twilio/rest/sync/v1/service/sync_list/__init__.py index 7e9ca672c4..235fcbd1b9 100644 --- a/twilio/rest/sync/v1/service/sync_list/__init__.py +++ b/twilio/rest/sync/v1/service/sync_list/__init__.py @@ -436,11 +436,10 @@ def create( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListInstance( @@ -470,11 +469,10 @@ async def create_async( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListInstance( diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py index 02dafcd49b..0db046e1a8 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py @@ -475,11 +475,10 @@ def create( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListItemInstance( @@ -515,11 +514,10 @@ async def create_async( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListItemInstance( diff --git a/twilio/rest/sync/v1/service/sync_map/__init__.py b/twilio/rest/sync/v1/service/sync_map/__init__.py index 1a68e8ef4d..1c6b5c9a00 100644 --- a/twilio/rest/sync/v1/service/sync_map/__init__.py +++ b/twilio/rest/sync/v1/service/sync_map/__init__.py @@ -436,11 +436,10 @@ def create( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapInstance( @@ -470,11 +469,10 @@ async def create_async( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapInstance( diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py index 7c621f8adc..c5381fc592 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py @@ -478,11 +478,10 @@ def create( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapItemInstance( @@ -521,11 +520,10 @@ async def create_async( "CollectionTtl": collection_ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapItemInstance( diff --git a/twilio/rest/sync/v1/service/sync_stream/__init__.py b/twilio/rest/sync/v1/service/sync_stream/__init__.py index aa10d164a6..c9b98ab7d0 100644 --- a/twilio/rest/sync/v1/service/sync_stream/__init__.py +++ b/twilio/rest/sync/v1/service/sync_stream/__init__.py @@ -387,11 +387,10 @@ def create( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncStreamInstance( @@ -418,11 +417,10 @@ async def create_async( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncStreamInstance( diff --git a/twilio/rest/sync/v1/service/sync_stream/stream_message.py b/twilio/rest/sync/v1/service/sync_stream/stream_message.py index 88a7604a7a..baca803f95 100644 --- a/twilio/rest/sync/v1/service/sync_stream/stream_message.py +++ b/twilio/rest/sync/v1/service/sync_stream/stream_message.py @@ -89,11 +89,10 @@ def create(self, data: object) -> StreamMessageInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return StreamMessageInstance( @@ -117,11 +116,10 @@ async def create_async(self, data: object) -> StreamMessageInstance: "Data": serialize.object(data), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return StreamMessageInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/__init__.py b/twilio/rest/taskrouter/v1/workspace/__init__.py index f1202197c4..60085c1186 100644 --- a/twilio/rest/taskrouter/v1/workspace/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/__init__.py @@ -671,11 +671,10 @@ def create( "PrioritizeQueueOrder": prioritize_queue_order, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkspaceInstance(self._version, payload) @@ -714,11 +713,10 @@ async def create_async( "PrioritizeQueueOrder": prioritize_queue_order, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkspaceInstance(self._version, payload) diff --git a/twilio/rest/taskrouter/v1/workspace/activity.py b/twilio/rest/taskrouter/v1/workspace/activity.py index bae49d5efa..e211ef9f72 100644 --- a/twilio/rest/taskrouter/v1/workspace/activity.py +++ b/twilio/rest/taskrouter/v1/workspace/activity.py @@ -364,11 +364,10 @@ def create( "Available": serialize.boolean_to_string(available), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ActivityInstance( @@ -393,11 +392,10 @@ async def create_async( "Available": serialize.boolean_to_string(available), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ActivityInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index 9d35415ae3..f71c4bd68f 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -555,11 +555,10 @@ def create( "TaskQueueSid": task_queue_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskInstance( @@ -607,11 +606,10 @@ async def create_async( "TaskQueueSid": task_queue_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/task_channel.py b/twilio/rest/taskrouter/v1/workspace/task_channel.py index 099f85efb1..95a7e5efaf 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/task_channel.py @@ -395,11 +395,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskChannelInstance( @@ -431,11 +430,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskChannelInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py index 794fd216d3..027cf8dbfc 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py @@ -555,11 +555,10 @@ def create( "AssignmentActivitySid": assignment_activity_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskQueueInstance( @@ -598,11 +597,10 @@ async def create_async( "AssignmentActivitySid": assignment_activity_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskQueueInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py index a1c44b1644..9ccef45773 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py @@ -92,7 +92,8 @@ def create( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers @@ -114,7 +115,8 @@ async def create_async( """ data = body.to_dict() - headers = {"Content-Type": "application/json"} + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py index a236fcae8d..8f6ff4c7e1 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py @@ -535,11 +535,10 @@ def create( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkerInstance( @@ -569,11 +568,10 @@ async def create_async( "Attributes": attributes, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkerInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py index f01e76d379..96d7aabf0e 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py @@ -526,11 +526,10 @@ def create( "TaskReservationTimeout": task_reservation_timeout, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkflowInstance( @@ -566,11 +565,10 @@ async def create_async( "TaskReservationTimeout": task_reservation_timeout, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkflowInstance( diff --git a/twilio/rest/trunking/v1/trunk/__init__.py b/twilio/rest/trunking/v1/trunk/__init__.py index 16125ead02..b1bfdba117 100644 --- a/twilio/rest/trunking/v1/trunk/__init__.py +++ b/twilio/rest/trunking/v1/trunk/__init__.py @@ -591,11 +591,10 @@ def create( "TransferCallerId": transfer_caller_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrunkInstance(self._version, payload) @@ -640,11 +639,10 @@ async def create_async( "TransferCallerId": transfer_caller_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrunkInstance(self._version, payload) diff --git a/twilio/rest/trunking/v1/trunk/credential_list.py b/twilio/rest/trunking/v1/trunk/credential_list.py index 7dc043d286..e04bb30720 100644 --- a/twilio/rest/trunking/v1/trunk/credential_list.py +++ b/twilio/rest/trunking/v1/trunk/credential_list.py @@ -268,11 +268,10 @@ def create(self, credential_list_sid: str) -> CredentialListInstance: "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListInstance( @@ -293,11 +292,10 @@ async def create_async(self, credential_list_sid: str) -> CredentialListInstance "CredentialListSid": credential_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListInstance( diff --git a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py index b361e7fe9f..957084cb62 100644 --- a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py +++ b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py @@ -270,11 +270,10 @@ def create(self, ip_access_control_list_sid: str) -> IpAccessControlListInstance "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListInstance( @@ -297,11 +296,10 @@ async def create_async( "IpAccessControlListSid": ip_access_control_list_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListInstance( diff --git a/twilio/rest/trunking/v1/trunk/origination_url.py b/twilio/rest/trunking/v1/trunk/origination_url.py index bcf0c5205f..e8e77180e8 100644 --- a/twilio/rest/trunking/v1/trunk/origination_url.py +++ b/twilio/rest/trunking/v1/trunk/origination_url.py @@ -429,11 +429,10 @@ def create( "SipUrl": sip_url, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return OriginationUrlInstance( @@ -469,11 +468,10 @@ async def create_async( "SipUrl": sip_url, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return OriginationUrlInstance( diff --git a/twilio/rest/trunking/v1/trunk/phone_number.py b/twilio/rest/trunking/v1/trunk/phone_number.py index 7f0adbeef1..75cb5f6c64 100644 --- a/twilio/rest/trunking/v1/trunk/phone_number.py +++ b/twilio/rest/trunking/v1/trunk/phone_number.py @@ -319,11 +319,10 @@ def create(self, phone_number_sid: str) -> PhoneNumberInstance: "PhoneNumberSid": phone_number_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( @@ -344,11 +343,10 @@ async def create_async(self, phone_number_sid: str) -> PhoneNumberInstance: "PhoneNumberSid": phone_number_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( diff --git a/twilio/rest/trusthub/v1/compliance_inquiries.py b/twilio/rest/trusthub/v1/compliance_inquiries.py index b1b52a4f78..6fe6c297bd 100644 --- a/twilio/rest/trusthub/v1/compliance_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_inquiries.py @@ -209,11 +209,10 @@ def create( "NotificationEmail": notification_email, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceInquiriesInstance(self._version, payload) @@ -238,11 +237,10 @@ async def create_async( "NotificationEmail": notification_email, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceInquiriesInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py index c279bce12b..2f6c465341 100644 --- a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py @@ -378,11 +378,10 @@ def create( "ThemeSetId": theme_set_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceRegistrationInquiriesInstance(self._version, payload) @@ -527,11 +526,10 @@ async def create_async( "ThemeSetId": theme_set_id, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceRegistrationInquiriesInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py index 490f68b4e6..4d8988ab41 100644 --- a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py @@ -93,6 +93,7 @@ def create( business_contact_email: Union[str, object] = values.unset, business_contact_phone: Union[str, object] = values.unset, theme_set_id: Union[str, object] = values.unset, + skip_messaging_use_case: Union[bool, object] = values.unset, ) -> ComplianceTollfreeInquiriesInstance: """ Create the ComplianceTollfreeInquiriesInstance @@ -119,6 +120,7 @@ def create( :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. :param theme_set_id: Theme id for styling the inquiry form. + :param skip_messaging_use_case: Skip the messaging use case screen of the inquiry form. :returns: The created ComplianceTollfreeInquiriesInstance """ @@ -147,13 +149,15 @@ def create( "BusinessContactEmail": business_contact_email, "BusinessContactPhone": business_contact_phone, "ThemeSetId": theme_set_id, + "SkipMessagingUseCase": serialize.boolean_to_string( + skip_messaging_use_case + ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceTollfreeInquiriesInstance(self._version, payload) @@ -184,6 +188,7 @@ async def create_async( business_contact_email: Union[str, object] = values.unset, business_contact_phone: Union[str, object] = values.unset, theme_set_id: Union[str, object] = values.unset, + skip_messaging_use_case: Union[bool, object] = values.unset, ) -> ComplianceTollfreeInquiriesInstance: """ Asynchronously create the ComplianceTollfreeInquiriesInstance @@ -210,6 +215,7 @@ async def create_async( :param business_contact_email: The email address of the contact for the business or organization using the Tollfree number. :param business_contact_phone: The phone number of the contact for the business or organization using the Tollfree number. :param theme_set_id: Theme id for styling the inquiry form. + :param skip_messaging_use_case: Skip the messaging use case screen of the inquiry form. :returns: The created ComplianceTollfreeInquiriesInstance """ @@ -238,13 +244,15 @@ async def create_async( "BusinessContactEmail": business_contact_email, "BusinessContactPhone": business_contact_phone, "ThemeSetId": theme_set_id, + "SkipMessagingUseCase": serialize.boolean_to_string( + skip_messaging_use_case + ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceTollfreeInquiriesInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/customer_profiles/__init__.py b/twilio/rest/trusthub/v1/customer_profiles/__init__.py index 5365092777..5079b89e6d 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/__init__.py +++ b/twilio/rest/trusthub/v1/customer_profiles/__init__.py @@ -493,11 +493,10 @@ def create( "StatusCallback": status_callback, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesInstance(self._version, payload) @@ -528,11 +527,10 @@ async def create_async( "StatusCallback": status_callback, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py index 4cb14c5ccd..0369e51d5c 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py @@ -282,11 +282,10 @@ def create( "ChannelEndpointSid": channel_endpoint_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesChannelEndpointAssignmentInstance( @@ -313,11 +312,10 @@ async def create_async( "ChannelEndpointSid": channel_endpoint_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesChannelEndpointAssignmentInstance( diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py index 5a19ccaabe..8fbb523b8a 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py @@ -282,11 +282,10 @@ def create(self, object_sid: str) -> CustomerProfilesEntityAssignmentsInstance: "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesEntityAssignmentsInstance( @@ -311,11 +310,10 @@ async def create_async( "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesEntityAssignmentsInstance( diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py index 60538ee22e..b5c3ba746e 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py @@ -245,11 +245,10 @@ def create(self, policy_sid: str) -> CustomerProfilesEvaluationsInstance: "PolicySid": policy_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesEvaluationsInstance( @@ -274,11 +273,10 @@ async def create_async( "PolicySid": policy_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesEvaluationsInstance( diff --git a/twilio/rest/trusthub/v1/end_user.py b/twilio/rest/trusthub/v1/end_user.py index b8b08d65ca..42bdb155e0 100644 --- a/twilio/rest/trusthub/v1/end_user.py +++ b/twilio/rest/trusthub/v1/end_user.py @@ -354,11 +354,10 @@ def create( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload) @@ -386,11 +385,10 @@ async def create_async( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/supporting_document.py b/twilio/rest/trusthub/v1/supporting_document.py index a18293fd8e..2336e1fefa 100644 --- a/twilio/rest/trusthub/v1/supporting_document.py +++ b/twilio/rest/trusthub/v1/supporting_document.py @@ -373,11 +373,10 @@ def create( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance(self._version, payload) @@ -405,11 +404,10 @@ async def create_async( "Attributes": serialize.object(attributes), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/trust_products/__init__.py b/twilio/rest/trusthub/v1/trust_products/__init__.py index 35f233cc7a..c819eb0a07 100644 --- a/twilio/rest/trusthub/v1/trust_products/__init__.py +++ b/twilio/rest/trusthub/v1/trust_products/__init__.py @@ -483,11 +483,10 @@ def create( "StatusCallback": status_callback, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsInstance(self._version, payload) @@ -518,11 +517,10 @@ async def create_async( "StatusCallback": status_callback, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsInstance(self._version, payload) diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py b/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py index ef2b589ffb..df69d31ddf 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py @@ -284,11 +284,10 @@ def create( "ChannelEndpointSid": channel_endpoint_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsChannelEndpointAssignmentInstance( @@ -315,11 +314,10 @@ async def create_async( "ChannelEndpointSid": channel_endpoint_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsChannelEndpointAssignmentInstance( diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py index 16f07a8927..57e1b3119c 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py @@ -276,11 +276,10 @@ def create(self, object_sid: str) -> TrustProductsEntityAssignmentsInstance: "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsEntityAssignmentsInstance( @@ -305,11 +304,10 @@ async def create_async( "ObjectSid": object_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsEntityAssignmentsInstance( diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py index dfb929bac0..3088a2b1b4 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py @@ -241,11 +241,10 @@ def create(self, policy_sid: str) -> TrustProductsEvaluationsInstance: "PolicySid": policy_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsEvaluationsInstance( @@ -268,11 +267,10 @@ async def create_async(self, policy_sid: str) -> TrustProductsEvaluationsInstanc "PolicySid": policy_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsEvaluationsInstance( diff --git a/twilio/rest/verify/v2/safelist.py b/twilio/rest/verify/v2/safelist.py index fb71369fb1..0ee946a342 100644 --- a/twilio/rest/verify/v2/safelist.py +++ b/twilio/rest/verify/v2/safelist.py @@ -221,11 +221,10 @@ def create(self, phone_number: str) -> SafelistInstance: "PhoneNumber": phone_number, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SafelistInstance(self._version, payload) @@ -244,11 +243,10 @@ async def create_async(self, phone_number: str) -> SafelistInstance: "PhoneNumber": phone_number, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SafelistInstance(self._version, payload) diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 36d7c1058b..69a6cf853e 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -821,11 +821,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) @@ -910,11 +909,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload) diff --git a/twilio/rest/verify/v2/service/access_token.py b/twilio/rest/verify/v2/service/access_token.py index 0bb888a08f..917abbc965 100644 --- a/twilio/rest/verify/v2/service/access_token.py +++ b/twilio/rest/verify/v2/service/access_token.py @@ -228,11 +228,10 @@ def create( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccessTokenInstance( @@ -265,11 +264,10 @@ async def create_async( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccessTokenInstance( diff --git a/twilio/rest/verify/v2/service/entity/__init__.py b/twilio/rest/verify/v2/service/entity/__init__.py index 41541a4ca6..7371edc08f 100644 --- a/twilio/rest/verify/v2/service/entity/__init__.py +++ b/twilio/rest/verify/v2/service/entity/__init__.py @@ -339,11 +339,10 @@ def create(self, identity: str) -> EntityInstance: "Identity": identity, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EntityInstance( @@ -364,11 +363,10 @@ async def create_async(self, identity: str) -> EntityInstance: "Identity": identity, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EntityInstance( diff --git a/twilio/rest/verify/v2/service/entity/challenge/__init__.py b/twilio/rest/verify/v2/service/entity/challenge/__init__.py index ab8c7f8d11..9ca2e4089b 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/__init__.py +++ b/twilio/rest/verify/v2/service/entity/challenge/__init__.py @@ -444,11 +444,10 @@ def create( "AuthPayload": auth_payload, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChallengeInstance( @@ -492,11 +491,10 @@ async def create_async( "AuthPayload": auth_payload, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChallengeInstance( diff --git a/twilio/rest/verify/v2/service/entity/challenge/notification.py b/twilio/rest/verify/v2/service/entity/challenge/notification.py index 0cfae0a60f..eadf42b81d 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/notification.py +++ b/twilio/rest/verify/v2/service/entity/challenge/notification.py @@ -112,11 +112,10 @@ def create(self, ttl: Union[int, object] = values.unset) -> NotificationInstance "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NotificationInstance( @@ -143,11 +142,10 @@ async def create_async( "Ttl": ttl, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NotificationInstance( diff --git a/twilio/rest/verify/v2/service/entity/new_factor.py b/twilio/rest/verify/v2/service/entity/new_factor.py index 7b260a4a3d..c88a945853 100644 --- a/twilio/rest/verify/v2/service/entity/new_factor.py +++ b/twilio/rest/verify/v2/service/entity/new_factor.py @@ -181,11 +181,10 @@ def create( "Metadata": serialize.object(metadata), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewFactorInstance( @@ -253,11 +252,10 @@ async def create_async( "Metadata": serialize.object(metadata), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NewFactorInstance( diff --git a/twilio/rest/verify/v2/service/messaging_configuration.py b/twilio/rest/verify/v2/service/messaging_configuration.py index f412aba1ee..b841770331 100644 --- a/twilio/rest/verify/v2/service/messaging_configuration.py +++ b/twilio/rest/verify/v2/service/messaging_configuration.py @@ -358,11 +358,10 @@ def create( "MessagingServiceSid": messaging_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessagingConfigurationInstance( @@ -387,11 +386,10 @@ async def create_async( "MessagingServiceSid": messaging_service_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessagingConfigurationInstance( diff --git a/twilio/rest/verify/v2/service/rate_limit/__init__.py b/twilio/rest/verify/v2/service/rate_limit/__init__.py index 2d4a18bf0f..bdd165858a 100644 --- a/twilio/rest/verify/v2/service/rate_limit/__init__.py +++ b/twilio/rest/verify/v2/service/rate_limit/__init__.py @@ -385,11 +385,10 @@ def create( "Description": description, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RateLimitInstance( @@ -414,11 +413,10 @@ async def create_async( "Description": description, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RateLimitInstance( diff --git a/twilio/rest/verify/v2/service/rate_limit/bucket.py b/twilio/rest/verify/v2/service/rate_limit/bucket.py index ca4ffaf775..dee84901e5 100644 --- a/twilio/rest/verify/v2/service/rate_limit/bucket.py +++ b/twilio/rest/verify/v2/service/rate_limit/bucket.py @@ -400,11 +400,10 @@ def create(self, max: int, interval: int) -> BucketInstance: "Interval": interval, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BucketInstance( @@ -430,11 +429,10 @@ async def create_async(self, max: int, interval: int) -> BucketInstance: "Interval": interval, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BucketInstance( diff --git a/twilio/rest/verify/v2/service/verification.py b/twilio/rest/verify/v2/service/verification.py index 3ab719551b..c8deef535b 100644 --- a/twilio/rest/verify/v2/service/verification.py +++ b/twilio/rest/verify/v2/service/verification.py @@ -373,11 +373,10 @@ def create( "Tags": tags, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VerificationInstance( @@ -449,11 +448,10 @@ async def create_async( "Tags": tags, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VerificationInstance( diff --git a/twilio/rest/verify/v2/service/verification_check.py b/twilio/rest/verify/v2/service/verification_check.py index 9744b1bbab..af216a39f6 100644 --- a/twilio/rest/verify/v2/service/verification_check.py +++ b/twilio/rest/verify/v2/service/verification_check.py @@ -130,11 +130,10 @@ def create( "Payee": payee, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VerificationCheckInstance( @@ -170,11 +169,10 @@ async def create_async( "Payee": payee, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VerificationCheckInstance( diff --git a/twilio/rest/verify/v2/service/webhook.py b/twilio/rest/verify/v2/service/webhook.py index 4f8772574c..67ffced265 100644 --- a/twilio/rest/verify/v2/service/webhook.py +++ b/twilio/rest/verify/v2/service/webhook.py @@ -446,11 +446,10 @@ def create( "Version": version, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -486,11 +485,10 @@ async def create_async( "Version": version, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/video/v1/composition.py b/twilio/rest/video/v1/composition.py index 30aa33fff8..8add1e74e5 100644 --- a/twilio/rest/video/v1/composition.py +++ b/twilio/rest/video/v1/composition.py @@ -328,11 +328,10 @@ def create( "Trim": serialize.boolean_to_string(trim), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CompositionInstance(self._version, payload) @@ -380,11 +379,10 @@ async def create_async( "Trim": serialize.boolean_to_string(trim), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CompositionInstance(self._version, payload) diff --git a/twilio/rest/video/v1/composition_hook.py b/twilio/rest/video/v1/composition_hook.py index 027a27f740..0f833f793f 100644 --- a/twilio/rest/video/v1/composition_hook.py +++ b/twilio/rest/video/v1/composition_hook.py @@ -504,11 +504,10 @@ def create( "Trim": serialize.boolean_to_string(trim), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CompositionHookInstance(self._version, payload) @@ -559,11 +558,10 @@ async def create_async( "Trim": serialize.boolean_to_string(trim), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CompositionHookInstance(self._version, payload) diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index a8ffdb895c..c735e5516f 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -456,11 +456,10 @@ def create( "LargeRoom": serialize.boolean_to_string(large_room), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoomInstance(self._version, payload) @@ -526,11 +525,10 @@ async def create_async( "LargeRoom": serialize.boolean_to_string(large_room), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoomInstance(self._version, payload) diff --git a/twilio/rest/video/v1/room/participant/subscribe_rules.py b/twilio/rest/video/v1/room/participant/subscribe_rules.py index e07d3b5ff9..a155038493 100644 --- a/twilio/rest/video/v1/room/participant/subscribe_rules.py +++ b/twilio/rest/video/v1/room/participant/subscribe_rules.py @@ -95,8 +95,9 @@ def fetch(self) -> SubscribeRulesInstance: :returns: The fetched SubscribeRulesInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = self._version.fetch(method="GET", uri=self._uri) + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SubscribeRulesInstance( self._version, @@ -112,8 +113,11 @@ async def fetch_async(self) -> SubscribeRulesInstance: :returns: The fetched SubscribeRulesInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = await self._version.fetch_async(method="GET", uri=self._uri) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return SubscribeRulesInstance( self._version, @@ -138,11 +142,10 @@ def update( "Rules": serialize.object(rules), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscribeRulesInstance( @@ -168,11 +171,10 @@ async def update_async( "Rules": serialize.object(rules), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscribeRulesInstance( diff --git a/twilio/rest/video/v1/room/recording_rules.py b/twilio/rest/video/v1/room/recording_rules.py index c94bbf1497..f85ebe896e 100644 --- a/twilio/rest/video/v1/room/recording_rules.py +++ b/twilio/rest/video/v1/room/recording_rules.py @@ -80,8 +80,9 @@ def fetch(self) -> RecordingRulesInstance: :returns: The fetched RecordingRulesInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = self._version.fetch(method="GET", uri=self._uri) + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RecordingRulesInstance( self._version, payload, room_sid=self._solution["room_sid"] @@ -94,8 +95,11 @@ async def fetch_async(self) -> RecordingRulesInstance: :returns: The fetched RecordingRulesInstance """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - payload = await self._version.fetch_async(method="GET", uri=self._uri) + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) return RecordingRulesInstance( self._version, payload, room_sid=self._solution["room_sid"] @@ -117,11 +121,10 @@ def update( "Rules": serialize.object(rules), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingRulesInstance( @@ -144,11 +147,10 @@ async def update_async( "Rules": serialize.object(rules), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingRulesInstance( diff --git a/twilio/rest/voice/v1/byoc_trunk.py b/twilio/rest/voice/v1/byoc_trunk.py index a85cae660a..1c3e301d7a 100644 --- a/twilio/rest/voice/v1/byoc_trunk.py +++ b/twilio/rest/voice/v1/byoc_trunk.py @@ -487,11 +487,10 @@ def create( "FromDomainSid": from_domain_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ByocTrunkInstance(self._version, payload) @@ -540,11 +539,10 @@ async def create_async( "FromDomainSid": from_domain_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ByocTrunkInstance(self._version, payload) diff --git a/twilio/rest/voice/v1/connection_policy/__init__.py b/twilio/rest/voice/v1/connection_policy/__init__.py index d1d8aac893..4e65be6519 100644 --- a/twilio/rest/voice/v1/connection_policy/__init__.py +++ b/twilio/rest/voice/v1/connection_policy/__init__.py @@ -357,11 +357,10 @@ def create( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyInstance(self._version, payload) @@ -382,11 +381,10 @@ async def create_async( "FriendlyName": friendly_name, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyInstance(self._version, payload) diff --git a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py index 2fa490880a..05daee6c79 100644 --- a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py +++ b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py @@ -435,11 +435,10 @@ def create( "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyTargetInstance( @@ -477,11 +476,10 @@ async def create_async( "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyTargetInstance( diff --git a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py index 60aa2642f0..5b0d35d3d2 100644 --- a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py +++ b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py @@ -71,11 +71,10 @@ def create(self, update_request: str) -> BulkCountryUpdateInstance: "UpdateRequest": update_request, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkCountryUpdateInstance(self._version, payload) @@ -94,11 +93,10 @@ async def create_async(self, update_request: str) -> BulkCountryUpdateInstance: "UpdateRequest": update_request, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BulkCountryUpdateInstance(self._version, payload) diff --git a/twilio/rest/voice/v1/ip_record.py b/twilio/rest/voice/v1/ip_record.py index ee409ba78c..5c103bf98e 100644 --- a/twilio/rest/voice/v1/ip_record.py +++ b/twilio/rest/voice/v1/ip_record.py @@ -340,11 +340,10 @@ def create( "CidrPrefixLength": cidr_prefix_length, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpRecordInstance(self._version, payload) @@ -372,11 +371,10 @@ async def create_async( "CidrPrefixLength": cidr_prefix_length, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpRecordInstance(self._version, payload) diff --git a/twilio/rest/voice/v1/source_ip_mapping.py b/twilio/rest/voice/v1/source_ip_mapping.py index 8a0d4a9126..50e2bbe361 100644 --- a/twilio/rest/voice/v1/source_ip_mapping.py +++ b/twilio/rest/voice/v1/source_ip_mapping.py @@ -325,11 +325,10 @@ def create( "SipDomainSid": sip_domain_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SourceIpMappingInstance(self._version, payload) @@ -352,11 +351,10 @@ async def create_async( "SipDomainSid": sip_domain_sid, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SourceIpMappingInstance(self._version, payload) diff --git a/twilio/rest/wireless/v1/command.py b/twilio/rest/wireless/v1/command.py index f310db8918..3dc78e9b8f 100644 --- a/twilio/rest/wireless/v1/command.py +++ b/twilio/rest/wireless/v1/command.py @@ -308,11 +308,10 @@ def create( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CommandInstance(self._version, payload) @@ -354,11 +353,10 @@ async def create_async( ), } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CommandInstance(self._version, payload) diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index 0ee1e205a2..5370ef2ae3 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -406,11 +406,10 @@ def create( "InternationalRoamingDataLimit": international_roaming_data_limit, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.create( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload) @@ -466,11 +465,10 @@ async def create_async( "InternationalRoamingDataLimit": international_roaming_data_limit, } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = await self._version.create_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload) From 1e7cc3917601da3d3a46c830274a48a8427c304d Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 18 Jun 2024 17:12:08 +0000 Subject: [PATCH 031/113] Release 9.2.0 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 9d80846085..6f79022049 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.1.1", + version="9.2.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 00a5b6d726..f178d17edc 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "1", "1") +__version_info__ = ("9", "2", "0") __version__ = ".".join(__version_info__) From 1a05d02c091fe5d112e7dac2d7cfe65228768b31 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 21 Jun 2024 11:10:55 +0000 Subject: [PATCH 032/113] [Librarian] Regenerated @ 56364e3f3b4f08483045295156a91ba3bd264c7e 7732d46cf642d80c9ec39cf2fab680d67a4f9806 --- CHANGES.md | 6 + twilio/rest/content/v1/content/__init__.py | 475 +++++++++++++++++- .../content/v1/content/approval_create.py | 53 +- .../rest/content/v1/content/approval_fetch.py | 32 +- 4 files changed, 530 insertions(+), 36 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b76a6331be..bdff147929 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,12 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-06-21] Version 9.2.1 +-------------------------- +**Api** +- Add beta feature request managed cert + + [2024-06-18] Version 9.2.0 -------------------------- **Library - Chore** diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 8a1c4212d9..6dd0978f31 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -25,6 +25,22 @@ class ContentInstance(InstanceResource): + + class AuthenticationActionType(object): + COPY_CODE = "COPY_CODE" + + class CallToActionActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + + class CardActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + QUICK_REPLY = "QUICK_REPLY" + + class QuickReplyActionType(object): + QUICK_REPLY = "QUICK_REPLY" + """ :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. @@ -33,7 +49,7 @@ class ContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar url: The URL of the resource, relative to `https://content.twilio.com`. :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create """ @@ -275,6 +291,451 @@ def __repr__(self) -> str: class ContentList(ListResource): + class AuthenticationAction(object): + """ + :ivar type: + :ivar copy_code_text: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.AuthenticationActionType"] = ( + payload.get("type") + ) + self.copy_code_text: Optional[str] = payload.get("copy_code_text") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "copy_code_text": self.copy_code_text, + } + + class CallToActionAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.CallToActionActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class CardAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.CardActionType"] = payload.get("type") + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class CatalogItem(object): + """ + :ivar id: + :ivar section_title: + :ivar name: + :ivar media_url: + :ivar price: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.id: Optional[str] = payload.get("id") + self.section_title: Optional[str] = payload.get("section_title") + self.name: Optional[str] = payload.get("name") + self.media_url: Optional[str] = payload.get("media_url") + self.price: Optional[float] = payload.get("price") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "section_title": self.section_title, + "name": self.name, + "media_url": self.media_url, + "price": self.price, + "description": self.description, + } + + class ContentCreateRequest(object): + """ + :ivar friendly_name: User defined name of the content + :ivar variables: Key value pairs of variable name to value + :ivar language: Language code for the content + :ivar types: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.variables: Optional[dict[str, str]] = payload.get("variables") + self.language: Optional[str] = payload.get("language") + self.types: Optional[ContentList.Types] = payload.get("types") + + def to_dict(self): + return { + "friendly_name": self.friendly_name, + "variables": self.variables, + "language": self.language, + "types": self.types.to_dict(), + } + + class ListItem(object): + """ + :ivar id: + :ivar item: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.id: Optional[str] = payload.get("id") + self.item: Optional[str] = payload.get("item") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "item": self.item, + "description": self.description, + } + + class QuickReplyAction(object): + """ + :ivar type: + :ivar title: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.type: Optional["ContentInstance.QuickReplyActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type.to_dict(), + "title": self.title, + "id": self.id, + } + + class TwilioCallToAction(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.CallToActionAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioCard(object): + """ + :ivar title: + :ivar subtitle: + :ivar media: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.title: Optional[str] = payload.get("title") + self.subtitle: Optional[str] = payload.get("subtitle") + self.media: Optional[List[str]] = payload.get("media") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "title": self.title, + "subtitle": self.subtitle, + "media": self.media, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioCatalog(object): + """ + :ivar title: + :ivar body: + :ivar subtitle: + :ivar id: + :ivar items: + :ivar dynamic_items: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.title: Optional[str] = payload.get("title") + self.body: Optional[str] = payload.get("body") + self.subtitle: Optional[str] = payload.get("subtitle") + self.id: Optional[str] = payload.get("id") + self.items: Optional[List[ContentList.CatalogItem]] = payload.get("items") + self.dynamic_items: Optional[str] = payload.get("dynamic_items") + + def to_dict(self): + return { + "title": self.title, + "body": self.body, + "subtitle": self.subtitle, + "id": self.id, + "items": [items.to_dict() for items in self.items], + "dynamic_items": self.dynamic_items, + } + + class TwilioListPicker(object): + """ + :ivar body: + :ivar button: + :ivar items: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.button: Optional[str] = payload.get("button") + self.items: Optional[List[ContentList.ListItem]] = payload.get("items") + + def to_dict(self): + return { + "body": self.body, + "button": self.button, + "items": [items.to_dict() for items in self.items], + } + + class TwilioLocation(object): + """ + :ivar latitude: + :ivar longitude: + :ivar label: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.latitude: Optional[float] = payload.get("latitude") + self.longitude: Optional[float] = payload.get("longitude") + self.label: Optional[str] = payload.get("label") + + def to_dict(self): + return { + "latitude": self.latitude, + "longitude": self.longitude, + "label": self.label, + } + + class TwilioMedia(object): + """ + :ivar body: + :ivar media: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.media: Optional[List[str]] = payload.get("media") + + def to_dict(self): + return { + "body": self.body, + "media": self.media, + } + + class TwilioQuickReply(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.QuickReplyAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": [actions.to_dict() for actions in self.actions], + } + + class TwilioText(object): + """ + :ivar body: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + + def to_dict(self): + return { + "body": self.body, + } + + class Types(object): + """ + :ivar twilio_text: + :ivar twilio_media: + :ivar twilio_location: + :ivar twilio_list_picker: + :ivar twilio_call_to_action: + :ivar twilio_quick_reply: + :ivar twilio_card: + :ivar twilio_catalog: + :ivar whatsapp_card: + :ivar whatsapp_authentication: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.twilio_text: Optional[ContentList.TwilioText] = payload.get( + "twilio_text" + ) + self.twilio_media: Optional[ContentList.TwilioMedia] = payload.get( + "twilio_media" + ) + self.twilio_location: Optional[ContentList.TwilioLocation] = payload.get( + "twilio_location" + ) + self.twilio_list_picker: Optional[ContentList.TwilioListPicker] = ( + payload.get("twilio_list_picker") + ) + self.twilio_call_to_action: Optional[ContentList.TwilioCallToAction] = ( + payload.get("twilio_call_to_action") + ) + self.twilio_quick_reply: Optional[ContentList.TwilioQuickReply] = ( + payload.get("twilio_quick_reply") + ) + self.twilio_card: Optional[ContentList.TwilioCard] = payload.get( + "twilio_card" + ) + self.twilio_catalog: Optional[ContentList.TwilioCatalog] = payload.get( + "twilio_catalog" + ) + self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( + "whatsapp_card" + ) + self.whatsapp_authentication: Optional[ + ContentList.WhatsappAuthentication + ] = payload.get("whatsapp_authentication") + + def to_dict(self): + return { + "twilio_text": self.twilio_text.to_dict(), + "twilio_media": self.twilio_media.to_dict(), + "twilio_location": self.twilio_location.to_dict(), + "twilio_list_picker": self.twilio_list_picker.to_dict(), + "twilio_call_to_action": self.twilio_call_to_action.to_dict(), + "twilio_quick_reply": self.twilio_quick_reply.to_dict(), + "twilio_card": self.twilio_card.to_dict(), + "twilio_catalog": self.twilio_catalog.to_dict(), + "whatsapp_card": self.whatsapp_card.to_dict(), + "whatsapp_authentication": self.whatsapp_authentication.to_dict(), + } + + class WhatsappAuthentication(object): + """ + :ivar add_security_recommendation: + :ivar code_expiration_minutes: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.add_security_recommendation: Optional[bool] = payload.get( + "add_security_recommendation" + ) + self.code_expiration_minutes: Optional[float] = payload.get( + "code_expiration_minutes" + ) + self.actions: Optional[List[ContentList.AuthenticationAction]] = ( + payload.get("actions") + ) + + def to_dict(self): + return { + "add_security_recommendation": self.add_security_recommendation, + "code_expiration_minutes": self.code_expiration_minutes, + "actions": [actions.to_dict() for actions in self.actions], + } + + class WhatsappCard(object): + """ + :ivar body: + :ivar footer: + :ivar media: + :ivar header_text: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + + self.body: Optional[str] = payload.get("body") + self.footer: Optional[str] = payload.get("footer") + self.media: Optional[List[str]] = payload.get("media") + self.header_text: Optional[str] = payload.get("header_text") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "footer": self.footer, + "media": self.media, + "header_text": self.header_text, + "actions": [actions.to_dict() for actions in self.actions], + } + def __init__(self, version: Version): """ Initialize the ContentList @@ -286,15 +747,15 @@ def __init__(self, version: Version): self._uri = "/Content" - def create(self, body: Union[object, object] = values.unset) -> ContentInstance: + def create(self, content_create_request: ContentCreateRequest) -> ContentInstance: """ Create the ContentInstance - :param body: + :param content_create_request: :returns: The created ContentInstance """ - data = body.to_dict() + data = content_create_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) headers["Content-Type"] = "application/json" @@ -306,16 +767,16 @@ def create(self, body: Union[object, object] = values.unset) -> ContentInstance: return ContentInstance(self._version, payload) async def create_async( - self, body: Union[object, object] = values.unset + self, content_create_request: ContentCreateRequest ) -> ContentInstance: """ Asynchronously create the ContentInstance - :param body: + :param content_create_request: :returns: The created ContentInstance """ - data = body.to_dict() + data = content_create_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) headers["Content-Type"] = "application/json" diff --git a/twilio/rest/content/v1/content/approval_create.py b/twilio/rest/content/v1/content/approval_create.py index 137c0a6d0c..6e28052e0d 100644 --- a/twilio/rest/content/v1/content/approval_create.py +++ b/twilio/rest/content/v1/content/approval_create.py @@ -12,7 +12,7 @@ Do not edit the class manually. """ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, Optional from twilio.base import values from twilio.base.instance_resource import InstanceResource @@ -30,7 +30,7 @@ class ApprovalCreateInstance(InstanceResource): :ivar allow_category_change: """ - def __init__(self, version: Version, payload: Dict[str, Any], sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): super().__init__(version) self.name: Optional[str] = payload.get("name") @@ -43,7 +43,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], sid: str): ) self._solution = { - "sid": sid, + "content_sid": content_sid, } def __repr__(self) -> str: @@ -58,33 +58,52 @@ def __repr__(self) -> str: class ApprovalCreateList(ListResource): - def __init__(self, version: Version, sid: str): + class ContentApprovalRequest(object): + """ + :ivar name: Name of the template. + :ivar category: A WhatsApp recognized template category. + """ + + def __init__(self, payload: Dict[str, Any], content_sid: str): + + self.name: Optional[str] = payload.get("name") + self.category: Optional[str] = payload.get("category") + + def to_dict(self): + return { + "name": self.name, + "category": self.category, + } + + def __init__(self, version: Version, content_sid: str): """ Initialize the ApprovalCreateList :param version: Version that contains the resource - :param sid: + :param content_sid: """ super().__init__(version) # Path Solution self._solution = { - "sid": sid, + "content_sid": content_sid, } - self._uri = "/Content/{sid}/ApprovalRequests/whatsapp".format(**self._solution) + self._uri = "/Content/{content_sid}/ApprovalRequests/whatsapp".format( + **self._solution + ) def create( - self, body: Union[object, object] = values.unset + self, content_approval_request: ContentApprovalRequest ) -> ApprovalCreateInstance: """ Create the ApprovalCreateInstance - :param body: + :param content_approval_request: :returns: The created ApprovalCreateInstance """ - data = body.to_dict() + data = content_approval_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) headers["Content-Type"] = "application/json" @@ -93,19 +112,21 @@ def create( method="POST", uri=self._uri, data=data, headers=headers ) - return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) + return ApprovalCreateInstance( + self._version, payload, content_sid=self._solution["content_sid"] + ) async def create_async( - self, body: Union[object, object] = values.unset + self, content_approval_request: ContentApprovalRequest ) -> ApprovalCreateInstance: """ Asynchronously create the ApprovalCreateInstance - :param body: + :param content_approval_request: :returns: The created ApprovalCreateInstance """ - data = body.to_dict() + data = content_approval_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) headers["Content-Type"] = "application/json" @@ -114,7 +135,9 @@ async def create_async( method="POST", uri=self._uri, data=data, headers=headers ) - return ApprovalCreateInstance(self._version, payload, sid=self._solution["sid"]) + return ApprovalCreateInstance( + self._version, payload, content_sid=self._solution["content_sid"] + ) def __repr__(self) -> str: """ diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index f35ef6a48f..f679a920a1 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -27,7 +27,7 @@ class ApprovalFetchInstance(InstanceResource): :ivar url: The URL of the resource, relative to `https://content.twilio.com`. """ - def __init__(self, version: Version, payload: Dict[str, Any], sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): super().__init__(version) self.sid: Optional[str] = payload.get("sid") @@ -36,7 +36,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], sid: str): self.url: Optional[str] = payload.get("url") self._solution = { - "sid": sid, + "content_sid": content_sid, } self._context: Optional[ApprovalFetchContext] = None @@ -51,7 +51,7 @@ def _proxy(self) -> "ApprovalFetchContext": if self._context is None: self._context = ApprovalFetchContext( self._version, - sid=self._solution["sid"], + content_sid=self._solution["content_sid"], ) return self._context @@ -85,20 +85,20 @@ def __repr__(self) -> str: class ApprovalFetchContext(InstanceContext): - def __init__(self, version: Version, sid: str): + def __init__(self, version: Version, content_sid: str): """ Initialize the ApprovalFetchContext :param version: Version that contains the resource - :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "sid": sid, + "content_sid": content_sid, } - self._uri = "/Content/{sid}/ApprovalRequests".format(**self._solution) + self._uri = "/Content/{content_sid}/ApprovalRequests".format(**self._solution) def fetch(self) -> ApprovalFetchInstance: """ @@ -116,7 +116,7 @@ def fetch(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - sid=self._solution["sid"], + content_sid=self._solution["content_sid"], ) async def fetch_async(self) -> ApprovalFetchInstance: @@ -135,7 +135,7 @@ async def fetch_async(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - sid=self._solution["sid"], + content_sid=self._solution["content_sid"], ) def __repr__(self) -> str: @@ -150,19 +150,19 @@ def __repr__(self) -> str: class ApprovalFetchList(ListResource): - def __init__(self, version: Version, sid: str): + def __init__(self, version: Version, content_sid: str): """ Initialize the ApprovalFetchList :param version: Version that contains the resource - :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "sid": sid, + "content_sid": content_sid, } def get(self) -> ApprovalFetchContext: @@ -170,14 +170,18 @@ def get(self) -> ApprovalFetchContext: Constructs a ApprovalFetchContext """ - return ApprovalFetchContext(self._version, sid=self._solution["sid"]) + return ApprovalFetchContext( + self._version, content_sid=self._solution["content_sid"] + ) def __call__(self) -> ApprovalFetchContext: """ Constructs a ApprovalFetchContext """ - return ApprovalFetchContext(self._version, sid=self._solution["sid"]) + return ApprovalFetchContext( + self._version, content_sid=self._solution["content_sid"] + ) def __repr__(self) -> str: """ From 6c7d08a92d431e9d0f1e40bb6ae92ab890503bea Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 21 Jun 2024 11:14:59 +0000 Subject: [PATCH 033/113] Release 9.2.1 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6f79022049..b7fa3a7cf5 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.2.0", + version="9.2.1", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index f178d17edc..f7985b5f36 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "2", "0") +__version_info__ = ("9", "2", "1") __version__ = ".".join(__version_info__) From 4fe254c012bf28616c4f6745440cf3438c101a7c Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 27 Jun 2024 19:40:36 +0000 Subject: [PATCH 034/113] [Librarian] Regenerated @ 93a2de5505384cb61be7440d3563d93d5cf980df 5146479cf5e06841f2d634d763cfd8acec49eb7e --- CHANGES.md | 18 + twilio/rest/__init__.py | 15 + .../rest/api/v2010/account/call/__init__.py | 22 + .../api/v2010/account/call/transcription.py | 1605 +++++++++++++++++ twilio/rest/content/v1/content/__init__.py | 8 +- .../rest/content/v1/content/approval_fetch.py | 32 +- .../rest/content/v1/content_and_approvals.py | 2 +- twilio/rest/content/v1/legacy_content.py | 2 +- .../installed_add_on_usage.py | 22 +- .../v2/regulatory_compliance/regulation.py | 66 +- twilio/twiml/voice_response.py | 168 +- 11 files changed, 1899 insertions(+), 61 deletions(-) create mode 100644 twilio/rest/api/v2010/account/call/transcription.py diff --git a/CHANGES.md b/CHANGES.md index bdff147929..1d0111abde 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,24 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-06-27] Version 9.2.2 +-------------------------- +**Api** +- Add `transcription` resource + +**Flex** +- Changed mount name for flex_team v2 api + +**Intelligence** +- Add `X-Rate-Limit-Limit`, `X-Rate-Limit-Remaining`, and `X-Rate-Limit-Config` as Response Headers to Operator resources + +**Numbers** +- Added include_constraints query parameter to the Regulations API + +**Twiml** +- Add support for `` noun + + [2024-06-21] Version 9.2.1 -------------------------- **Api** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 2dc0a4930f..31d114a6c0 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -23,6 +23,7 @@ from twilio.rest.events import Events from twilio.rest.flex_api import FlexApi from twilio.rest.frontline_api import FrontlineApi + from twilio.rest.preview_iam import PreviewIam from twilio.rest.insights import Insights from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging @@ -131,6 +132,7 @@ def __init__( self._events: Optional["Events"] = None self._flex_api: Optional["FlexApi"] = None self._frontline_api: Optional["FrontlineApi"] = None + self._preview_iam: Optional["PreviewIam"] = None self._insights: Optional["Insights"] = None self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None @@ -275,6 +277,19 @@ def frontline_api(self) -> "FrontlineApi": self._frontline_api = FrontlineApi(self) return self._frontline_api + @property + def preview_iam(self) -> "PreviewIam": + """ + Access the PreviewIam Twilio Domain + + :returns: PreviewIam Twilio Domain + """ + if self._preview_iam is None: + from twilio.rest.preview_iam import PreviewIam + + self._preview_iam = PreviewIam(self) + return self._preview_iam + @property def insights(self) -> "Insights": """ diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index fa8e40707b..ff9e98b09f 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -26,6 +26,7 @@ from twilio.rest.api.v2010.account.call.recording import RecordingList from twilio.rest.api.v2010.account.call.siprec import SiprecList from twilio.rest.api.v2010.account.call.stream import StreamList +from twilio.rest.api.v2010.account.call.transcription import TranscriptionList from twilio.rest.api.v2010.account.call.user_defined_message import ( UserDefinedMessageList, ) @@ -303,6 +304,13 @@ def streams(self) -> StreamList: """ return self._proxy.streams + @property + def transcriptions(self) -> TranscriptionList: + """ + Access the transcriptions + """ + return self._proxy.transcriptions + @property def user_defined_messages(self) -> UserDefinedMessageList: """ @@ -352,6 +360,7 @@ def __init__(self, version: Version, account_sid: str, sid: str): self._recordings: Optional[RecordingList] = None self._siprec: Optional[SiprecList] = None self._streams: Optional[StreamList] = None + self._transcriptions: Optional[TranscriptionList] = None self._user_defined_messages: Optional[UserDefinedMessageList] = None self._user_defined_message_subscriptions: Optional[ UserDefinedMessageSubscriptionList @@ -607,6 +616,19 @@ def streams(self) -> StreamList: ) return self._streams + @property + def transcriptions(self) -> TranscriptionList: + """ + Access the transcriptions + """ + if self._transcriptions is None: + self._transcriptions = TranscriptionList( + self._version, + self._solution["account_sid"], + self._solution["sid"], + ) + return self._transcriptions + @property def user_defined_messages(self) -> UserDefinedMessageList: """ diff --git a/twilio/rest/api/v2010/account/call/transcription.py b/twilio/rest/api/v2010/account/call/transcription.py new file mode 100644 index 0000000000..96554eaa02 --- /dev/null +++ b/twilio/rest/api/v2010/account/call/transcription.py @@ -0,0 +1,1605 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Api + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class TranscriptionInstance(InstanceResource): + + class Status(object): + IN_PROGRESS = "in-progress" + STOPPED = "stopped" + + class Track(object): + INBOUND_TRACK = "inbound_track" + OUTBOUND_TRACK = "outbound_track" + BOTH_TRACKS = "both_tracks" + + class UpdateStatus(object): + STOPPED = "stopped" + + """ + :ivar sid: The SID of the Transcription resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Transcription resource. + :ivar call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with. + :ivar name: The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription. + :ivar status: + :ivar date_updated: The date and time in GMT that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar uri: + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + account_sid: str, + call_sid: str, + sid: Optional[str] = None, + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.call_sid: Optional[str] = payload.get("call_sid") + self.name: Optional[str] = payload.get("name") + self.status: Optional["TranscriptionInstance.Status"] = payload.get("status") + self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_updated") + ) + self.uri: Optional[str] = payload.get("uri") + + self._solution = { + "account_sid": account_sid, + "call_sid": call_sid, + "sid": sid or self.sid, + } + self._context: Optional[TranscriptionContext] = None + + @property + def _proxy(self) -> "TranscriptionContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: TranscriptionContext for this TranscriptionInstance + """ + if self._context is None: + self._context = TranscriptionContext( + self._version, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + sid=self._solution["sid"], + ) + return self._context + + def update( + self, status: "TranscriptionInstance.UpdateStatus" + ) -> "TranscriptionInstance": + """ + Update the TranscriptionInstance + + :param status: + + :returns: The updated TranscriptionInstance + """ + return self._proxy.update( + status=status, + ) + + async def update_async( + self, status: "TranscriptionInstance.UpdateStatus" + ) -> "TranscriptionInstance": + """ + Asynchronous coroutine to update the TranscriptionInstance + + :param status: + + :returns: The updated TranscriptionInstance + """ + return await self._proxy.update_async( + status=status, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class TranscriptionContext(InstanceContext): + + def __init__(self, version: Version, account_sid: str, call_sid: str, sid: str): + """ + Initialize the TranscriptionContext + + :param version: Version that contains the resource + :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Transcription resource. + :param call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with. + :param sid: The SID of the Transcription resource, or the `name` used when creating the resource + """ + super().__init__(version) + + # Path Solution + self._solution = { + "account_sid": account_sid, + "call_sid": call_sid, + "sid": sid, + } + self._uri = ( + "/Accounts/{account_sid}/Calls/{call_sid}/Transcriptions/{sid}.json".format( + **self._solution + ) + ) + + def update( + self, status: "TranscriptionInstance.UpdateStatus" + ) -> TranscriptionInstance: + """ + Update the TranscriptionInstance + + :param status: + + :returns: The updated TranscriptionInstance + """ + data = values.of( + { + "Status": status, + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return TranscriptionInstance( + self._version, + payload, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + sid=self._solution["sid"], + ) + + async def update_async( + self, status: "TranscriptionInstance.UpdateStatus" + ) -> TranscriptionInstance: + """ + Asynchronous coroutine to update the TranscriptionInstance + + :param status: + + :returns: The updated TranscriptionInstance + """ + data = values.of( + { + "Status": status, + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return TranscriptionInstance( + self._version, + payload, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class TranscriptionList(ListResource): + + def __init__(self, version: Version, account_sid: str, call_sid: str): + """ + Initialize the TranscriptionList + + :param version: Version that contains the resource + :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created this Transcription resource. + :param call_sid: The SID of the [Call](https://www.twilio.com/docs/voice/api/call-resource) the Transcription resource is associated with. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "account_sid": account_sid, + "call_sid": call_sid, + } + self._uri = ( + "/Accounts/{account_sid}/Calls/{call_sid}/Transcriptions.json".format( + **self._solution + ) + ) + + def create( + self, + name: Union[str, object] = values.unset, + track: Union["TranscriptionInstance.Track", object] = values.unset, + status_callback_url: Union[str, object] = values.unset, + status_callback_method: Union[str, object] = values.unset, + inbound_track_label: Union[str, object] = values.unset, + outbound_track_label: Union[str, object] = values.unset, + partial_results: Union[bool, object] = values.unset, + language_code: Union[str, object] = values.unset, + transcription_engine: Union[str, object] = values.unset, + profanity_filter: Union[bool, object] = values.unset, + speech_model: Union[str, object] = values.unset, + hints: Union[str, object] = values.unset, + enable_automatic_punctuation: Union[bool, object] = values.unset, + parameter1_name: Union[str, object] = values.unset, + parameter1_value: Union[str, object] = values.unset, + parameter2_name: Union[str, object] = values.unset, + parameter2_value: Union[str, object] = values.unset, + parameter3_name: Union[str, object] = values.unset, + parameter3_value: Union[str, object] = values.unset, + parameter4_name: Union[str, object] = values.unset, + parameter4_value: Union[str, object] = values.unset, + parameter5_name: Union[str, object] = values.unset, + parameter5_value: Union[str, object] = values.unset, + parameter6_name: Union[str, object] = values.unset, + parameter6_value: Union[str, object] = values.unset, + parameter7_name: Union[str, object] = values.unset, + parameter7_value: Union[str, object] = values.unset, + parameter8_name: Union[str, object] = values.unset, + parameter8_value: Union[str, object] = values.unset, + parameter9_name: Union[str, object] = values.unset, + parameter9_value: Union[str, object] = values.unset, + parameter10_name: Union[str, object] = values.unset, + parameter10_value: Union[str, object] = values.unset, + parameter11_name: Union[str, object] = values.unset, + parameter11_value: Union[str, object] = values.unset, + parameter12_name: Union[str, object] = values.unset, + parameter12_value: Union[str, object] = values.unset, + parameter13_name: Union[str, object] = values.unset, + parameter13_value: Union[str, object] = values.unset, + parameter14_name: Union[str, object] = values.unset, + parameter14_value: Union[str, object] = values.unset, + parameter15_name: Union[str, object] = values.unset, + parameter15_value: Union[str, object] = values.unset, + parameter16_name: Union[str, object] = values.unset, + parameter16_value: Union[str, object] = values.unset, + parameter17_name: Union[str, object] = values.unset, + parameter17_value: Union[str, object] = values.unset, + parameter18_name: Union[str, object] = values.unset, + parameter18_value: Union[str, object] = values.unset, + parameter19_name: Union[str, object] = values.unset, + parameter19_value: Union[str, object] = values.unset, + parameter20_name: Union[str, object] = values.unset, + parameter20_value: Union[str, object] = values.unset, + parameter21_name: Union[str, object] = values.unset, + parameter21_value: Union[str, object] = values.unset, + parameter22_name: Union[str, object] = values.unset, + parameter22_value: Union[str, object] = values.unset, + parameter23_name: Union[str, object] = values.unset, + parameter23_value: Union[str, object] = values.unset, + parameter24_name: Union[str, object] = values.unset, + parameter24_value: Union[str, object] = values.unset, + parameter25_name: Union[str, object] = values.unset, + parameter25_value: Union[str, object] = values.unset, + parameter26_name: Union[str, object] = values.unset, + parameter26_value: Union[str, object] = values.unset, + parameter27_name: Union[str, object] = values.unset, + parameter27_value: Union[str, object] = values.unset, + parameter28_name: Union[str, object] = values.unset, + parameter28_value: Union[str, object] = values.unset, + parameter29_name: Union[str, object] = values.unset, + parameter29_value: Union[str, object] = values.unset, + parameter30_name: Union[str, object] = values.unset, + parameter30_value: Union[str, object] = values.unset, + parameter31_name: Union[str, object] = values.unset, + parameter31_value: Union[str, object] = values.unset, + parameter32_name: Union[str, object] = values.unset, + parameter32_value: Union[str, object] = values.unset, + parameter33_name: Union[str, object] = values.unset, + parameter33_value: Union[str, object] = values.unset, + parameter34_name: Union[str, object] = values.unset, + parameter34_value: Union[str, object] = values.unset, + parameter35_name: Union[str, object] = values.unset, + parameter35_value: Union[str, object] = values.unset, + parameter36_name: Union[str, object] = values.unset, + parameter36_value: Union[str, object] = values.unset, + parameter37_name: Union[str, object] = values.unset, + parameter37_value: Union[str, object] = values.unset, + parameter38_name: Union[str, object] = values.unset, + parameter38_value: Union[str, object] = values.unset, + parameter39_name: Union[str, object] = values.unset, + parameter39_value: Union[str, object] = values.unset, + parameter40_name: Union[str, object] = values.unset, + parameter40_value: Union[str, object] = values.unset, + parameter41_name: Union[str, object] = values.unset, + parameter41_value: Union[str, object] = values.unset, + parameter42_name: Union[str, object] = values.unset, + parameter42_value: Union[str, object] = values.unset, + parameter43_name: Union[str, object] = values.unset, + parameter43_value: Union[str, object] = values.unset, + parameter44_name: Union[str, object] = values.unset, + parameter44_value: Union[str, object] = values.unset, + parameter45_name: Union[str, object] = values.unset, + parameter45_value: Union[str, object] = values.unset, + parameter46_name: Union[str, object] = values.unset, + parameter46_value: Union[str, object] = values.unset, + parameter47_name: Union[str, object] = values.unset, + parameter47_value: Union[str, object] = values.unset, + parameter48_name: Union[str, object] = values.unset, + parameter48_value: Union[str, object] = values.unset, + parameter49_name: Union[str, object] = values.unset, + parameter49_value: Union[str, object] = values.unset, + parameter50_name: Union[str, object] = values.unset, + parameter50_value: Union[str, object] = values.unset, + parameter51_name: Union[str, object] = values.unset, + parameter51_value: Union[str, object] = values.unset, + parameter52_name: Union[str, object] = values.unset, + parameter52_value: Union[str, object] = values.unset, + parameter53_name: Union[str, object] = values.unset, + parameter53_value: Union[str, object] = values.unset, + parameter54_name: Union[str, object] = values.unset, + parameter54_value: Union[str, object] = values.unset, + parameter55_name: Union[str, object] = values.unset, + parameter55_value: Union[str, object] = values.unset, + parameter56_name: Union[str, object] = values.unset, + parameter56_value: Union[str, object] = values.unset, + parameter57_name: Union[str, object] = values.unset, + parameter57_value: Union[str, object] = values.unset, + parameter58_name: Union[str, object] = values.unset, + parameter58_value: Union[str, object] = values.unset, + parameter59_name: Union[str, object] = values.unset, + parameter59_value: Union[str, object] = values.unset, + parameter60_name: Union[str, object] = values.unset, + parameter60_value: Union[str, object] = values.unset, + parameter61_name: Union[str, object] = values.unset, + parameter61_value: Union[str, object] = values.unset, + parameter62_name: Union[str, object] = values.unset, + parameter62_value: Union[str, object] = values.unset, + parameter63_name: Union[str, object] = values.unset, + parameter63_value: Union[str, object] = values.unset, + parameter64_name: Union[str, object] = values.unset, + parameter64_value: Union[str, object] = values.unset, + parameter65_name: Union[str, object] = values.unset, + parameter65_value: Union[str, object] = values.unset, + parameter66_name: Union[str, object] = values.unset, + parameter66_value: Union[str, object] = values.unset, + parameter67_name: Union[str, object] = values.unset, + parameter67_value: Union[str, object] = values.unset, + parameter68_name: Union[str, object] = values.unset, + parameter68_value: Union[str, object] = values.unset, + parameter69_name: Union[str, object] = values.unset, + parameter69_value: Union[str, object] = values.unset, + parameter70_name: Union[str, object] = values.unset, + parameter70_value: Union[str, object] = values.unset, + parameter71_name: Union[str, object] = values.unset, + parameter71_value: Union[str, object] = values.unset, + parameter72_name: Union[str, object] = values.unset, + parameter72_value: Union[str, object] = values.unset, + parameter73_name: Union[str, object] = values.unset, + parameter73_value: Union[str, object] = values.unset, + parameter74_name: Union[str, object] = values.unset, + parameter74_value: Union[str, object] = values.unset, + parameter75_name: Union[str, object] = values.unset, + parameter75_value: Union[str, object] = values.unset, + parameter76_name: Union[str, object] = values.unset, + parameter76_value: Union[str, object] = values.unset, + parameter77_name: Union[str, object] = values.unset, + parameter77_value: Union[str, object] = values.unset, + parameter78_name: Union[str, object] = values.unset, + parameter78_value: Union[str, object] = values.unset, + parameter79_name: Union[str, object] = values.unset, + parameter79_value: Union[str, object] = values.unset, + parameter80_name: Union[str, object] = values.unset, + parameter80_value: Union[str, object] = values.unset, + parameter81_name: Union[str, object] = values.unset, + parameter81_value: Union[str, object] = values.unset, + parameter82_name: Union[str, object] = values.unset, + parameter82_value: Union[str, object] = values.unset, + parameter83_name: Union[str, object] = values.unset, + parameter83_value: Union[str, object] = values.unset, + parameter84_name: Union[str, object] = values.unset, + parameter84_value: Union[str, object] = values.unset, + parameter85_name: Union[str, object] = values.unset, + parameter85_value: Union[str, object] = values.unset, + parameter86_name: Union[str, object] = values.unset, + parameter86_value: Union[str, object] = values.unset, + parameter87_name: Union[str, object] = values.unset, + parameter87_value: Union[str, object] = values.unset, + parameter88_name: Union[str, object] = values.unset, + parameter88_value: Union[str, object] = values.unset, + parameter89_name: Union[str, object] = values.unset, + parameter89_value: Union[str, object] = values.unset, + parameter90_name: Union[str, object] = values.unset, + parameter90_value: Union[str, object] = values.unset, + parameter91_name: Union[str, object] = values.unset, + parameter91_value: Union[str, object] = values.unset, + parameter92_name: Union[str, object] = values.unset, + parameter92_value: Union[str, object] = values.unset, + parameter93_name: Union[str, object] = values.unset, + parameter93_value: Union[str, object] = values.unset, + parameter94_name: Union[str, object] = values.unset, + parameter94_value: Union[str, object] = values.unset, + parameter95_name: Union[str, object] = values.unset, + parameter95_value: Union[str, object] = values.unset, + parameter96_name: Union[str, object] = values.unset, + parameter96_value: Union[str, object] = values.unset, + parameter97_name: Union[str, object] = values.unset, + parameter97_value: Union[str, object] = values.unset, + parameter98_name: Union[str, object] = values.unset, + parameter98_value: Union[str, object] = values.unset, + parameter99_name: Union[str, object] = values.unset, + parameter99_value: Union[str, object] = values.unset, + ) -> TranscriptionInstance: + """ + Create the TranscriptionInstance + + :param name: The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription. + :param track: + :param status_callback_url: Absolute URL of the status callback. + :param status_callback_method: The http method for the status_callback (one of GET, POST). + :param inbound_track_label: Friendly name given to the Inbound Track + :param outbound_track_label: Friendly name given to the Outbound Track + :param partial_results: Indicates if partial results are going to be send to the customer + :param language_code: Language code used by the transcription engine, specified in [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) format + :param transcription_engine: Definition of the transcription engine to be used, between those supported by Twilio + :param profanity_filter: indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks + :param speech_model: Recognition model used by the transcription engine, between those supported by the provider + :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. + :param enable_automatic_punctuation: The provider will adds punctuation to recognition result hypotheses + :param parameter1_name: Parameter name + :param parameter1_value: Parameter value + :param parameter2_name: Parameter name + :param parameter2_value: Parameter value + :param parameter3_name: Parameter name + :param parameter3_value: Parameter value + :param parameter4_name: Parameter name + :param parameter4_value: Parameter value + :param parameter5_name: Parameter name + :param parameter5_value: Parameter value + :param parameter6_name: Parameter name + :param parameter6_value: Parameter value + :param parameter7_name: Parameter name + :param parameter7_value: Parameter value + :param parameter8_name: Parameter name + :param parameter8_value: Parameter value + :param parameter9_name: Parameter name + :param parameter9_value: Parameter value + :param parameter10_name: Parameter name + :param parameter10_value: Parameter value + :param parameter11_name: Parameter name + :param parameter11_value: Parameter value + :param parameter12_name: Parameter name + :param parameter12_value: Parameter value + :param parameter13_name: Parameter name + :param parameter13_value: Parameter value + :param parameter14_name: Parameter name + :param parameter14_value: Parameter value + :param parameter15_name: Parameter name + :param parameter15_value: Parameter value + :param parameter16_name: Parameter name + :param parameter16_value: Parameter value + :param parameter17_name: Parameter name + :param parameter17_value: Parameter value + :param parameter18_name: Parameter name + :param parameter18_value: Parameter value + :param parameter19_name: Parameter name + :param parameter19_value: Parameter value + :param parameter20_name: Parameter name + :param parameter20_value: Parameter value + :param parameter21_name: Parameter name + :param parameter21_value: Parameter value + :param parameter22_name: Parameter name + :param parameter22_value: Parameter value + :param parameter23_name: Parameter name + :param parameter23_value: Parameter value + :param parameter24_name: Parameter name + :param parameter24_value: Parameter value + :param parameter25_name: Parameter name + :param parameter25_value: Parameter value + :param parameter26_name: Parameter name + :param parameter26_value: Parameter value + :param parameter27_name: Parameter name + :param parameter27_value: Parameter value + :param parameter28_name: Parameter name + :param parameter28_value: Parameter value + :param parameter29_name: Parameter name + :param parameter29_value: Parameter value + :param parameter30_name: Parameter name + :param parameter30_value: Parameter value + :param parameter31_name: Parameter name + :param parameter31_value: Parameter value + :param parameter32_name: Parameter name + :param parameter32_value: Parameter value + :param parameter33_name: Parameter name + :param parameter33_value: Parameter value + :param parameter34_name: Parameter name + :param parameter34_value: Parameter value + :param parameter35_name: Parameter name + :param parameter35_value: Parameter value + :param parameter36_name: Parameter name + :param parameter36_value: Parameter value + :param parameter37_name: Parameter name + :param parameter37_value: Parameter value + :param parameter38_name: Parameter name + :param parameter38_value: Parameter value + :param parameter39_name: Parameter name + :param parameter39_value: Parameter value + :param parameter40_name: Parameter name + :param parameter40_value: Parameter value + :param parameter41_name: Parameter name + :param parameter41_value: Parameter value + :param parameter42_name: Parameter name + :param parameter42_value: Parameter value + :param parameter43_name: Parameter name + :param parameter43_value: Parameter value + :param parameter44_name: Parameter name + :param parameter44_value: Parameter value + :param parameter45_name: Parameter name + :param parameter45_value: Parameter value + :param parameter46_name: Parameter name + :param parameter46_value: Parameter value + :param parameter47_name: Parameter name + :param parameter47_value: Parameter value + :param parameter48_name: Parameter name + :param parameter48_value: Parameter value + :param parameter49_name: Parameter name + :param parameter49_value: Parameter value + :param parameter50_name: Parameter name + :param parameter50_value: Parameter value + :param parameter51_name: Parameter name + :param parameter51_value: Parameter value + :param parameter52_name: Parameter name + :param parameter52_value: Parameter value + :param parameter53_name: Parameter name + :param parameter53_value: Parameter value + :param parameter54_name: Parameter name + :param parameter54_value: Parameter value + :param parameter55_name: Parameter name + :param parameter55_value: Parameter value + :param parameter56_name: Parameter name + :param parameter56_value: Parameter value + :param parameter57_name: Parameter name + :param parameter57_value: Parameter value + :param parameter58_name: Parameter name + :param parameter58_value: Parameter value + :param parameter59_name: Parameter name + :param parameter59_value: Parameter value + :param parameter60_name: Parameter name + :param parameter60_value: Parameter value + :param parameter61_name: Parameter name + :param parameter61_value: Parameter value + :param parameter62_name: Parameter name + :param parameter62_value: Parameter value + :param parameter63_name: Parameter name + :param parameter63_value: Parameter value + :param parameter64_name: Parameter name + :param parameter64_value: Parameter value + :param parameter65_name: Parameter name + :param parameter65_value: Parameter value + :param parameter66_name: Parameter name + :param parameter66_value: Parameter value + :param parameter67_name: Parameter name + :param parameter67_value: Parameter value + :param parameter68_name: Parameter name + :param parameter68_value: Parameter value + :param parameter69_name: Parameter name + :param parameter69_value: Parameter value + :param parameter70_name: Parameter name + :param parameter70_value: Parameter value + :param parameter71_name: Parameter name + :param parameter71_value: Parameter value + :param parameter72_name: Parameter name + :param parameter72_value: Parameter value + :param parameter73_name: Parameter name + :param parameter73_value: Parameter value + :param parameter74_name: Parameter name + :param parameter74_value: Parameter value + :param parameter75_name: Parameter name + :param parameter75_value: Parameter value + :param parameter76_name: Parameter name + :param parameter76_value: Parameter value + :param parameter77_name: Parameter name + :param parameter77_value: Parameter value + :param parameter78_name: Parameter name + :param parameter78_value: Parameter value + :param parameter79_name: Parameter name + :param parameter79_value: Parameter value + :param parameter80_name: Parameter name + :param parameter80_value: Parameter value + :param parameter81_name: Parameter name + :param parameter81_value: Parameter value + :param parameter82_name: Parameter name + :param parameter82_value: Parameter value + :param parameter83_name: Parameter name + :param parameter83_value: Parameter value + :param parameter84_name: Parameter name + :param parameter84_value: Parameter value + :param parameter85_name: Parameter name + :param parameter85_value: Parameter value + :param parameter86_name: Parameter name + :param parameter86_value: Parameter value + :param parameter87_name: Parameter name + :param parameter87_value: Parameter value + :param parameter88_name: Parameter name + :param parameter88_value: Parameter value + :param parameter89_name: Parameter name + :param parameter89_value: Parameter value + :param parameter90_name: Parameter name + :param parameter90_value: Parameter value + :param parameter91_name: Parameter name + :param parameter91_value: Parameter value + :param parameter92_name: Parameter name + :param parameter92_value: Parameter value + :param parameter93_name: Parameter name + :param parameter93_value: Parameter value + :param parameter94_name: Parameter name + :param parameter94_value: Parameter value + :param parameter95_name: Parameter name + :param parameter95_value: Parameter value + :param parameter96_name: Parameter name + :param parameter96_value: Parameter value + :param parameter97_name: Parameter name + :param parameter97_value: Parameter value + :param parameter98_name: Parameter name + :param parameter98_value: Parameter value + :param parameter99_name: Parameter name + :param parameter99_value: Parameter value + + :returns: The created TranscriptionInstance + """ + + data = values.of( + { + "Name": name, + "Track": track, + "StatusCallbackUrl": status_callback_url, + "StatusCallbackMethod": status_callback_method, + "InboundTrackLabel": inbound_track_label, + "OutboundTrackLabel": outbound_track_label, + "PartialResults": serialize.boolean_to_string(partial_results), + "LanguageCode": language_code, + "TranscriptionEngine": transcription_engine, + "ProfanityFilter": serialize.boolean_to_string(profanity_filter), + "SpeechModel": speech_model, + "Hints": hints, + "EnableAutomaticPunctuation": serialize.boolean_to_string( + enable_automatic_punctuation + ), + "Parameter1.Name": parameter1_name, + "Parameter1.Value": parameter1_value, + "Parameter2.Name": parameter2_name, + "Parameter2.Value": parameter2_value, + "Parameter3.Name": parameter3_name, + "Parameter3.Value": parameter3_value, + "Parameter4.Name": parameter4_name, + "Parameter4.Value": parameter4_value, + "Parameter5.Name": parameter5_name, + "Parameter5.Value": parameter5_value, + "Parameter6.Name": parameter6_name, + "Parameter6.Value": parameter6_value, + "Parameter7.Name": parameter7_name, + "Parameter7.Value": parameter7_value, + "Parameter8.Name": parameter8_name, + "Parameter8.Value": parameter8_value, + "Parameter9.Name": parameter9_name, + "Parameter9.Value": parameter9_value, + "Parameter10.Name": parameter10_name, + "Parameter10.Value": parameter10_value, + "Parameter11.Name": parameter11_name, + "Parameter11.Value": parameter11_value, + "Parameter12.Name": parameter12_name, + "Parameter12.Value": parameter12_value, + "Parameter13.Name": parameter13_name, + "Parameter13.Value": parameter13_value, + "Parameter14.Name": parameter14_name, + "Parameter14.Value": parameter14_value, + "Parameter15.Name": parameter15_name, + "Parameter15.Value": parameter15_value, + "Parameter16.Name": parameter16_name, + "Parameter16.Value": parameter16_value, + "Parameter17.Name": parameter17_name, + "Parameter17.Value": parameter17_value, + "Parameter18.Name": parameter18_name, + "Parameter18.Value": parameter18_value, + "Parameter19.Name": parameter19_name, + "Parameter19.Value": parameter19_value, + "Parameter20.Name": parameter20_name, + "Parameter20.Value": parameter20_value, + "Parameter21.Name": parameter21_name, + "Parameter21.Value": parameter21_value, + "Parameter22.Name": parameter22_name, + "Parameter22.Value": parameter22_value, + "Parameter23.Name": parameter23_name, + "Parameter23.Value": parameter23_value, + "Parameter24.Name": parameter24_name, + "Parameter24.Value": parameter24_value, + "Parameter25.Name": parameter25_name, + "Parameter25.Value": parameter25_value, + "Parameter26.Name": parameter26_name, + "Parameter26.Value": parameter26_value, + "Parameter27.Name": parameter27_name, + "Parameter27.Value": parameter27_value, + "Parameter28.Name": parameter28_name, + "Parameter28.Value": parameter28_value, + "Parameter29.Name": parameter29_name, + "Parameter29.Value": parameter29_value, + "Parameter30.Name": parameter30_name, + "Parameter30.Value": parameter30_value, + "Parameter31.Name": parameter31_name, + "Parameter31.Value": parameter31_value, + "Parameter32.Name": parameter32_name, + "Parameter32.Value": parameter32_value, + "Parameter33.Name": parameter33_name, + "Parameter33.Value": parameter33_value, + "Parameter34.Name": parameter34_name, + "Parameter34.Value": parameter34_value, + "Parameter35.Name": parameter35_name, + "Parameter35.Value": parameter35_value, + "Parameter36.Name": parameter36_name, + "Parameter36.Value": parameter36_value, + "Parameter37.Name": parameter37_name, + "Parameter37.Value": parameter37_value, + "Parameter38.Name": parameter38_name, + "Parameter38.Value": parameter38_value, + "Parameter39.Name": parameter39_name, + "Parameter39.Value": parameter39_value, + "Parameter40.Name": parameter40_name, + "Parameter40.Value": parameter40_value, + "Parameter41.Name": parameter41_name, + "Parameter41.Value": parameter41_value, + "Parameter42.Name": parameter42_name, + "Parameter42.Value": parameter42_value, + "Parameter43.Name": parameter43_name, + "Parameter43.Value": parameter43_value, + "Parameter44.Name": parameter44_name, + "Parameter44.Value": parameter44_value, + "Parameter45.Name": parameter45_name, + "Parameter45.Value": parameter45_value, + "Parameter46.Name": parameter46_name, + "Parameter46.Value": parameter46_value, + "Parameter47.Name": parameter47_name, + "Parameter47.Value": parameter47_value, + "Parameter48.Name": parameter48_name, + "Parameter48.Value": parameter48_value, + "Parameter49.Name": parameter49_name, + "Parameter49.Value": parameter49_value, + "Parameter50.Name": parameter50_name, + "Parameter50.Value": parameter50_value, + "Parameter51.Name": parameter51_name, + "Parameter51.Value": parameter51_value, + "Parameter52.Name": parameter52_name, + "Parameter52.Value": parameter52_value, + "Parameter53.Name": parameter53_name, + "Parameter53.Value": parameter53_value, + "Parameter54.Name": parameter54_name, + "Parameter54.Value": parameter54_value, + "Parameter55.Name": parameter55_name, + "Parameter55.Value": parameter55_value, + "Parameter56.Name": parameter56_name, + "Parameter56.Value": parameter56_value, + "Parameter57.Name": parameter57_name, + "Parameter57.Value": parameter57_value, + "Parameter58.Name": parameter58_name, + "Parameter58.Value": parameter58_value, + "Parameter59.Name": parameter59_name, + "Parameter59.Value": parameter59_value, + "Parameter60.Name": parameter60_name, + "Parameter60.Value": parameter60_value, + "Parameter61.Name": parameter61_name, + "Parameter61.Value": parameter61_value, + "Parameter62.Name": parameter62_name, + "Parameter62.Value": parameter62_value, + "Parameter63.Name": parameter63_name, + "Parameter63.Value": parameter63_value, + "Parameter64.Name": parameter64_name, + "Parameter64.Value": parameter64_value, + "Parameter65.Name": parameter65_name, + "Parameter65.Value": parameter65_value, + "Parameter66.Name": parameter66_name, + "Parameter66.Value": parameter66_value, + "Parameter67.Name": parameter67_name, + "Parameter67.Value": parameter67_value, + "Parameter68.Name": parameter68_name, + "Parameter68.Value": parameter68_value, + "Parameter69.Name": parameter69_name, + "Parameter69.Value": parameter69_value, + "Parameter70.Name": parameter70_name, + "Parameter70.Value": parameter70_value, + "Parameter71.Name": parameter71_name, + "Parameter71.Value": parameter71_value, + "Parameter72.Name": parameter72_name, + "Parameter72.Value": parameter72_value, + "Parameter73.Name": parameter73_name, + "Parameter73.Value": parameter73_value, + "Parameter74.Name": parameter74_name, + "Parameter74.Value": parameter74_value, + "Parameter75.Name": parameter75_name, + "Parameter75.Value": parameter75_value, + "Parameter76.Name": parameter76_name, + "Parameter76.Value": parameter76_value, + "Parameter77.Name": parameter77_name, + "Parameter77.Value": parameter77_value, + "Parameter78.Name": parameter78_name, + "Parameter78.Value": parameter78_value, + "Parameter79.Name": parameter79_name, + "Parameter79.Value": parameter79_value, + "Parameter80.Name": parameter80_name, + "Parameter80.Value": parameter80_value, + "Parameter81.Name": parameter81_name, + "Parameter81.Value": parameter81_value, + "Parameter82.Name": parameter82_name, + "Parameter82.Value": parameter82_value, + "Parameter83.Name": parameter83_name, + "Parameter83.Value": parameter83_value, + "Parameter84.Name": parameter84_name, + "Parameter84.Value": parameter84_value, + "Parameter85.Name": parameter85_name, + "Parameter85.Value": parameter85_value, + "Parameter86.Name": parameter86_name, + "Parameter86.Value": parameter86_value, + "Parameter87.Name": parameter87_name, + "Parameter87.Value": parameter87_value, + "Parameter88.Name": parameter88_name, + "Parameter88.Value": parameter88_value, + "Parameter89.Name": parameter89_name, + "Parameter89.Value": parameter89_value, + "Parameter90.Name": parameter90_name, + "Parameter90.Value": parameter90_value, + "Parameter91.Name": parameter91_name, + "Parameter91.Value": parameter91_value, + "Parameter92.Name": parameter92_name, + "Parameter92.Value": parameter92_value, + "Parameter93.Name": parameter93_name, + "Parameter93.Value": parameter93_value, + "Parameter94.Name": parameter94_name, + "Parameter94.Value": parameter94_value, + "Parameter95.Name": parameter95_name, + "Parameter95.Value": parameter95_value, + "Parameter96.Name": parameter96_name, + "Parameter96.Value": parameter96_value, + "Parameter97.Name": parameter97_name, + "Parameter97.Value": parameter97_value, + "Parameter98.Name": parameter98_name, + "Parameter98.Value": parameter98_value, + "Parameter99.Name": parameter99_name, + "Parameter99.Value": parameter99_value, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return TranscriptionInstance( + self._version, + payload, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + ) + + async def create_async( + self, + name: Union[str, object] = values.unset, + track: Union["TranscriptionInstance.Track", object] = values.unset, + status_callback_url: Union[str, object] = values.unset, + status_callback_method: Union[str, object] = values.unset, + inbound_track_label: Union[str, object] = values.unset, + outbound_track_label: Union[str, object] = values.unset, + partial_results: Union[bool, object] = values.unset, + language_code: Union[str, object] = values.unset, + transcription_engine: Union[str, object] = values.unset, + profanity_filter: Union[bool, object] = values.unset, + speech_model: Union[str, object] = values.unset, + hints: Union[str, object] = values.unset, + enable_automatic_punctuation: Union[bool, object] = values.unset, + parameter1_name: Union[str, object] = values.unset, + parameter1_value: Union[str, object] = values.unset, + parameter2_name: Union[str, object] = values.unset, + parameter2_value: Union[str, object] = values.unset, + parameter3_name: Union[str, object] = values.unset, + parameter3_value: Union[str, object] = values.unset, + parameter4_name: Union[str, object] = values.unset, + parameter4_value: Union[str, object] = values.unset, + parameter5_name: Union[str, object] = values.unset, + parameter5_value: Union[str, object] = values.unset, + parameter6_name: Union[str, object] = values.unset, + parameter6_value: Union[str, object] = values.unset, + parameter7_name: Union[str, object] = values.unset, + parameter7_value: Union[str, object] = values.unset, + parameter8_name: Union[str, object] = values.unset, + parameter8_value: Union[str, object] = values.unset, + parameter9_name: Union[str, object] = values.unset, + parameter9_value: Union[str, object] = values.unset, + parameter10_name: Union[str, object] = values.unset, + parameter10_value: Union[str, object] = values.unset, + parameter11_name: Union[str, object] = values.unset, + parameter11_value: Union[str, object] = values.unset, + parameter12_name: Union[str, object] = values.unset, + parameter12_value: Union[str, object] = values.unset, + parameter13_name: Union[str, object] = values.unset, + parameter13_value: Union[str, object] = values.unset, + parameter14_name: Union[str, object] = values.unset, + parameter14_value: Union[str, object] = values.unset, + parameter15_name: Union[str, object] = values.unset, + parameter15_value: Union[str, object] = values.unset, + parameter16_name: Union[str, object] = values.unset, + parameter16_value: Union[str, object] = values.unset, + parameter17_name: Union[str, object] = values.unset, + parameter17_value: Union[str, object] = values.unset, + parameter18_name: Union[str, object] = values.unset, + parameter18_value: Union[str, object] = values.unset, + parameter19_name: Union[str, object] = values.unset, + parameter19_value: Union[str, object] = values.unset, + parameter20_name: Union[str, object] = values.unset, + parameter20_value: Union[str, object] = values.unset, + parameter21_name: Union[str, object] = values.unset, + parameter21_value: Union[str, object] = values.unset, + parameter22_name: Union[str, object] = values.unset, + parameter22_value: Union[str, object] = values.unset, + parameter23_name: Union[str, object] = values.unset, + parameter23_value: Union[str, object] = values.unset, + parameter24_name: Union[str, object] = values.unset, + parameter24_value: Union[str, object] = values.unset, + parameter25_name: Union[str, object] = values.unset, + parameter25_value: Union[str, object] = values.unset, + parameter26_name: Union[str, object] = values.unset, + parameter26_value: Union[str, object] = values.unset, + parameter27_name: Union[str, object] = values.unset, + parameter27_value: Union[str, object] = values.unset, + parameter28_name: Union[str, object] = values.unset, + parameter28_value: Union[str, object] = values.unset, + parameter29_name: Union[str, object] = values.unset, + parameter29_value: Union[str, object] = values.unset, + parameter30_name: Union[str, object] = values.unset, + parameter30_value: Union[str, object] = values.unset, + parameter31_name: Union[str, object] = values.unset, + parameter31_value: Union[str, object] = values.unset, + parameter32_name: Union[str, object] = values.unset, + parameter32_value: Union[str, object] = values.unset, + parameter33_name: Union[str, object] = values.unset, + parameter33_value: Union[str, object] = values.unset, + parameter34_name: Union[str, object] = values.unset, + parameter34_value: Union[str, object] = values.unset, + parameter35_name: Union[str, object] = values.unset, + parameter35_value: Union[str, object] = values.unset, + parameter36_name: Union[str, object] = values.unset, + parameter36_value: Union[str, object] = values.unset, + parameter37_name: Union[str, object] = values.unset, + parameter37_value: Union[str, object] = values.unset, + parameter38_name: Union[str, object] = values.unset, + parameter38_value: Union[str, object] = values.unset, + parameter39_name: Union[str, object] = values.unset, + parameter39_value: Union[str, object] = values.unset, + parameter40_name: Union[str, object] = values.unset, + parameter40_value: Union[str, object] = values.unset, + parameter41_name: Union[str, object] = values.unset, + parameter41_value: Union[str, object] = values.unset, + parameter42_name: Union[str, object] = values.unset, + parameter42_value: Union[str, object] = values.unset, + parameter43_name: Union[str, object] = values.unset, + parameter43_value: Union[str, object] = values.unset, + parameter44_name: Union[str, object] = values.unset, + parameter44_value: Union[str, object] = values.unset, + parameter45_name: Union[str, object] = values.unset, + parameter45_value: Union[str, object] = values.unset, + parameter46_name: Union[str, object] = values.unset, + parameter46_value: Union[str, object] = values.unset, + parameter47_name: Union[str, object] = values.unset, + parameter47_value: Union[str, object] = values.unset, + parameter48_name: Union[str, object] = values.unset, + parameter48_value: Union[str, object] = values.unset, + parameter49_name: Union[str, object] = values.unset, + parameter49_value: Union[str, object] = values.unset, + parameter50_name: Union[str, object] = values.unset, + parameter50_value: Union[str, object] = values.unset, + parameter51_name: Union[str, object] = values.unset, + parameter51_value: Union[str, object] = values.unset, + parameter52_name: Union[str, object] = values.unset, + parameter52_value: Union[str, object] = values.unset, + parameter53_name: Union[str, object] = values.unset, + parameter53_value: Union[str, object] = values.unset, + parameter54_name: Union[str, object] = values.unset, + parameter54_value: Union[str, object] = values.unset, + parameter55_name: Union[str, object] = values.unset, + parameter55_value: Union[str, object] = values.unset, + parameter56_name: Union[str, object] = values.unset, + parameter56_value: Union[str, object] = values.unset, + parameter57_name: Union[str, object] = values.unset, + parameter57_value: Union[str, object] = values.unset, + parameter58_name: Union[str, object] = values.unset, + parameter58_value: Union[str, object] = values.unset, + parameter59_name: Union[str, object] = values.unset, + parameter59_value: Union[str, object] = values.unset, + parameter60_name: Union[str, object] = values.unset, + parameter60_value: Union[str, object] = values.unset, + parameter61_name: Union[str, object] = values.unset, + parameter61_value: Union[str, object] = values.unset, + parameter62_name: Union[str, object] = values.unset, + parameter62_value: Union[str, object] = values.unset, + parameter63_name: Union[str, object] = values.unset, + parameter63_value: Union[str, object] = values.unset, + parameter64_name: Union[str, object] = values.unset, + parameter64_value: Union[str, object] = values.unset, + parameter65_name: Union[str, object] = values.unset, + parameter65_value: Union[str, object] = values.unset, + parameter66_name: Union[str, object] = values.unset, + parameter66_value: Union[str, object] = values.unset, + parameter67_name: Union[str, object] = values.unset, + parameter67_value: Union[str, object] = values.unset, + parameter68_name: Union[str, object] = values.unset, + parameter68_value: Union[str, object] = values.unset, + parameter69_name: Union[str, object] = values.unset, + parameter69_value: Union[str, object] = values.unset, + parameter70_name: Union[str, object] = values.unset, + parameter70_value: Union[str, object] = values.unset, + parameter71_name: Union[str, object] = values.unset, + parameter71_value: Union[str, object] = values.unset, + parameter72_name: Union[str, object] = values.unset, + parameter72_value: Union[str, object] = values.unset, + parameter73_name: Union[str, object] = values.unset, + parameter73_value: Union[str, object] = values.unset, + parameter74_name: Union[str, object] = values.unset, + parameter74_value: Union[str, object] = values.unset, + parameter75_name: Union[str, object] = values.unset, + parameter75_value: Union[str, object] = values.unset, + parameter76_name: Union[str, object] = values.unset, + parameter76_value: Union[str, object] = values.unset, + parameter77_name: Union[str, object] = values.unset, + parameter77_value: Union[str, object] = values.unset, + parameter78_name: Union[str, object] = values.unset, + parameter78_value: Union[str, object] = values.unset, + parameter79_name: Union[str, object] = values.unset, + parameter79_value: Union[str, object] = values.unset, + parameter80_name: Union[str, object] = values.unset, + parameter80_value: Union[str, object] = values.unset, + parameter81_name: Union[str, object] = values.unset, + parameter81_value: Union[str, object] = values.unset, + parameter82_name: Union[str, object] = values.unset, + parameter82_value: Union[str, object] = values.unset, + parameter83_name: Union[str, object] = values.unset, + parameter83_value: Union[str, object] = values.unset, + parameter84_name: Union[str, object] = values.unset, + parameter84_value: Union[str, object] = values.unset, + parameter85_name: Union[str, object] = values.unset, + parameter85_value: Union[str, object] = values.unset, + parameter86_name: Union[str, object] = values.unset, + parameter86_value: Union[str, object] = values.unset, + parameter87_name: Union[str, object] = values.unset, + parameter87_value: Union[str, object] = values.unset, + parameter88_name: Union[str, object] = values.unset, + parameter88_value: Union[str, object] = values.unset, + parameter89_name: Union[str, object] = values.unset, + parameter89_value: Union[str, object] = values.unset, + parameter90_name: Union[str, object] = values.unset, + parameter90_value: Union[str, object] = values.unset, + parameter91_name: Union[str, object] = values.unset, + parameter91_value: Union[str, object] = values.unset, + parameter92_name: Union[str, object] = values.unset, + parameter92_value: Union[str, object] = values.unset, + parameter93_name: Union[str, object] = values.unset, + parameter93_value: Union[str, object] = values.unset, + parameter94_name: Union[str, object] = values.unset, + parameter94_value: Union[str, object] = values.unset, + parameter95_name: Union[str, object] = values.unset, + parameter95_value: Union[str, object] = values.unset, + parameter96_name: Union[str, object] = values.unset, + parameter96_value: Union[str, object] = values.unset, + parameter97_name: Union[str, object] = values.unset, + parameter97_value: Union[str, object] = values.unset, + parameter98_name: Union[str, object] = values.unset, + parameter98_value: Union[str, object] = values.unset, + parameter99_name: Union[str, object] = values.unset, + parameter99_value: Union[str, object] = values.unset, + ) -> TranscriptionInstance: + """ + Asynchronously create the TranscriptionInstance + + :param name: The user-specified name of this Transcription, if one was given when the Transcription was created. This may be used to stop the Transcription. + :param track: + :param status_callback_url: Absolute URL of the status callback. + :param status_callback_method: The http method for the status_callback (one of GET, POST). + :param inbound_track_label: Friendly name given to the Inbound Track + :param outbound_track_label: Friendly name given to the Outbound Track + :param partial_results: Indicates if partial results are going to be send to the customer + :param language_code: Language code used by the transcription engine, specified in [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) format + :param transcription_engine: Definition of the transcription engine to be used, between those supported by Twilio + :param profanity_filter: indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks + :param speech_model: Recognition model used by the transcription engine, between those supported by the provider + :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. + :param enable_automatic_punctuation: The provider will adds punctuation to recognition result hypotheses + :param parameter1_name: Parameter name + :param parameter1_value: Parameter value + :param parameter2_name: Parameter name + :param parameter2_value: Parameter value + :param parameter3_name: Parameter name + :param parameter3_value: Parameter value + :param parameter4_name: Parameter name + :param parameter4_value: Parameter value + :param parameter5_name: Parameter name + :param parameter5_value: Parameter value + :param parameter6_name: Parameter name + :param parameter6_value: Parameter value + :param parameter7_name: Parameter name + :param parameter7_value: Parameter value + :param parameter8_name: Parameter name + :param parameter8_value: Parameter value + :param parameter9_name: Parameter name + :param parameter9_value: Parameter value + :param parameter10_name: Parameter name + :param parameter10_value: Parameter value + :param parameter11_name: Parameter name + :param parameter11_value: Parameter value + :param parameter12_name: Parameter name + :param parameter12_value: Parameter value + :param parameter13_name: Parameter name + :param parameter13_value: Parameter value + :param parameter14_name: Parameter name + :param parameter14_value: Parameter value + :param parameter15_name: Parameter name + :param parameter15_value: Parameter value + :param parameter16_name: Parameter name + :param parameter16_value: Parameter value + :param parameter17_name: Parameter name + :param parameter17_value: Parameter value + :param parameter18_name: Parameter name + :param parameter18_value: Parameter value + :param parameter19_name: Parameter name + :param parameter19_value: Parameter value + :param parameter20_name: Parameter name + :param parameter20_value: Parameter value + :param parameter21_name: Parameter name + :param parameter21_value: Parameter value + :param parameter22_name: Parameter name + :param parameter22_value: Parameter value + :param parameter23_name: Parameter name + :param parameter23_value: Parameter value + :param parameter24_name: Parameter name + :param parameter24_value: Parameter value + :param parameter25_name: Parameter name + :param parameter25_value: Parameter value + :param parameter26_name: Parameter name + :param parameter26_value: Parameter value + :param parameter27_name: Parameter name + :param parameter27_value: Parameter value + :param parameter28_name: Parameter name + :param parameter28_value: Parameter value + :param parameter29_name: Parameter name + :param parameter29_value: Parameter value + :param parameter30_name: Parameter name + :param parameter30_value: Parameter value + :param parameter31_name: Parameter name + :param parameter31_value: Parameter value + :param parameter32_name: Parameter name + :param parameter32_value: Parameter value + :param parameter33_name: Parameter name + :param parameter33_value: Parameter value + :param parameter34_name: Parameter name + :param parameter34_value: Parameter value + :param parameter35_name: Parameter name + :param parameter35_value: Parameter value + :param parameter36_name: Parameter name + :param parameter36_value: Parameter value + :param parameter37_name: Parameter name + :param parameter37_value: Parameter value + :param parameter38_name: Parameter name + :param parameter38_value: Parameter value + :param parameter39_name: Parameter name + :param parameter39_value: Parameter value + :param parameter40_name: Parameter name + :param parameter40_value: Parameter value + :param parameter41_name: Parameter name + :param parameter41_value: Parameter value + :param parameter42_name: Parameter name + :param parameter42_value: Parameter value + :param parameter43_name: Parameter name + :param parameter43_value: Parameter value + :param parameter44_name: Parameter name + :param parameter44_value: Parameter value + :param parameter45_name: Parameter name + :param parameter45_value: Parameter value + :param parameter46_name: Parameter name + :param parameter46_value: Parameter value + :param parameter47_name: Parameter name + :param parameter47_value: Parameter value + :param parameter48_name: Parameter name + :param parameter48_value: Parameter value + :param parameter49_name: Parameter name + :param parameter49_value: Parameter value + :param parameter50_name: Parameter name + :param parameter50_value: Parameter value + :param parameter51_name: Parameter name + :param parameter51_value: Parameter value + :param parameter52_name: Parameter name + :param parameter52_value: Parameter value + :param parameter53_name: Parameter name + :param parameter53_value: Parameter value + :param parameter54_name: Parameter name + :param parameter54_value: Parameter value + :param parameter55_name: Parameter name + :param parameter55_value: Parameter value + :param parameter56_name: Parameter name + :param parameter56_value: Parameter value + :param parameter57_name: Parameter name + :param parameter57_value: Parameter value + :param parameter58_name: Parameter name + :param parameter58_value: Parameter value + :param parameter59_name: Parameter name + :param parameter59_value: Parameter value + :param parameter60_name: Parameter name + :param parameter60_value: Parameter value + :param parameter61_name: Parameter name + :param parameter61_value: Parameter value + :param parameter62_name: Parameter name + :param parameter62_value: Parameter value + :param parameter63_name: Parameter name + :param parameter63_value: Parameter value + :param parameter64_name: Parameter name + :param parameter64_value: Parameter value + :param parameter65_name: Parameter name + :param parameter65_value: Parameter value + :param parameter66_name: Parameter name + :param parameter66_value: Parameter value + :param parameter67_name: Parameter name + :param parameter67_value: Parameter value + :param parameter68_name: Parameter name + :param parameter68_value: Parameter value + :param parameter69_name: Parameter name + :param parameter69_value: Parameter value + :param parameter70_name: Parameter name + :param parameter70_value: Parameter value + :param parameter71_name: Parameter name + :param parameter71_value: Parameter value + :param parameter72_name: Parameter name + :param parameter72_value: Parameter value + :param parameter73_name: Parameter name + :param parameter73_value: Parameter value + :param parameter74_name: Parameter name + :param parameter74_value: Parameter value + :param parameter75_name: Parameter name + :param parameter75_value: Parameter value + :param parameter76_name: Parameter name + :param parameter76_value: Parameter value + :param parameter77_name: Parameter name + :param parameter77_value: Parameter value + :param parameter78_name: Parameter name + :param parameter78_value: Parameter value + :param parameter79_name: Parameter name + :param parameter79_value: Parameter value + :param parameter80_name: Parameter name + :param parameter80_value: Parameter value + :param parameter81_name: Parameter name + :param parameter81_value: Parameter value + :param parameter82_name: Parameter name + :param parameter82_value: Parameter value + :param parameter83_name: Parameter name + :param parameter83_value: Parameter value + :param parameter84_name: Parameter name + :param parameter84_value: Parameter value + :param parameter85_name: Parameter name + :param parameter85_value: Parameter value + :param parameter86_name: Parameter name + :param parameter86_value: Parameter value + :param parameter87_name: Parameter name + :param parameter87_value: Parameter value + :param parameter88_name: Parameter name + :param parameter88_value: Parameter value + :param parameter89_name: Parameter name + :param parameter89_value: Parameter value + :param parameter90_name: Parameter name + :param parameter90_value: Parameter value + :param parameter91_name: Parameter name + :param parameter91_value: Parameter value + :param parameter92_name: Parameter name + :param parameter92_value: Parameter value + :param parameter93_name: Parameter name + :param parameter93_value: Parameter value + :param parameter94_name: Parameter name + :param parameter94_value: Parameter value + :param parameter95_name: Parameter name + :param parameter95_value: Parameter value + :param parameter96_name: Parameter name + :param parameter96_value: Parameter value + :param parameter97_name: Parameter name + :param parameter97_value: Parameter value + :param parameter98_name: Parameter name + :param parameter98_value: Parameter value + :param parameter99_name: Parameter name + :param parameter99_value: Parameter value + + :returns: The created TranscriptionInstance + """ + + data = values.of( + { + "Name": name, + "Track": track, + "StatusCallbackUrl": status_callback_url, + "StatusCallbackMethod": status_callback_method, + "InboundTrackLabel": inbound_track_label, + "OutboundTrackLabel": outbound_track_label, + "PartialResults": serialize.boolean_to_string(partial_results), + "LanguageCode": language_code, + "TranscriptionEngine": transcription_engine, + "ProfanityFilter": serialize.boolean_to_string(profanity_filter), + "SpeechModel": speech_model, + "Hints": hints, + "EnableAutomaticPunctuation": serialize.boolean_to_string( + enable_automatic_punctuation + ), + "Parameter1.Name": parameter1_name, + "Parameter1.Value": parameter1_value, + "Parameter2.Name": parameter2_name, + "Parameter2.Value": parameter2_value, + "Parameter3.Name": parameter3_name, + "Parameter3.Value": parameter3_value, + "Parameter4.Name": parameter4_name, + "Parameter4.Value": parameter4_value, + "Parameter5.Name": parameter5_name, + "Parameter5.Value": parameter5_value, + "Parameter6.Name": parameter6_name, + "Parameter6.Value": parameter6_value, + "Parameter7.Name": parameter7_name, + "Parameter7.Value": parameter7_value, + "Parameter8.Name": parameter8_name, + "Parameter8.Value": parameter8_value, + "Parameter9.Name": parameter9_name, + "Parameter9.Value": parameter9_value, + "Parameter10.Name": parameter10_name, + "Parameter10.Value": parameter10_value, + "Parameter11.Name": parameter11_name, + "Parameter11.Value": parameter11_value, + "Parameter12.Name": parameter12_name, + "Parameter12.Value": parameter12_value, + "Parameter13.Name": parameter13_name, + "Parameter13.Value": parameter13_value, + "Parameter14.Name": parameter14_name, + "Parameter14.Value": parameter14_value, + "Parameter15.Name": parameter15_name, + "Parameter15.Value": parameter15_value, + "Parameter16.Name": parameter16_name, + "Parameter16.Value": parameter16_value, + "Parameter17.Name": parameter17_name, + "Parameter17.Value": parameter17_value, + "Parameter18.Name": parameter18_name, + "Parameter18.Value": parameter18_value, + "Parameter19.Name": parameter19_name, + "Parameter19.Value": parameter19_value, + "Parameter20.Name": parameter20_name, + "Parameter20.Value": parameter20_value, + "Parameter21.Name": parameter21_name, + "Parameter21.Value": parameter21_value, + "Parameter22.Name": parameter22_name, + "Parameter22.Value": parameter22_value, + "Parameter23.Name": parameter23_name, + "Parameter23.Value": parameter23_value, + "Parameter24.Name": parameter24_name, + "Parameter24.Value": parameter24_value, + "Parameter25.Name": parameter25_name, + "Parameter25.Value": parameter25_value, + "Parameter26.Name": parameter26_name, + "Parameter26.Value": parameter26_value, + "Parameter27.Name": parameter27_name, + "Parameter27.Value": parameter27_value, + "Parameter28.Name": parameter28_name, + "Parameter28.Value": parameter28_value, + "Parameter29.Name": parameter29_name, + "Parameter29.Value": parameter29_value, + "Parameter30.Name": parameter30_name, + "Parameter30.Value": parameter30_value, + "Parameter31.Name": parameter31_name, + "Parameter31.Value": parameter31_value, + "Parameter32.Name": parameter32_name, + "Parameter32.Value": parameter32_value, + "Parameter33.Name": parameter33_name, + "Parameter33.Value": parameter33_value, + "Parameter34.Name": parameter34_name, + "Parameter34.Value": parameter34_value, + "Parameter35.Name": parameter35_name, + "Parameter35.Value": parameter35_value, + "Parameter36.Name": parameter36_name, + "Parameter36.Value": parameter36_value, + "Parameter37.Name": parameter37_name, + "Parameter37.Value": parameter37_value, + "Parameter38.Name": parameter38_name, + "Parameter38.Value": parameter38_value, + "Parameter39.Name": parameter39_name, + "Parameter39.Value": parameter39_value, + "Parameter40.Name": parameter40_name, + "Parameter40.Value": parameter40_value, + "Parameter41.Name": parameter41_name, + "Parameter41.Value": parameter41_value, + "Parameter42.Name": parameter42_name, + "Parameter42.Value": parameter42_value, + "Parameter43.Name": parameter43_name, + "Parameter43.Value": parameter43_value, + "Parameter44.Name": parameter44_name, + "Parameter44.Value": parameter44_value, + "Parameter45.Name": parameter45_name, + "Parameter45.Value": parameter45_value, + "Parameter46.Name": parameter46_name, + "Parameter46.Value": parameter46_value, + "Parameter47.Name": parameter47_name, + "Parameter47.Value": parameter47_value, + "Parameter48.Name": parameter48_name, + "Parameter48.Value": parameter48_value, + "Parameter49.Name": parameter49_name, + "Parameter49.Value": parameter49_value, + "Parameter50.Name": parameter50_name, + "Parameter50.Value": parameter50_value, + "Parameter51.Name": parameter51_name, + "Parameter51.Value": parameter51_value, + "Parameter52.Name": parameter52_name, + "Parameter52.Value": parameter52_value, + "Parameter53.Name": parameter53_name, + "Parameter53.Value": parameter53_value, + "Parameter54.Name": parameter54_name, + "Parameter54.Value": parameter54_value, + "Parameter55.Name": parameter55_name, + "Parameter55.Value": parameter55_value, + "Parameter56.Name": parameter56_name, + "Parameter56.Value": parameter56_value, + "Parameter57.Name": parameter57_name, + "Parameter57.Value": parameter57_value, + "Parameter58.Name": parameter58_name, + "Parameter58.Value": parameter58_value, + "Parameter59.Name": parameter59_name, + "Parameter59.Value": parameter59_value, + "Parameter60.Name": parameter60_name, + "Parameter60.Value": parameter60_value, + "Parameter61.Name": parameter61_name, + "Parameter61.Value": parameter61_value, + "Parameter62.Name": parameter62_name, + "Parameter62.Value": parameter62_value, + "Parameter63.Name": parameter63_name, + "Parameter63.Value": parameter63_value, + "Parameter64.Name": parameter64_name, + "Parameter64.Value": parameter64_value, + "Parameter65.Name": parameter65_name, + "Parameter65.Value": parameter65_value, + "Parameter66.Name": parameter66_name, + "Parameter66.Value": parameter66_value, + "Parameter67.Name": parameter67_name, + "Parameter67.Value": parameter67_value, + "Parameter68.Name": parameter68_name, + "Parameter68.Value": parameter68_value, + "Parameter69.Name": parameter69_name, + "Parameter69.Value": parameter69_value, + "Parameter70.Name": parameter70_name, + "Parameter70.Value": parameter70_value, + "Parameter71.Name": parameter71_name, + "Parameter71.Value": parameter71_value, + "Parameter72.Name": parameter72_name, + "Parameter72.Value": parameter72_value, + "Parameter73.Name": parameter73_name, + "Parameter73.Value": parameter73_value, + "Parameter74.Name": parameter74_name, + "Parameter74.Value": parameter74_value, + "Parameter75.Name": parameter75_name, + "Parameter75.Value": parameter75_value, + "Parameter76.Name": parameter76_name, + "Parameter76.Value": parameter76_value, + "Parameter77.Name": parameter77_name, + "Parameter77.Value": parameter77_value, + "Parameter78.Name": parameter78_name, + "Parameter78.Value": parameter78_value, + "Parameter79.Name": parameter79_name, + "Parameter79.Value": parameter79_value, + "Parameter80.Name": parameter80_name, + "Parameter80.Value": parameter80_value, + "Parameter81.Name": parameter81_name, + "Parameter81.Value": parameter81_value, + "Parameter82.Name": parameter82_name, + "Parameter82.Value": parameter82_value, + "Parameter83.Name": parameter83_name, + "Parameter83.Value": parameter83_value, + "Parameter84.Name": parameter84_name, + "Parameter84.Value": parameter84_value, + "Parameter85.Name": parameter85_name, + "Parameter85.Value": parameter85_value, + "Parameter86.Name": parameter86_name, + "Parameter86.Value": parameter86_value, + "Parameter87.Name": parameter87_name, + "Parameter87.Value": parameter87_value, + "Parameter88.Name": parameter88_name, + "Parameter88.Value": parameter88_value, + "Parameter89.Name": parameter89_name, + "Parameter89.Value": parameter89_value, + "Parameter90.Name": parameter90_name, + "Parameter90.Value": parameter90_value, + "Parameter91.Name": parameter91_name, + "Parameter91.Value": parameter91_value, + "Parameter92.Name": parameter92_name, + "Parameter92.Value": parameter92_value, + "Parameter93.Name": parameter93_name, + "Parameter93.Value": parameter93_value, + "Parameter94.Name": parameter94_name, + "Parameter94.Value": parameter94_value, + "Parameter95.Name": parameter95_name, + "Parameter95.Value": parameter95_value, + "Parameter96.Name": parameter96_name, + "Parameter96.Value": parameter96_value, + "Parameter97.Name": parameter97_name, + "Parameter97.Value": parameter97_value, + "Parameter98.Name": parameter98_name, + "Parameter98.Value": parameter98_value, + "Parameter99.Name": parameter99_name, + "Parameter99.Value": parameter99_value, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return TranscriptionInstance( + self._version, + payload, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + ) + + def get(self, sid: str) -> TranscriptionContext: + """ + Constructs a TranscriptionContext + + :param sid: The SID of the Transcription resource, or the `name` used when creating the resource + """ + return TranscriptionContext( + self._version, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + sid=sid, + ) + + def __call__(self, sid: str) -> TranscriptionContext: + """ + Constructs a TranscriptionContext + + :param sid: The SID of the Transcription resource, or the `name` used when creating the resource + """ + return TranscriptionContext( + self._version, + account_sid=self._solution["account_sid"], + call_sid=self._solution["call_sid"], + sid=sid, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 6dd0978f31..0fcbd1c19e 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -306,7 +306,7 @@ def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): def to_dict(self): return { - "type": self.type.to_dict(), + "type": self.type, "copy_code_text": self.copy_code_text, } @@ -331,7 +331,7 @@ def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): def to_dict(self): return { - "type": self.type.to_dict(), + "type": self.type, "title": self.title, "url": self.url, "phone": self.phone, @@ -357,7 +357,7 @@ def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): def to_dict(self): return { - "type": self.type.to_dict(), + "type": self.type, "title": self.title, "url": self.url, "phone": self.phone, @@ -453,7 +453,7 @@ def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): def to_dict(self): return { - "type": self.type.to_dict(), + "type": self.type, "title": self.title, "id": self.id, } diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index f679a920a1..f35ef6a48f 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -27,7 +27,7 @@ class ApprovalFetchInstance(InstanceResource): :ivar url: The URL of the resource, relative to `https://content.twilio.com`. """ - def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], sid: str): super().__init__(version) self.sid: Optional[str] = payload.get("sid") @@ -36,7 +36,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): self.url: Optional[str] = payload.get("url") self._solution = { - "content_sid": content_sid, + "sid": sid, } self._context: Optional[ApprovalFetchContext] = None @@ -51,7 +51,7 @@ def _proxy(self) -> "ApprovalFetchContext": if self._context is None: self._context = ApprovalFetchContext( self._version, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) return self._context @@ -85,20 +85,20 @@ def __repr__(self) -> str: class ApprovalFetchContext(InstanceContext): - def __init__(self, version: Version, content_sid: str): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchContext :param version: Version that contains the resource - :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "content_sid": content_sid, + "sid": sid, } - self._uri = "/Content/{content_sid}/ApprovalRequests".format(**self._solution) + self._uri = "/Content/{sid}/ApprovalRequests".format(**self._solution) def fetch(self) -> ApprovalFetchInstance: """ @@ -116,7 +116,7 @@ def fetch(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) async def fetch_async(self) -> ApprovalFetchInstance: @@ -135,7 +135,7 @@ async def fetch_async(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) def __repr__(self) -> str: @@ -150,19 +150,19 @@ def __repr__(self) -> str: class ApprovalFetchList(ListResource): - def __init__(self, version: Version, content_sid: str): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchList :param version: Version that contains the resource - :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "content_sid": content_sid, + "sid": sid, } def get(self) -> ApprovalFetchContext: @@ -170,18 +170,14 @@ def get(self) -> ApprovalFetchContext: Constructs a ApprovalFetchContext """ - return ApprovalFetchContext( - self._version, content_sid=self._solution["content_sid"] - ) + return ApprovalFetchContext(self._version, sid=self._solution["sid"]) def __call__(self) -> ApprovalFetchContext: """ Constructs a ApprovalFetchContext """ - return ApprovalFetchContext( - self._version, content_sid=self._solution["content_sid"] - ) + return ApprovalFetchContext(self._version, sid=self._solution["sid"]) def __repr__(self) -> str: """ diff --git a/twilio/rest/content/v1/content_and_approvals.py b/twilio/rest/content/v1/content_and_approvals.py index e2d6d72aaf..de40cfc172 100644 --- a/twilio/rest/content/v1/content_and_approvals.py +++ b/twilio/rest/content/v1/content_and_approvals.py @@ -31,7 +31,7 @@ class ContentAndApprovalsInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar approval_requests: The submitted information and approval request status of the Content resource. """ diff --git a/twilio/rest/content/v1/legacy_content.py b/twilio/rest/content/v1/legacy_content.py index 5705c33b0b..cfb4ac698d 100644 --- a/twilio/rest/content/v1/legacy_content.py +++ b/twilio/rest/content/v1/legacy_content.py @@ -31,7 +31,7 @@ class LegacyContentInstance(InstanceResource): :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. :ivar legacy_template_name: The string name of the legacy content template associated with this Content resource, unique across all template names for its account. Only lowercase letters, numbers and underscores are allowed :ivar legacy_body: The string body field of the legacy content template associated with this Content resource :ivar url: The URL of the resource, relative to `https://content.twilio.com`. diff --git a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py index 3d8d694a22..3f9415ed49 100644 --- a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py +++ b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py @@ -52,7 +52,7 @@ def __repr__(self) -> str: class InstalledAddOnUsageList(ListResource): - class CreateMarketplaceBillingUsageRequest(object): + class CreateBillingUsageRequest(object): """ :ivar billable_items: """ @@ -60,9 +60,7 @@ class CreateMarketplaceBillingUsageRequest(object): def __init__(self, payload: Dict[str, Any], installed_add_on_sid: str): self.billable_items: Optional[ - List[ - InstalledAddOnUsageList.CreateMarketplaceBillingUsageRequestBillableItems - ] + List[InstalledAddOnUsageList.CreateBillingUsageRequestBillableItems] ] = payload.get("billable_items") def to_dict(self): @@ -72,7 +70,7 @@ def to_dict(self): ], } - class CreateMarketplaceBillingUsageRequestBillableItems(object): + class CreateBillingUsageRequestBillableItems(object): """ :ivar quantity: :ivar sid: @@ -108,17 +106,16 @@ def __init__(self, version: Version, installed_add_on_sid: str): ) def create( - self, - create_marketplace_billing_usage_request: CreateMarketplaceBillingUsageRequest, + self, create_billing_usage_request: CreateBillingUsageRequest ) -> InstalledAddOnUsageInstance: """ Create the InstalledAddOnUsageInstance - :param create_marketplace_billing_usage_request: + :param create_billing_usage_request: :returns: The created InstalledAddOnUsageInstance """ - data = create_marketplace_billing_usage_request.to_dict() + data = create_billing_usage_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) headers["Content-Type"] = "application/json" @@ -134,17 +131,16 @@ def create( ) async def create_async( - self, - create_marketplace_billing_usage_request: CreateMarketplaceBillingUsageRequest, + self, create_billing_usage_request: CreateBillingUsageRequest ) -> InstalledAddOnUsageInstance: """ Asynchronously create the InstalledAddOnUsageInstance - :param create_marketplace_billing_usage_request: + :param create_billing_usage_request: :returns: The created InstalledAddOnUsageInstance """ - data = create_marketplace_billing_usage_request.to_dict() + data = create_billing_usage_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) headers["Content-Type"] = "application/json" diff --git a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py index 9d9a508810..706853bcee 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py @@ -13,7 +13,7 @@ """ from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -72,23 +72,33 @@ def _proxy(self) -> "RegulationContext": ) return self._context - def fetch(self) -> "RegulationInstance": + def fetch( + self, include_constraints: Union[bool, object] = values.unset + ) -> "RegulationInstance": """ Fetch the RegulationInstance + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :returns: The fetched RegulationInstance """ - return self._proxy.fetch() + return self._proxy.fetch( + include_constraints=include_constraints, + ) - async def fetch_async(self) -> "RegulationInstance": + async def fetch_async( + self, include_constraints: Union[bool, object] = values.unset + ) -> "RegulationInstance": """ Asynchronous coroutine to fetch the RegulationInstance + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :returns: The fetched RegulationInstance """ - return await self._proxy.fetch_async() + return await self._proxy.fetch_async( + include_constraints=include_constraints, + ) def __repr__(self) -> str: """ @@ -117,36 +127,50 @@ def __init__(self, version: Version, sid: str): } self._uri = "/RegulatoryCompliance/Regulations/{sid}".format(**self._solution) - def fetch(self) -> RegulationInstance: + def fetch( + self, include_constraints: Union[bool, object] = values.unset + ) -> RegulationInstance: """ Fetch the RegulationInstance + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :returns: The fetched RegulationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, + data = values.of( + { + "IncludeConstraints": serialize.boolean_to_string(include_constraints), + } ) + payload = self._version.fetch(method="GET", uri=self._uri, params=data) + return RegulationInstance( self._version, payload, sid=self._solution["sid"], ) - async def fetch_async(self) -> RegulationInstance: + async def fetch_async( + self, include_constraints: Union[bool, object] = values.unset + ) -> RegulationInstance: """ Asynchronous coroutine to fetch the RegulationInstance + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :returns: The fetched RegulationInstance """ + data = values.of( + { + "IncludeConstraints": serialize.boolean_to_string(include_constraints), + } + ) + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, params=data ) return RegulationInstance( @@ -202,6 +226,7 @@ def stream( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[RegulationInstance]: @@ -214,6 +239,7 @@ def stream( :param "RegulationInstance.EndUserType" end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param str iso_country: The ISO country code of the phone number's country. :param str number_type: The type of phone number that the regulatory requiremnt is restricting. + :param bool include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -228,6 +254,7 @@ def stream( end_user_type=end_user_type, iso_country=iso_country, number_type=number_type, + include_constraints=include_constraints, page_size=limits["page_size"], ) @@ -238,6 +265,7 @@ async def stream_async( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[RegulationInstance]: @@ -250,6 +278,7 @@ async def stream_async( :param "RegulationInstance.EndUserType" end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param str iso_country: The ISO country code of the phone number's country. :param str number_type: The type of phone number that the regulatory requiremnt is restricting. + :param bool include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -264,6 +293,7 @@ async def stream_async( end_user_type=end_user_type, iso_country=iso_country, number_type=number_type, + include_constraints=include_constraints, page_size=limits["page_size"], ) @@ -274,6 +304,7 @@ def list( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[RegulationInstance]: @@ -285,6 +316,7 @@ def list( :param "RegulationInstance.EndUserType" end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param str iso_country: The ISO country code of the phone number's country. :param str number_type: The type of phone number that the regulatory requiremnt is restricting. + :param bool include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -299,6 +331,7 @@ def list( end_user_type=end_user_type, iso_country=iso_country, number_type=number_type, + include_constraints=include_constraints, limit=limit, page_size=page_size, ) @@ -309,6 +342,7 @@ async def list_async( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[RegulationInstance]: @@ -320,6 +354,7 @@ async def list_async( :param "RegulationInstance.EndUserType" end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param str iso_country: The ISO country code of the phone number's country. :param str number_type: The type of phone number that the regulatory requiremnt is restricting. + :param bool include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -335,6 +370,7 @@ async def list_async( end_user_type=end_user_type, iso_country=iso_country, number_type=number_type, + include_constraints=include_constraints, limit=limit, page_size=page_size, ) @@ -345,6 +381,7 @@ def page( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -356,6 +393,7 @@ def page( :param end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param iso_country: The ISO country code of the phone number's country. :param number_type: The type of phone number that the regulatory requiremnt is restricting. + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -367,6 +405,7 @@ def page( "EndUserType": end_user_type, "IsoCountry": iso_country, "NumberType": number_type, + "IncludeConstraints": serialize.boolean_to_string(include_constraints), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -381,6 +420,7 @@ async def page_async( end_user_type: Union["RegulationInstance.EndUserType", object] = values.unset, iso_country: Union[str, object] = values.unset, number_type: Union[str, object] = values.unset, + include_constraints: Union[bool, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -392,6 +432,7 @@ async def page_async( :param end_user_type: The type of End User the regulation requires - can be `individual` or `business`. :param iso_country: The ISO country code of the phone number's country. :param number_type: The type of phone number that the regulatory requiremnt is restricting. + :param include_constraints: A boolean parameter indicating whether to include constraints or not for supporting end user, documents and their fields :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -403,6 +444,7 @@ async def page_async( "EndUserType": end_user_type, "IsoCountry": iso_country, "NumberType": number_type, + "IncludeConstraints": serialize.boolean_to_string(include_constraints), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/twiml/voice_response.py b/twilio/twiml/voice_response.py index 6beb109dc5..c6d453e143 100644 --- a/twilio/twiml/voice_response.py +++ b/twilio/twiml/voice_response.py @@ -663,13 +663,81 @@ def siprec( ) ) + def transcription( + self, + name=None, + track=None, + status_callback_url=None, + status_callback_method=None, + inbound_track_label=None, + outbound_track_label=None, + partial_results=None, + language_code=None, + transcription_engine=None, + profanity_filter=None, + speech_model=None, + hints=None, + enable_automatic_punctuation=None, + **kwargs + ): + """ + Create a element -class Siprec(TwiML): - """ TwiML Noun""" + :param name: Friendly name given to the Transcription + :param track: Track to be analyze by the provider + :param status_callback_url: Status Callback URL + :param status_callback_method: Status Callback URL method + :param inbound_track_label: Friendly name given to the Inbound Track + :param outbound_track_label: Friendly name given to the Outbound Track Label + :param partial_results: Indicates if partial results are going to be send to the customer + :param language_code: Language Code used by the transcription engine + :param transcription_engine: Transcription Engine to be used + :param profanity_filter: Enable Profanity Filter + :param speech_model: Speech Model used by the transcription engine + :param hints: Hints to be provided to the transcription engine + :param enable_automatic_punctuation: Enable Automatic Punctuation + :param kwargs: additional attributes + + :returns: element + """ + return self.nest( + Transcription( + name=name, + track=track, + status_callback_url=status_callback_url, + status_callback_method=status_callback_method, + inbound_track_label=inbound_track_label, + outbound_track_label=outbound_track_label, + partial_results=partial_results, + language_code=language_code, + transcription_engine=transcription_engine, + profanity_filter=profanity_filter, + speech_model=speech_model, + hints=hints, + enable_automatic_punctuation=enable_automatic_punctuation, + **kwargs + ) + ) + + +class Transcription(TwiML): + """ TwiML Noun""" def __init__(self, **kwargs): - super(Siprec, self).__init__(**kwargs) - self.name = "Siprec" + super(Transcription, self).__init__(**kwargs) + self.name = "Transcription" + + def config(self, name=None, value=None, **kwargs): + """ + Create a element + + :param name: The name of the custom config + :param value: The value of the custom config + :param kwargs: additional attributes + + :returns: element + """ + return self.nest(Config(name=name, value=value, **kwargs)) def parameter(self, name=None, value=None, **kwargs): """ @@ -692,6 +760,34 @@ def __init__(self, **kwargs): self.name = "Parameter" +class Config(TwiML): + """ TwiML Noun""" + + def __init__(self, **kwargs): + super(Config, self).__init__(**kwargs) + self.name = "Config" + + +class Siprec(TwiML): + """ TwiML Noun""" + + def __init__(self, **kwargs): + super(Siprec, self).__init__(**kwargs) + self.name = "Siprec" + + def parameter(self, name=None, value=None, **kwargs): + """ + Create a element + + :param name: The name of the custom parameter + :param value: The value of the custom parameter + :param kwargs: additional attributes + + :returns: element + """ + return self.nest(Parameter(name=name, value=value, **kwargs)) + + class Stream(TwiML): """ TwiML Noun""" @@ -786,6 +882,62 @@ def siprec( ) ) + def transcription( + self, + name=None, + track=None, + status_callback_url=None, + status_callback_method=None, + inbound_track_label=None, + outbound_track_label=None, + partial_results=None, + language_code=None, + transcription_engine=None, + profanity_filter=None, + speech_model=None, + hints=None, + enable_automatic_punctuation=None, + **kwargs + ): + """ + Create a element + + :param name: Friendly name given to the Transcription + :param track: Track to be analyze by the provider + :param status_callback_url: Status Callback URL + :param status_callback_method: Status Callback URL method + :param inbound_track_label: Friendly name given to the Inbound Track + :param outbound_track_label: Friendly name given to the Outbound Track Label + :param partial_results: Indicates if partial results are going to be send to the customer + :param language_code: Language Code used by the transcription engine + :param transcription_engine: Transcription Engine to be used + :param profanity_filter: Enable Profanity Filter + :param speech_model: Speech Model used by the transcription engine + :param hints: Hints to be provided to the transcription engine + :param enable_automatic_punctuation: Enable Automatic Punctuation + :param kwargs: additional attributes + + :returns: element + """ + return self.nest( + Transcription( + name=name, + track=track, + status_callback_url=status_callback_url, + status_callback_method=status_callback_method, + inbound_track_label=inbound_track_label, + outbound_track_label=outbound_track_label, + partial_results=partial_results, + language_code=language_code, + transcription_engine=transcription_engine, + profanity_filter=profanity_filter, + speech_model=speech_model, + hints=hints, + enable_automatic_punctuation=enable_automatic_punctuation, + **kwargs + ) + ) + class Prompt(TwiML): """ Twiml Verb""" @@ -2614,14 +2766,6 @@ def parameter(self, name=None, value=None, **kwargs): return self.nest(Parameter(name=name, value=value, **kwargs)) -class Config(TwiML): - """ TwiML Noun""" - - def __init__(self, **kwargs): - super(Config, self).__init__(**kwargs) - self.name = "Config" - - class Autopilot(TwiML): """ TwiML Noun""" From 35bc17436ef0542b090472494a0c111b9333c247 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 27 Jun 2024 19:44:50 +0000 Subject: [PATCH 035/113] Release 9.2.2 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b7fa3a7cf5..76dccd0d66 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.2.1", + version="9.2.2", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index f7985b5f36..149012e549 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "2", "1") +__version_info__ = ("9", "2", "2") __version__ = ".".join(__version_info__) From bd426ae6b529a28e8f8da0e5d44cd59c7f00b701 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 2 Jul 2024 09:31:02 +0000 Subject: [PATCH 036/113] [Librarian] Regenerated @ a412066ed53a791734369f33f4b2f579662850b3 e43180215d9b6a7f705d187446184940bb3dfac1 --- CHANGES.md | 6 ++++ .../rest/content/v1/content/approval_fetch.py | 32 +++++++++++-------- twilio/rest/numbers/v1/__init__.py | 24 +++++--------- ...hook_configuration_fetch.py => webhook.py} | 26 +++++++-------- 4 files changed, 45 insertions(+), 43 deletions(-) rename twilio/rest/numbers/v1/{porting_webhook_configuration_fetch.py => webhook.py} (76%) diff --git a/CHANGES.md b/CHANGES.md index 1d0111abde..a9e6811010 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,12 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-07-02] Version 9.2.3 +-------------------------- +**Intelligence** +- Deprecate account flag api.twilio-intelligence.v2 + + [2024-06-27] Version 9.2.2 -------------------------- **Api** diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index f35ef6a48f..f679a920a1 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -27,7 +27,7 @@ class ApprovalFetchInstance(InstanceResource): :ivar url: The URL of the resource, relative to `https://content.twilio.com`. """ - def __init__(self, version: Version, payload: Dict[str, Any], sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): super().__init__(version) self.sid: Optional[str] = payload.get("sid") @@ -36,7 +36,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], sid: str): self.url: Optional[str] = payload.get("url") self._solution = { - "sid": sid, + "content_sid": content_sid, } self._context: Optional[ApprovalFetchContext] = None @@ -51,7 +51,7 @@ def _proxy(self) -> "ApprovalFetchContext": if self._context is None: self._context = ApprovalFetchContext( self._version, - sid=self._solution["sid"], + content_sid=self._solution["content_sid"], ) return self._context @@ -85,20 +85,20 @@ def __repr__(self) -> str: class ApprovalFetchContext(InstanceContext): - def __init__(self, version: Version, sid: str): + def __init__(self, version: Version, content_sid: str): """ Initialize the ApprovalFetchContext :param version: Version that contains the resource - :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "sid": sid, + "content_sid": content_sid, } - self._uri = "/Content/{sid}/ApprovalRequests".format(**self._solution) + self._uri = "/Content/{content_sid}/ApprovalRequests".format(**self._solution) def fetch(self) -> ApprovalFetchInstance: """ @@ -116,7 +116,7 @@ def fetch(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - sid=self._solution["sid"], + content_sid=self._solution["content_sid"], ) async def fetch_async(self) -> ApprovalFetchInstance: @@ -135,7 +135,7 @@ async def fetch_async(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - sid=self._solution["sid"], + content_sid=self._solution["content_sid"], ) def __repr__(self) -> str: @@ -150,19 +150,19 @@ def __repr__(self) -> str: class ApprovalFetchList(ListResource): - def __init__(self, version: Version, sid: str): + def __init__(self, version: Version, content_sid: str): """ Initialize the ApprovalFetchList :param version: Version that contains the resource - :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "sid": sid, + "content_sid": content_sid, } def get(self) -> ApprovalFetchContext: @@ -170,14 +170,18 @@ def get(self) -> ApprovalFetchContext: Constructs a ApprovalFetchContext """ - return ApprovalFetchContext(self._version, sid=self._solution["sid"]) + return ApprovalFetchContext( + self._version, content_sid=self._solution["content_sid"] + ) def __call__(self) -> ApprovalFetchContext: """ Constructs a ApprovalFetchContext """ - return ApprovalFetchContext(self._version, sid=self._solution["sid"]) + return ApprovalFetchContext( + self._version, content_sid=self._solution["content_sid"] + ) def __repr__(self) -> str: """ diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 043364c3d5..68f078a88d 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,12 +28,10 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) -from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( - PortingWebhookConfigurationFetchList, -) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) +from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -58,12 +56,10 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None - self._porting_webhook_configuration_fetch: Optional[ - PortingWebhookConfigurationFetchList - ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None + self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -111,22 +107,18 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete - @property - def porting_webhook_configuration_fetch( - self, - ) -> PortingWebhookConfigurationFetchList: - if self._porting_webhook_configuration_fetch is None: - self._porting_webhook_configuration_fetch = ( - PortingWebhookConfigurationFetchList(self) - ) - return self._porting_webhook_configuration_fetch - @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations + @property + def webhook(self) -> WebhookList: + if self._webhook is None: + self._webhook = WebhookList(self) + return self._webhook + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/webhook.py similarity index 76% rename from twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py rename to twilio/rest/numbers/v1/webhook.py index 0119fe002f..0986db12f3 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py +++ b/twilio/rest/numbers/v1/webhook.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class PortingWebhookConfigurationFetchInstance(InstanceResource): +class WebhookInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: Webhook URL to send a request when a port in request or port in phone number event happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class PortingWebhookConfigurationFetchList(ListResource): +class WebhookList(ListResource): def __init__(self, version: Version): """ - Initialize the PortingWebhookConfigurationFetchList + Initialize the WebhookList :param version: Version that contains the resource @@ -68,25 +68,25 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> PortingWebhookConfigurationFetchInstance: + def fetch(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) - async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: + async def fetch_async(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -94,7 +94,7 @@ async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: method="GET", uri=self._uri, headers=headers ) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) def __repr__(self) -> str: """ @@ -102,4 +102,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" From 6324a1cf55ebf7efcb20f67fdb6ed1fbe1f31e10 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 2 Jul 2024 09:35:15 +0000 Subject: [PATCH 037/113] Release 9.2.3 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 76dccd0d66..8fee9aa182 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.2.2", + version="9.2.3", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 149012e549..bb8cd36f5d 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "2", "2") +__version_info__ = ("9", "2", "3") __version__ = ".".join(__version_info__) From dd72ebead6ced3eef5c5faf92b2bb2a1d88506ff Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Mon, 22 Jul 2024 21:32:03 +0530 Subject: [PATCH 038/113] chore: oauth sdk implementation (#804) --- twilio/rest/marketplace/__init__.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 twilio/rest/marketplace/__init__.py diff --git a/twilio/rest/marketplace/__init__.py b/twilio/rest/marketplace/__init__.py new file mode 100644 index 0000000000..79b10ef6c4 --- /dev/null +++ b/twilio/rest/marketplace/__init__.py @@ -0,0 +1,10 @@ +from twilio.rest.marketplace.MarketplaceBase import MarketplaceBase + + +class Marketplace(MarketplaceBase): + def available_add_ons(self): + return self.v1.available_add_ons + + def installed_add_ons(self): + return self.v1.installed_add_ons + From 0cd40b58765fc669f8c6093343d08bda605577f3 Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 2 Aug 2024 16:13:43 +0530 Subject: [PATCH 039/113] chore: update intersphinx_mapping (#807) * chore: test change * chore: update intersphinx_mapping * chore: fixed quotes * chore: updating docs link --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 405c2e99af..017b358093 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -203,4 +203,4 @@ # -- Options for intersphinx extension --------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"https://docs.python.org/": None} +intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} From fdd6edce6310e9bc7dfed866037ec287e3708813 Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Mon, 12 Aug 2024 11:43:52 +0530 Subject: [PATCH 040/113] chore: preview iam removal (#808) --- twilio/rest/__init__.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 31d114a6c0..2c1aa3b9dc 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -23,7 +23,6 @@ from twilio.rest.events import Events from twilio.rest.flex_api import FlexApi from twilio.rest.frontline_api import FrontlineApi - from twilio.rest.preview_iam import PreviewIam from twilio.rest.insights import Insights from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging @@ -132,7 +131,6 @@ def __init__( self._events: Optional["Events"] = None self._flex_api: Optional["FlexApi"] = None self._frontline_api: Optional["FrontlineApi"] = None - self._preview_iam: Optional["PreviewIam"] = None self._insights: Optional["Insights"] = None self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None @@ -277,18 +275,6 @@ def frontline_api(self) -> "FrontlineApi": self._frontline_api = FrontlineApi(self) return self._frontline_api - @property - def preview_iam(self) -> "PreviewIam": - """ - Access the PreviewIam Twilio Domain - - :returns: PreviewIam Twilio Domain - """ - if self._preview_iam is None: - from twilio.rest.preview_iam import PreviewIam - - self._preview_iam = PreviewIam(self) - return self._preview_iam @property def insights(self) -> "Insights": From 2b875ec54e34cfa3bbebc6f439ca6ccfafb3fd75 Mon Sep 17 00:00:00 2001 From: Matthias Schoettle Date: Fri, 23 Aug 2024 12:57:58 -0400 Subject: [PATCH 041/113] chore: add license identifier to project metadata (#810) --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index c8673986ed..0df04dde4d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -3,6 +3,7 @@ universal = 1 [metadata] description-file = README.md +license = MIT [flake8] exclude = ./twilio/rest,./twilio/twiml,./tests/integration From f4e7765caccd0063c13eff105f611efa8488422e Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 26 Aug 2024 11:18:54 +0000 Subject: [PATCH 042/113] [Librarian] Regenerated @ c8ce9820730ef3b2a48912311d45afb8c26b9ee7 2ee5b1fa49840dd67929ff69952e93618b74425b --- CHANGES.md | 43 + twilio/rest/__init__.py | 1 - .../api/v2010/account/call/transcription.py | 1204 +---------------- .../api/v2010/account/message/__init__.py | 4 +- .../{payload.py => payload/__init__.py} | 25 + .../recording/add_on_result/payload/data.py | 242 ++++ twilio/rest/content/v1/content/__init__.py | 116 +- .../content/v1/content/approval_create.py | 2 +- twilio/rest/flex_api/v2/flex_user.py | 164 ++- twilio/rest/insights/v1/call_summaries.py | 196 ++- twilio/rest/intelligence/v2/operator_type.py | 6 +- .../intelligence/v2/transcript/sentence.py | 30 +- twilio/rest/marketplace/__init__.py | 1 - twilio/rest/marketplace/v1/__init__.py | 8 + .../installed_add_on_usage.py | 30 +- .../marketplace/v1/module_data_management.py | 28 +- .../marketplace/v1/referral_conversion.py | 198 +++ twilio/rest/messaging/v1/external_campaign.py | 18 +- .../messaging/v1/service/channel_sender.py | 94 ++ twilio/rest/numbers/v1/__init__.py | 24 +- twilio/rest/numbers/v1/porting_port_in.py | 16 +- .../v1/porting_port_in_phone_number.py | 38 +- twilio/rest/numbers/v1/porting_portability.py | 22 +- .../v1/porting_webhook_configuration.py | 6 +- .../porting_webhook_configuration_delete.py | 6 +- ...=> porting_webhook_configuration_fetch.py} | 32 +- .../v1/signing_request_configuration.py | 243 +++- twilio/rest/numbers/v2/__init__.py | 8 + twilio/rest/numbers/v2/bundle_clone.py | 268 ++++ .../regulatory_compliance/bundle/__init__.py | 6 + .../taskrouter/v1/workspace/task/__init__.py | 6 +- .../rest/trusthub/v1/compliance_inquiries.py | 26 +- twilio/rest/verify/v2/service/__init__.py | 14 +- 33 files changed, 1767 insertions(+), 1358 deletions(-) rename twilio/rest/api/v2010/account/recording/add_on_result/{payload.py => payload/__init__.py} (96%) create mode 100644 twilio/rest/api/v2010/account/recording/add_on_result/payload/data.py create mode 100644 twilio/rest/marketplace/v1/referral_conversion.py rename twilio/rest/numbers/v1/{webhook.py => porting_webhook_configuration_fetch.py} (64%) create mode 100644 twilio/rest/numbers/v2/bundle_clone.py diff --git a/CHANGES.md b/CHANGES.md index a9e6811010..2222dfc4d5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,49 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-08-26] Version 9.2.4 +-------------------------- +**Library - Chore** +- [PR #810](https://github.com/twilio/twilio-python/pull/810): add license identifier to project metadata. Thanks to [@mschoettle](https://github.com/mschoettle)! +- [PR #808](https://github.com/twilio/twilio-python/pull/808): preview iam removal. Thanks to [@manisha1997](https://github.com/manisha1997)! +- [PR #807](https://github.com/twilio/twilio-python/pull/807): update intersphinx_mapping. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #804](https://github.com/twilio/twilio-python/pull/804): add init file. Thanks to [@manisha1997](https://github.com/manisha1997)! + +**Api** +- Update documentation of `error_code` and `error_message` on the Message resource. +- Remove generic parameters from `transcription` resource +- Added public documentation for Payload Data retrieval API + +**Flex** +- Adding update Flex User api + +**Insights** +- Added 'branded', 'business_profile' and 'voice_integrity' fields in List Call Summary + +**Intelligence** +- Add `words` array information to the Sentences v2 entity. +- Add `X-Rate-Limit-Limit`, `X-Rate-Limit-Remaining`, and `X-Rate-Limit-Config` headers for Operator Results. +- Change the path parameter when fetching an `/OperatorType/{}` from `sid` to `string` to support searching by SID or by name +- Add `X-Rate-Limit-Limit`, `X-Rate-Limit-Remaining`, and `X-Rate-Limit-Config` headers for Transcript and Service endpoints. + +**Messaging** +- Adds two new channel senders api to add/remove channel senders to/from a messaging service +- Extend ERC api to accept an optional attribute in request body to indicate CNP migration for an ERC + +**Numbers** +- Modify visibility to public in bundle clone API +- Add `port_date` field to Port In Request and Port In Phone Numbers Fetch APIs +- Change properties docs for port in phone numbers api +- Add is_test body param to the Bundle Create API +- Change properties docs for port in api + +**Trusthub** +- Add new field in themeSetId in compliance_inquiry. + +**Verify** +- Update `custom_code_enabled` description on verification docs + + [2024-07-02] Version 9.2.3 -------------------------- **Intelligence** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 2c1aa3b9dc..2dc0a4930f 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -275,7 +275,6 @@ def frontline_api(self) -> "FrontlineApi": self._frontline_api = FrontlineApi(self) return self._frontline_api - @property def insights(self) -> "Insights": """ diff --git a/twilio/rest/api/v2010/account/call/transcription.py b/twilio/rest/api/v2010/account/call/transcription.py index 96554eaa02..d4aa87e3df 100644 --- a/twilio/rest/api/v2010/account/call/transcription.py +++ b/twilio/rest/api/v2010/account/call/transcription.py @@ -261,204 +261,6 @@ def create( speech_model: Union[str, object] = values.unset, hints: Union[str, object] = values.unset, enable_automatic_punctuation: Union[bool, object] = values.unset, - parameter1_name: Union[str, object] = values.unset, - parameter1_value: Union[str, object] = values.unset, - parameter2_name: Union[str, object] = values.unset, - parameter2_value: Union[str, object] = values.unset, - parameter3_name: Union[str, object] = values.unset, - parameter3_value: Union[str, object] = values.unset, - parameter4_name: Union[str, object] = values.unset, - parameter4_value: Union[str, object] = values.unset, - parameter5_name: Union[str, object] = values.unset, - parameter5_value: Union[str, object] = values.unset, - parameter6_name: Union[str, object] = values.unset, - parameter6_value: Union[str, object] = values.unset, - parameter7_name: Union[str, object] = values.unset, - parameter7_value: Union[str, object] = values.unset, - parameter8_name: Union[str, object] = values.unset, - parameter8_value: Union[str, object] = values.unset, - parameter9_name: Union[str, object] = values.unset, - parameter9_value: Union[str, object] = values.unset, - parameter10_name: Union[str, object] = values.unset, - parameter10_value: Union[str, object] = values.unset, - parameter11_name: Union[str, object] = values.unset, - parameter11_value: Union[str, object] = values.unset, - parameter12_name: Union[str, object] = values.unset, - parameter12_value: Union[str, object] = values.unset, - parameter13_name: Union[str, object] = values.unset, - parameter13_value: Union[str, object] = values.unset, - parameter14_name: Union[str, object] = values.unset, - parameter14_value: Union[str, object] = values.unset, - parameter15_name: Union[str, object] = values.unset, - parameter15_value: Union[str, object] = values.unset, - parameter16_name: Union[str, object] = values.unset, - parameter16_value: Union[str, object] = values.unset, - parameter17_name: Union[str, object] = values.unset, - parameter17_value: Union[str, object] = values.unset, - parameter18_name: Union[str, object] = values.unset, - parameter18_value: Union[str, object] = values.unset, - parameter19_name: Union[str, object] = values.unset, - parameter19_value: Union[str, object] = values.unset, - parameter20_name: Union[str, object] = values.unset, - parameter20_value: Union[str, object] = values.unset, - parameter21_name: Union[str, object] = values.unset, - parameter21_value: Union[str, object] = values.unset, - parameter22_name: Union[str, object] = values.unset, - parameter22_value: Union[str, object] = values.unset, - parameter23_name: Union[str, object] = values.unset, - parameter23_value: Union[str, object] = values.unset, - parameter24_name: Union[str, object] = values.unset, - parameter24_value: Union[str, object] = values.unset, - parameter25_name: Union[str, object] = values.unset, - parameter25_value: Union[str, object] = values.unset, - parameter26_name: Union[str, object] = values.unset, - parameter26_value: Union[str, object] = values.unset, - parameter27_name: Union[str, object] = values.unset, - parameter27_value: Union[str, object] = values.unset, - parameter28_name: Union[str, object] = values.unset, - parameter28_value: Union[str, object] = values.unset, - parameter29_name: Union[str, object] = values.unset, - parameter29_value: Union[str, object] = values.unset, - parameter30_name: Union[str, object] = values.unset, - parameter30_value: Union[str, object] = values.unset, - parameter31_name: Union[str, object] = values.unset, - parameter31_value: Union[str, object] = values.unset, - parameter32_name: Union[str, object] = values.unset, - parameter32_value: Union[str, object] = values.unset, - parameter33_name: Union[str, object] = values.unset, - parameter33_value: Union[str, object] = values.unset, - parameter34_name: Union[str, object] = values.unset, - parameter34_value: Union[str, object] = values.unset, - parameter35_name: Union[str, object] = values.unset, - parameter35_value: Union[str, object] = values.unset, - parameter36_name: Union[str, object] = values.unset, - parameter36_value: Union[str, object] = values.unset, - parameter37_name: Union[str, object] = values.unset, - parameter37_value: Union[str, object] = values.unset, - parameter38_name: Union[str, object] = values.unset, - parameter38_value: Union[str, object] = values.unset, - parameter39_name: Union[str, object] = values.unset, - parameter39_value: Union[str, object] = values.unset, - parameter40_name: Union[str, object] = values.unset, - parameter40_value: Union[str, object] = values.unset, - parameter41_name: Union[str, object] = values.unset, - parameter41_value: Union[str, object] = values.unset, - parameter42_name: Union[str, object] = values.unset, - parameter42_value: Union[str, object] = values.unset, - parameter43_name: Union[str, object] = values.unset, - parameter43_value: Union[str, object] = values.unset, - parameter44_name: Union[str, object] = values.unset, - parameter44_value: Union[str, object] = values.unset, - parameter45_name: Union[str, object] = values.unset, - parameter45_value: Union[str, object] = values.unset, - parameter46_name: Union[str, object] = values.unset, - parameter46_value: Union[str, object] = values.unset, - parameter47_name: Union[str, object] = values.unset, - parameter47_value: Union[str, object] = values.unset, - parameter48_name: Union[str, object] = values.unset, - parameter48_value: Union[str, object] = values.unset, - parameter49_name: Union[str, object] = values.unset, - parameter49_value: Union[str, object] = values.unset, - parameter50_name: Union[str, object] = values.unset, - parameter50_value: Union[str, object] = values.unset, - parameter51_name: Union[str, object] = values.unset, - parameter51_value: Union[str, object] = values.unset, - parameter52_name: Union[str, object] = values.unset, - parameter52_value: Union[str, object] = values.unset, - parameter53_name: Union[str, object] = values.unset, - parameter53_value: Union[str, object] = values.unset, - parameter54_name: Union[str, object] = values.unset, - parameter54_value: Union[str, object] = values.unset, - parameter55_name: Union[str, object] = values.unset, - parameter55_value: Union[str, object] = values.unset, - parameter56_name: Union[str, object] = values.unset, - parameter56_value: Union[str, object] = values.unset, - parameter57_name: Union[str, object] = values.unset, - parameter57_value: Union[str, object] = values.unset, - parameter58_name: Union[str, object] = values.unset, - parameter58_value: Union[str, object] = values.unset, - parameter59_name: Union[str, object] = values.unset, - parameter59_value: Union[str, object] = values.unset, - parameter60_name: Union[str, object] = values.unset, - parameter60_value: Union[str, object] = values.unset, - parameter61_name: Union[str, object] = values.unset, - parameter61_value: Union[str, object] = values.unset, - parameter62_name: Union[str, object] = values.unset, - parameter62_value: Union[str, object] = values.unset, - parameter63_name: Union[str, object] = values.unset, - parameter63_value: Union[str, object] = values.unset, - parameter64_name: Union[str, object] = values.unset, - parameter64_value: Union[str, object] = values.unset, - parameter65_name: Union[str, object] = values.unset, - parameter65_value: Union[str, object] = values.unset, - parameter66_name: Union[str, object] = values.unset, - parameter66_value: Union[str, object] = values.unset, - parameter67_name: Union[str, object] = values.unset, - parameter67_value: Union[str, object] = values.unset, - parameter68_name: Union[str, object] = values.unset, - parameter68_value: Union[str, object] = values.unset, - parameter69_name: Union[str, object] = values.unset, - parameter69_value: Union[str, object] = values.unset, - parameter70_name: Union[str, object] = values.unset, - parameter70_value: Union[str, object] = values.unset, - parameter71_name: Union[str, object] = values.unset, - parameter71_value: Union[str, object] = values.unset, - parameter72_name: Union[str, object] = values.unset, - parameter72_value: Union[str, object] = values.unset, - parameter73_name: Union[str, object] = values.unset, - parameter73_value: Union[str, object] = values.unset, - parameter74_name: Union[str, object] = values.unset, - parameter74_value: Union[str, object] = values.unset, - parameter75_name: Union[str, object] = values.unset, - parameter75_value: Union[str, object] = values.unset, - parameter76_name: Union[str, object] = values.unset, - parameter76_value: Union[str, object] = values.unset, - parameter77_name: Union[str, object] = values.unset, - parameter77_value: Union[str, object] = values.unset, - parameter78_name: Union[str, object] = values.unset, - parameter78_value: Union[str, object] = values.unset, - parameter79_name: Union[str, object] = values.unset, - parameter79_value: Union[str, object] = values.unset, - parameter80_name: Union[str, object] = values.unset, - parameter80_value: Union[str, object] = values.unset, - parameter81_name: Union[str, object] = values.unset, - parameter81_value: Union[str, object] = values.unset, - parameter82_name: Union[str, object] = values.unset, - parameter82_value: Union[str, object] = values.unset, - parameter83_name: Union[str, object] = values.unset, - parameter83_value: Union[str, object] = values.unset, - parameter84_name: Union[str, object] = values.unset, - parameter84_value: Union[str, object] = values.unset, - parameter85_name: Union[str, object] = values.unset, - parameter85_value: Union[str, object] = values.unset, - parameter86_name: Union[str, object] = values.unset, - parameter86_value: Union[str, object] = values.unset, - parameter87_name: Union[str, object] = values.unset, - parameter87_value: Union[str, object] = values.unset, - parameter88_name: Union[str, object] = values.unset, - parameter88_value: Union[str, object] = values.unset, - parameter89_name: Union[str, object] = values.unset, - parameter89_value: Union[str, object] = values.unset, - parameter90_name: Union[str, object] = values.unset, - parameter90_value: Union[str, object] = values.unset, - parameter91_name: Union[str, object] = values.unset, - parameter91_value: Union[str, object] = values.unset, - parameter92_name: Union[str, object] = values.unset, - parameter92_value: Union[str, object] = values.unset, - parameter93_name: Union[str, object] = values.unset, - parameter93_value: Union[str, object] = values.unset, - parameter94_name: Union[str, object] = values.unset, - parameter94_value: Union[str, object] = values.unset, - parameter95_name: Union[str, object] = values.unset, - parameter95_value: Union[str, object] = values.unset, - parameter96_name: Union[str, object] = values.unset, - parameter96_value: Union[str, object] = values.unset, - parameter97_name: Union[str, object] = values.unset, - parameter97_value: Union[str, object] = values.unset, - parameter98_name: Union[str, object] = values.unset, - parameter98_value: Union[str, object] = values.unset, - parameter99_name: Union[str, object] = values.unset, - parameter99_value: Union[str, object] = values.unset, ) -> TranscriptionInstance: """ Create the TranscriptionInstance @@ -469,211 +271,13 @@ def create( :param status_callback_method: The http method for the status_callback (one of GET, POST). :param inbound_track_label: Friendly name given to the Inbound Track :param outbound_track_label: Friendly name given to the Outbound Track - :param partial_results: Indicates if partial results are going to be send to the customer + :param partial_results: Indicates if partial results are going to be sent to the customer :param language_code: Language code used by the transcription engine, specified in [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) format - :param transcription_engine: Definition of the transcription engine to be used, between those supported by Twilio + :param transcription_engine: Definition of the transcription engine to be used, among those supported by Twilio :param profanity_filter: indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks - :param speech_model: Recognition model used by the transcription engine, between those supported by the provider + :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. - :param enable_automatic_punctuation: The provider will adds punctuation to recognition result hypotheses - :param parameter1_name: Parameter name - :param parameter1_value: Parameter value - :param parameter2_name: Parameter name - :param parameter2_value: Parameter value - :param parameter3_name: Parameter name - :param parameter3_value: Parameter value - :param parameter4_name: Parameter name - :param parameter4_value: Parameter value - :param parameter5_name: Parameter name - :param parameter5_value: Parameter value - :param parameter6_name: Parameter name - :param parameter6_value: Parameter value - :param parameter7_name: Parameter name - :param parameter7_value: Parameter value - :param parameter8_name: Parameter name - :param parameter8_value: Parameter value - :param parameter9_name: Parameter name - :param parameter9_value: Parameter value - :param parameter10_name: Parameter name - :param parameter10_value: Parameter value - :param parameter11_name: Parameter name - :param parameter11_value: Parameter value - :param parameter12_name: Parameter name - :param parameter12_value: Parameter value - :param parameter13_name: Parameter name - :param parameter13_value: Parameter value - :param parameter14_name: Parameter name - :param parameter14_value: Parameter value - :param parameter15_name: Parameter name - :param parameter15_value: Parameter value - :param parameter16_name: Parameter name - :param parameter16_value: Parameter value - :param parameter17_name: Parameter name - :param parameter17_value: Parameter value - :param parameter18_name: Parameter name - :param parameter18_value: Parameter value - :param parameter19_name: Parameter name - :param parameter19_value: Parameter value - :param parameter20_name: Parameter name - :param parameter20_value: Parameter value - :param parameter21_name: Parameter name - :param parameter21_value: Parameter value - :param parameter22_name: Parameter name - :param parameter22_value: Parameter value - :param parameter23_name: Parameter name - :param parameter23_value: Parameter value - :param parameter24_name: Parameter name - :param parameter24_value: Parameter value - :param parameter25_name: Parameter name - :param parameter25_value: Parameter value - :param parameter26_name: Parameter name - :param parameter26_value: Parameter value - :param parameter27_name: Parameter name - :param parameter27_value: Parameter value - :param parameter28_name: Parameter name - :param parameter28_value: Parameter value - :param parameter29_name: Parameter name - :param parameter29_value: Parameter value - :param parameter30_name: Parameter name - :param parameter30_value: Parameter value - :param parameter31_name: Parameter name - :param parameter31_value: Parameter value - :param parameter32_name: Parameter name - :param parameter32_value: Parameter value - :param parameter33_name: Parameter name - :param parameter33_value: Parameter value - :param parameter34_name: Parameter name - :param parameter34_value: Parameter value - :param parameter35_name: Parameter name - :param parameter35_value: Parameter value - :param parameter36_name: Parameter name - :param parameter36_value: Parameter value - :param parameter37_name: Parameter name - :param parameter37_value: Parameter value - :param parameter38_name: Parameter name - :param parameter38_value: Parameter value - :param parameter39_name: Parameter name - :param parameter39_value: Parameter value - :param parameter40_name: Parameter name - :param parameter40_value: Parameter value - :param parameter41_name: Parameter name - :param parameter41_value: Parameter value - :param parameter42_name: Parameter name - :param parameter42_value: Parameter value - :param parameter43_name: Parameter name - :param parameter43_value: Parameter value - :param parameter44_name: Parameter name - :param parameter44_value: Parameter value - :param parameter45_name: Parameter name - :param parameter45_value: Parameter value - :param parameter46_name: Parameter name - :param parameter46_value: Parameter value - :param parameter47_name: Parameter name - :param parameter47_value: Parameter value - :param parameter48_name: Parameter name - :param parameter48_value: Parameter value - :param parameter49_name: Parameter name - :param parameter49_value: Parameter value - :param parameter50_name: Parameter name - :param parameter50_value: Parameter value - :param parameter51_name: Parameter name - :param parameter51_value: Parameter value - :param parameter52_name: Parameter name - :param parameter52_value: Parameter value - :param parameter53_name: Parameter name - :param parameter53_value: Parameter value - :param parameter54_name: Parameter name - :param parameter54_value: Parameter value - :param parameter55_name: Parameter name - :param parameter55_value: Parameter value - :param parameter56_name: Parameter name - :param parameter56_value: Parameter value - :param parameter57_name: Parameter name - :param parameter57_value: Parameter value - :param parameter58_name: Parameter name - :param parameter58_value: Parameter value - :param parameter59_name: Parameter name - :param parameter59_value: Parameter value - :param parameter60_name: Parameter name - :param parameter60_value: Parameter value - :param parameter61_name: Parameter name - :param parameter61_value: Parameter value - :param parameter62_name: Parameter name - :param parameter62_value: Parameter value - :param parameter63_name: Parameter name - :param parameter63_value: Parameter value - :param parameter64_name: Parameter name - :param parameter64_value: Parameter value - :param parameter65_name: Parameter name - :param parameter65_value: Parameter value - :param parameter66_name: Parameter name - :param parameter66_value: Parameter value - :param parameter67_name: Parameter name - :param parameter67_value: Parameter value - :param parameter68_name: Parameter name - :param parameter68_value: Parameter value - :param parameter69_name: Parameter name - :param parameter69_value: Parameter value - :param parameter70_name: Parameter name - :param parameter70_value: Parameter value - :param parameter71_name: Parameter name - :param parameter71_value: Parameter value - :param parameter72_name: Parameter name - :param parameter72_value: Parameter value - :param parameter73_name: Parameter name - :param parameter73_value: Parameter value - :param parameter74_name: Parameter name - :param parameter74_value: Parameter value - :param parameter75_name: Parameter name - :param parameter75_value: Parameter value - :param parameter76_name: Parameter name - :param parameter76_value: Parameter value - :param parameter77_name: Parameter name - :param parameter77_value: Parameter value - :param parameter78_name: Parameter name - :param parameter78_value: Parameter value - :param parameter79_name: Parameter name - :param parameter79_value: Parameter value - :param parameter80_name: Parameter name - :param parameter80_value: Parameter value - :param parameter81_name: Parameter name - :param parameter81_value: Parameter value - :param parameter82_name: Parameter name - :param parameter82_value: Parameter value - :param parameter83_name: Parameter name - :param parameter83_value: Parameter value - :param parameter84_name: Parameter name - :param parameter84_value: Parameter value - :param parameter85_name: Parameter name - :param parameter85_value: Parameter value - :param parameter86_name: Parameter name - :param parameter86_value: Parameter value - :param parameter87_name: Parameter name - :param parameter87_value: Parameter value - :param parameter88_name: Parameter name - :param parameter88_value: Parameter value - :param parameter89_name: Parameter name - :param parameter89_value: Parameter value - :param parameter90_name: Parameter name - :param parameter90_value: Parameter value - :param parameter91_name: Parameter name - :param parameter91_value: Parameter value - :param parameter92_name: Parameter name - :param parameter92_value: Parameter value - :param parameter93_name: Parameter name - :param parameter93_value: Parameter value - :param parameter94_name: Parameter name - :param parameter94_value: Parameter value - :param parameter95_name: Parameter name - :param parameter95_value: Parameter value - :param parameter96_name: Parameter name - :param parameter96_value: Parameter value - :param parameter97_name: Parameter name - :param parameter97_value: Parameter value - :param parameter98_name: Parameter name - :param parameter98_value: Parameter value - :param parameter99_name: Parameter name - :param parameter99_value: Parameter value + :param enable_automatic_punctuation: The provider will add punctuation to recognition result :returns: The created TranscriptionInstance """ @@ -695,204 +299,6 @@ def create( "EnableAutomaticPunctuation": serialize.boolean_to_string( enable_automatic_punctuation ), - "Parameter1.Name": parameter1_name, - "Parameter1.Value": parameter1_value, - "Parameter2.Name": parameter2_name, - "Parameter2.Value": parameter2_value, - "Parameter3.Name": parameter3_name, - "Parameter3.Value": parameter3_value, - "Parameter4.Name": parameter4_name, - "Parameter4.Value": parameter4_value, - "Parameter5.Name": parameter5_name, - "Parameter5.Value": parameter5_value, - "Parameter6.Name": parameter6_name, - "Parameter6.Value": parameter6_value, - "Parameter7.Name": parameter7_name, - "Parameter7.Value": parameter7_value, - "Parameter8.Name": parameter8_name, - "Parameter8.Value": parameter8_value, - "Parameter9.Name": parameter9_name, - "Parameter9.Value": parameter9_value, - "Parameter10.Name": parameter10_name, - "Parameter10.Value": parameter10_value, - "Parameter11.Name": parameter11_name, - "Parameter11.Value": parameter11_value, - "Parameter12.Name": parameter12_name, - "Parameter12.Value": parameter12_value, - "Parameter13.Name": parameter13_name, - "Parameter13.Value": parameter13_value, - "Parameter14.Name": parameter14_name, - "Parameter14.Value": parameter14_value, - "Parameter15.Name": parameter15_name, - "Parameter15.Value": parameter15_value, - "Parameter16.Name": parameter16_name, - "Parameter16.Value": parameter16_value, - "Parameter17.Name": parameter17_name, - "Parameter17.Value": parameter17_value, - "Parameter18.Name": parameter18_name, - "Parameter18.Value": parameter18_value, - "Parameter19.Name": parameter19_name, - "Parameter19.Value": parameter19_value, - "Parameter20.Name": parameter20_name, - "Parameter20.Value": parameter20_value, - "Parameter21.Name": parameter21_name, - "Parameter21.Value": parameter21_value, - "Parameter22.Name": parameter22_name, - "Parameter22.Value": parameter22_value, - "Parameter23.Name": parameter23_name, - "Parameter23.Value": parameter23_value, - "Parameter24.Name": parameter24_name, - "Parameter24.Value": parameter24_value, - "Parameter25.Name": parameter25_name, - "Parameter25.Value": parameter25_value, - "Parameter26.Name": parameter26_name, - "Parameter26.Value": parameter26_value, - "Parameter27.Name": parameter27_name, - "Parameter27.Value": parameter27_value, - "Parameter28.Name": parameter28_name, - "Parameter28.Value": parameter28_value, - "Parameter29.Name": parameter29_name, - "Parameter29.Value": parameter29_value, - "Parameter30.Name": parameter30_name, - "Parameter30.Value": parameter30_value, - "Parameter31.Name": parameter31_name, - "Parameter31.Value": parameter31_value, - "Parameter32.Name": parameter32_name, - "Parameter32.Value": parameter32_value, - "Parameter33.Name": parameter33_name, - "Parameter33.Value": parameter33_value, - "Parameter34.Name": parameter34_name, - "Parameter34.Value": parameter34_value, - "Parameter35.Name": parameter35_name, - "Parameter35.Value": parameter35_value, - "Parameter36.Name": parameter36_name, - "Parameter36.Value": parameter36_value, - "Parameter37.Name": parameter37_name, - "Parameter37.Value": parameter37_value, - "Parameter38.Name": parameter38_name, - "Parameter38.Value": parameter38_value, - "Parameter39.Name": parameter39_name, - "Parameter39.Value": parameter39_value, - "Parameter40.Name": parameter40_name, - "Parameter40.Value": parameter40_value, - "Parameter41.Name": parameter41_name, - "Parameter41.Value": parameter41_value, - "Parameter42.Name": parameter42_name, - "Parameter42.Value": parameter42_value, - "Parameter43.Name": parameter43_name, - "Parameter43.Value": parameter43_value, - "Parameter44.Name": parameter44_name, - "Parameter44.Value": parameter44_value, - "Parameter45.Name": parameter45_name, - "Parameter45.Value": parameter45_value, - "Parameter46.Name": parameter46_name, - "Parameter46.Value": parameter46_value, - "Parameter47.Name": parameter47_name, - "Parameter47.Value": parameter47_value, - "Parameter48.Name": parameter48_name, - "Parameter48.Value": parameter48_value, - "Parameter49.Name": parameter49_name, - "Parameter49.Value": parameter49_value, - "Parameter50.Name": parameter50_name, - "Parameter50.Value": parameter50_value, - "Parameter51.Name": parameter51_name, - "Parameter51.Value": parameter51_value, - "Parameter52.Name": parameter52_name, - "Parameter52.Value": parameter52_value, - "Parameter53.Name": parameter53_name, - "Parameter53.Value": parameter53_value, - "Parameter54.Name": parameter54_name, - "Parameter54.Value": parameter54_value, - "Parameter55.Name": parameter55_name, - "Parameter55.Value": parameter55_value, - "Parameter56.Name": parameter56_name, - "Parameter56.Value": parameter56_value, - "Parameter57.Name": parameter57_name, - "Parameter57.Value": parameter57_value, - "Parameter58.Name": parameter58_name, - "Parameter58.Value": parameter58_value, - "Parameter59.Name": parameter59_name, - "Parameter59.Value": parameter59_value, - "Parameter60.Name": parameter60_name, - "Parameter60.Value": parameter60_value, - "Parameter61.Name": parameter61_name, - "Parameter61.Value": parameter61_value, - "Parameter62.Name": parameter62_name, - "Parameter62.Value": parameter62_value, - "Parameter63.Name": parameter63_name, - "Parameter63.Value": parameter63_value, - "Parameter64.Name": parameter64_name, - "Parameter64.Value": parameter64_value, - "Parameter65.Name": parameter65_name, - "Parameter65.Value": parameter65_value, - "Parameter66.Name": parameter66_name, - "Parameter66.Value": parameter66_value, - "Parameter67.Name": parameter67_name, - "Parameter67.Value": parameter67_value, - "Parameter68.Name": parameter68_name, - "Parameter68.Value": parameter68_value, - "Parameter69.Name": parameter69_name, - "Parameter69.Value": parameter69_value, - "Parameter70.Name": parameter70_name, - "Parameter70.Value": parameter70_value, - "Parameter71.Name": parameter71_name, - "Parameter71.Value": parameter71_value, - "Parameter72.Name": parameter72_name, - "Parameter72.Value": parameter72_value, - "Parameter73.Name": parameter73_name, - "Parameter73.Value": parameter73_value, - "Parameter74.Name": parameter74_name, - "Parameter74.Value": parameter74_value, - "Parameter75.Name": parameter75_name, - "Parameter75.Value": parameter75_value, - "Parameter76.Name": parameter76_name, - "Parameter76.Value": parameter76_value, - "Parameter77.Name": parameter77_name, - "Parameter77.Value": parameter77_value, - "Parameter78.Name": parameter78_name, - "Parameter78.Value": parameter78_value, - "Parameter79.Name": parameter79_name, - "Parameter79.Value": parameter79_value, - "Parameter80.Name": parameter80_name, - "Parameter80.Value": parameter80_value, - "Parameter81.Name": parameter81_name, - "Parameter81.Value": parameter81_value, - "Parameter82.Name": parameter82_name, - "Parameter82.Value": parameter82_value, - "Parameter83.Name": parameter83_name, - "Parameter83.Value": parameter83_value, - "Parameter84.Name": parameter84_name, - "Parameter84.Value": parameter84_value, - "Parameter85.Name": parameter85_name, - "Parameter85.Value": parameter85_value, - "Parameter86.Name": parameter86_name, - "Parameter86.Value": parameter86_value, - "Parameter87.Name": parameter87_name, - "Parameter87.Value": parameter87_value, - "Parameter88.Name": parameter88_name, - "Parameter88.Value": parameter88_value, - "Parameter89.Name": parameter89_name, - "Parameter89.Value": parameter89_value, - "Parameter90.Name": parameter90_name, - "Parameter90.Value": parameter90_value, - "Parameter91.Name": parameter91_name, - "Parameter91.Value": parameter91_value, - "Parameter92.Name": parameter92_name, - "Parameter92.Value": parameter92_value, - "Parameter93.Name": parameter93_name, - "Parameter93.Value": parameter93_value, - "Parameter94.Name": parameter94_name, - "Parameter94.Value": parameter94_value, - "Parameter95.Name": parameter95_name, - "Parameter95.Value": parameter95_value, - "Parameter96.Name": parameter96_name, - "Parameter96.Value": parameter96_value, - "Parameter97.Name": parameter97_name, - "Parameter97.Value": parameter97_value, - "Parameter98.Name": parameter98_name, - "Parameter98.Value": parameter98_value, - "Parameter99.Name": parameter99_name, - "Parameter99.Value": parameter99_value, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -923,204 +329,6 @@ async def create_async( speech_model: Union[str, object] = values.unset, hints: Union[str, object] = values.unset, enable_automatic_punctuation: Union[bool, object] = values.unset, - parameter1_name: Union[str, object] = values.unset, - parameter1_value: Union[str, object] = values.unset, - parameter2_name: Union[str, object] = values.unset, - parameter2_value: Union[str, object] = values.unset, - parameter3_name: Union[str, object] = values.unset, - parameter3_value: Union[str, object] = values.unset, - parameter4_name: Union[str, object] = values.unset, - parameter4_value: Union[str, object] = values.unset, - parameter5_name: Union[str, object] = values.unset, - parameter5_value: Union[str, object] = values.unset, - parameter6_name: Union[str, object] = values.unset, - parameter6_value: Union[str, object] = values.unset, - parameter7_name: Union[str, object] = values.unset, - parameter7_value: Union[str, object] = values.unset, - parameter8_name: Union[str, object] = values.unset, - parameter8_value: Union[str, object] = values.unset, - parameter9_name: Union[str, object] = values.unset, - parameter9_value: Union[str, object] = values.unset, - parameter10_name: Union[str, object] = values.unset, - parameter10_value: Union[str, object] = values.unset, - parameter11_name: Union[str, object] = values.unset, - parameter11_value: Union[str, object] = values.unset, - parameter12_name: Union[str, object] = values.unset, - parameter12_value: Union[str, object] = values.unset, - parameter13_name: Union[str, object] = values.unset, - parameter13_value: Union[str, object] = values.unset, - parameter14_name: Union[str, object] = values.unset, - parameter14_value: Union[str, object] = values.unset, - parameter15_name: Union[str, object] = values.unset, - parameter15_value: Union[str, object] = values.unset, - parameter16_name: Union[str, object] = values.unset, - parameter16_value: Union[str, object] = values.unset, - parameter17_name: Union[str, object] = values.unset, - parameter17_value: Union[str, object] = values.unset, - parameter18_name: Union[str, object] = values.unset, - parameter18_value: Union[str, object] = values.unset, - parameter19_name: Union[str, object] = values.unset, - parameter19_value: Union[str, object] = values.unset, - parameter20_name: Union[str, object] = values.unset, - parameter20_value: Union[str, object] = values.unset, - parameter21_name: Union[str, object] = values.unset, - parameter21_value: Union[str, object] = values.unset, - parameter22_name: Union[str, object] = values.unset, - parameter22_value: Union[str, object] = values.unset, - parameter23_name: Union[str, object] = values.unset, - parameter23_value: Union[str, object] = values.unset, - parameter24_name: Union[str, object] = values.unset, - parameter24_value: Union[str, object] = values.unset, - parameter25_name: Union[str, object] = values.unset, - parameter25_value: Union[str, object] = values.unset, - parameter26_name: Union[str, object] = values.unset, - parameter26_value: Union[str, object] = values.unset, - parameter27_name: Union[str, object] = values.unset, - parameter27_value: Union[str, object] = values.unset, - parameter28_name: Union[str, object] = values.unset, - parameter28_value: Union[str, object] = values.unset, - parameter29_name: Union[str, object] = values.unset, - parameter29_value: Union[str, object] = values.unset, - parameter30_name: Union[str, object] = values.unset, - parameter30_value: Union[str, object] = values.unset, - parameter31_name: Union[str, object] = values.unset, - parameter31_value: Union[str, object] = values.unset, - parameter32_name: Union[str, object] = values.unset, - parameter32_value: Union[str, object] = values.unset, - parameter33_name: Union[str, object] = values.unset, - parameter33_value: Union[str, object] = values.unset, - parameter34_name: Union[str, object] = values.unset, - parameter34_value: Union[str, object] = values.unset, - parameter35_name: Union[str, object] = values.unset, - parameter35_value: Union[str, object] = values.unset, - parameter36_name: Union[str, object] = values.unset, - parameter36_value: Union[str, object] = values.unset, - parameter37_name: Union[str, object] = values.unset, - parameter37_value: Union[str, object] = values.unset, - parameter38_name: Union[str, object] = values.unset, - parameter38_value: Union[str, object] = values.unset, - parameter39_name: Union[str, object] = values.unset, - parameter39_value: Union[str, object] = values.unset, - parameter40_name: Union[str, object] = values.unset, - parameter40_value: Union[str, object] = values.unset, - parameter41_name: Union[str, object] = values.unset, - parameter41_value: Union[str, object] = values.unset, - parameter42_name: Union[str, object] = values.unset, - parameter42_value: Union[str, object] = values.unset, - parameter43_name: Union[str, object] = values.unset, - parameter43_value: Union[str, object] = values.unset, - parameter44_name: Union[str, object] = values.unset, - parameter44_value: Union[str, object] = values.unset, - parameter45_name: Union[str, object] = values.unset, - parameter45_value: Union[str, object] = values.unset, - parameter46_name: Union[str, object] = values.unset, - parameter46_value: Union[str, object] = values.unset, - parameter47_name: Union[str, object] = values.unset, - parameter47_value: Union[str, object] = values.unset, - parameter48_name: Union[str, object] = values.unset, - parameter48_value: Union[str, object] = values.unset, - parameter49_name: Union[str, object] = values.unset, - parameter49_value: Union[str, object] = values.unset, - parameter50_name: Union[str, object] = values.unset, - parameter50_value: Union[str, object] = values.unset, - parameter51_name: Union[str, object] = values.unset, - parameter51_value: Union[str, object] = values.unset, - parameter52_name: Union[str, object] = values.unset, - parameter52_value: Union[str, object] = values.unset, - parameter53_name: Union[str, object] = values.unset, - parameter53_value: Union[str, object] = values.unset, - parameter54_name: Union[str, object] = values.unset, - parameter54_value: Union[str, object] = values.unset, - parameter55_name: Union[str, object] = values.unset, - parameter55_value: Union[str, object] = values.unset, - parameter56_name: Union[str, object] = values.unset, - parameter56_value: Union[str, object] = values.unset, - parameter57_name: Union[str, object] = values.unset, - parameter57_value: Union[str, object] = values.unset, - parameter58_name: Union[str, object] = values.unset, - parameter58_value: Union[str, object] = values.unset, - parameter59_name: Union[str, object] = values.unset, - parameter59_value: Union[str, object] = values.unset, - parameter60_name: Union[str, object] = values.unset, - parameter60_value: Union[str, object] = values.unset, - parameter61_name: Union[str, object] = values.unset, - parameter61_value: Union[str, object] = values.unset, - parameter62_name: Union[str, object] = values.unset, - parameter62_value: Union[str, object] = values.unset, - parameter63_name: Union[str, object] = values.unset, - parameter63_value: Union[str, object] = values.unset, - parameter64_name: Union[str, object] = values.unset, - parameter64_value: Union[str, object] = values.unset, - parameter65_name: Union[str, object] = values.unset, - parameter65_value: Union[str, object] = values.unset, - parameter66_name: Union[str, object] = values.unset, - parameter66_value: Union[str, object] = values.unset, - parameter67_name: Union[str, object] = values.unset, - parameter67_value: Union[str, object] = values.unset, - parameter68_name: Union[str, object] = values.unset, - parameter68_value: Union[str, object] = values.unset, - parameter69_name: Union[str, object] = values.unset, - parameter69_value: Union[str, object] = values.unset, - parameter70_name: Union[str, object] = values.unset, - parameter70_value: Union[str, object] = values.unset, - parameter71_name: Union[str, object] = values.unset, - parameter71_value: Union[str, object] = values.unset, - parameter72_name: Union[str, object] = values.unset, - parameter72_value: Union[str, object] = values.unset, - parameter73_name: Union[str, object] = values.unset, - parameter73_value: Union[str, object] = values.unset, - parameter74_name: Union[str, object] = values.unset, - parameter74_value: Union[str, object] = values.unset, - parameter75_name: Union[str, object] = values.unset, - parameter75_value: Union[str, object] = values.unset, - parameter76_name: Union[str, object] = values.unset, - parameter76_value: Union[str, object] = values.unset, - parameter77_name: Union[str, object] = values.unset, - parameter77_value: Union[str, object] = values.unset, - parameter78_name: Union[str, object] = values.unset, - parameter78_value: Union[str, object] = values.unset, - parameter79_name: Union[str, object] = values.unset, - parameter79_value: Union[str, object] = values.unset, - parameter80_name: Union[str, object] = values.unset, - parameter80_value: Union[str, object] = values.unset, - parameter81_name: Union[str, object] = values.unset, - parameter81_value: Union[str, object] = values.unset, - parameter82_name: Union[str, object] = values.unset, - parameter82_value: Union[str, object] = values.unset, - parameter83_name: Union[str, object] = values.unset, - parameter83_value: Union[str, object] = values.unset, - parameter84_name: Union[str, object] = values.unset, - parameter84_value: Union[str, object] = values.unset, - parameter85_name: Union[str, object] = values.unset, - parameter85_value: Union[str, object] = values.unset, - parameter86_name: Union[str, object] = values.unset, - parameter86_value: Union[str, object] = values.unset, - parameter87_name: Union[str, object] = values.unset, - parameter87_value: Union[str, object] = values.unset, - parameter88_name: Union[str, object] = values.unset, - parameter88_value: Union[str, object] = values.unset, - parameter89_name: Union[str, object] = values.unset, - parameter89_value: Union[str, object] = values.unset, - parameter90_name: Union[str, object] = values.unset, - parameter90_value: Union[str, object] = values.unset, - parameter91_name: Union[str, object] = values.unset, - parameter91_value: Union[str, object] = values.unset, - parameter92_name: Union[str, object] = values.unset, - parameter92_value: Union[str, object] = values.unset, - parameter93_name: Union[str, object] = values.unset, - parameter93_value: Union[str, object] = values.unset, - parameter94_name: Union[str, object] = values.unset, - parameter94_value: Union[str, object] = values.unset, - parameter95_name: Union[str, object] = values.unset, - parameter95_value: Union[str, object] = values.unset, - parameter96_name: Union[str, object] = values.unset, - parameter96_value: Union[str, object] = values.unset, - parameter97_name: Union[str, object] = values.unset, - parameter97_value: Union[str, object] = values.unset, - parameter98_name: Union[str, object] = values.unset, - parameter98_value: Union[str, object] = values.unset, - parameter99_name: Union[str, object] = values.unset, - parameter99_value: Union[str, object] = values.unset, ) -> TranscriptionInstance: """ Asynchronously create the TranscriptionInstance @@ -1131,211 +339,13 @@ async def create_async( :param status_callback_method: The http method for the status_callback (one of GET, POST). :param inbound_track_label: Friendly name given to the Inbound Track :param outbound_track_label: Friendly name given to the Outbound Track - :param partial_results: Indicates if partial results are going to be send to the customer + :param partial_results: Indicates if partial results are going to be sent to the customer :param language_code: Language code used by the transcription engine, specified in [BCP-47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt) format - :param transcription_engine: Definition of the transcription engine to be used, between those supported by Twilio + :param transcription_engine: Definition of the transcription engine to be used, among those supported by Twilio :param profanity_filter: indicates if the server will attempt to filter out profanities, replacing all but the initial character in each filtered word with asterisks - :param speech_model: Recognition model used by the transcription engine, between those supported by the provider + :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. - :param enable_automatic_punctuation: The provider will adds punctuation to recognition result hypotheses - :param parameter1_name: Parameter name - :param parameter1_value: Parameter value - :param parameter2_name: Parameter name - :param parameter2_value: Parameter value - :param parameter3_name: Parameter name - :param parameter3_value: Parameter value - :param parameter4_name: Parameter name - :param parameter4_value: Parameter value - :param parameter5_name: Parameter name - :param parameter5_value: Parameter value - :param parameter6_name: Parameter name - :param parameter6_value: Parameter value - :param parameter7_name: Parameter name - :param parameter7_value: Parameter value - :param parameter8_name: Parameter name - :param parameter8_value: Parameter value - :param parameter9_name: Parameter name - :param parameter9_value: Parameter value - :param parameter10_name: Parameter name - :param parameter10_value: Parameter value - :param parameter11_name: Parameter name - :param parameter11_value: Parameter value - :param parameter12_name: Parameter name - :param parameter12_value: Parameter value - :param parameter13_name: Parameter name - :param parameter13_value: Parameter value - :param parameter14_name: Parameter name - :param parameter14_value: Parameter value - :param parameter15_name: Parameter name - :param parameter15_value: Parameter value - :param parameter16_name: Parameter name - :param parameter16_value: Parameter value - :param parameter17_name: Parameter name - :param parameter17_value: Parameter value - :param parameter18_name: Parameter name - :param parameter18_value: Parameter value - :param parameter19_name: Parameter name - :param parameter19_value: Parameter value - :param parameter20_name: Parameter name - :param parameter20_value: Parameter value - :param parameter21_name: Parameter name - :param parameter21_value: Parameter value - :param parameter22_name: Parameter name - :param parameter22_value: Parameter value - :param parameter23_name: Parameter name - :param parameter23_value: Parameter value - :param parameter24_name: Parameter name - :param parameter24_value: Parameter value - :param parameter25_name: Parameter name - :param parameter25_value: Parameter value - :param parameter26_name: Parameter name - :param parameter26_value: Parameter value - :param parameter27_name: Parameter name - :param parameter27_value: Parameter value - :param parameter28_name: Parameter name - :param parameter28_value: Parameter value - :param parameter29_name: Parameter name - :param parameter29_value: Parameter value - :param parameter30_name: Parameter name - :param parameter30_value: Parameter value - :param parameter31_name: Parameter name - :param parameter31_value: Parameter value - :param parameter32_name: Parameter name - :param parameter32_value: Parameter value - :param parameter33_name: Parameter name - :param parameter33_value: Parameter value - :param parameter34_name: Parameter name - :param parameter34_value: Parameter value - :param parameter35_name: Parameter name - :param parameter35_value: Parameter value - :param parameter36_name: Parameter name - :param parameter36_value: Parameter value - :param parameter37_name: Parameter name - :param parameter37_value: Parameter value - :param parameter38_name: Parameter name - :param parameter38_value: Parameter value - :param parameter39_name: Parameter name - :param parameter39_value: Parameter value - :param parameter40_name: Parameter name - :param parameter40_value: Parameter value - :param parameter41_name: Parameter name - :param parameter41_value: Parameter value - :param parameter42_name: Parameter name - :param parameter42_value: Parameter value - :param parameter43_name: Parameter name - :param parameter43_value: Parameter value - :param parameter44_name: Parameter name - :param parameter44_value: Parameter value - :param parameter45_name: Parameter name - :param parameter45_value: Parameter value - :param parameter46_name: Parameter name - :param parameter46_value: Parameter value - :param parameter47_name: Parameter name - :param parameter47_value: Parameter value - :param parameter48_name: Parameter name - :param parameter48_value: Parameter value - :param parameter49_name: Parameter name - :param parameter49_value: Parameter value - :param parameter50_name: Parameter name - :param parameter50_value: Parameter value - :param parameter51_name: Parameter name - :param parameter51_value: Parameter value - :param parameter52_name: Parameter name - :param parameter52_value: Parameter value - :param parameter53_name: Parameter name - :param parameter53_value: Parameter value - :param parameter54_name: Parameter name - :param parameter54_value: Parameter value - :param parameter55_name: Parameter name - :param parameter55_value: Parameter value - :param parameter56_name: Parameter name - :param parameter56_value: Parameter value - :param parameter57_name: Parameter name - :param parameter57_value: Parameter value - :param parameter58_name: Parameter name - :param parameter58_value: Parameter value - :param parameter59_name: Parameter name - :param parameter59_value: Parameter value - :param parameter60_name: Parameter name - :param parameter60_value: Parameter value - :param parameter61_name: Parameter name - :param parameter61_value: Parameter value - :param parameter62_name: Parameter name - :param parameter62_value: Parameter value - :param parameter63_name: Parameter name - :param parameter63_value: Parameter value - :param parameter64_name: Parameter name - :param parameter64_value: Parameter value - :param parameter65_name: Parameter name - :param parameter65_value: Parameter value - :param parameter66_name: Parameter name - :param parameter66_value: Parameter value - :param parameter67_name: Parameter name - :param parameter67_value: Parameter value - :param parameter68_name: Parameter name - :param parameter68_value: Parameter value - :param parameter69_name: Parameter name - :param parameter69_value: Parameter value - :param parameter70_name: Parameter name - :param parameter70_value: Parameter value - :param parameter71_name: Parameter name - :param parameter71_value: Parameter value - :param parameter72_name: Parameter name - :param parameter72_value: Parameter value - :param parameter73_name: Parameter name - :param parameter73_value: Parameter value - :param parameter74_name: Parameter name - :param parameter74_value: Parameter value - :param parameter75_name: Parameter name - :param parameter75_value: Parameter value - :param parameter76_name: Parameter name - :param parameter76_value: Parameter value - :param parameter77_name: Parameter name - :param parameter77_value: Parameter value - :param parameter78_name: Parameter name - :param parameter78_value: Parameter value - :param parameter79_name: Parameter name - :param parameter79_value: Parameter value - :param parameter80_name: Parameter name - :param parameter80_value: Parameter value - :param parameter81_name: Parameter name - :param parameter81_value: Parameter value - :param parameter82_name: Parameter name - :param parameter82_value: Parameter value - :param parameter83_name: Parameter name - :param parameter83_value: Parameter value - :param parameter84_name: Parameter name - :param parameter84_value: Parameter value - :param parameter85_name: Parameter name - :param parameter85_value: Parameter value - :param parameter86_name: Parameter name - :param parameter86_value: Parameter value - :param parameter87_name: Parameter name - :param parameter87_value: Parameter value - :param parameter88_name: Parameter name - :param parameter88_value: Parameter value - :param parameter89_name: Parameter name - :param parameter89_value: Parameter value - :param parameter90_name: Parameter name - :param parameter90_value: Parameter value - :param parameter91_name: Parameter name - :param parameter91_value: Parameter value - :param parameter92_name: Parameter name - :param parameter92_value: Parameter value - :param parameter93_name: Parameter name - :param parameter93_value: Parameter value - :param parameter94_name: Parameter name - :param parameter94_value: Parameter value - :param parameter95_name: Parameter name - :param parameter95_value: Parameter value - :param parameter96_name: Parameter name - :param parameter96_value: Parameter value - :param parameter97_name: Parameter name - :param parameter97_value: Parameter value - :param parameter98_name: Parameter name - :param parameter98_value: Parameter value - :param parameter99_name: Parameter name - :param parameter99_value: Parameter value + :param enable_automatic_punctuation: The provider will add punctuation to recognition result :returns: The created TranscriptionInstance """ @@ -1357,204 +367,6 @@ async def create_async( "EnableAutomaticPunctuation": serialize.boolean_to_string( enable_automatic_punctuation ), - "Parameter1.Name": parameter1_name, - "Parameter1.Value": parameter1_value, - "Parameter2.Name": parameter2_name, - "Parameter2.Value": parameter2_value, - "Parameter3.Name": parameter3_name, - "Parameter3.Value": parameter3_value, - "Parameter4.Name": parameter4_name, - "Parameter4.Value": parameter4_value, - "Parameter5.Name": parameter5_name, - "Parameter5.Value": parameter5_value, - "Parameter6.Name": parameter6_name, - "Parameter6.Value": parameter6_value, - "Parameter7.Name": parameter7_name, - "Parameter7.Value": parameter7_value, - "Parameter8.Name": parameter8_name, - "Parameter8.Value": parameter8_value, - "Parameter9.Name": parameter9_name, - "Parameter9.Value": parameter9_value, - "Parameter10.Name": parameter10_name, - "Parameter10.Value": parameter10_value, - "Parameter11.Name": parameter11_name, - "Parameter11.Value": parameter11_value, - "Parameter12.Name": parameter12_name, - "Parameter12.Value": parameter12_value, - "Parameter13.Name": parameter13_name, - "Parameter13.Value": parameter13_value, - "Parameter14.Name": parameter14_name, - "Parameter14.Value": parameter14_value, - "Parameter15.Name": parameter15_name, - "Parameter15.Value": parameter15_value, - "Parameter16.Name": parameter16_name, - "Parameter16.Value": parameter16_value, - "Parameter17.Name": parameter17_name, - "Parameter17.Value": parameter17_value, - "Parameter18.Name": parameter18_name, - "Parameter18.Value": parameter18_value, - "Parameter19.Name": parameter19_name, - "Parameter19.Value": parameter19_value, - "Parameter20.Name": parameter20_name, - "Parameter20.Value": parameter20_value, - "Parameter21.Name": parameter21_name, - "Parameter21.Value": parameter21_value, - "Parameter22.Name": parameter22_name, - "Parameter22.Value": parameter22_value, - "Parameter23.Name": parameter23_name, - "Parameter23.Value": parameter23_value, - "Parameter24.Name": parameter24_name, - "Parameter24.Value": parameter24_value, - "Parameter25.Name": parameter25_name, - "Parameter25.Value": parameter25_value, - "Parameter26.Name": parameter26_name, - "Parameter26.Value": parameter26_value, - "Parameter27.Name": parameter27_name, - "Parameter27.Value": parameter27_value, - "Parameter28.Name": parameter28_name, - "Parameter28.Value": parameter28_value, - "Parameter29.Name": parameter29_name, - "Parameter29.Value": parameter29_value, - "Parameter30.Name": parameter30_name, - "Parameter30.Value": parameter30_value, - "Parameter31.Name": parameter31_name, - "Parameter31.Value": parameter31_value, - "Parameter32.Name": parameter32_name, - "Parameter32.Value": parameter32_value, - "Parameter33.Name": parameter33_name, - "Parameter33.Value": parameter33_value, - "Parameter34.Name": parameter34_name, - "Parameter34.Value": parameter34_value, - "Parameter35.Name": parameter35_name, - "Parameter35.Value": parameter35_value, - "Parameter36.Name": parameter36_name, - "Parameter36.Value": parameter36_value, - "Parameter37.Name": parameter37_name, - "Parameter37.Value": parameter37_value, - "Parameter38.Name": parameter38_name, - "Parameter38.Value": parameter38_value, - "Parameter39.Name": parameter39_name, - "Parameter39.Value": parameter39_value, - "Parameter40.Name": parameter40_name, - "Parameter40.Value": parameter40_value, - "Parameter41.Name": parameter41_name, - "Parameter41.Value": parameter41_value, - "Parameter42.Name": parameter42_name, - "Parameter42.Value": parameter42_value, - "Parameter43.Name": parameter43_name, - "Parameter43.Value": parameter43_value, - "Parameter44.Name": parameter44_name, - "Parameter44.Value": parameter44_value, - "Parameter45.Name": parameter45_name, - "Parameter45.Value": parameter45_value, - "Parameter46.Name": parameter46_name, - "Parameter46.Value": parameter46_value, - "Parameter47.Name": parameter47_name, - "Parameter47.Value": parameter47_value, - "Parameter48.Name": parameter48_name, - "Parameter48.Value": parameter48_value, - "Parameter49.Name": parameter49_name, - "Parameter49.Value": parameter49_value, - "Parameter50.Name": parameter50_name, - "Parameter50.Value": parameter50_value, - "Parameter51.Name": parameter51_name, - "Parameter51.Value": parameter51_value, - "Parameter52.Name": parameter52_name, - "Parameter52.Value": parameter52_value, - "Parameter53.Name": parameter53_name, - "Parameter53.Value": parameter53_value, - "Parameter54.Name": parameter54_name, - "Parameter54.Value": parameter54_value, - "Parameter55.Name": parameter55_name, - "Parameter55.Value": parameter55_value, - "Parameter56.Name": parameter56_name, - "Parameter56.Value": parameter56_value, - "Parameter57.Name": parameter57_name, - "Parameter57.Value": parameter57_value, - "Parameter58.Name": parameter58_name, - "Parameter58.Value": parameter58_value, - "Parameter59.Name": parameter59_name, - "Parameter59.Value": parameter59_value, - "Parameter60.Name": parameter60_name, - "Parameter60.Value": parameter60_value, - "Parameter61.Name": parameter61_name, - "Parameter61.Value": parameter61_value, - "Parameter62.Name": parameter62_name, - "Parameter62.Value": parameter62_value, - "Parameter63.Name": parameter63_name, - "Parameter63.Value": parameter63_value, - "Parameter64.Name": parameter64_name, - "Parameter64.Value": parameter64_value, - "Parameter65.Name": parameter65_name, - "Parameter65.Value": parameter65_value, - "Parameter66.Name": parameter66_name, - "Parameter66.Value": parameter66_value, - "Parameter67.Name": parameter67_name, - "Parameter67.Value": parameter67_value, - "Parameter68.Name": parameter68_name, - "Parameter68.Value": parameter68_value, - "Parameter69.Name": parameter69_name, - "Parameter69.Value": parameter69_value, - "Parameter70.Name": parameter70_name, - "Parameter70.Value": parameter70_value, - "Parameter71.Name": parameter71_name, - "Parameter71.Value": parameter71_value, - "Parameter72.Name": parameter72_name, - "Parameter72.Value": parameter72_value, - "Parameter73.Name": parameter73_name, - "Parameter73.Value": parameter73_value, - "Parameter74.Name": parameter74_name, - "Parameter74.Value": parameter74_value, - "Parameter75.Name": parameter75_name, - "Parameter75.Value": parameter75_value, - "Parameter76.Name": parameter76_name, - "Parameter76.Value": parameter76_value, - "Parameter77.Name": parameter77_name, - "Parameter77.Value": parameter77_value, - "Parameter78.Name": parameter78_name, - "Parameter78.Value": parameter78_value, - "Parameter79.Name": parameter79_name, - "Parameter79.Value": parameter79_value, - "Parameter80.Name": parameter80_name, - "Parameter80.Value": parameter80_value, - "Parameter81.Name": parameter81_name, - "Parameter81.Value": parameter81_value, - "Parameter82.Name": parameter82_name, - "Parameter82.Value": parameter82_value, - "Parameter83.Name": parameter83_name, - "Parameter83.Value": parameter83_value, - "Parameter84.Name": parameter84_name, - "Parameter84.Value": parameter84_value, - "Parameter85.Name": parameter85_name, - "Parameter85.Value": parameter85_value, - "Parameter86.Name": parameter86_name, - "Parameter86.Value": parameter86_value, - "Parameter87.Name": parameter87_name, - "Parameter87.Value": parameter87_value, - "Parameter88.Name": parameter88_name, - "Parameter88.Value": parameter88_value, - "Parameter89.Name": parameter89_name, - "Parameter89.Value": parameter89_value, - "Parameter90.Name": parameter90_name, - "Parameter90.Value": parameter90_value, - "Parameter91.Name": parameter91_name, - "Parameter91.Value": parameter91_value, - "Parameter92.Name": parameter92_name, - "Parameter92.Value": parameter92_value, - "Parameter93.Name": parameter93_name, - "Parameter93.Value": parameter93_value, - "Parameter94.Name": parameter94_name, - "Parameter94.Value": parameter94_value, - "Parameter95.Name": parameter95_name, - "Parameter95.Value": parameter95_value, - "Parameter96.Name": parameter96_name, - "Parameter96.Value": parameter96_value, - "Parameter97.Name": parameter97_name, - "Parameter97.Value": parameter97_value, - "Parameter98.Name": parameter98_name, - "Parameter98.Value": parameter98_value, - "Parameter99.Name": parameter99_name, - "Parameter99.Value": parameter99_value, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 7eb11d3889..1b6d3aea81 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -73,7 +73,7 @@ class UpdateStatus(object): :ivar to: The recipient's phone number (in [E.164](https://en.wikipedia.org/wiki/E.164) format) or [channel address](https://www.twilio.com/docs/messaging/channels) (e.g. `whatsapp:+15552229999`) :ivar date_updated: The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message resource was last updated :ivar price: The amount billed for the message in the currency specified by `price_unit`. The `price` is populated after the message has been sent/received, and may not be immediately availalble. View the [Pricing page](https://www.twilio.com/en-us/pricing) for more details. - :ivar error_message: The description of the `error_code` if the Message `status` is `failed` or `undelivered`. If no error was encountered, the value is `null`. + :ivar error_message: The description of the `error_code` if the Message `status` is `failed` or `undelivered`. If no error was encountered, the value is `null`. The value returned in this field for a specific error cause is subject to change as Twilio improves errors. Users should not use the `error_code` and `error_message` fields programmatically. :ivar uri: The URI of the Message resource, relative to `https://api.twilio.com`. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) associated with the Message resource :ivar num_media: The number of media files associated with the Message resource. @@ -82,7 +82,7 @@ class UpdateStatus(object): :ivar sid: The unique, Twilio-provided string that identifies the Message resource. :ivar date_sent: The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message was sent. For an outgoing message, this is when Twilio sent the message. For an incoming message, this is when Twilio sent the HTTP request to your incoming message webhook URL. :ivar date_created: The [RFC 2822](https://datatracker.ietf.org/doc/html/rfc2822#section-3.3) timestamp (in GMT) of when the Message resource was created - :ivar error_code: The [error code](https://www.twilio.com/docs/api/errors) returned if the Message `status` is `failed` or `undelivered`. If no error was encountered, the value is `null`. + :ivar error_code: The [error code](https://www.twilio.com/docs/api/errors) returned if the Message `status` is `failed` or `undelivered`. If no error was encountered, the value is `null`. The value returned in this field for a specific error cause is subject to change as Twilio improves errors. Users should not use the `error_code` and `error_message` fields programmatically. :ivar price_unit: The currency in which `price` is measured, in [ISO 4127](https://www.iso.org/iso/home/standards/currency_codes.htm) format (e.g. `usd`, `eur`, `jpy`). :ivar api_version: The API version used to process the Message :ivar subresource_uris: A list of related resources identified by their URIs relative to `https://api.twilio.com` diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/payload.py b/twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py similarity index 96% rename from twilio/rest/api/v2010/account/recording/add_on_result/payload.py rename to twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py index 1dc26e1d7b..9008f6a688 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/payload.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py @@ -20,6 +20,7 @@ from twilio.base.list_resource import ListResource from twilio.base.version import Version from twilio.base.page import Page +from twilio.rest.api.v2010.account.recording.add_on_result.payload.data import DataList class PayloadInstance(InstanceResource): @@ -130,6 +131,13 @@ async def fetch_async(self) -> "PayloadInstance": """ return await self._proxy.fetch_async() + @property + def data(self) -> DataList: + """ + Access the data + """ + return self._proxy.data + def __repr__(self) -> str: """ Provide a friendly representation @@ -172,6 +180,8 @@ def __init__( **self._solution ) + self._data: Optional[DataList] = None + def delete(self) -> bool: """ Deletes the PayloadInstance @@ -240,6 +250,21 @@ async def fetch_async(self) -> PayloadInstance: sid=self._solution["sid"], ) + @property + def data(self) -> DataList: + """ + Access the data + """ + if self._data is None: + self._data = DataList( + self._version, + self._solution["account_sid"], + self._solution["reference_sid"], + self._solution["add_on_result_sid"], + self._solution["sid"], + ) + return self._data + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/payload/data.py b/twilio/rest/api/v2010/account/recording/add_on_result/payload/data.py new file mode 100644 index 0000000000..1cc931a693 --- /dev/null +++ b/twilio/rest/api/v2010/account/recording/add_on_result/payload/data.py @@ -0,0 +1,242 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Api + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class DataInstance(InstanceResource): + """ + :ivar redirect_to: The URL to redirect to to get the data returned by the AddOn that was previously stored. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + account_sid: str, + reference_sid: str, + add_on_result_sid: str, + payload_sid: str, + ): + super().__init__(version) + + self.redirect_to: Optional[str] = payload.get("redirect_to") + + self._solution = { + "account_sid": account_sid, + "reference_sid": reference_sid, + "add_on_result_sid": add_on_result_sid, + "payload_sid": payload_sid, + } + self._context: Optional[DataContext] = None + + @property + def _proxy(self) -> "DataContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: DataContext for this DataInstance + """ + if self._context is None: + self._context = DataContext( + self._version, + account_sid=self._solution["account_sid"], + reference_sid=self._solution["reference_sid"], + add_on_result_sid=self._solution["add_on_result_sid"], + payload_sid=self._solution["payload_sid"], + ) + return self._context + + def fetch(self) -> "DataInstance": + """ + Fetch the DataInstance + + + :returns: The fetched DataInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "DataInstance": + """ + Asynchronous coroutine to fetch the DataInstance + + + :returns: The fetched DataInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class DataContext(InstanceContext): + + def __init__( + self, + version: Version, + account_sid: str, + reference_sid: str, + add_on_result_sid: str, + payload_sid: str, + ): + """ + Initialize the DataContext + + :param version: Version that contains the resource + :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resource to fetch. + :param reference_sid: The SID of the recording to which the AddOnResult resource that contains the payload to fetch belongs. + :param add_on_result_sid: The SID of the AddOnResult to which the payload to fetch belongs. + :param payload_sid: The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to fetch. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "account_sid": account_sid, + "reference_sid": reference_sid, + "add_on_result_sid": add_on_result_sid, + "payload_sid": payload_sid, + } + self._uri = "/Accounts/{account_sid}/Recordings/{reference_sid}/AddOnResults/{add_on_result_sid}/Payloads/{payload_sid}/Data.json".format( + **self._solution + ) + + def fetch(self) -> DataInstance: + """ + Fetch the DataInstance + + + :returns: The fetched DataInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return DataInstance( + self._version, + payload, + account_sid=self._solution["account_sid"], + reference_sid=self._solution["reference_sid"], + add_on_result_sid=self._solution["add_on_result_sid"], + payload_sid=self._solution["payload_sid"], + ) + + async def fetch_async(self) -> DataInstance: + """ + Asynchronous coroutine to fetch the DataInstance + + + :returns: The fetched DataInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return DataInstance( + self._version, + payload, + account_sid=self._solution["account_sid"], + reference_sid=self._solution["reference_sid"], + add_on_result_sid=self._solution["add_on_result_sid"], + payload_sid=self._solution["payload_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class DataList(ListResource): + + def __init__( + self, + version: Version, + account_sid: str, + reference_sid: str, + add_on_result_sid: str, + payload_sid: str, + ): + """ + Initialize the DataList + + :param version: Version that contains the resource + :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Recording AddOnResult Payload resource to fetch. + :param reference_sid: The SID of the recording to which the AddOnResult resource that contains the payload to fetch belongs. + :param add_on_result_sid: The SID of the AddOnResult to which the payload to fetch belongs. + :param payload_sid: The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to fetch. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "account_sid": account_sid, + "reference_sid": reference_sid, + "add_on_result_sid": add_on_result_sid, + "payload_sid": payload_sid, + } + + def get(self) -> DataContext: + """ + Constructs a DataContext + + """ + return DataContext( + self._version, + account_sid=self._solution["account_sid"], + reference_sid=self._solution["reference_sid"], + add_on_result_sid=self._solution["add_on_result_sid"], + payload_sid=self._solution["payload_sid"], + ) + + def __call__(self) -> DataContext: + """ + Constructs a DataContext + + """ + return DataContext( + self._version, + account_sid=self._solution["account_sid"], + reference_sid=self._solution["reference_sid"], + add_on_result_sid=self._solution["add_on_result_sid"], + payload_sid=self._solution["payload_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 0fcbd1c19e..f2dec12761 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -38,6 +38,11 @@ class CardActionType(object): PHONE_NUMBER = "PHONE_NUMBER" QUICK_REPLY = "QUICK_REPLY" + class CarouselActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + QUICK_REPLY = "QUICK_REPLY" + class QuickReplyActionType(object): QUICK_REPLY = "QUICK_REPLY" @@ -297,7 +302,7 @@ class AuthenticationAction(object): :ivar copy_code_text: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.type: Optional["ContentInstance.AuthenticationActionType"] = ( payload.get("type") @@ -319,7 +324,7 @@ class CallToActionAction(object): :ivar id: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.type: Optional["ContentInstance.CallToActionActionType"] = payload.get( "type" @@ -347,7 +352,7 @@ class CardAction(object): :ivar id: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.type: Optional["ContentInstance.CardActionType"] = payload.get("type") self.title: Optional[str] = payload.get("title") @@ -364,6 +369,59 @@ def to_dict(self): "id": self.id, } + class CarouselAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.CarouselActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type, + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class CarouselCard(object): + """ + :ivar title: + :ivar body: + :ivar media: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.title: Optional[str] = payload.get("title") + self.body: Optional[str] = payload.get("body") + self.media: Optional[str] = payload.get("media") + self.actions: Optional[List[ContentList.CarouselAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "title": self.title, + "body": self.body, + "media": self.media, + "actions": [actions.to_dict() for actions in self.actions], + } + class CatalogItem(object): """ :ivar id: @@ -374,7 +432,7 @@ class CatalogItem(object): :ivar description: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.id: Optional[str] = payload.get("id") self.section_title: Optional[str] = payload.get("section_title") @@ -401,7 +459,7 @@ class ContentCreateRequest(object): :ivar types: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.friendly_name: Optional[str] = payload.get("friendly_name") self.variables: Optional[dict[str, str]] = payload.get("variables") @@ -423,7 +481,7 @@ class ListItem(object): :ivar description: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.id: Optional[str] = payload.get("id") self.item: Optional[str] = payload.get("item") @@ -443,7 +501,7 @@ class QuickReplyAction(object): :ivar id: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.type: Optional["ContentInstance.QuickReplyActionType"] = payload.get( "type" @@ -464,7 +522,7 @@ class TwilioCallToAction(object): :ivar actions: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.body: Optional[str] = payload.get("body") self.actions: Optional[List[ContentList.CallToActionAction]] = payload.get( @@ -485,7 +543,7 @@ class TwilioCard(object): :ivar actions: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.title: Optional[str] = payload.get("title") self.subtitle: Optional[str] = payload.get("subtitle") @@ -502,6 +560,23 @@ def to_dict(self): "actions": [actions.to_dict() for actions in self.actions], } + class TwilioCarousel(object): + """ + :ivar body: + :ivar cards: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.cards: Optional[List[ContentList.CarouselCard]] = payload.get("cards") + + def to_dict(self): + return { + "body": self.body, + "cards": [cards.to_dict() for cards in self.cards], + } + class TwilioCatalog(object): """ :ivar title: @@ -512,7 +587,7 @@ class TwilioCatalog(object): :ivar dynamic_items: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.title: Optional[str] = payload.get("title") self.body: Optional[str] = payload.get("body") @@ -538,7 +613,7 @@ class TwilioListPicker(object): :ivar items: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.body: Optional[str] = payload.get("body") self.button: Optional[str] = payload.get("button") @@ -558,7 +633,7 @@ class TwilioLocation(object): :ivar label: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.latitude: Optional[float] = payload.get("latitude") self.longitude: Optional[float] = payload.get("longitude") @@ -577,7 +652,7 @@ class TwilioMedia(object): :ivar media: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.body: Optional[str] = payload.get("body") self.media: Optional[List[str]] = payload.get("media") @@ -594,7 +669,7 @@ class TwilioQuickReply(object): :ivar actions: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.body: Optional[str] = payload.get("body") self.actions: Optional[List[ContentList.QuickReplyAction]] = payload.get( @@ -612,7 +687,7 @@ class TwilioText(object): :ivar body: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.body: Optional[str] = payload.get("body") @@ -631,11 +706,12 @@ class Types(object): :ivar twilio_quick_reply: :ivar twilio_card: :ivar twilio_catalog: + :ivar twilio_carousel: :ivar whatsapp_card: :ivar whatsapp_authentication: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.twilio_text: Optional[ContentList.TwilioText] = payload.get( "twilio_text" @@ -661,6 +737,9 @@ def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): self.twilio_catalog: Optional[ContentList.TwilioCatalog] = payload.get( "twilio_catalog" ) + self.twilio_carousel: Optional[ContentList.TwilioCarousel] = payload.get( + "twilio_carousel" + ) self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( "whatsapp_card" ) @@ -678,6 +757,7 @@ def to_dict(self): "twilio_quick_reply": self.twilio_quick_reply.to_dict(), "twilio_card": self.twilio_card.to_dict(), "twilio_catalog": self.twilio_catalog.to_dict(), + "twilio_carousel": self.twilio_carousel.to_dict(), "whatsapp_card": self.whatsapp_card.to_dict(), "whatsapp_authentication": self.whatsapp_authentication.to_dict(), } @@ -689,7 +769,7 @@ class WhatsappAuthentication(object): :ivar actions: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.add_security_recommendation: Optional[bool] = payload.get( "add_security_recommendation" @@ -717,7 +797,7 @@ class WhatsappCard(object): :ivar actions: """ - def __init__(self, payload: Dict[str, Any], sid: Optional[str] = None): + def __init__(self, payload: Dict[str, Any]): self.body: Optional[str] = payload.get("body") self.footer: Optional[str] = payload.get("footer") diff --git a/twilio/rest/content/v1/content/approval_create.py b/twilio/rest/content/v1/content/approval_create.py index 6e28052e0d..4f22f2df14 100644 --- a/twilio/rest/content/v1/content/approval_create.py +++ b/twilio/rest/content/v1/content/approval_create.py @@ -64,7 +64,7 @@ class ContentApprovalRequest(object): :ivar category: A WhatsApp recognized template category. """ - def __init__(self, payload: Dict[str, Any], content_sid: str): + def __init__(self, payload: Dict[str, Any]): self.name: Optional[str] = payload.get("name") self.category: Optional[str] = payload.get("category") diff --git a/twilio/rest/flex_api/v2/flex_user.py b/twilio/rest/flex_api/v2/flex_user.py index 1acc75a8a8..0f5b1571f2 100644 --- a/twilio/rest/flex_api/v2/flex_user.py +++ b/twilio/rest/flex_api/v2/flex_user.py @@ -13,8 +13,8 @@ """ from datetime import datetime -from typing import Any, Dict, Optional -from twilio.base import deserialize +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -35,6 +35,8 @@ class FlexUserInstance(InstanceResource): :ivar username: Username of the User. :ivar email: Email of the User. :ivar friendly_name: Friendly name of the User. + :ivar locale: The locale preference of the user. + :ivar roles: The roles of the user. :ivar created_date: The date that this user was created, given in ISO 8601 format. :ivar updated_date: The date that this user was updated, given in ISO 8601 format. :ivar version: The current version of the user. @@ -62,6 +64,8 @@ def __init__( self.username: Optional[str] = payload.get("username") self.email: Optional[str] = payload.get("email") self.friendly_name: Optional[str] = payload.get("friendly_name") + self.locale: Optional[str] = payload.get("locale") + self.roles: Optional[List[str]] = payload.get("roles") self.created_date: Optional[datetime] = deserialize.iso8601_datetime( payload.get("created_date") ) @@ -111,6 +115,66 @@ async def fetch_async(self) -> "FlexUserInstance": """ return await self._proxy.fetch_async() + def update( + self, + first_name: Union[str, object] = values.unset, + last_name: Union[str, object] = values.unset, + email: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + user_sid: Union[str, object] = values.unset, + locale: Union[str, object] = values.unset, + ) -> "FlexUserInstance": + """ + Update the FlexUserInstance + + :param first_name: First name of the User. + :param last_name: Last name of the User. + :param email: Email of the User. + :param friendly_name: Friendly name of the User. + :param user_sid: The unique SID identifier of the Twilio Unified User. + :param locale: The locale preference of the user. + + :returns: The updated FlexUserInstance + """ + return self._proxy.update( + first_name=first_name, + last_name=last_name, + email=email, + friendly_name=friendly_name, + user_sid=user_sid, + locale=locale, + ) + + async def update_async( + self, + first_name: Union[str, object] = values.unset, + last_name: Union[str, object] = values.unset, + email: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + user_sid: Union[str, object] = values.unset, + locale: Union[str, object] = values.unset, + ) -> "FlexUserInstance": + """ + Asynchronous coroutine to update the FlexUserInstance + + :param first_name: First name of the User. + :param last_name: Last name of the User. + :param email: Email of the User. + :param friendly_name: Friendly name of the User. + :param user_sid: The unique SID identifier of the Twilio Unified User. + :param locale: The locale preference of the user. + + :returns: The updated FlexUserInstance + """ + return await self._proxy.update_async( + first_name=first_name, + last_name=last_name, + email=email, + friendly_name=friendly_name, + user_sid=user_sid, + locale=locale, + ) + def __repr__(self) -> str: """ Provide a friendly representation @@ -129,7 +193,7 @@ def __init__(self, version: Version, instance_sid: str, flex_user_sid: str): :param version: Version that contains the resource :param instance_sid: The unique ID created by Twilio to identify a Flex instance. - :param flex_user_sid: The unique id for the flex user to be retrieved. + :param flex_user_sid: The unique id for the flex user. """ super().__init__(version) @@ -182,6 +246,96 @@ async def fetch_async(self) -> FlexUserInstance: flex_user_sid=self._solution["flex_user_sid"], ) + def update( + self, + first_name: Union[str, object] = values.unset, + last_name: Union[str, object] = values.unset, + email: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + user_sid: Union[str, object] = values.unset, + locale: Union[str, object] = values.unset, + ) -> FlexUserInstance: + """ + Update the FlexUserInstance + + :param first_name: First name of the User. + :param last_name: Last name of the User. + :param email: Email of the User. + :param friendly_name: Friendly name of the User. + :param user_sid: The unique SID identifier of the Twilio Unified User. + :param locale: The locale preference of the user. + + :returns: The updated FlexUserInstance + """ + data = values.of( + { + "FirstName": first_name, + "LastName": last_name, + "Email": email, + "FriendlyName": friendly_name, + "UserSid": user_sid, + "Locale": locale, + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return FlexUserInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + flex_user_sid=self._solution["flex_user_sid"], + ) + + async def update_async( + self, + first_name: Union[str, object] = values.unset, + last_name: Union[str, object] = values.unset, + email: Union[str, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + user_sid: Union[str, object] = values.unset, + locale: Union[str, object] = values.unset, + ) -> FlexUserInstance: + """ + Asynchronous coroutine to update the FlexUserInstance + + :param first_name: First name of the User. + :param last_name: Last name of the User. + :param email: Email of the User. + :param friendly_name: Friendly name of the User. + :param user_sid: The unique SID identifier of the Twilio Unified User. + :param locale: The locale preference of the user. + + :returns: The updated FlexUserInstance + """ + data = values.of( + { + "FirstName": first_name, + "LastName": last_name, + "Email": email, + "FriendlyName": friendly_name, + "UserSid": user_sid, + "Locale": locale, + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return FlexUserInstance( + self._version, + payload, + instance_sid=self._solution["instance_sid"], + flex_user_sid=self._solution["flex_user_sid"], + ) + def __repr__(self) -> str: """ Provide a friendly representation @@ -208,7 +362,7 @@ def get(self, instance_sid: str, flex_user_sid: str) -> FlexUserContext: Constructs a FlexUserContext :param instance_sid: The unique ID created by Twilio to identify a Flex instance. - :param flex_user_sid: The unique id for the flex user to be retrieved. + :param flex_user_sid: The unique id for the flex user. """ return FlexUserContext( self._version, instance_sid=instance_sid, flex_user_sid=flex_user_sid @@ -219,7 +373,7 @@ def __call__(self, instance_sid: str, flex_user_sid: str) -> FlexUserContext: Constructs a FlexUserContext :param instance_sid: The unique ID created by Twilio to identify a Flex instance. - :param flex_user_sid: The unique id for the flex user to be retrieved. + :param flex_user_sid: The unique id for the flex user. """ return FlexUserContext( self._version, instance_sid=instance_sid, flex_user_sid=flex_user_sid diff --git a/twilio/rest/insights/v1/call_summaries.py b/twilio/rest/insights/v1/call_summaries.py index f68744eefc..35cf41aa49 100644 --- a/twilio/rest/insights/v1/call_summaries.py +++ b/twilio/rest/insights/v1/call_summaries.py @@ -182,7 +182,6 @@ def stream( to_carrier: Union[str, object] = values.unset, from_country_code: Union[str, object] = values.unset, to_country_code: Union[str, object] = values.unset, - branded: Union[bool, object] = values.unset, verified_caller: Union[bool, object] = values.unset, has_tag: Union[bool, object] = values.unset, start_time: Union[str, object] = values.unset, @@ -202,6 +201,15 @@ def stream( quality_issue_annotation: Union[str, object] = values.unset, spam_annotation: Union[bool, object] = values.unset, call_score_annotation: Union[str, object] = values.unset, + branded_enabled: Union[bool, object] = values.unset, + voice_integrity_enabled: Union[bool, object] = values.unset, + branded_bundle_sid: Union[str, object] = values.unset, + voice_integrity_bundle_sid: Union[str, object] = values.unset, + voice_integrity_use_case: Union[str, object] = values.unset, + business_profile_identity: Union[str, object] = values.unset, + business_profile_industry: Union[str, object] = values.unset, + business_profile_bundle_sid: Union[str, object] = values.unset, + business_profile_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[CallSummariesInstance]: @@ -217,8 +225,7 @@ def stream( :param str to_carrier: A destination carrier. :param str from_country_code: A source country code based on phone number in From. :param str to_country_code: A destination country code. Based on phone number in To. - :param bool branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. - :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. + :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.One of 'true' or 'false'. :param bool has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). :param str start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. :param str end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. @@ -235,6 +242,15 @@ def stream( :param str quality_issue_annotation: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. :param bool spam_annotation: A boolean flag indicating spam calls. :param str call_score_annotation: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + :param bool branded_enabled: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. One of 'true' or 'false' + :param bool voice_integrity_enabled: A boolean flag indicating whether or not the phone number had voice integrity enabled.One of 'true' or 'false' + :param str branded_bundle_sid: A unique SID identifier of the Branded Call. + :param str voice_integrity_bundle_sid: A unique SID identifier of the Voice Integrity Profile. + :param str voice_integrity_use_case: A Voice Integrity Use Case . Is of type enum. One of 'abandoned_cart', 'appointment_reminders', 'appointment_scheduling', 'asset_management', 'automated_support', 'call_tracking', 'click_to_call', 'contact_tracing', 'contactless_delivery', 'customer_support', 'dating/social', 'delivery_notifications', 'distance_learning', 'emergency_notifications', 'employee_notifications', 'exam_proctoring', 'field_notifications', 'first_responder', 'fraud_alerts', 'group_messaging', 'identify_&_verification', 'intelligent_routing', 'lead_alerts', 'lead_distribution', 'lead_generation', 'lead_management', 'lead_nurturing', 'marketing_events', 'mass_alerts', 'meetings/collaboration', 'order_notifications', 'outbound_dialer', 'pharmacy', 'phone_system', 'purchase_confirmation', 'remote_appointments', 'rewards_program', 'self-service', 'service_alerts', 'shift_management', 'survey/research', 'telehealth', 'telemarketing', 'therapy_(individual+group)'. + :param str business_profile_identity: A Business Identity of the calls. Is of type enum. One of 'direct_customer', 'isv_reseller_or_partner'. + :param str business_profile_industry: A Business Industry of the calls. Is of type enum. One of 'automotive', 'agriculture', 'banking', 'consumer', 'construction', 'education', 'engineering', 'energy', 'oil_and_gas', 'fast_moving_consumer_goods', 'financial', 'fintech', 'food_and_beverage', 'government', 'healthcare', 'hospitality', 'insurance', 'legal', 'manufacturing', 'media', 'online', 'professional_services', 'raw_materials', 'real_estate', 'religion', 'retail', 'jewelry', 'technology', 'telecommunications', 'transportation', 'travel', 'electronics', 'not_for_profit' + :param str business_profile_bundle_sid: A unique SID identifier of the Business Profile. + :param str business_profile_type: A Business Profile Type of the calls. Is of type enum. One of 'primary', 'secondary'. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -252,7 +268,6 @@ def stream( to_carrier=to_carrier, from_country_code=from_country_code, to_country_code=to_country_code, - branded=branded, verified_caller=verified_caller, has_tag=has_tag, start_time=start_time, @@ -270,6 +285,15 @@ def stream( quality_issue_annotation=quality_issue_annotation, spam_annotation=spam_annotation, call_score_annotation=call_score_annotation, + branded_enabled=branded_enabled, + voice_integrity_enabled=voice_integrity_enabled, + branded_bundle_sid=branded_bundle_sid, + voice_integrity_bundle_sid=voice_integrity_bundle_sid, + voice_integrity_use_case=voice_integrity_use_case, + business_profile_identity=business_profile_identity, + business_profile_industry=business_profile_industry, + business_profile_bundle_sid=business_profile_bundle_sid, + business_profile_type=business_profile_type, page_size=limits["page_size"], ) @@ -283,7 +307,6 @@ async def stream_async( to_carrier: Union[str, object] = values.unset, from_country_code: Union[str, object] = values.unset, to_country_code: Union[str, object] = values.unset, - branded: Union[bool, object] = values.unset, verified_caller: Union[bool, object] = values.unset, has_tag: Union[bool, object] = values.unset, start_time: Union[str, object] = values.unset, @@ -303,6 +326,15 @@ async def stream_async( quality_issue_annotation: Union[str, object] = values.unset, spam_annotation: Union[bool, object] = values.unset, call_score_annotation: Union[str, object] = values.unset, + branded_enabled: Union[bool, object] = values.unset, + voice_integrity_enabled: Union[bool, object] = values.unset, + branded_bundle_sid: Union[str, object] = values.unset, + voice_integrity_bundle_sid: Union[str, object] = values.unset, + voice_integrity_use_case: Union[str, object] = values.unset, + business_profile_identity: Union[str, object] = values.unset, + business_profile_industry: Union[str, object] = values.unset, + business_profile_bundle_sid: Union[str, object] = values.unset, + business_profile_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[CallSummariesInstance]: @@ -318,8 +350,7 @@ async def stream_async( :param str to_carrier: A destination carrier. :param str from_country_code: A source country code based on phone number in From. :param str to_country_code: A destination country code. Based on phone number in To. - :param bool branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. - :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. + :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.One of 'true' or 'false'. :param bool has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). :param str start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. :param str end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. @@ -336,6 +367,15 @@ async def stream_async( :param str quality_issue_annotation: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. :param bool spam_annotation: A boolean flag indicating spam calls. :param str call_score_annotation: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + :param bool branded_enabled: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. One of 'true' or 'false' + :param bool voice_integrity_enabled: A boolean flag indicating whether or not the phone number had voice integrity enabled.One of 'true' or 'false' + :param str branded_bundle_sid: A unique SID identifier of the Branded Call. + :param str voice_integrity_bundle_sid: A unique SID identifier of the Voice Integrity Profile. + :param str voice_integrity_use_case: A Voice Integrity Use Case . Is of type enum. One of 'abandoned_cart', 'appointment_reminders', 'appointment_scheduling', 'asset_management', 'automated_support', 'call_tracking', 'click_to_call', 'contact_tracing', 'contactless_delivery', 'customer_support', 'dating/social', 'delivery_notifications', 'distance_learning', 'emergency_notifications', 'employee_notifications', 'exam_proctoring', 'field_notifications', 'first_responder', 'fraud_alerts', 'group_messaging', 'identify_&_verification', 'intelligent_routing', 'lead_alerts', 'lead_distribution', 'lead_generation', 'lead_management', 'lead_nurturing', 'marketing_events', 'mass_alerts', 'meetings/collaboration', 'order_notifications', 'outbound_dialer', 'pharmacy', 'phone_system', 'purchase_confirmation', 'remote_appointments', 'rewards_program', 'self-service', 'service_alerts', 'shift_management', 'survey/research', 'telehealth', 'telemarketing', 'therapy_(individual+group)'. + :param str business_profile_identity: A Business Identity of the calls. Is of type enum. One of 'direct_customer', 'isv_reseller_or_partner'. + :param str business_profile_industry: A Business Industry of the calls. Is of type enum. One of 'automotive', 'agriculture', 'banking', 'consumer', 'construction', 'education', 'engineering', 'energy', 'oil_and_gas', 'fast_moving_consumer_goods', 'financial', 'fintech', 'food_and_beverage', 'government', 'healthcare', 'hospitality', 'insurance', 'legal', 'manufacturing', 'media', 'online', 'professional_services', 'raw_materials', 'real_estate', 'religion', 'retail', 'jewelry', 'technology', 'telecommunications', 'transportation', 'travel', 'electronics', 'not_for_profit' + :param str business_profile_bundle_sid: A unique SID identifier of the Business Profile. + :param str business_profile_type: A Business Profile Type of the calls. Is of type enum. One of 'primary', 'secondary'. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -353,7 +393,6 @@ async def stream_async( to_carrier=to_carrier, from_country_code=from_country_code, to_country_code=to_country_code, - branded=branded, verified_caller=verified_caller, has_tag=has_tag, start_time=start_time, @@ -371,6 +410,15 @@ async def stream_async( quality_issue_annotation=quality_issue_annotation, spam_annotation=spam_annotation, call_score_annotation=call_score_annotation, + branded_enabled=branded_enabled, + voice_integrity_enabled=voice_integrity_enabled, + branded_bundle_sid=branded_bundle_sid, + voice_integrity_bundle_sid=voice_integrity_bundle_sid, + voice_integrity_use_case=voice_integrity_use_case, + business_profile_identity=business_profile_identity, + business_profile_industry=business_profile_industry, + business_profile_bundle_sid=business_profile_bundle_sid, + business_profile_type=business_profile_type, page_size=limits["page_size"], ) @@ -384,7 +432,6 @@ def list( to_carrier: Union[str, object] = values.unset, from_country_code: Union[str, object] = values.unset, to_country_code: Union[str, object] = values.unset, - branded: Union[bool, object] = values.unset, verified_caller: Union[bool, object] = values.unset, has_tag: Union[bool, object] = values.unset, start_time: Union[str, object] = values.unset, @@ -404,6 +451,15 @@ def list( quality_issue_annotation: Union[str, object] = values.unset, spam_annotation: Union[bool, object] = values.unset, call_score_annotation: Union[str, object] = values.unset, + branded_enabled: Union[bool, object] = values.unset, + voice_integrity_enabled: Union[bool, object] = values.unset, + branded_bundle_sid: Union[str, object] = values.unset, + voice_integrity_bundle_sid: Union[str, object] = values.unset, + voice_integrity_use_case: Union[str, object] = values.unset, + business_profile_identity: Union[str, object] = values.unset, + business_profile_industry: Union[str, object] = values.unset, + business_profile_bundle_sid: Union[str, object] = values.unset, + business_profile_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CallSummariesInstance]: @@ -418,8 +474,7 @@ def list( :param str to_carrier: A destination carrier. :param str from_country_code: A source country code based on phone number in From. :param str to_country_code: A destination country code. Based on phone number in To. - :param bool branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. - :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. + :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.One of 'true' or 'false'. :param bool has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). :param str start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. :param str end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. @@ -436,6 +491,15 @@ def list( :param str quality_issue_annotation: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. :param bool spam_annotation: A boolean flag indicating spam calls. :param str call_score_annotation: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + :param bool branded_enabled: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. One of 'true' or 'false' + :param bool voice_integrity_enabled: A boolean flag indicating whether or not the phone number had voice integrity enabled.One of 'true' or 'false' + :param str branded_bundle_sid: A unique SID identifier of the Branded Call. + :param str voice_integrity_bundle_sid: A unique SID identifier of the Voice Integrity Profile. + :param str voice_integrity_use_case: A Voice Integrity Use Case . Is of type enum. One of 'abandoned_cart', 'appointment_reminders', 'appointment_scheduling', 'asset_management', 'automated_support', 'call_tracking', 'click_to_call', 'contact_tracing', 'contactless_delivery', 'customer_support', 'dating/social', 'delivery_notifications', 'distance_learning', 'emergency_notifications', 'employee_notifications', 'exam_proctoring', 'field_notifications', 'first_responder', 'fraud_alerts', 'group_messaging', 'identify_&_verification', 'intelligent_routing', 'lead_alerts', 'lead_distribution', 'lead_generation', 'lead_management', 'lead_nurturing', 'marketing_events', 'mass_alerts', 'meetings/collaboration', 'order_notifications', 'outbound_dialer', 'pharmacy', 'phone_system', 'purchase_confirmation', 'remote_appointments', 'rewards_program', 'self-service', 'service_alerts', 'shift_management', 'survey/research', 'telehealth', 'telemarketing', 'therapy_(individual+group)'. + :param str business_profile_identity: A Business Identity of the calls. Is of type enum. One of 'direct_customer', 'isv_reseller_or_partner'. + :param str business_profile_industry: A Business Industry of the calls. Is of type enum. One of 'automotive', 'agriculture', 'banking', 'consumer', 'construction', 'education', 'engineering', 'energy', 'oil_and_gas', 'fast_moving_consumer_goods', 'financial', 'fintech', 'food_and_beverage', 'government', 'healthcare', 'hospitality', 'insurance', 'legal', 'manufacturing', 'media', 'online', 'professional_services', 'raw_materials', 'real_estate', 'religion', 'retail', 'jewelry', 'technology', 'telecommunications', 'transportation', 'travel', 'electronics', 'not_for_profit' + :param str business_profile_bundle_sid: A unique SID identifier of the Business Profile. + :param str business_profile_type: A Business Profile Type of the calls. Is of type enum. One of 'primary', 'secondary'. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -453,7 +517,6 @@ def list( to_carrier=to_carrier, from_country_code=from_country_code, to_country_code=to_country_code, - branded=branded, verified_caller=verified_caller, has_tag=has_tag, start_time=start_time, @@ -471,6 +534,15 @@ def list( quality_issue_annotation=quality_issue_annotation, spam_annotation=spam_annotation, call_score_annotation=call_score_annotation, + branded_enabled=branded_enabled, + voice_integrity_enabled=voice_integrity_enabled, + branded_bundle_sid=branded_bundle_sid, + voice_integrity_bundle_sid=voice_integrity_bundle_sid, + voice_integrity_use_case=voice_integrity_use_case, + business_profile_identity=business_profile_identity, + business_profile_industry=business_profile_industry, + business_profile_bundle_sid=business_profile_bundle_sid, + business_profile_type=business_profile_type, limit=limit, page_size=page_size, ) @@ -484,7 +556,6 @@ async def list_async( to_carrier: Union[str, object] = values.unset, from_country_code: Union[str, object] = values.unset, to_country_code: Union[str, object] = values.unset, - branded: Union[bool, object] = values.unset, verified_caller: Union[bool, object] = values.unset, has_tag: Union[bool, object] = values.unset, start_time: Union[str, object] = values.unset, @@ -504,6 +575,15 @@ async def list_async( quality_issue_annotation: Union[str, object] = values.unset, spam_annotation: Union[bool, object] = values.unset, call_score_annotation: Union[str, object] = values.unset, + branded_enabled: Union[bool, object] = values.unset, + voice_integrity_enabled: Union[bool, object] = values.unset, + branded_bundle_sid: Union[str, object] = values.unset, + voice_integrity_bundle_sid: Union[str, object] = values.unset, + voice_integrity_use_case: Union[str, object] = values.unset, + business_profile_identity: Union[str, object] = values.unset, + business_profile_industry: Union[str, object] = values.unset, + business_profile_bundle_sid: Union[str, object] = values.unset, + business_profile_type: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[CallSummariesInstance]: @@ -518,8 +598,7 @@ async def list_async( :param str to_carrier: A destination carrier. :param str from_country_code: A source country code based on phone number in From. :param str to_country_code: A destination country code. Based on phone number in To. - :param bool branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. - :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. + :param bool verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.One of 'true' or 'false'. :param bool has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). :param str start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. :param str end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. @@ -536,6 +615,15 @@ async def list_async( :param str quality_issue_annotation: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. :param bool spam_annotation: A boolean flag indicating spam calls. :param str call_score_annotation: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + :param bool branded_enabled: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. One of 'true' or 'false' + :param bool voice_integrity_enabled: A boolean flag indicating whether or not the phone number had voice integrity enabled.One of 'true' or 'false' + :param str branded_bundle_sid: A unique SID identifier of the Branded Call. + :param str voice_integrity_bundle_sid: A unique SID identifier of the Voice Integrity Profile. + :param str voice_integrity_use_case: A Voice Integrity Use Case . Is of type enum. One of 'abandoned_cart', 'appointment_reminders', 'appointment_scheduling', 'asset_management', 'automated_support', 'call_tracking', 'click_to_call', 'contact_tracing', 'contactless_delivery', 'customer_support', 'dating/social', 'delivery_notifications', 'distance_learning', 'emergency_notifications', 'employee_notifications', 'exam_proctoring', 'field_notifications', 'first_responder', 'fraud_alerts', 'group_messaging', 'identify_&_verification', 'intelligent_routing', 'lead_alerts', 'lead_distribution', 'lead_generation', 'lead_management', 'lead_nurturing', 'marketing_events', 'mass_alerts', 'meetings/collaboration', 'order_notifications', 'outbound_dialer', 'pharmacy', 'phone_system', 'purchase_confirmation', 'remote_appointments', 'rewards_program', 'self-service', 'service_alerts', 'shift_management', 'survey/research', 'telehealth', 'telemarketing', 'therapy_(individual+group)'. + :param str business_profile_identity: A Business Identity of the calls. Is of type enum. One of 'direct_customer', 'isv_reseller_or_partner'. + :param str business_profile_industry: A Business Industry of the calls. Is of type enum. One of 'automotive', 'agriculture', 'banking', 'consumer', 'construction', 'education', 'engineering', 'energy', 'oil_and_gas', 'fast_moving_consumer_goods', 'financial', 'fintech', 'food_and_beverage', 'government', 'healthcare', 'hospitality', 'insurance', 'legal', 'manufacturing', 'media', 'online', 'professional_services', 'raw_materials', 'real_estate', 'religion', 'retail', 'jewelry', 'technology', 'telecommunications', 'transportation', 'travel', 'electronics', 'not_for_profit' + :param str business_profile_bundle_sid: A unique SID identifier of the Business Profile. + :param str business_profile_type: A Business Profile Type of the calls. Is of type enum. One of 'primary', 'secondary'. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -554,7 +642,6 @@ async def list_async( to_carrier=to_carrier, from_country_code=from_country_code, to_country_code=to_country_code, - branded=branded, verified_caller=verified_caller, has_tag=has_tag, start_time=start_time, @@ -572,6 +659,15 @@ async def list_async( quality_issue_annotation=quality_issue_annotation, spam_annotation=spam_annotation, call_score_annotation=call_score_annotation, + branded_enabled=branded_enabled, + voice_integrity_enabled=voice_integrity_enabled, + branded_bundle_sid=branded_bundle_sid, + voice_integrity_bundle_sid=voice_integrity_bundle_sid, + voice_integrity_use_case=voice_integrity_use_case, + business_profile_identity=business_profile_identity, + business_profile_industry=business_profile_industry, + business_profile_bundle_sid=business_profile_bundle_sid, + business_profile_type=business_profile_type, limit=limit, page_size=page_size, ) @@ -585,7 +681,6 @@ def page( to_carrier: Union[str, object] = values.unset, from_country_code: Union[str, object] = values.unset, to_country_code: Union[str, object] = values.unset, - branded: Union[bool, object] = values.unset, verified_caller: Union[bool, object] = values.unset, has_tag: Union[bool, object] = values.unset, start_time: Union[str, object] = values.unset, @@ -605,6 +700,15 @@ def page( quality_issue_annotation: Union[str, object] = values.unset, spam_annotation: Union[bool, object] = values.unset, call_score_annotation: Union[str, object] = values.unset, + branded_enabled: Union[bool, object] = values.unset, + voice_integrity_enabled: Union[bool, object] = values.unset, + branded_bundle_sid: Union[str, object] = values.unset, + voice_integrity_bundle_sid: Union[str, object] = values.unset, + voice_integrity_use_case: Union[str, object] = values.unset, + business_profile_identity: Union[str, object] = values.unset, + business_profile_industry: Union[str, object] = values.unset, + business_profile_bundle_sid: Union[str, object] = values.unset, + business_profile_type: Union[str, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -619,8 +723,7 @@ def page( :param to_carrier: A destination carrier. :param from_country_code: A source country code based on phone number in From. :param to_country_code: A destination country code. Based on phone number in To. - :param branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. - :param verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. + :param verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.One of 'true' or 'false'. :param has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). :param start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. :param end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. @@ -637,6 +740,15 @@ def page( :param quality_issue_annotation: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. :param spam_annotation: A boolean flag indicating spam calls. :param call_score_annotation: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + :param branded_enabled: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. One of 'true' or 'false' + :param voice_integrity_enabled: A boolean flag indicating whether or not the phone number had voice integrity enabled.One of 'true' or 'false' + :param branded_bundle_sid: A unique SID identifier of the Branded Call. + :param voice_integrity_bundle_sid: A unique SID identifier of the Voice Integrity Profile. + :param voice_integrity_use_case: A Voice Integrity Use Case . Is of type enum. One of 'abandoned_cart', 'appointment_reminders', 'appointment_scheduling', 'asset_management', 'automated_support', 'call_tracking', 'click_to_call', 'contact_tracing', 'contactless_delivery', 'customer_support', 'dating/social', 'delivery_notifications', 'distance_learning', 'emergency_notifications', 'employee_notifications', 'exam_proctoring', 'field_notifications', 'first_responder', 'fraud_alerts', 'group_messaging', 'identify_&_verification', 'intelligent_routing', 'lead_alerts', 'lead_distribution', 'lead_generation', 'lead_management', 'lead_nurturing', 'marketing_events', 'mass_alerts', 'meetings/collaboration', 'order_notifications', 'outbound_dialer', 'pharmacy', 'phone_system', 'purchase_confirmation', 'remote_appointments', 'rewards_program', 'self-service', 'service_alerts', 'shift_management', 'survey/research', 'telehealth', 'telemarketing', 'therapy_(individual+group)'. + :param business_profile_identity: A Business Identity of the calls. Is of type enum. One of 'direct_customer', 'isv_reseller_or_partner'. + :param business_profile_industry: A Business Industry of the calls. Is of type enum. One of 'automotive', 'agriculture', 'banking', 'consumer', 'construction', 'education', 'engineering', 'energy', 'oil_and_gas', 'fast_moving_consumer_goods', 'financial', 'fintech', 'food_and_beverage', 'government', 'healthcare', 'hospitality', 'insurance', 'legal', 'manufacturing', 'media', 'online', 'professional_services', 'raw_materials', 'real_estate', 'religion', 'retail', 'jewelry', 'technology', 'telecommunications', 'transportation', 'travel', 'electronics', 'not_for_profit' + :param business_profile_bundle_sid: A unique SID identifier of the Business Profile. + :param business_profile_type: A Business Profile Type of the calls. Is of type enum. One of 'primary', 'secondary'. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -651,7 +763,6 @@ def page( "ToCarrier": to_carrier, "FromCountryCode": from_country_code, "ToCountryCode": to_country_code, - "Branded": serialize.boolean_to_string(branded), "VerifiedCaller": serialize.boolean_to_string(verified_caller), "HasTag": serialize.boolean_to_string(has_tag), "StartTime": start_time, @@ -669,6 +780,17 @@ def page( "QualityIssueAnnotation": quality_issue_annotation, "SpamAnnotation": serialize.boolean_to_string(spam_annotation), "CallScoreAnnotation": call_score_annotation, + "BrandedEnabled": serialize.boolean_to_string(branded_enabled), + "VoiceIntegrityEnabled": serialize.boolean_to_string( + voice_integrity_enabled + ), + "BrandedBundleSid": branded_bundle_sid, + "VoiceIntegrityBundleSid": voice_integrity_bundle_sid, + "VoiceIntegrityUseCase": voice_integrity_use_case, + "BusinessProfileIdentity": business_profile_identity, + "BusinessProfileIndustry": business_profile_industry, + "BusinessProfileBundleSid": business_profile_bundle_sid, + "BusinessProfileType": business_profile_type, "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -686,7 +808,6 @@ async def page_async( to_carrier: Union[str, object] = values.unset, from_country_code: Union[str, object] = values.unset, to_country_code: Union[str, object] = values.unset, - branded: Union[bool, object] = values.unset, verified_caller: Union[bool, object] = values.unset, has_tag: Union[bool, object] = values.unset, start_time: Union[str, object] = values.unset, @@ -706,6 +827,15 @@ async def page_async( quality_issue_annotation: Union[str, object] = values.unset, spam_annotation: Union[bool, object] = values.unset, call_score_annotation: Union[str, object] = values.unset, + branded_enabled: Union[bool, object] = values.unset, + voice_integrity_enabled: Union[bool, object] = values.unset, + branded_bundle_sid: Union[str, object] = values.unset, + voice_integrity_bundle_sid: Union[str, object] = values.unset, + voice_integrity_use_case: Union[str, object] = values.unset, + business_profile_identity: Union[str, object] = values.unset, + business_profile_industry: Union[str, object] = values.unset, + business_profile_bundle_sid: Union[str, object] = values.unset, + business_profile_type: Union[str, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -720,8 +850,7 @@ async def page_async( :param to_carrier: A destination carrier. :param from_country_code: A source country code based on phone number in From. :param to_country_code: A destination country code. Based on phone number in To. - :param branded: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. - :param verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR. + :param verified_caller: A boolean flag indicating whether or not the caller was verified using SHAKEN/STIR.One of 'true' or 'false'. :param has_tag: A boolean flag indicating the presence of one or more [Voice Insights Call Tags](https://www.twilio.com/docs/voice/voice-insights/api/call/details-call-tags). :param start_time: A Start time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 4h. :param end_time: An End Time of the calls. xm (x minutes), xh (x hours), xd (x days), 1w, 30m, 3d, 4w or datetime-ISO. Defaults to 0m. @@ -738,6 +867,15 @@ async def page_async( :param quality_issue_annotation: A subjective Quality Issue with the calls. One of `no_quality_issue`, `low_volume`, `choppy_robotic`, `echo`, `dtmf`, `latency`, `owa`, `static_noise`. :param spam_annotation: A boolean flag indicating spam calls. :param call_score_annotation: A Call Score of the calls. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for the rated call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + :param branded_enabled: A boolean flag indicating whether or not the calls were branded using Twilio Branded Calls. One of 'true' or 'false' + :param voice_integrity_enabled: A boolean flag indicating whether or not the phone number had voice integrity enabled.One of 'true' or 'false' + :param branded_bundle_sid: A unique SID identifier of the Branded Call. + :param voice_integrity_bundle_sid: A unique SID identifier of the Voice Integrity Profile. + :param voice_integrity_use_case: A Voice Integrity Use Case . Is of type enum. One of 'abandoned_cart', 'appointment_reminders', 'appointment_scheduling', 'asset_management', 'automated_support', 'call_tracking', 'click_to_call', 'contact_tracing', 'contactless_delivery', 'customer_support', 'dating/social', 'delivery_notifications', 'distance_learning', 'emergency_notifications', 'employee_notifications', 'exam_proctoring', 'field_notifications', 'first_responder', 'fraud_alerts', 'group_messaging', 'identify_&_verification', 'intelligent_routing', 'lead_alerts', 'lead_distribution', 'lead_generation', 'lead_management', 'lead_nurturing', 'marketing_events', 'mass_alerts', 'meetings/collaboration', 'order_notifications', 'outbound_dialer', 'pharmacy', 'phone_system', 'purchase_confirmation', 'remote_appointments', 'rewards_program', 'self-service', 'service_alerts', 'shift_management', 'survey/research', 'telehealth', 'telemarketing', 'therapy_(individual+group)'. + :param business_profile_identity: A Business Identity of the calls. Is of type enum. One of 'direct_customer', 'isv_reseller_or_partner'. + :param business_profile_industry: A Business Industry of the calls. Is of type enum. One of 'automotive', 'agriculture', 'banking', 'consumer', 'construction', 'education', 'engineering', 'energy', 'oil_and_gas', 'fast_moving_consumer_goods', 'financial', 'fintech', 'food_and_beverage', 'government', 'healthcare', 'hospitality', 'insurance', 'legal', 'manufacturing', 'media', 'online', 'professional_services', 'raw_materials', 'real_estate', 'religion', 'retail', 'jewelry', 'technology', 'telecommunications', 'transportation', 'travel', 'electronics', 'not_for_profit' + :param business_profile_bundle_sid: A unique SID identifier of the Business Profile. + :param business_profile_type: A Business Profile Type of the calls. Is of type enum. One of 'primary', 'secondary'. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -752,7 +890,6 @@ async def page_async( "ToCarrier": to_carrier, "FromCountryCode": from_country_code, "ToCountryCode": to_country_code, - "Branded": serialize.boolean_to_string(branded), "VerifiedCaller": serialize.boolean_to_string(verified_caller), "HasTag": serialize.boolean_to_string(has_tag), "StartTime": start_time, @@ -770,6 +907,17 @@ async def page_async( "QualityIssueAnnotation": quality_issue_annotation, "SpamAnnotation": serialize.boolean_to_string(spam_annotation), "CallScoreAnnotation": call_score_annotation, + "BrandedEnabled": serialize.boolean_to_string(branded_enabled), + "VoiceIntegrityEnabled": serialize.boolean_to_string( + voice_integrity_enabled + ), + "BrandedBundleSid": branded_bundle_sid, + "VoiceIntegrityBundleSid": voice_integrity_bundle_sid, + "VoiceIntegrityUseCase": voice_integrity_use_case, + "BusinessProfileIdentity": business_profile_identity, + "BusinessProfileIndustry": business_profile_industry, + "BusinessProfileBundleSid": business_profile_bundle_sid, + "BusinessProfileType": business_profile_type, "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/intelligence/v2/operator_type.py b/twilio/rest/intelligence/v2/operator_type.py index 9884df0aee..ff2403b1cb 100644 --- a/twilio/rest/intelligence/v2/operator_type.py +++ b/twilio/rest/intelligence/v2/operator_type.py @@ -145,7 +145,7 @@ def __init__(self, version: Version, sid: str): Initialize the OperatorTypeContext :param version: Version that contains the resource - :param sid: A 34 character string that uniquely identifies this Operator Type. + :param sid: Either a 34 character string that uniquely identifies this Operator Type or the unique name that references an Operator Type. """ super().__init__(version) @@ -422,7 +422,7 @@ def get(self, sid: str) -> OperatorTypeContext: """ Constructs a OperatorTypeContext - :param sid: A 34 character string that uniquely identifies this Operator Type. + :param sid: Either a 34 character string that uniquely identifies this Operator Type or the unique name that references an Operator Type. """ return OperatorTypeContext(self._version, sid=sid) @@ -430,7 +430,7 @@ def __call__(self, sid: str) -> OperatorTypeContext: """ Constructs a OperatorTypeContext - :param sid: A 34 character string that uniquely identifies this Operator Type. + :param sid: Either a 34 character string that uniquely identifies this Operator Type or the unique name that references an Operator Type. """ return OperatorTypeContext(self._version, sid=sid) diff --git a/twilio/rest/intelligence/v2/transcript/sentence.py b/twilio/rest/intelligence/v2/transcript/sentence.py index 5bdd18b00f..4a2229b8a4 100644 --- a/twilio/rest/intelligence/v2/transcript/sentence.py +++ b/twilio/rest/intelligence/v2/transcript/sentence.py @@ -30,6 +30,7 @@ class SentenceInstance(InstanceResource): :ivar transcript: Transcript text. :ivar sid: A 34 character string that uniquely identifies this Sentence. :ivar confidence: + :ivar words: Detailed information for each of the words of the given Sentence. """ def __init__(self, version: Version, payload: Dict[str, Any], transcript_sid: str): @@ -50,6 +51,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], transcript_sid: st self.confidence: Optional[float] = deserialize.decimal( payload.get("confidence") ) + self.words: Optional[List[Dict[str, object]]] = payload.get("words") self._solution = { "transcript_sid": transcript_sid, @@ -107,6 +109,7 @@ def __init__(self, version: Version, transcript_sid: str): def stream( self, redacted: Union[bool, object] = values.unset, + word_timestamps: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[SentenceInstance]: @@ -117,6 +120,7 @@ def stream( The results are returned as a generator, so this operation is memory efficient. :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. + :param bool word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -127,13 +131,18 @@ def stream( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = self.page(redacted=redacted, page_size=limits["page_size"]) + page = self.page( + redacted=redacted, + word_timestamps=word_timestamps, + page_size=limits["page_size"], + ) return self._version.stream(page, limits["limit"]) async def stream_async( self, redacted: Union[bool, object] = values.unset, + word_timestamps: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[SentenceInstance]: @@ -144,6 +153,7 @@ async def stream_async( The results are returned as a generator, so this operation is memory efficient. :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. + :param bool word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -154,13 +164,18 @@ async def stream_async( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = await self.page_async(redacted=redacted, page_size=limits["page_size"]) + page = await self.page_async( + redacted=redacted, + word_timestamps=word_timestamps, + page_size=limits["page_size"], + ) return self._version.stream_async(page, limits["limit"]) def list( self, redacted: Union[bool, object] = values.unset, + word_timestamps: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[SentenceInstance]: @@ -170,6 +185,7 @@ def list( memory before returning. :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. + :param bool word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -182,6 +198,7 @@ def list( return list( self.stream( redacted=redacted, + word_timestamps=word_timestamps, limit=limit, page_size=page_size, ) @@ -190,6 +207,7 @@ def list( async def list_async( self, redacted: Union[bool, object] = values.unset, + word_timestamps: Union[bool, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[SentenceInstance]: @@ -199,6 +217,7 @@ async def list_async( memory before returning. :param bool redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. + :param bool word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -212,6 +231,7 @@ async def list_async( record async for record in await self.stream_async( redacted=redacted, + word_timestamps=word_timestamps, limit=limit, page_size=page_size, ) @@ -220,6 +240,7 @@ async def list_async( def page( self, redacted: Union[bool, object] = values.unset, + word_timestamps: Union[bool, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -229,6 +250,7 @@ def page( Request is executed immediately :param redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. + :param word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -238,6 +260,7 @@ def page( data = values.of( { "Redacted": serialize.boolean_to_string(redacted), + "WordTimestamps": serialize.boolean_to_string(word_timestamps), "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -250,6 +273,7 @@ def page( async def page_async( self, redacted: Union[bool, object] = values.unset, + word_timestamps: Union[bool, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -259,6 +283,7 @@ async def page_async( Request is executed immediately :param redacted: Grant access to PII Redacted/Unredacted Sentences. If redaction is enabled, the default is `true` to access redacted sentences. + :param word_timestamps: Returns word level timestamps information, if word_timestamps is enabled. The default is `false`. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -268,6 +293,7 @@ async def page_async( data = values.of( { "Redacted": serialize.boolean_to_string(redacted), + "WordTimestamps": serialize.boolean_to_string(word_timestamps), "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/marketplace/__init__.py b/twilio/rest/marketplace/__init__.py index 79b10ef6c4..f0276a8f84 100644 --- a/twilio/rest/marketplace/__init__.py +++ b/twilio/rest/marketplace/__init__.py @@ -7,4 +7,3 @@ def available_add_ons(self): def installed_add_ons(self): return self.v1.installed_add_ons - diff --git a/twilio/rest/marketplace/v1/__init__.py b/twilio/rest/marketplace/v1/__init__.py index 49fc490396..9a29e0b691 100644 --- a/twilio/rest/marketplace/v1/__init__.py +++ b/twilio/rest/marketplace/v1/__init__.py @@ -18,6 +18,7 @@ from twilio.rest.marketplace.v1.available_add_on import AvailableAddOnList from twilio.rest.marketplace.v1.installed_add_on import InstalledAddOnList from twilio.rest.marketplace.v1.module_data_management import ModuleDataManagementList +from twilio.rest.marketplace.v1.referral_conversion import ReferralConversionList class V1(Version): @@ -32,6 +33,7 @@ def __init__(self, domain: Domain): self._available_add_ons: Optional[AvailableAddOnList] = None self._installed_add_ons: Optional[InstalledAddOnList] = None self._module_data_management: Optional[ModuleDataManagementList] = None + self._referral_conversion: Optional[ReferralConversionList] = None @property def available_add_ons(self) -> AvailableAddOnList: @@ -51,6 +53,12 @@ def module_data_management(self) -> ModuleDataManagementList: self._module_data_management = ModuleDataManagementList(self) return self._module_data_management + @property + def referral_conversion(self) -> ReferralConversionList: + if self._referral_conversion is None: + self._referral_conversion = ReferralConversionList(self) + return self._referral_conversion + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py index 3f9415ed49..7e44ac4e0e 100644 --- a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py +++ b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py @@ -52,15 +52,17 @@ def __repr__(self) -> str: class InstalledAddOnUsageList(ListResource): - class CreateBillingUsageRequest(object): + class MarketplaceV1InstalledAddOnInstalledAddOnUsage(object): """ :ivar billable_items: """ - def __init__(self, payload: Dict[str, Any], installed_add_on_sid: str): + def __init__(self, payload: Dict[str, Any]): self.billable_items: Optional[ - List[InstalledAddOnUsageList.CreateBillingUsageRequestBillableItems] + List[ + InstalledAddOnUsageList.MarketplaceV1InstalledAddOnInstalledAddOnUsageBillableItems + ] ] = payload.get("billable_items") def to_dict(self): @@ -70,13 +72,13 @@ def to_dict(self): ], } - class CreateBillingUsageRequestBillableItems(object): + class MarketplaceV1InstalledAddOnInstalledAddOnUsageBillableItems(object): """ - :ivar quantity: - :ivar sid: + :ivar quantity: Any floating number greater than 0. + :ivar sid: BillingSid to use for billing. """ - def __init__(self, payload: Dict[str, Any], installed_add_on_sid: str): + def __init__(self, payload: Dict[str, Any]): self.quantity: Optional[float] = payload.get("quantity") self.sid: Optional[str] = payload.get("sid") @@ -106,16 +108,17 @@ def __init__(self, version: Version, installed_add_on_sid: str): ) def create( - self, create_billing_usage_request: CreateBillingUsageRequest + self, + marketplace_v1_installed_add_on_installed_add_on_usage: MarketplaceV1InstalledAddOnInstalledAddOnUsage, ) -> InstalledAddOnUsageInstance: """ Create the InstalledAddOnUsageInstance - :param create_billing_usage_request: + :param marketplace_v1_installed_add_on_installed_add_on_usage: :returns: The created InstalledAddOnUsageInstance """ - data = create_billing_usage_request.to_dict() + data = marketplace_v1_installed_add_on_installed_add_on_usage.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) headers["Content-Type"] = "application/json" @@ -131,16 +134,17 @@ def create( ) async def create_async( - self, create_billing_usage_request: CreateBillingUsageRequest + self, + marketplace_v1_installed_add_on_installed_add_on_usage: MarketplaceV1InstalledAddOnInstalledAddOnUsage, ) -> InstalledAddOnUsageInstance: """ Asynchronously create the InstalledAddOnUsageInstance - :param create_billing_usage_request: + :param marketplace_v1_installed_add_on_installed_add_on_usage: :returns: The created InstalledAddOnUsageInstance """ - data = create_billing_usage_request.to_dict() + data = marketplace_v1_installed_add_on_installed_add_on_usage.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) headers["Content-Type"] = "application/json" diff --git a/twilio/rest/marketplace/v1/module_data_management.py b/twilio/rest/marketplace/v1/module_data_management.py index 079a1a3343..837f5fc3f7 100644 --- a/twilio/rest/marketplace/v1/module_data_management.py +++ b/twilio/rest/marketplace/v1/module_data_management.py @@ -22,13 +22,14 @@ class ModuleDataManagementInstance(InstanceResource): """ - :ivar url: - :ivar sid: - :ivar description: - :ivar support: - :ivar policies: - :ivar module_info: - :ivar documentation: + :ivar url: URL to query the subresource. + :ivar sid: ModuleSid that identifies this Listing. + :ivar description: A JSON object describing the module and is displayed under the Description tab of the Module detail page. You can define the main body of the description, highlight key features or aspects of the module and if applicable, provide code samples for developers + :ivar support: A JSON object containing information on how customers can obtain support for the module. Use this parameter to provide details such as contact information and support description. + :ivar policies: A JSON object describing the module's privacy and legal policies and is displayed under the Policies tab of the Module detail page. The maximum file size for Policies is 5MB + :ivar module_info: A JSON object containing essential attributes that define a module. This information is presented on the Module detail page in the Twilio Marketplace Catalog. You can pass the following attributes in the JSON object + :ivar documentation: A JSON object for providing comprehensive information, instructions, and resources related to the module + :ivar configuration: A JSON object for providing listing specific configuration. Contains button setup, notification url, among others. """ def __init__( @@ -43,6 +44,7 @@ def __init__( self.policies: Optional[Dict[str, object]] = payload.get("policies") self.module_info: Optional[Dict[str, object]] = payload.get("module_info") self.documentation: Optional[Dict[str, object]] = payload.get("documentation") + self.configuration: Optional[Dict[str, object]] = payload.get("configuration") self._solution = { "sid": sid or self.sid, @@ -89,6 +91,7 @@ def update( documentation: Union[str, object] = values.unset, policies: Union[str, object] = values.unset, support: Union[str, object] = values.unset, + configuration: Union[str, object] = values.unset, ) -> "ModuleDataManagementInstance": """ Update the ModuleDataManagementInstance @@ -98,6 +101,7 @@ def update( :param documentation: :param policies: :param support: + :param configuration: :returns: The updated ModuleDataManagementInstance """ @@ -107,6 +111,7 @@ def update( documentation=documentation, policies=policies, support=support, + configuration=configuration, ) async def update_async( @@ -116,6 +121,7 @@ async def update_async( documentation: Union[str, object] = values.unset, policies: Union[str, object] = values.unset, support: Union[str, object] = values.unset, + configuration: Union[str, object] = values.unset, ) -> "ModuleDataManagementInstance": """ Asynchronous coroutine to update the ModuleDataManagementInstance @@ -125,6 +131,7 @@ async def update_async( :param documentation: :param policies: :param support: + :param configuration: :returns: The updated ModuleDataManagementInstance """ @@ -134,6 +141,7 @@ async def update_async( documentation=documentation, policies=policies, support=support, + configuration=configuration, ) def __repr__(self) -> str: @@ -208,6 +216,7 @@ def update( documentation: Union[str, object] = values.unset, policies: Union[str, object] = values.unset, support: Union[str, object] = values.unset, + configuration: Union[str, object] = values.unset, ) -> ModuleDataManagementInstance: """ Update the ModuleDataManagementInstance @@ -217,6 +226,7 @@ def update( :param documentation: :param policies: :param support: + :param configuration: :returns: The updated ModuleDataManagementInstance """ @@ -227,6 +237,7 @@ def update( "Documentation": documentation, "Policies": policies, "Support": support, + "Configuration": configuration, } ) @@ -247,6 +258,7 @@ async def update_async( documentation: Union[str, object] = values.unset, policies: Union[str, object] = values.unset, support: Union[str, object] = values.unset, + configuration: Union[str, object] = values.unset, ) -> ModuleDataManagementInstance: """ Asynchronous coroutine to update the ModuleDataManagementInstance @@ -256,6 +268,7 @@ async def update_async( :param documentation: :param policies: :param support: + :param configuration: :returns: The updated ModuleDataManagementInstance """ @@ -266,6 +279,7 @@ async def update_async( "Documentation": documentation, "Policies": policies, "Support": support, + "Configuration": configuration, } ) diff --git a/twilio/rest/marketplace/v1/referral_conversion.py b/twilio/rest/marketplace/v1/referral_conversion.py new file mode 100644 index 0000000000..62d6ad84fd --- /dev/null +++ b/twilio/rest/marketplace/v1/referral_conversion.py @@ -0,0 +1,198 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Marketplace + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional +from twilio.base import values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ReferralConversionInstance(InstanceResource): + """ + :ivar converted_account_sid: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.converted_account_sid: Optional[str] = payload.get("converted_account_sid") + + self._context: Optional[ReferralConversionContext] = None + + @property + def _proxy(self) -> "ReferralConversionContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: ReferralConversionContext for this ReferralConversionInstance + """ + if self._context is None: + self._context = ReferralConversionContext( + self._version, + ) + return self._context + + def create( + self, create_referral_conversion_request: CreateReferralConversionRequest + ) -> "ReferralConversionInstance": + """ + Create the ReferralConversionInstance + + :param create_referral_conversion_request: + + :returns: The created ReferralConversionInstance + """ + return self._proxy.create( + create_referral_conversion_request, + ) + + async def create_async( + self, create_referral_conversion_request: CreateReferralConversionRequest + ) -> "ReferralConversionInstance": + """ + Asynchronous coroutine to create the ReferralConversionInstance + + :param create_referral_conversion_request: + + :returns: The created ReferralConversionInstance + """ + return await self._proxy.create_async( + create_referral_conversion_request, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ReferralConversionContext(InstanceContext): + + def __init__(self, version: Version): + """ + Initialize the ReferralConversionContext + + :param version: Version that contains the resource + """ + super().__init__(version) + + self._uri = "/ReferralConversion" + + def create( + self, create_referral_conversion_request: CreateReferralConversionRequest + ) -> ReferralConversionInstance: + """ + Create the ReferralConversionInstance + + :param create_referral_conversion_request: + + :returns: The created ReferralConversionInstance + """ + data = values.of( + { + "CreateReferralConversionRequest": create_referral_conversion_request, + } + ) + + payload = self._version.create(method="POST", uri=self._uri, data=data) + + return ReferralConversionInstance(self._version, payload) + + async def create_async( + self, create_referral_conversion_request: CreateReferralConversionRequest + ) -> ReferralConversionInstance: + """ + Asynchronous coroutine to create the ReferralConversionInstance + + :param create_referral_conversion_request: + + :returns: The created ReferralConversionInstance + """ + data = values.of( + { + "CreateReferralConversionRequest": create_referral_conversion_request, + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data + ) + + return ReferralConversionInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ReferralConversionList(ListResource): + + class CreateReferralConversionRequest(object): + """ + :ivar referral_account_sid: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.referral_account_sid: Optional[str] = payload.get( + "referral_account_sid" + ) + + def to_dict(self): + return { + "referral_account_sid": self.referral_account_sid, + } + + def __init__(self, version: Version): + """ + Initialize the ReferralConversionList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self) -> ReferralConversionContext: + """ + Constructs a ReferralConversionContext + + """ + return ReferralConversionContext(self._version) + + def __call__(self) -> ReferralConversionContext: + """ + Constructs a ReferralConversionContext + + """ + return ReferralConversionContext(self._version) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/messaging/v1/external_campaign.py b/twilio/rest/messaging/v1/external_campaign.py index 88262f978d..ebc115ee74 100644 --- a/twilio/rest/messaging/v1/external_campaign.py +++ b/twilio/rest/messaging/v1/external_campaign.py @@ -13,8 +13,8 @@ """ from datetime import datetime -from typing import Any, Dict, Optional -from twilio.base import deserialize, values +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, serialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -65,13 +65,17 @@ def __init__(self, version: Version): self._uri = "/Services/PreregisteredUsa2p" def create( - self, campaign_id: str, messaging_service_sid: str + self, + campaign_id: str, + messaging_service_sid: str, + cnp_migration: Union[bool, object] = values.unset, ) -> ExternalCampaignInstance: """ Create the ExternalCampaignInstance :param campaign_id: ID of the preregistered campaign. :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with. + :param cnp_migration: Customers should use this flag during the ERC registration process to indicate to Twilio that the campaign being registered is undergoing CNP migration. It is important for the user to first trigger the CNP migration process for said campaign in their CSP portal and have Twilio accept the sharing request, before making this api call. :returns: The created ExternalCampaignInstance """ @@ -80,6 +84,7 @@ def create( { "CampaignId": campaign_id, "MessagingServiceSid": messaging_service_sid, + "CnpMigration": serialize.boolean_to_string(cnp_migration), } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -91,13 +96,17 @@ def create( return ExternalCampaignInstance(self._version, payload) async def create_async( - self, campaign_id: str, messaging_service_sid: str + self, + campaign_id: str, + messaging_service_sid: str, + cnp_migration: Union[bool, object] = values.unset, ) -> ExternalCampaignInstance: """ Asynchronously create the ExternalCampaignInstance :param campaign_id: ID of the preregistered campaign. :param messaging_service_sid: The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) that the resource is associated with. + :param cnp_migration: Customers should use this flag during the ERC registration process to indicate to Twilio that the campaign being registered is undergoing CNP migration. It is important for the user to first trigger the CNP migration process for said campaign in their CSP portal and have Twilio accept the sharing request, before making this api call. :returns: The created ExternalCampaignInstance """ @@ -106,6 +115,7 @@ async def create_async( { "CampaignId": campaign_id, "MessagingServiceSid": messaging_service_sid, + "CnpMigration": serialize.boolean_to_string(cnp_migration), } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) diff --git a/twilio/rest/messaging/v1/service/channel_sender.py b/twilio/rest/messaging/v1/service/channel_sender.py index a8de3d0cf6..0a0d5c98de 100644 --- a/twilio/rest/messaging/v1/service/channel_sender.py +++ b/twilio/rest/messaging/v1/service/channel_sender.py @@ -80,6 +80,24 @@ def _proxy(self) -> "ChannelSenderContext": ) return self._context + def delete(self) -> bool: + """ + Deletes the ChannelSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the ChannelSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + def fetch(self) -> "ChannelSenderInstance": """ Fetch the ChannelSenderInstance @@ -129,6 +147,30 @@ def __init__(self, version: Version, messaging_service_sid: str, sid: str): **self._solution ) + def delete(self) -> bool: + """ + Deletes the ChannelSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the ChannelSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + def fetch(self) -> ChannelSenderInstance: """ Fetch the ChannelSenderInstance @@ -222,6 +264,58 @@ def __init__(self, version: Version, messaging_service_sid: str): **self._solution ) + def create(self, sid: str) -> ChannelSenderInstance: + """ + Create the ChannelSenderInstance + + :param sid: The SID of the Channel Sender being added to the Service. + + :returns: The created ChannelSenderInstance + """ + + data = values.of( + { + "Sid": sid, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ChannelSenderInstance( + self._version, + payload, + messaging_service_sid=self._solution["messaging_service_sid"], + ) + + async def create_async(self, sid: str) -> ChannelSenderInstance: + """ + Asynchronously create the ChannelSenderInstance + + :param sid: The SID of the Channel Sender being added to the Service. + + :returns: The created ChannelSenderInstance + """ + + data = values.of( + { + "Sid": sid, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ChannelSenderInstance( + self._version, + payload, + messaging_service_sid=self._solution["messaging_service_sid"], + ) + def stream( self, limit: Optional[int] = None, diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 68f078a88d..043364c3d5 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,10 +28,12 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) +from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( + PortingWebhookConfigurationFetchList, +) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) -from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -56,10 +58,12 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None + self._porting_webhook_configuration_fetch: Optional[ + PortingWebhookConfigurationFetchList + ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None - self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -107,18 +111,22 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete + @property + def porting_webhook_configuration_fetch( + self, + ) -> PortingWebhookConfigurationFetchList: + if self._porting_webhook_configuration_fetch is None: + self._porting_webhook_configuration_fetch = ( + PortingWebhookConfigurationFetchList(self) + ) + return self._porting_webhook_configuration_fetch + @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations - @property - def webhook(self) -> WebhookList: - if self._webhook is None: - self._webhook = WebhookList(self) - return self._webhook - def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index 50b3e328ec..9ce6b7b4cd 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -25,15 +25,15 @@ class PortingPortInInstance(InstanceResource): """ :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. :ivar url: The URL of this Port In request - :ivar account_sid: The Account SID that the numbers will be added to after they are ported into Twilio. - :ivar notification_emails: List of emails for getting notifications about the LOA signing process. Allowed Max 10 emails. - :ivar target_port_in_date: Minimum number of days in the future (at least 2 days) needs to be established with the Ops team for validation. - :ivar target_port_in_time_range_start: Minimum hour in the future needs to be established with the Ops team for validation. - :ivar target_port_in_time_range_end: Maximum hour in the future needs to be established with the Ops team for validation. + :ivar account_sid: Account Sid or subaccount where the phone number(s) will be Ported + :ivar notification_emails: Additional emails to send a copy of the signed LOA to. + :ivar target_port_in_date: Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. (This value is only available for custom porting customers.) + :ivar target_port_in_time_range_start: The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. (This value is only available for custom porting customers.) + :ivar target_port_in_time_range_end: The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. (This value is only available for custom porting customers.) :ivar port_in_request_status: The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled. - :ivar losing_carrier_information: The information for the losing carrier. - :ivar phone_numbers: The list of phone numbers to Port in. Phone numbers are in E.164 format (e.g. +16175551212). - :ivar documents: The list of documents SID referencing a utility bills + :ivar losing_carrier_information: Details regarding the customer’s information with the losing carrier. These values will be used to generate the letter of authorization and should match the losing carrier’s data as closely as possible to ensure the port is accepted. + :ivar phone_numbers: + :ivar documents: List of document SIDs for all phone numbers included in the port in request. At least one document SID referring to a document of the type Utility Bill is required. :ivar date_created: """ diff --git a/twilio/rest/numbers/v1/porting_port_in_phone_number.py b/twilio/rest/numbers/v1/porting_port_in_phone_number.py index f5d881a657..c494961ef6 100644 --- a/twilio/rest/numbers/v1/porting_port_in_phone_number.py +++ b/twilio/rest/numbers/v1/porting_port_in_phone_number.py @@ -23,23 +23,24 @@ class PortingPortInPhoneNumberInstance(InstanceResource): """ - :ivar port_in_request_sid: The SID of the Port In request. This is a unique identifier of the port in request. - :ivar phone_number_sid: The SID of the Port In request phone number. This is a unique identifier of the phone number. - :ivar url: - :ivar account_sid: The SID of the account that the phone number belongs to. - :ivar phone_number_type: The type of the phone number. - :ivar date_created: The date when the phone number was created. - :ivar country: The country of the phone number. - :ivar missing_required_fields: The phone number is missing required fields. - :ivar last_updated: The timestamp when the status was last updated. - :ivar phone_number: The phone number. - :ivar portable: The phone number is portable. - :ivar not_portability_reason: The reason why the phone number is not portable. - :ivar not_portability_reason_code: The code of the reason why the phone number is not portable. - :ivar port_in_phone_number_status: The status of the phone number in the port in request. - :ivar port_out_pin: The pin required for the losing carrier to port out the phone number. - :ivar rejection_reason: The rejection reason returned by the vendor. - :ivar rejection_reason_code: The rejection reason code returned by the vendor. + :ivar port_in_request_sid: The unique identifier for the port in request that this phone number is associated with. + :ivar phone_number_sid: The unique identifier for this phone number associated with this port in request. + :ivar url: URL reference for this resource. + :ivar account_sid: Account Sid or subaccount where the phone number(s) will be Ported. + :ivar phone_number_type: The number type of the phone number. This can be: toll-free, local, mobile or unknown. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated. + :ivar date_created: The timestamp for when this port in phone number was created. + :ivar country: The ISO country code that this number is associated with. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated. + :ivar missing_required_fields: Indicates if the phone number is missing required fields such as a PIN or account number. This field may be null if the number is not portable or if the portability for a number has not yet been evaluated. + :ivar last_updated: Timestamp indicating when the Port In Phone Number resource was last modified. + :ivar phone_number: Phone number to be ported. This will be in the E164 Format. + :ivar portable: If the number is portable by Twilio or not. This field may be null if the number portability has not yet been evaluated. If a number is not portable reference the `not_portability_reason_code` and `not_portability_reason` fields for more details + :ivar not_portability_reason: The not portability reason code description. This field may be null if the number is portable or if the portability for a number has not yet been evaluated. + :ivar not_portability_reason_code: The not portability reason code. This field may be null if the number is portable or if the portability for a number has not yet been evaluated. + :ivar port_in_phone_number_status: The status of the port in phone number. + :ivar port_out_pin: The pin required by the losing carrier to do the port out. + :ivar rejection_reason: The description of the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier. + :ivar rejection_reason_code: The code for the rejection reason provided by the losing carrier. This field may be null if the number has not been rejected by the losing carrier. + :ivar port_date: The timestamp the phone number will be ported. This will only be set once a port date has been confirmed. Not all carriers can guarantee a specific time on the port date. Twilio will try its best to get the port completed by this time on the port date. Please subscribe to webhooks for confirmation on when a port has actually been completed. """ def __init__( @@ -84,6 +85,9 @@ def __init__( self.rejection_reason_code: Optional[int] = deserialize.integer( payload.get("rejection_reason_code") ) + self.port_date: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("port_date") + ) self._solution = { "port_in_request_sid": port_in_request_sid or self.port_in_request_sid, diff --git a/twilio/rest/numbers/v1/porting_portability.py b/twilio/rest/numbers/v1/porting_portability.py index d4f92ba7d5..1f0fc210a4 100644 --- a/twilio/rest/numbers/v1/porting_portability.py +++ b/twilio/rest/numbers/v1/porting_portability.py @@ -30,11 +30,11 @@ class NumberType(object): """ :ivar phone_number: The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212). - :ivar account_sid: The target account sid to which the number will be ported - :ivar portable: Boolean flag specifying if phone number is portable or not. - :ivar pin_and_account_number_required: Boolean flag specifying if PIN and account number is required for the phone number. + :ivar account_sid: Account Sid that the phone number belongs to in Twilio. This is only returned for phone numbers that already exist in Twilio’s inventory and belong to your account or sub account. + :ivar portable: Boolean flag indicates if the phone number can be ported into Twilio through the Porting API or not. + :ivar pin_and_account_number_required: Indicates if the port in process will require a personal identification number (PIN) and an account number for this phone number. If this is true you will be required to submit both a PIN and account number from the losing carrier for this number when opening a port in request. These fields will be required in order to complete the port in process to Twilio. :ivar not_portable_reason: Reason why the phone number cannot be ported into Twilio, `null` otherwise. - :ivar not_portable_reason_code: The Portability Reason Code for the phone number if it cannot be ported into Twilio, `null` otherwise. One of `22131`, `22132`, `22130`, `22133`, `22102` or `22135`. + :ivar not_portable_reason_code: The Portability Reason Code for the phone number if it cannot be ported into Twilio, `null` otherwise. :ivar number_type: :ivar country: Country the phone number belongs to. :ivar url: This is the url of the request that you're trying to reach out to locate the resource. @@ -90,7 +90,7 @@ def fetch( """ Fetch the PortingPortabilityInstance - :param target_account_sid: The SID of the account where the phone number(s) will be ported. + :param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account. :returns: The fetched PortingPortabilityInstance """ @@ -104,7 +104,7 @@ async def fetch_async( """ Asynchronous coroutine to fetch the PortingPortabilityInstance - :param target_account_sid: The SID of the account where the phone number(s) will be ported. + :param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account. :returns: The fetched PortingPortabilityInstance """ @@ -129,7 +129,7 @@ def __init__(self, version: Version, phone_number: str): Initialize the PortingPortabilityContext :param version: Version that contains the resource - :param phone_number: The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212). + :param phone_number: Phone number to check portability in e164 format. """ super().__init__(version) @@ -147,7 +147,7 @@ def fetch( """ Fetch the PortingPortabilityInstance - :param target_account_sid: The SID of the account where the phone number(s) will be ported. + :param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account. :returns: The fetched PortingPortabilityInstance """ @@ -172,7 +172,7 @@ async def fetch_async( """ Asynchronous coroutine to fetch the PortingPortabilityInstance - :param target_account_sid: The SID of the account where the phone number(s) will be ported. + :param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account. :returns: The fetched PortingPortabilityInstance """ @@ -218,7 +218,7 @@ def get(self, phone_number: str) -> PortingPortabilityContext: """ Constructs a PortingPortabilityContext - :param phone_number: The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212). + :param phone_number: Phone number to check portability in e164 format. """ return PortingPortabilityContext(self._version, phone_number=phone_number) @@ -226,7 +226,7 @@ def __call__(self, phone_number: str) -> PortingPortabilityContext: """ Constructs a PortingPortabilityContext - :param phone_number: The phone number which portability is to be checked. Phone numbers are in E.164 format (e.g. +16175551212). + :param phone_number: Phone number to check portability in e164 format. """ return PortingPortabilityContext(self._version, phone_number=phone_number) diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration.py b/twilio/rest/numbers/v1/porting_webhook_configuration.py index ea6d9bd2eb..ec36777a61 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration.py @@ -23,9 +23,9 @@ class PortingWebhookConfigurationInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request - :ivar port_in_target_url: Webhook URL to send a request when a port in request or port in phone number event happens - :ivar port_out_target_url: Webhook URL to send a request when a port out phone number event happens - :ivar notifications_of: List of notification events to send a request to the webhook URL + :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens + :ivar port_out_target_url: The complete webhook url that will be called when a notification event for a port out phone number happens. + :ivar notifications_of: A list to filter what notification events to receive for this account and its sub accounts. If it is an empty list, then it means that there are no filters for the notifications events to send in each webhook and all events will get sent. """ def __init__(self, version: Version, payload: Dict[str, Any]): diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py b/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py index beb011128f..73d3477972 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py @@ -29,7 +29,7 @@ def __init__( Initialize the PortingWebhookConfigurationDeleteContext :param version: Version that contains the resource - :param webhook_type: The of the webhook type of the configuration to be deleted + :param webhook_type: The webhook type for the configuration to be delete. `PORT_IN`, `PORT_OUT` """ super().__init__(version) @@ -94,7 +94,7 @@ def get( """ Constructs a PortingWebhookConfigurationDeleteContext - :param webhook_type: The of the webhook type of the configuration to be deleted + :param webhook_type: The webhook type for the configuration to be delete. `PORT_IN`, `PORT_OUT` """ return PortingWebhookConfigurationDeleteContext( self._version, webhook_type=webhook_type @@ -106,7 +106,7 @@ def __call__( """ Constructs a PortingWebhookConfigurationDeleteContext - :param webhook_type: The of the webhook type of the configuration to be deleted + :param webhook_type: The webhook type for the configuration to be delete. `PORT_IN`, `PORT_OUT` """ return PortingWebhookConfigurationDeleteContext( self._version, webhook_type=webhook_type diff --git a/twilio/rest/numbers/v1/webhook.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py similarity index 64% rename from twilio/rest/numbers/v1/webhook.py rename to twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py index 0986db12f3..89b8064bdb 100644 --- a/twilio/rest/numbers/v1/webhook.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -21,12 +21,12 @@ from twilio.base.version import Version -class WebhookInstance(InstanceResource): +class PortingWebhookConfigurationFetchInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request - :ivar port_in_target_url: Webhook URL to send a request when a port in request or port in phone number event happens - :ivar port_out_target_url: Webhook URL to send a request when a port out phone number event happens - :ivar notifications_of: List of notification events to send a request to the webhook URL + :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens + :ivar port_out_target_url: The complete webhook url that will be called when a notification event for a port out phone number happens. + :ivar notifications_of: A list to filter what notification events to receive for this account and its sub accounts. If it is an empty list, then it means that there are no filters for the notifications events to send in each webhook and all events will get sent. :ivar port_in_target_date_created: Creation date for the port in webhook configuration :ivar port_out_target_date_created: Creation date for the port out webhook configuration """ @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class WebhookList(ListResource): +class PortingWebhookConfigurationFetchList(ListResource): def __init__(self, version: Version): """ - Initialize the WebhookList + Initialize the PortingWebhookConfigurationFetchList :param version: Version that contains the resource @@ -68,25 +68,25 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> WebhookInstance: + def fetch(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) - async def fetch_async(self) -> WebhookInstance: + async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -94,7 +94,7 @@ async def fetch_async(self) -> WebhookInstance: method="GET", uri=self._uri, headers=headers ) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) def __repr__(self) -> str: """ @@ -102,4 +102,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/numbers/v1/signing_request_configuration.py b/twilio/rest/numbers/v1/signing_request_configuration.py index 541062ec6d..a144a09fe6 100644 --- a/twilio/rest/numbers/v1/signing_request_configuration.py +++ b/twilio/rest/numbers/v1/signing_request_configuration.py @@ -12,12 +12,13 @@ Do not edit the class manually. """ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base.version import Version +from twilio.base.page import Page class SigningRequestConfigurationInstance(InstanceResource): @@ -54,6 +55,27 @@ def __repr__(self) -> str: return "" +class SigningRequestConfigurationPage(Page): + + def get_instance( + self, payload: Dict[str, Any] + ) -> SigningRequestConfigurationInstance: + """ + Build an instance of SigningRequestConfigurationInstance + + :param payload: Payload response from the API + """ + return SigningRequestConfigurationInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + class SigningRequestConfigurationList(ListResource): def __init__(self, version: Version): @@ -109,6 +131,225 @@ async def create_async( return SigningRequestConfigurationInstance(self._version, payload) + def stream( + self, + country: Union[str, object] = values.unset, + product: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[SigningRequestConfigurationInstance]: + """ + Streams SigningRequestConfigurationInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str country: The country ISO code to apply this configuration, this is an optional field, Example: US, MX + :param str product: The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page( + country=country, product=product, page_size=limits["page_size"] + ) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + country: Union[str, object] = values.unset, + product: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[SigningRequestConfigurationInstance]: + """ + Asynchronously streams SigningRequestConfigurationInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str country: The country ISO code to apply this configuration, this is an optional field, Example: US, MX + :param str product: The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + country=country, product=product, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + country: Union[str, object] = values.unset, + product: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[SigningRequestConfigurationInstance]: + """ + Lists SigningRequestConfigurationInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str country: The country ISO code to apply this configuration, this is an optional field, Example: US, MX + :param str product: The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + country=country, + product=product, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + country: Union[str, object] = values.unset, + product: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[SigningRequestConfigurationInstance]: + """ + Asynchronously lists SigningRequestConfigurationInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str country: The country ISO code to apply this configuration, this is an optional field, Example: US, MX + :param str product: The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + country=country, + product=product, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + country: Union[str, object] = values.unset, + product: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> SigningRequestConfigurationPage: + """ + Retrieve a single page of SigningRequestConfigurationInstance records from the API. + Request is executed immediately + + :param country: The country ISO code to apply this configuration, this is an optional field, Example: US, MX + :param product: The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of SigningRequestConfigurationInstance + """ + data = values.of( + { + "Country": country, + "Product": product, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return SigningRequestConfigurationPage(self._version, response) + + async def page_async( + self, + country: Union[str, object] = values.unset, + product: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> SigningRequestConfigurationPage: + """ + Asynchronously retrieve a single page of SigningRequestConfigurationInstance records from the API. + Request is executed immediately + + :param country: The country ISO code to apply this configuration, this is an optional field, Example: US, MX + :param product: The product or service for which is requesting the signature, this is an optional field, Example: Porting, Hosting + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of SigningRequestConfigurationInstance + """ + data = values.of( + { + "Country": country, + "Product": product, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return SigningRequestConfigurationPage(self._version, response) + + def get_page(self, target_url: str) -> SigningRequestConfigurationPage: + """ + Retrieve a specific page of SigningRequestConfigurationInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of SigningRequestConfigurationInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return SigningRequestConfigurationPage(self._version, response) + + async def get_page_async(self, target_url: str) -> SigningRequestConfigurationPage: + """ + Asynchronously retrieve a specific page of SigningRequestConfigurationInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of SigningRequestConfigurationInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return SigningRequestConfigurationPage(self._version, response) + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v2/__init__.py b/twilio/rest/numbers/v2/__init__.py index 9b5b50154e..04b303486e 100644 --- a/twilio/rest/numbers/v2/__init__.py +++ b/twilio/rest/numbers/v2/__init__.py @@ -17,6 +17,7 @@ from twilio.base.domain import Domain from twilio.rest.numbers.v2.authorization_document import AuthorizationDocumentList from twilio.rest.numbers.v2.bulk_hosted_number_order import BulkHostedNumberOrderList +from twilio.rest.numbers.v2.bundle_clone import BundleCloneList from twilio.rest.numbers.v2.hosted_number_order import HostedNumberOrderList from twilio.rest.numbers.v2.regulatory_compliance import RegulatoryComplianceList @@ -32,6 +33,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v2") self._authorization_documents: Optional[AuthorizationDocumentList] = None self._bulk_hosted_number_orders: Optional[BulkHostedNumberOrderList] = None + self._bundle_clone: Optional[BundleCloneList] = None self._hosted_number_orders: Optional[HostedNumberOrderList] = None self._regulatory_compliance: Optional[RegulatoryComplianceList] = None @@ -47,6 +49,12 @@ def bulk_hosted_number_orders(self) -> BulkHostedNumberOrderList: self._bulk_hosted_number_orders = BulkHostedNumberOrderList(self) return self._bulk_hosted_number_orders + @property + def bundle_clone(self) -> BundleCloneList: + if self._bundle_clone is None: + self._bundle_clone = BundleCloneList(self) + return self._bundle_clone + @property def hosted_number_orders(self) -> HostedNumberOrderList: if self._hosted_number_orders is None: diff --git a/twilio/rest/numbers/v2/bundle_clone.py b/twilio/rest/numbers/v2/bundle_clone.py new file mode 100644 index 0000000000..ff24e29063 --- /dev/null +++ b/twilio/rest/numbers/v2/bundle_clone.py @@ -0,0 +1,268 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Numbers + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class BundleCloneInstance(InstanceResource): + + class Status(object): + DRAFT = "draft" + PENDING_REVIEW = "pending-review" + IN_REVIEW = "in-review" + TWILIO_REJECTED = "twilio-rejected" + TWILIO_APPROVED = "twilio-approved" + PROVISIONALLY_APPROVED = "provisionally-approved" + + """ + :ivar bundle_sid: The unique string that we created to identify the Bundle resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Bundle resource. + :ivar regulation_sid: The unique string of a regulation that is associated to the Bundle resource. + :ivar friendly_name: The string that you assigned to describe the resource. + :ivar status: + :ivar valid_until: The date and time in GMT in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format when the resource will be valid until. + :ivar email: The email address that will receive updates when the Bundle resource changes status. + :ivar status_callback: The URL we call to inform your application of status changes. + :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar url: The URL of this resource. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + bundle_sid: Optional[str] = None, + ): + super().__init__(version) + + self.bundle_sid: Optional[str] = payload.get("bundle_sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.regulation_sid: Optional[str] = payload.get("regulation_sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.status: Optional["BundleCloneInstance.Status"] = payload.get("status") + self.valid_until: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("valid_until") + ) + self.email: Optional[str] = payload.get("email") + self.status_callback: Optional[str] = payload.get("status_callback") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "bundle_sid": bundle_sid or self.bundle_sid, + } + self._context: Optional[BundleCloneContext] = None + + @property + def _proxy(self) -> "BundleCloneContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: BundleCloneContext for this BundleCloneInstance + """ + if self._context is None: + self._context = BundleCloneContext( + self._version, + bundle_sid=self._solution["bundle_sid"], + ) + return self._context + + def create( + self, + target_account_sid: str, + move_to_draft: Union[bool, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> "BundleCloneInstance": + """ + Create the BundleCloneInstance + + :param target_account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) where the bundle needs to be cloned. + :param move_to_draft: This is to determine whether the cloned bundle needs to be in draft state or not. + :param friendly_name: The string that you assigned to describe the cloned bundle. + + :returns: The created BundleCloneInstance + """ + return self._proxy.create( + target_account_sid, + move_to_draft=move_to_draft, + friendly_name=friendly_name, + ) + + async def create_async( + self, + target_account_sid: str, + move_to_draft: Union[bool, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> "BundleCloneInstance": + """ + Asynchronous coroutine to create the BundleCloneInstance + + :param target_account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) where the bundle needs to be cloned. + :param move_to_draft: This is to determine whether the cloned bundle needs to be in draft state or not. + :param friendly_name: The string that you assigned to describe the cloned bundle. + + :returns: The created BundleCloneInstance + """ + return await self._proxy.create_async( + target_account_sid, + move_to_draft=move_to_draft, + friendly_name=friendly_name, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class BundleCloneContext(InstanceContext): + + def __init__(self, version: Version, bundle_sid: str): + """ + Initialize the BundleCloneContext + + :param version: Version that contains the resource + :param bundle_sid: The unique string that identifies the Bundle to be cloned. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "bundle_sid": bundle_sid, + } + self._uri = "/RegulatoryCompliance/Bundles/{bundle_sid}/Clones".format( + **self._solution + ) + + def create( + self, + target_account_sid: str, + move_to_draft: Union[bool, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> BundleCloneInstance: + """ + Create the BundleCloneInstance + + :param target_account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) where the bundle needs to be cloned. + :param move_to_draft: This is to determine whether the cloned bundle needs to be in draft state or not. + :param friendly_name: The string that you assigned to describe the cloned bundle. + + :returns: The created BundleCloneInstance + """ + data = values.of( + { + "TargetAccountSid": target_account_sid, + "MoveToDraft": serialize.boolean_to_string(move_to_draft), + "FriendlyName": friendly_name, + } + ) + + payload = self._version.create(method="POST", uri=self._uri, data=data) + + return BundleCloneInstance( + self._version, payload, bundle_sid=self._solution["bundle_sid"] + ) + + async def create_async( + self, + target_account_sid: str, + move_to_draft: Union[bool, object] = values.unset, + friendly_name: Union[str, object] = values.unset, + ) -> BundleCloneInstance: + """ + Asynchronous coroutine to create the BundleCloneInstance + + :param target_account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) where the bundle needs to be cloned. + :param move_to_draft: This is to determine whether the cloned bundle needs to be in draft state or not. + :param friendly_name: The string that you assigned to describe the cloned bundle. + + :returns: The created BundleCloneInstance + """ + data = values.of( + { + "TargetAccountSid": target_account_sid, + "MoveToDraft": serialize.boolean_to_string(move_to_draft), + "FriendlyName": friendly_name, + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data + ) + + return BundleCloneInstance( + self._version, payload, bundle_sid=self._solution["bundle_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class BundleCloneList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the BundleCloneList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, bundle_sid: str) -> BundleCloneContext: + """ + Constructs a BundleCloneContext + + :param bundle_sid: The unique string that identifies the Bundle to be cloned. + """ + return BundleCloneContext(self._version, bundle_sid=bundle_sid) + + def __call__(self, bundle_sid: str) -> BundleCloneContext: + """ + Constructs a BundleCloneContext + + :param bundle_sid: The unique string that identifies the Bundle to be cloned. + """ + return BundleCloneContext(self._version, bundle_sid=bundle_sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index ccdcbb3f38..5c8b48f11d 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -488,6 +488,7 @@ def create( iso_country: Union[str, object] = values.unset, end_user_type: Union["BundleInstance.EndUserType", object] = values.unset, number_type: Union[str, object] = values.unset, + is_test: Union[bool, object] = values.unset, ) -> BundleInstance: """ Create the BundleInstance @@ -499,6 +500,7 @@ def create( :param iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. :param end_user_type: :param number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. + :param is_test: Indicates that Bundle is a Test Bundle and will be Auto-Rejected :returns: The created BundleInstance """ @@ -512,6 +514,7 @@ def create( "IsoCountry": iso_country, "EndUserType": end_user_type, "NumberType": number_type, + "IsTest": serialize.boolean_to_string(is_test), } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -531,6 +534,7 @@ async def create_async( iso_country: Union[str, object] = values.unset, end_user_type: Union["BundleInstance.EndUserType", object] = values.unset, number_type: Union[str, object] = values.unset, + is_test: Union[bool, object] = values.unset, ) -> BundleInstance: """ Asynchronously create the BundleInstance @@ -542,6 +546,7 @@ async def create_async( :param iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. :param end_user_type: :param number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. + :param is_test: Indicates that Bundle is a Test Bundle and will be Auto-Rejected :returns: The created BundleInstance """ @@ -555,6 +560,7 @@ async def create_async( "IsoCountry": iso_country, "EndUserType": end_user_type, "NumberType": number_type, + "IsTest": serialize.boolean_to_string(is_test), } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index f71c4bd68f..631b8f8bdb 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -56,7 +56,7 @@ class Status(object): :ivar url: The absolute URL of the Task resource. :ivar links: The URLs of related resources. :ivar virtual_start_time: The date and time in GMT indicating the ordering for routing of the Task specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar ignore_capacity: A boolean indicating if a new task should respect a worker's capacity during assignment + :ivar ignore_capacity: A boolean that indicates if the Task should respect a Worker's capacity and availability during assignment. This field can only be used when the `RoutingTarget` field is set to a Worker SID. By setting `IgnoreCapacity` to a value of `true`, `1`, or `yes`, the Task will be routed to the Worker without respecting their capacity and availability. Any other value will enforce the Worker's capacity and availability. The default value of `IgnoreCapacity` is `true` when the `RoutingTarget` is set to a Worker SID. :ivar routing_target: A SID of a Worker, Queue, or Workflow to route a Task to """ @@ -536,7 +536,7 @@ def create( :param attributes: A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. :param virtual_start_time: The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. :param routing_target: A SID of a Worker, Queue, or Workflow to route a Task to - :param ignore_capacity: A boolean indicating if a new task should respect a worker's capacity during assignment + :param ignore_capacity: A boolean that indicates if the Task should respect a Worker's capacity and availability during assignment. This field can only be used when the `RoutingTarget` field is set to a Worker SID. By setting `IgnoreCapacity` to a value of `true`, `1`, or `yes`, the Task will be routed to the Worker without respecting their capacity and availability. Any other value will enforce the Worker's capacity and availability. The default value of `IgnoreCapacity` is `true` when the `RoutingTarget` is set to a Worker SID. :param task_queue_sid: The SID of the TaskQueue in which the Task belongs :returns: The created TaskInstance @@ -587,7 +587,7 @@ async def create_async( :param attributes: A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. :param virtual_start_time: The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. :param routing_target: A SID of a Worker, Queue, or Workflow to route a Task to - :param ignore_capacity: A boolean indicating if a new task should respect a worker's capacity during assignment + :param ignore_capacity: A boolean that indicates if the Task should respect a Worker's capacity and availability during assignment. This field can only be used when the `RoutingTarget` field is set to a Worker SID. By setting `IgnoreCapacity` to a value of `true`, `1`, or `yes`, the Task will be routed to the Worker without respecting their capacity and availability. Any other value will enforce the Worker's capacity and availability. The default value of `IgnoreCapacity` is `true` when the `RoutingTarget` is set to a Worker SID. :param task_queue_sid: The SID of the TaskQueue in which the Task belongs :returns: The created TaskInstance diff --git a/twilio/rest/trusthub/v1/compliance_inquiries.py b/twilio/rest/trusthub/v1/compliance_inquiries.py index 6fe6c297bd..fe83b8630a 100644 --- a/twilio/rest/trusthub/v1/compliance_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_inquiries.py @@ -61,30 +61,36 @@ def _proxy(self) -> "ComplianceInquiriesContext": ) return self._context - def update(self, primary_profile_sid: str) -> "ComplianceInquiriesInstance": + def update( + self, primary_profile_sid: str, theme_set_id: Union[str, object] = values.unset + ) -> "ComplianceInquiriesInstance": """ Update the ComplianceInquiriesInstance :param primary_profile_sid: The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + :param theme_set_id: Theme id for styling the inquiry form. :returns: The updated ComplianceInquiriesInstance """ return self._proxy.update( primary_profile_sid=primary_profile_sid, + theme_set_id=theme_set_id, ) async def update_async( - self, primary_profile_sid: str + self, primary_profile_sid: str, theme_set_id: Union[str, object] = values.unset ) -> "ComplianceInquiriesInstance": """ Asynchronous coroutine to update the ComplianceInquiriesInstance :param primary_profile_sid: The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + :param theme_set_id: Theme id for styling the inquiry form. :returns: The updated ComplianceInquiriesInstance """ return await self._proxy.update_async( primary_profile_sid=primary_profile_sid, + theme_set_id=theme_set_id, ) def __repr__(self) -> str: @@ -116,17 +122,21 @@ def __init__(self, version: Version, customer_id: str): **self._solution ) - def update(self, primary_profile_sid: str) -> ComplianceInquiriesInstance: + def update( + self, primary_profile_sid: str, theme_set_id: Union[str, object] = values.unset + ) -> ComplianceInquiriesInstance: """ Update the ComplianceInquiriesInstance :param primary_profile_sid: The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + :param theme_set_id: Theme id for styling the inquiry form. :returns: The updated ComplianceInquiriesInstance """ data = values.of( { "PrimaryProfileSid": primary_profile_sid, + "ThemeSetId": theme_set_id, } ) @@ -141,18 +151,20 @@ def update(self, primary_profile_sid: str) -> ComplianceInquiriesInstance: ) async def update_async( - self, primary_profile_sid: str + self, primary_profile_sid: str, theme_set_id: Union[str, object] = values.unset ) -> ComplianceInquiriesInstance: """ Asynchronous coroutine to update the ComplianceInquiriesInstance :param primary_profile_sid: The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. + :param theme_set_id: Theme id for styling the inquiry form. :returns: The updated ComplianceInquiriesInstance """ data = values.of( { "PrimaryProfileSid": primary_profile_sid, + "ThemeSetId": theme_set_id, } ) @@ -193,12 +205,14 @@ def create( self, primary_profile_sid: str, notification_email: Union[str, object] = values.unset, + theme_set_id: Union[str, object] = values.unset, ) -> ComplianceInquiriesInstance: """ Create the ComplianceInquiriesInstance :param primary_profile_sid: The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. :param notification_email: The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. + :param theme_set_id: Theme id for styling the inquiry form. :returns: The created ComplianceInquiriesInstance """ @@ -207,6 +221,7 @@ def create( { "PrimaryProfileSid": primary_profile_sid, "NotificationEmail": notification_email, + "ThemeSetId": theme_set_id, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -221,12 +236,14 @@ async def create_async( self, primary_profile_sid: str, notification_email: Union[str, object] = values.unset, + theme_set_id: Union[str, object] = values.unset, ) -> ComplianceInquiriesInstance: """ Asynchronously create the ComplianceInquiriesInstance :param primary_profile_sid: The unique SID identifier of the Primary Customer Profile that should be used as a parent. Only necessary when creating a secondary Customer Profile. :param notification_email: The email address that approval status updates will be sent to. If not specified, the email address associated with your primary customer profile will be used. + :param theme_set_id: Theme id for styling the inquiry form. :returns: The created ComplianceInquiriesInstance """ @@ -235,6 +252,7 @@ async def create_async( { "PrimaryProfileSid": primary_profile_sid, "NotificationEmail": notification_email, + "ThemeSetId": theme_set_id, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 69a6cf853e..9b8b4b4da9 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -43,7 +43,7 @@ class ServiceInstance(InstanceResource): :ivar dtmf_input_required: Whether to ask the user to press a number before delivering the verify code in a phone call. :ivar tts_name: The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. :ivar do_not_share_warning_enabled: Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` - :ivar custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + :ivar custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. :ivar push: Configurations for the Push factors (channel) created under this Service. :ivar totp: Configurations for the TOTP factors (channel) created under this Service. :ivar default_template_sid: @@ -183,7 +183,7 @@ def update( :param tts_name: The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. :param psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification. :param do_not_share_warning_enabled: Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** - :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. :param push_include_date: Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. :param push_apn_credential_sid: Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) :param push_fcm_credential_sid: Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) @@ -255,7 +255,7 @@ async def update_async( :param tts_name: The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. :param psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification. :param do_not_share_warning_enabled: Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** - :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. :param push_include_date: Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. :param push_apn_credential_sid: Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) :param push_fcm_credential_sid: Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) @@ -473,7 +473,7 @@ def update( :param tts_name: The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. :param psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification. :param do_not_share_warning_enabled: Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** - :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. :param push_include_date: Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. :param push_apn_credential_sid: Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) :param push_fcm_credential_sid: Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) @@ -561,7 +561,7 @@ async def update_async( :param tts_name: The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. :param psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification. :param do_not_share_warning_enabled: Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** - :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. :param push_include_date: Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. :param push_apn_credential_sid: Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) :param push_fcm_credential_sid: Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) @@ -775,7 +775,7 @@ def create( :param tts_name: The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. :param psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification. :param do_not_share_warning_enabled: Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` - :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. :param push_include_date: Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. :param push_apn_credential_sid: Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) :param push_fcm_credential_sid: Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) @@ -863,7 +863,7 @@ async def create_async( :param tts_name: The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. :param psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification. :param do_not_share_warning_enabled: Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` - :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + :param custom_code_enabled: Whether to allow sending verifications with a custom code instead of a randomly generated one. :param push_include_date: Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. :param push_apn_credential_sid: Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) :param push_fcm_credential_sid: Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) From e848451ed378cf12bba443051d8f04d19e9c0153 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 26 Aug 2024 11:23:30 +0000 Subject: [PATCH 043/113] Release 9.2.4 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8fee9aa182..c775b6c766 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.2.3", + version="9.2.4", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index bb8cd36f5d..17b3d8825f 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "2", "3") +__version_info__ = ("9", "2", "4") __version__ = ".".join(__version_info__) From ba7da14775a5271accbf8fa2841d008b356287ce Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 5 Sep 2024 12:55:48 +0000 Subject: [PATCH 044/113] [Librarian] Regenerated @ 78bf2bbef74e4846ca8353fbdee038a6b8080c59 2250ef3ba08540233f688bf6aaa55e9c94febf3b --- CHANGES.md | 10 + twilio/rest/__init__.py | 15 + twilio/rest/content/v1/content/__init__.py | 117 ++++++- twilio/rest/iam/IamBase.py | 44 +++ twilio/rest/iam/v1/__init__.py | 59 ++++ twilio/rest/iam/v1/api_key.py | 328 ++++++++++++++++++ twilio/rest/iam/v1/get_api_keys.py | 294 ++++++++++++++++ twilio/rest/iam/v1/new_api_key.py | 149 ++++++++ twilio/rest/numbers/v1/porting_port_in.py | 4 +- .../supporting_document.py | 2 + .../task_queue_real_time_statistics.py | 2 +- 11 files changed, 1018 insertions(+), 6 deletions(-) create mode 100644 twilio/rest/iam/IamBase.py create mode 100644 twilio/rest/iam/v1/__init__.py create mode 100644 twilio/rest/iam/v1/api_key.py create mode 100644 twilio/rest/iam/v1/get_api_keys.py create mode 100644 twilio/rest/iam/v1/new_api_key.py diff --git a/CHANGES.md b/CHANGES.md index 2222dfc4d5..ad840949f1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,16 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-09-05] Version 9.3.0 +-------------------------- +**Iam** +- updated library_visibility public for new public apikeys + +**Numbers** +- Add new field in Error Codes for Regulatory Compliance. +- Change typing of Port In Request date_created field to date_time instead of date **(breaking change)** + + [2024-08-26] Version 9.2.4 -------------------------- **Library - Chore** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 2dc0a4930f..35c57385aa 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -23,6 +23,7 @@ from twilio.rest.events import Events from twilio.rest.flex_api import FlexApi from twilio.rest.frontline_api import FrontlineApi + from twilio.rest.iam import Iam from twilio.rest.insights import Insights from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging @@ -131,6 +132,7 @@ def __init__( self._events: Optional["Events"] = None self._flex_api: Optional["FlexApi"] = None self._frontline_api: Optional["FrontlineApi"] = None + self._iam: Optional["Iam"] = None self._insights: Optional["Insights"] = None self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None @@ -275,6 +277,19 @@ def frontline_api(self) -> "FrontlineApi": self._frontline_api = FrontlineApi(self) return self._frontline_api + @property + def iam(self) -> "Iam": + """ + Access the Iam Twilio Domain + + :returns: Iam Twilio Domain + """ + if self._iam is None: + from twilio.rest.iam import Iam + + self._iam = Iam(self) + return self._iam + @property def insights(self) -> "Insights": """ diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index f2dec12761..3ddc8b926e 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -32,11 +32,15 @@ class AuthenticationActionType(object): class CallToActionActionType(object): URL = "URL" PHONE_NUMBER = "PHONE_NUMBER" + COPY_CODE = "COPY_CODE" + VOICE_CALL = "VOICE_CALL" class CardActionType(object): URL = "URL" PHONE_NUMBER = "PHONE_NUMBER" QUICK_REPLY = "QUICK_REPLY" + COPY_CODE = "COPY_CODE" + VOICE_CALL = "VOICE_CALL" class CarouselActionType(object): URL = "URL" @@ -321,7 +325,7 @@ class CallToActionAction(object): :ivar title: :ivar url: :ivar phone: - :ivar id: + :ivar code: """ def __init__(self, payload: Dict[str, Any]): @@ -332,7 +336,7 @@ def __init__(self, payload: Dict[str, Any]): self.title: Optional[str] = payload.get("title") self.url: Optional[str] = payload.get("url") self.phone: Optional[str] = payload.get("phone") - self.id: Optional[str] = payload.get("id") + self.code: Optional[str] = payload.get("code") def to_dict(self): return { @@ -340,7 +344,7 @@ def to_dict(self): "title": self.title, "url": self.url, "phone": self.phone, - "id": self.id, + "code": self.code, } class CardAction(object): @@ -350,6 +354,7 @@ class CardAction(object): :ivar url: :ivar phone: :ivar id: + :ivar code: """ def __init__(self, payload: Dict[str, Any]): @@ -359,6 +364,7 @@ def __init__(self, payload: Dict[str, Any]): self.url: Optional[str] = payload.get("url") self.phone: Optional[str] = payload.get("phone") self.id: Optional[str] = payload.get("id") + self.code: Optional[str] = payload.get("code") def to_dict(self): return { @@ -367,6 +373,7 @@ def to_dict(self): "url": self.url, "phone": self.phone, "id": self.id, + "code": self.code, } class CarouselAction(object): @@ -474,6 +481,76 @@ def to_dict(self): "types": self.types.to_dict(), } + class FlowsPage(object): + """ + :ivar id: + :ivar next_page_id: + :ivar title: + :ivar subtitle: + :ivar layout: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.next_page_id: Optional[str] = payload.get("next_page_id") + self.title: Optional[str] = payload.get("title") + self.subtitle: Optional[str] = payload.get("subtitle") + self.layout: Optional[List[ContentList.FlowsPageComponent]] = payload.get( + "layout" + ) + + def to_dict(self): + return { + "id": self.id, + "next_page_id": self.next_page_id, + "title": self.title, + "subtitle": self.subtitle, + "layout": [layout.to_dict() for layout in self.layout], + } + + class FlowsPageComponent(object): + """ + :ivar label: + :ivar type: + :ivar text: + :ivar options: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.label: Optional[str] = payload.get("label") + self.type: Optional[str] = payload.get("type") + self.text: Optional[str] = payload.get("text") + self.options: Optional[List[ContentList.FlowsPageComponentSelectItem]] = ( + payload.get("options") + ) + + def to_dict(self): + return { + "label": self.label, + "type": self.type, + "text": self.text, + "options": [options.to_dict() for options in self.options], + } + + class FlowsPageComponentSelectItem(object): + """ + :ivar id: + :ivar title: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.title: Optional[str] = payload.get("title") + + def to_dict(self): + return { + "id": self.id, + "title": self.title, + } + class ListItem(object): """ :ivar id: @@ -606,6 +683,35 @@ def to_dict(self): "dynamic_items": self.dynamic_items, } + class TwilioFlows(object): + """ + :ivar body: + :ivar button_text: + :ivar subtitle: + :ivar media_url: + :ivar pages: + :ivar type: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.button_text: Optional[str] = payload.get("button_text") + self.subtitle: Optional[str] = payload.get("subtitle") + self.media_url: Optional[str] = payload.get("media_url") + self.pages: Optional[List[ContentList.FlowsPage]] = payload.get("pages") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "body": self.body, + "button_text": self.button_text, + "subtitle": self.subtitle, + "media_url": self.media_url, + "pages": [pages.to_dict() for pages in self.pages], + "type": self.type, + } + class TwilioListPicker(object): """ :ivar body: @@ -707,6 +813,7 @@ class Types(object): :ivar twilio_card: :ivar twilio_catalog: :ivar twilio_carousel: + :ivar twilio_flows: :ivar whatsapp_card: :ivar whatsapp_authentication: """ @@ -740,6 +847,9 @@ def __init__(self, payload: Dict[str, Any]): self.twilio_carousel: Optional[ContentList.TwilioCarousel] = payload.get( "twilio_carousel" ) + self.twilio_flows: Optional[ContentList.TwilioFlows] = payload.get( + "twilio_flows" + ) self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( "whatsapp_card" ) @@ -758,6 +868,7 @@ def to_dict(self): "twilio_card": self.twilio_card.to_dict(), "twilio_catalog": self.twilio_catalog.to_dict(), "twilio_carousel": self.twilio_carousel.to_dict(), + "twilio_flows": self.twilio_flows.to_dict(), "whatsapp_card": self.whatsapp_card.to_dict(), "whatsapp_authentication": self.whatsapp_authentication.to_dict(), } diff --git a/twilio/rest/iam/IamBase.py b/twilio/rest/iam/IamBase.py new file mode 100644 index 0000000000..2882ec145b --- /dev/null +++ b/twilio/rest/iam/IamBase.py @@ -0,0 +1,44 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional + +from twilio.base.domain import Domain +from twilio.rest import Client +from twilio.rest.iam.v1 import V1 + + +class IamBase(Domain): + + def __init__(self, twilio: Client): + """ + Initialize the Iam Domain + + :returns: Domain for Iam + """ + super().__init__(twilio, "https://iam.twilio.com") + self._v1: Optional[V1] = None + + @property + def v1(self) -> V1: + """ + :returns: Versions v1 of Iam + """ + if self._v1 is None: + self._v1 = V1(self) + return self._v1 + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/iam/v1/__init__.py b/twilio/rest/iam/v1/__init__.py new file mode 100644 index 0000000000..0c46947341 --- /dev/null +++ b/twilio/rest/iam/v1/__init__.py @@ -0,0 +1,59 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Iam + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.iam.v1.api_key import ApiKeyList +from twilio.rest.iam.v1.get_api_keys import GetApiKeysList +from twilio.rest.iam.v1.new_api_key import NewApiKeyList + + +class V1(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V1 version of Iam + + :param domain: The Twilio.iam domain + """ + super().__init__(domain, "v1") + self._api_key: Optional[ApiKeyList] = None + self._get_api_keys: Optional[GetApiKeysList] = None + self._new_api_key: Optional[NewApiKeyList] = None + + @property + def api_key(self) -> ApiKeyList: + if self._api_key is None: + self._api_key = ApiKeyList(self) + return self._api_key + + @property + def get_api_keys(self) -> GetApiKeysList: + if self._get_api_keys is None: + self._get_api_keys = GetApiKeysList(self) + return self._get_api_keys + + @property + def new_api_key(self) -> NewApiKeyList: + if self._new_api_key is None: + self._new_api_key = NewApiKeyList(self) + return self._new_api_key + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/iam/v1/api_key.py b/twilio/rest/iam/v1/api_key.py new file mode 100644 index 0000000000..b94889fcca --- /dev/null +++ b/twilio/rest/iam/v1/api_key.py @@ -0,0 +1,328 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Iam + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, serialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ApiKeyInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the Key resource. + :ivar friendly_name: The string that you assigned to describe the resource. + :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar policy: The \\`Policy\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.date_created: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_updated") + ) + self.policy: Optional[Dict[str, object]] = payload.get("policy") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[ApiKeyContext] = None + + @property + def _proxy(self) -> "ApiKeyContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: ApiKeyContext for this ApiKeyInstance + """ + if self._context is None: + self._context = ApiKeyContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the ApiKeyInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the ApiKeyInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "ApiKeyInstance": + """ + Fetch the ApiKeyInstance + + + :returns: The fetched ApiKeyInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "ApiKeyInstance": + """ + Asynchronous coroutine to fetch the ApiKeyInstance + + + :returns: The fetched ApiKeyInstance + """ + return await self._proxy.fetch_async() + + def update( + self, + friendly_name: Union[str, object] = values.unset, + policy: Union[object, object] = values.unset, + ) -> "ApiKeyInstance": + """ + Update the ApiKeyInstance + + :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. + :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). + + :returns: The updated ApiKeyInstance + """ + return self._proxy.update( + friendly_name=friendly_name, + policy=policy, + ) + + async def update_async( + self, + friendly_name: Union[str, object] = values.unset, + policy: Union[object, object] = values.unset, + ) -> "ApiKeyInstance": + """ + Asynchronous coroutine to update the ApiKeyInstance + + :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. + :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). + + :returns: The updated ApiKeyInstance + """ + return await self._proxy.update_async( + friendly_name=friendly_name, + policy=policy, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ApiKeyContext(InstanceContext): + + def __init__(self, version: Version, sid: str): + """ + Initialize the ApiKeyContext + + :param version: Version that contains the resource + :param sid: The Twilio-provided string that uniquely identifies the Key resource to update. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/Keys/{sid}".format(**self._solution) + + def delete(self) -> bool: + """ + Deletes the ApiKeyInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the ApiKeyInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def fetch(self) -> ApiKeyInstance: + """ + Fetch the ApiKeyInstance + + + :returns: The fetched ApiKeyInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return ApiKeyInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> ApiKeyInstance: + """ + Asynchronous coroutine to fetch the ApiKeyInstance + + + :returns: The fetched ApiKeyInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return ApiKeyInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + def update( + self, + friendly_name: Union[str, object] = values.unset, + policy: Union[object, object] = values.unset, + ) -> ApiKeyInstance: + """ + Update the ApiKeyInstance + + :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. + :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). + + :returns: The updated ApiKeyInstance + """ + data = values.of( + { + "FriendlyName": friendly_name, + "Policy": serialize.object(policy), + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return ApiKeyInstance(self._version, payload, sid=self._solution["sid"]) + + async def update_async( + self, + friendly_name: Union[str, object] = values.unset, + policy: Union[object, object] = values.unset, + ) -> ApiKeyInstance: + """ + Asynchronous coroutine to update the ApiKeyInstance + + :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. + :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). + + :returns: The updated ApiKeyInstance + """ + data = values.of( + { + "FriendlyName": friendly_name, + "Policy": serialize.object(policy), + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return ApiKeyInstance(self._version, payload, sid=self._solution["sid"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ApiKeyList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the ApiKeyList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, sid: str) -> ApiKeyContext: + """ + Constructs a ApiKeyContext + + :param sid: The Twilio-provided string that uniquely identifies the Key resource to update. + """ + return ApiKeyContext(self._version, sid=sid) + + def __call__(self, sid: str) -> ApiKeyContext: + """ + Constructs a ApiKeyContext + + :param sid: The Twilio-provided string that uniquely identifies the Key resource to update. + """ + return ApiKeyContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/iam/v1/get_api_keys.py b/twilio/rest/iam/v1/get_api_keys.py new file mode 100644 index 0000000000..3a3e9bda76 --- /dev/null +++ b/twilio/rest/iam/v1/get_api_keys.py @@ -0,0 +1,294 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Iam + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class GetApiKeysInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the Key resource. + :ivar friendly_name: The string that you assigned to describe the resource. + :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.date_created: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_updated") + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class GetApiKeysPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> GetApiKeysInstance: + """ + Build an instance of GetApiKeysInstance + + :param payload: Payload response from the API + """ + return GetApiKeysInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class GetApiKeysList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the GetApiKeysList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Keys" + + def stream( + self, + account_sid: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[GetApiKeysInstance]: + """ + Streams GetApiKeysInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(account_sid=account_sid, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + account_sid: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[GetApiKeysInstance]: + """ + Asynchronously streams GetApiKeysInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + account_sid=account_sid, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + account_sid: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[GetApiKeysInstance]: + """ + Lists GetApiKeysInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + account_sid=account_sid, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + account_sid: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[GetApiKeysInstance]: + """ + Asynchronously lists GetApiKeysInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + account_sid=account_sid, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + account_sid: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> GetApiKeysPage: + """ + Retrieve a single page of GetApiKeysInstance records from the API. + Request is executed immediately + + :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of GetApiKeysInstance + """ + data = values.of( + { + "AccountSid": account_sid, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return GetApiKeysPage(self._version, response) + + async def page_async( + self, + account_sid: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> GetApiKeysPage: + """ + Asynchronously retrieve a single page of GetApiKeysInstance records from the API. + Request is executed immediately + + :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of GetApiKeysInstance + """ + data = values.of( + { + "AccountSid": account_sid, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return GetApiKeysPage(self._version, response) + + def get_page(self, target_url: str) -> GetApiKeysPage: + """ + Retrieve a specific page of GetApiKeysInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of GetApiKeysInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return GetApiKeysPage(self._version, response) + + async def get_page_async(self, target_url: str) -> GetApiKeysPage: + """ + Asynchronously retrieve a specific page of GetApiKeysInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of GetApiKeysInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return GetApiKeysPage(self._version, response) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/iam/v1/new_api_key.py b/twilio/rest/iam/v1/new_api_key.py new file mode 100644 index 0000000000..e3f9fa05a6 --- /dev/null +++ b/twilio/rest/iam/v1/new_api_key.py @@ -0,0 +1,149 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Iam + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, serialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class NewApiKeyInstance(InstanceResource): + + class Keytype(object): + RESTRICTED = "restricted" + + """ + :ivar sid: The unique string that that we created to identify the NewKey resource. You will use this as the basic-auth `user` when authenticating to the API. + :ivar friendly_name: The string that you assigned to describe the resource. + :ivar date_created: The date and time in GMT that the API Key was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_updated: The date and time in GMT that the new API Key was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar secret: The secret your application uses to sign Access Tokens and to authenticate to the REST API (you will use this as the basic-auth `password`). **Note that for security reasons, this field is ONLY returned when the API Key is first created.** + :ivar policy: Collection of allow assertions. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.date_created: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_updated") + ) + self.secret: Optional[str] = payload.get("secret") + self.policy: Optional[Dict[str, object]] = payload.get("policy") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class NewApiKeyList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the NewApiKeyList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Keys" + + def create( + self, + account_sid: str, + friendly_name: Union[str, object] = values.unset, + key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, + policy: Union[object, object] = values.unset, + ) -> NewApiKeyInstance: + """ + Create the NewApiKeyInstance + + :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. + :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. + :param key_type: + :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). + + :returns: The created NewApiKeyInstance + """ + + data = values.of( + { + "AccountSid": account_sid, + "FriendlyName": friendly_name, + "KeyType": key_type, + "Policy": serialize.object(policy), + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return NewApiKeyInstance(self._version, payload) + + async def create_async( + self, + account_sid: str, + friendly_name: Union[str, object] = values.unset, + key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, + policy: Union[object, object] = values.unset, + ) -> NewApiKeyInstance: + """ + Asynchronously create the NewApiKeyInstance + + :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. + :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. + :param key_type: + :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). + + :returns: The created NewApiKeyInstance + """ + + data = values.of( + { + "AccountSid": account_sid, + "FriendlyName": friendly_name, + "KeyType": key_type, + "Policy": serialize.object(policy), + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return NewApiKeyInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index 9ce6b7b4cd..02844a09b4 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -12,7 +12,7 @@ Do not edit the class manually. """ -from datetime import date +from datetime import date, datetime from typing import Any, Dict, List, Optional, Union from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext @@ -70,7 +70,7 @@ def __init__( "phone_numbers" ) self.documents: Optional[List[str]] = payload.get("documents") - self.date_created: Optional[date] = deserialize.iso8601_date( + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py index afa6579a13..c343e91ed5 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py @@ -39,6 +39,7 @@ class Status(object): :ivar mime_type: The image type uploaded in the Supporting Document container. :ivar status: :ivar failure_reason: The failure reason of the Supporting Document Resource. + :ivar errors: A list of errors that occurred during the registering RC Bundle :ivar type: The type of the Supporting Document. :ivar attributes: The set of parameters that are the attributes of the Supporting Documents resource which are listed in the Supporting Document Types. :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. @@ -59,6 +60,7 @@ def __init__( "status" ) self.failure_reason: Optional[str] = payload.get("failure_reason") + self.errors: Optional[List[Dict[str, object]]] = payload.get("errors") self.type: Optional[str] = payload.get("type") self.attributes: Optional[Dict[str, object]] = payload.get("attributes") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py index faca804702..4d4198ac89 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py @@ -31,7 +31,7 @@ class TaskQueueRealTimeStatisticsInstance(InstanceResource): :ivar task_queue_sid: The SID of the TaskQueue from which these statistics were calculated. :ivar tasks_by_priority: The number of Tasks by priority. For example: `{\"0\": \"10\", \"99\": \"5\"}` shows 10 Tasks at priority 0 and 5 at priority 99. :ivar tasks_by_status: The number of Tasks by their current status. For example: `{\"pending\": \"1\", \"reserved\": \"3\", \"assigned\": \"2\", \"completed\": \"5\"}`. - :ivar total_available_workers: The total number of Workers available for Tasks in the TaskQueue. + :ivar total_available_workers: The total number of Workers in the TaskQueue with an `available` status. Workers with an `available` status may already have active interactions or may have none. :ivar total_eligible_workers: The total number of Workers eligible for Tasks in the TaskQueue, independent of their Activity state. :ivar total_tasks: The total number of Tasks. :ivar workspace_sid: The SID of the Workspace that contains the TaskQueue. From 74b506ec8e7207ffbbeabd5c0e71b47ce41a70b4 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 5 Sep 2024 13:00:28 +0000 Subject: [PATCH 045/113] Release 9.3.0 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c775b6c766..6366ea68eb 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.2.4", + version="9.3.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 17b3d8825f..529960ecb5 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "2", "4") +__version_info__ = ("9", "3", "0") __version__ = ".".join(__version_info__) From 3eacd66d8d93a0da044e2db21a71267539f49f6d Mon Sep 17 00:00:00 2001 From: Shubham Date: Wed, 18 Sep 2024 16:58:48 +0530 Subject: [PATCH 046/113] chore: add static init file to iam domain (#813) --- twilio/rest/iam/__init__.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 twilio/rest/iam/__init__.py diff --git a/twilio/rest/iam/__init__.py b/twilio/rest/iam/__init__.py new file mode 100644 index 0000000000..7a7819bcc2 --- /dev/null +++ b/twilio/rest/iam/__init__.py @@ -0,0 +1,35 @@ +from warnings import warn + +from twilio.rest.iam.IamBase import IamBase +from twilio.rest.iam.v1.api_key import ApiKeyList +from twilio.rest.iam.v1.get_api_keys import GetApiKeysList +from twilio.rest.iam.v1.new_api_key import NewApiKeyList + + +class Accounts(IamBase): + @property + def api_key(self) -> ApiKeyList: + warn( + "api_key is deprecated. Use v1.api_key instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.v1.api_key + + @property + def get_api_keys(self) -> GetApiKeysList: + warn( + "get_api_keys is deprecated. Use v1.get_api_keys instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.v1.get_api_keys + + @property + def new_api_key(self) -> NewApiKeyList: + warn( + "new_api_key is deprecated. Use v1.new_api_key instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.v1.new_api_key From e595e2863574bd10caa29247693daab60963bad6 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 18 Sep 2024 13:18:47 +0000 Subject: [PATCH 047/113] [Librarian] Regenerated @ 1b6718f23da76f150eac392860c66a26de9af713 ceb130295f80bc623f22496076e3dd57e27da2fb --- CHANGES.md | 13 + twilio/rest/__init__.py | 15 + twilio/rest/assistants/AssistantsBase.py | 44 ++ twilio/rest/assistants/v1/__init__.py | 75 ++ .../rest/assistants/v1/assistant/__init__.py | 706 +++++++++++++++++ .../rest/assistants/v1/assistant/feedback.py | 364 +++++++++ .../rest/assistants/v1/knowledge/__init__.py | 712 ++++++++++++++++++ twilio/rest/assistants/v1/knowledge/chunk.py | 287 +++++++ twilio/rest/assistants/v1/policy.py | 322 ++++++++ twilio/rest/assistants/v1/session/__init__.py | 425 +++++++++++ twilio/rest/assistants/v1/session/message.py | 299 ++++++++ twilio/rest/assistants/v1/tool.py | 639 ++++++++++++++++ .../rest/content/v1/content/approval_fetch.py | 32 +- twilio/rest/intelligence/v2/operator_type.py | 3 +- .../installed_add_on_usage.py | 30 +- .../marketplace/v1/module_data_management.py | 68 +- twilio/rest/numbers/v2/bundle_clone.py | 8 +- .../regulatory_compliance/bundle/__init__.py | 16 +- 18 files changed, 3980 insertions(+), 78 deletions(-) create mode 100644 twilio/rest/assistants/AssistantsBase.py create mode 100644 twilio/rest/assistants/v1/__init__.py create mode 100644 twilio/rest/assistants/v1/assistant/__init__.py create mode 100644 twilio/rest/assistants/v1/assistant/feedback.py create mode 100644 twilio/rest/assistants/v1/knowledge/__init__.py create mode 100644 twilio/rest/assistants/v1/knowledge/chunk.py create mode 100644 twilio/rest/assistants/v1/policy.py create mode 100644 twilio/rest/assistants/v1/session/__init__.py create mode 100644 twilio/rest/assistants/v1/session/message.py create mode 100644 twilio/rest/assistants/v1/tool.py diff --git a/CHANGES.md b/CHANGES.md index ad840949f1..e8d6748656 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,19 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-09-18] Version 9.3.1 +-------------------------- +**Library - Chore** +- [PR #813](https://github.com/twilio/twilio-python/pull/813): add static init file to iam domain. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Intelligence** +- Remove public from operator_type +- Update operator_type to include general-availablity and deprecated + +**Numbers** +- Remove beta flag for bundle clone API + + [2024-09-05] Version 9.3.0 -------------------------- **Iam** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 35c57385aa..5c8f3ebcfe 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -16,6 +16,7 @@ if TYPE_CHECKING: from twilio.rest.accounts import Accounts from twilio.rest.api import Api + from twilio.rest.assistants import Assistants from twilio.rest.bulkexports import Bulkexports from twilio.rest.chat import Chat from twilio.rest.content import Content @@ -125,6 +126,7 @@ def __init__( # Domains self._accounts: Optional["Accounts"] = None self._api: Optional["Api"] = None + self._assistants: Optional["Assistants"] = None self._bulkexports: Optional["Bulkexports"] = None self._chat: Optional["Chat"] = None self._content: Optional["Content"] = None @@ -186,6 +188,19 @@ def api(self) -> "Api": self._api = Api(self) return self._api + @property + def assistants(self) -> "Assistants": + """ + Access the Assistants Twilio Domain + + :returns: Assistants Twilio Domain + """ + if self._assistants is None: + from twilio.rest.assistants import Assistants + + self._assistants = Assistants(self) + return self._assistants + @property def bulkexports(self) -> "Bulkexports": """ diff --git a/twilio/rest/assistants/AssistantsBase.py b/twilio/rest/assistants/AssistantsBase.py new file mode 100644 index 0000000000..a9c9e9afcd --- /dev/null +++ b/twilio/rest/assistants/AssistantsBase.py @@ -0,0 +1,44 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional + +from twilio.base.domain import Domain +from twilio.rest import Client +from twilio.rest.assistants.v1 import V1 + + +class AssistantsBase(Domain): + + def __init__(self, twilio: Client): + """ + Initialize the Assistants Domain + + :returns: Domain for Assistants + """ + super().__init__(twilio, "https://assistants.twilio.com") + self._v1: Optional[V1] = None + + @property + def v1(self) -> V1: + """ + :returns: Versions v1 of Assistants + """ + if self._v1 is None: + self._v1 = V1(self) + return self._v1 + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/__init__.py b/twilio/rest/assistants/v1/__init__.py new file mode 100644 index 0000000000..546ad14554 --- /dev/null +++ b/twilio/rest/assistants/v1/__init__.py @@ -0,0 +1,75 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.assistants.v1.assistant import AssistantList +from twilio.rest.assistants.v1.knowledge import KnowledgeList +from twilio.rest.assistants.v1.policy import PolicyList +from twilio.rest.assistants.v1.session import SessionList +from twilio.rest.assistants.v1.tool import ToolList + + +class V1(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V1 version of Assistants + + :param domain: The Twilio.assistants domain + """ + super().__init__(domain, "v1") + self._assistants: Optional[AssistantList] = None + self._knowledge: Optional[KnowledgeList] = None + self._policies: Optional[PolicyList] = None + self._sessions: Optional[SessionList] = None + self._tools: Optional[ToolList] = None + + @property + def assistants(self) -> AssistantList: + if self._assistants is None: + self._assistants = AssistantList(self) + return self._assistants + + @property + def knowledge(self) -> KnowledgeList: + if self._knowledge is None: + self._knowledge = KnowledgeList(self) + return self._knowledge + + @property + def policies(self) -> PolicyList: + if self._policies is None: + self._policies = PolicyList(self) + return self._policies + + @property + def sessions(self) -> SessionList: + if self._sessions is None: + self._sessions = SessionList(self) + return self._sessions + + @property + def tools(self) -> ToolList: + if self._tools is None: + self._tools = ToolList(self) + return self._tools + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/assistant/__init__.py b/twilio/rest/assistants/v1/assistant/__init__.py new file mode 100644 index 0000000000..10e90c4743 --- /dev/null +++ b/twilio/rest/assistants/v1/assistant/__init__.py @@ -0,0 +1,706 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page +from twilio.rest.assistants.v1.assistant.feedback import FeedbackList + + +class AssistantInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. + :ivar customer_ai: The Personalization and Perception Engine settings. + :ivar id: The Assistant ID. + :ivar model: The default model used by the assistant. + :ivar name: The name of the assistant. + :ivar owner: The owner/company of the assistant. + :ivar personality_prompt: The personality prompt to be used for assistant. + :ivar date_created: The date and time in GMT when the Assistant was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Assistant was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar knowledge: The list of knowledge sources associated with the assistant. + :ivar tools: The list of tools associated with the assistant. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], id: Optional[str] = None + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.customer_ai: Optional[Dict[str, object]] = payload.get("customer_ai") + self.id: Optional[str] = payload.get("id") + self.model: Optional[str] = payload.get("model") + self.name: Optional[str] = payload.get("name") + self.owner: Optional[str] = payload.get("owner") + self.personality_prompt: Optional[str] = payload.get("personality_prompt") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.knowledge: Optional[List[str]] = payload.get("knowledge") + self.tools: Optional[List[str]] = payload.get("tools") + + self._solution = { + "id": id or self.id, + } + self._context: Optional[AssistantContext] = None + + @property + def _proxy(self) -> "AssistantContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: AssistantContext for this AssistantInstance + """ + if self._context is None: + self._context = AssistantContext( + self._version, + id=self._solution["id"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the AssistantInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the AssistantInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "AssistantInstance": + """ + Fetch the AssistantInstance + + + :returns: The fetched AssistantInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "AssistantInstance": + """ + Asynchronous coroutine to fetch the AssistantInstance + + + :returns: The fetched AssistantInstance + """ + return await self._proxy.fetch_async() + + def update( + self, + assistants_v1_service_update_assistant_request: Union[ + AssistantsV1ServiceUpdateAssistantRequest, object + ] = values.unset, + ) -> "AssistantInstance": + """ + Update the AssistantInstance + + :param assistants_v1_service_update_assistant_request: + + :returns: The updated AssistantInstance + """ + return self._proxy.update( + assistants_v1_service_update_assistant_request=assistants_v1_service_update_assistant_request, + ) + + async def update_async( + self, + assistants_v1_service_update_assistant_request: Union[ + AssistantsV1ServiceUpdateAssistantRequest, object + ] = values.unset, + ) -> "AssistantInstance": + """ + Asynchronous coroutine to update the AssistantInstance + + :param assistants_v1_service_update_assistant_request: + + :returns: The updated AssistantInstance + """ + return await self._proxy.update_async( + assistants_v1_service_update_assistant_request=assistants_v1_service_update_assistant_request, + ) + + @property + def feedbacks(self) -> FeedbackList: + """ + Access the feedbacks + """ + return self._proxy.feedbacks + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AssistantContext(InstanceContext): + + def __init__(self, version: Version, id: str): + """ + Initialize the AssistantContext + + :param version: Version that contains the resource + :param id: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Assistants/{id}".format(**self._solution) + + self._feedbacks: Optional[FeedbackList] = None + + def delete(self) -> bool: + """ + Deletes the AssistantInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the AssistantInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def fetch(self) -> AssistantInstance: + """ + Fetch the AssistantInstance + + + :returns: The fetched AssistantInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return AssistantInstance( + self._version, + payload, + id=self._solution["id"], + ) + + async def fetch_async(self) -> AssistantInstance: + """ + Asynchronous coroutine to fetch the AssistantInstance + + + :returns: The fetched AssistantInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return AssistantInstance( + self._version, + payload, + id=self._solution["id"], + ) + + def update( + self, + assistants_v1_service_update_assistant_request: Union[ + AssistantsV1ServiceUpdateAssistantRequest, object + ] = values.unset, + ) -> AssistantInstance: + """ + Update the AssistantInstance + + :param assistants_v1_service_update_assistant_request: + + :returns: The updated AssistantInstance + """ + data = values.of({}) + headers = values.of( + { + "AssistantsV1ServiceUpdateAssistantRequest": assistants_v1_service_update_assistant_request, + } + ) + + payload = self._version.update( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return AssistantInstance(self._version, payload, id=self._solution["id"]) + + async def update_async( + self, + assistants_v1_service_update_assistant_request: Union[ + AssistantsV1ServiceUpdateAssistantRequest, object + ] = values.unset, + ) -> AssistantInstance: + """ + Asynchronous coroutine to update the AssistantInstance + + :param assistants_v1_service_update_assistant_request: + + :returns: The updated AssistantInstance + """ + data = values.of({}) + headers = values.of( + { + "AssistantsV1ServiceUpdateAssistantRequest": assistants_v1_service_update_assistant_request, + } + ) + + payload = await self._version.update_async( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return AssistantInstance(self._version, payload, id=self._solution["id"]) + + @property + def feedbacks(self) -> FeedbackList: + """ + Access the feedbacks + """ + if self._feedbacks is None: + self._feedbacks = FeedbackList( + self._version, + self._solution["id"], + ) + return self._feedbacks + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AssistantPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> AssistantInstance: + """ + Build an instance of AssistantInstance + + :param payload: Payload response from the API + """ + return AssistantInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class AssistantList(ListResource): + + class AssistantsV1ServiceCreateAssistantRequest(object): + """ + :ivar customer_ai: + :ivar name: The name of the assistant. + :ivar owner: The owner/company of the assistant. + :ivar personality_prompt: The personality prompt to be used for assistant. + :ivar segment_credential: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.customer_ai: Optional[AssistantList.AssistantsV1ServiceCustomerAi] = ( + payload.get("customer_ai") + ) + self.name: Optional[str] = payload.get("name") + self.owner: Optional[str] = payload.get("owner") + self.personality_prompt: Optional[str] = payload.get("personality_prompt") + self.segment_credential: Optional[ + AssistantList.AssistantsV1ServiceSegmentCredential + ] = payload.get("segment_credential") + + def to_dict(self): + return { + "customer_ai": self.customer_ai.to_dict(), + "name": self.name, + "owner": self.owner, + "personality_prompt": self.personality_prompt, + "segment_credential": self.segment_credential.to_dict(), + } + + class AssistantsV1ServiceCustomerAi(object): + """ + :ivar perception_engine_enabled: True if the perception engine is enabled. + :ivar personalization_engine_enabled: True if the personalization engine is enabled. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.perception_engine_enabled: Optional[bool] = payload.get( + "perception_engine_enabled" + ) + self.personalization_engine_enabled: Optional[bool] = payload.get( + "personalization_engine_enabled" + ) + + def to_dict(self): + return { + "perception_engine_enabled": self.perception_engine_enabled, + "personalization_engine_enabled": self.personalization_engine_enabled, + } + + class AssistantsV1ServiceSegmentCredential(object): + """ + :ivar profile_api_key: The profile API key. + :ivar space_id: The space ID. + :ivar write_key: The write key. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.profile_api_key: Optional[str] = payload.get("profile_api_key") + self.space_id: Optional[str] = payload.get("space_id") + self.write_key: Optional[str] = payload.get("write_key") + + def to_dict(self): + return { + "profile_api_key": self.profile_api_key, + "space_id": self.space_id, + "write_key": self.write_key, + } + + class AssistantsV1ServiceUpdateAssistantRequest(object): + """ + :ivar customer_ai: + :ivar name: The name of the assistant. + :ivar owner: The owner/company of the assistant. + :ivar personality_prompt: The personality prompt to be used for assistant. + :ivar segment_credential: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.customer_ai: Optional[AssistantList.AssistantsV1ServiceCustomerAi] = ( + payload.get("customer_ai") + ) + self.name: Optional[str] = payload.get("name") + self.owner: Optional[str] = payload.get("owner") + self.personality_prompt: Optional[str] = payload.get("personality_prompt") + self.segment_credential: Optional[ + AssistantList.AssistantsV1ServiceSegmentCredential + ] = payload.get("segment_credential") + + def to_dict(self): + return { + "customer_ai": self.customer_ai.to_dict(), + "name": self.name, + "owner": self.owner, + "personality_prompt": self.personality_prompt, + "segment_credential": self.segment_credential.to_dict(), + } + + def __init__(self, version: Version): + """ + Initialize the AssistantList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Assistants" + + def create( + self, + assistants_v1_service_create_assistant_request: AssistantsV1ServiceCreateAssistantRequest, + ) -> AssistantInstance: + """ + Create the AssistantInstance + + :param assistants_v1_service_create_assistant_request: + + :returns: The created AssistantInstance + """ + data = assistants_v1_service_create_assistant_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return AssistantInstance(self._version, payload) + + async def create_async( + self, + assistants_v1_service_create_assistant_request: AssistantsV1ServiceCreateAssistantRequest, + ) -> AssistantInstance: + """ + Asynchronously create the AssistantInstance + + :param assistants_v1_service_create_assistant_request: + + :returns: The created AssistantInstance + """ + data = assistants_v1_service_create_assistant_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return AssistantInstance(self._version, payload) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[AssistantInstance]: + """ + Streams AssistantInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[AssistantInstance]: + """ + Asynchronously streams AssistantInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AssistantInstance]: + """ + Lists AssistantInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AssistantInstance]: + """ + Asynchronously lists AssistantInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AssistantPage: + """ + Retrieve a single page of AssistantInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AssistantInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return AssistantPage(self._version, response) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AssistantPage: + """ + Asynchronously retrieve a single page of AssistantInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AssistantInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return AssistantPage(self._version, response) + + def get_page(self, target_url: str) -> AssistantPage: + """ + Retrieve a specific page of AssistantInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AssistantInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return AssistantPage(self._version, response) + + async def get_page_async(self, target_url: str) -> AssistantPage: + """ + Asynchronously retrieve a specific page of AssistantInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AssistantInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return AssistantPage(self._version, response) + + def get(self, id: str) -> AssistantContext: + """ + Constructs a AssistantContext + + :param id: + """ + return AssistantContext(self._version, id=id) + + def __call__(self, id: str) -> AssistantContext: + """ + Constructs a AssistantContext + + :param id: + """ + return AssistantContext(self._version, id=id) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/assistant/feedback.py b/twilio/rest/assistants/v1/assistant/feedback.py new file mode 100644 index 0000000000..63a6d3b6b2 --- /dev/null +++ b/twilio/rest/assistants/v1/assistant/feedback.py @@ -0,0 +1,364 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class FeedbackInstance(InstanceResource): + """ + :ivar assistant_id: The Assistant ID. + :ivar id: The Feedback ID. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Feedback. + :ivar user_sid: The SID of the User created the Feedback. + :ivar message_id: The Message ID. + :ivar score: The Score to provide as Feedback (0-1) + :ivar session_id: The Session ID. + :ivar text: The text to be given as feedback. + :ivar date_created: The date and time in GMT when the Feedback was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Feedback was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], id: str): + super().__init__(version) + + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.id: Optional[str] = payload.get("id") + self.account_sid: Optional[str] = payload.get("account_sid") + self.user_sid: Optional[str] = payload.get("user_sid") + self.message_id: Optional[str] = payload.get("message_id") + self.score: Optional[float] = payload.get("score") + self.session_id: Optional[str] = payload.get("session_id") + self.text: Optional[str] = payload.get("text") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class FeedbackPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> FeedbackInstance: + """ + Build an instance of FeedbackInstance + + :param payload: Payload response from the API + """ + return FeedbackInstance(self._version, payload, id=self._solution["id"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class FeedbackList(ListResource): + + class AssistantsV1ServiceCreateFeedbackRequest(object): + """ + :ivar message_id: The message ID. + :ivar score: The score to be given(0-1). + :ivar session_id: The Session ID. + :ivar text: The text to be given as feedback. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.message_id: Optional[str] = payload.get("message_id") + self.score: Optional[float] = payload.get("score") + self.session_id: Optional[str] = payload.get("session_id") + self.text: Optional[str] = payload.get("text") + + def to_dict(self): + return { + "message_id": self.message_id, + "score": self.score, + "session_id": self.session_id, + "text": self.text, + } + + def __init__(self, version: Version, id: str): + """ + Initialize the FeedbackList + + :param version: Version that contains the resource + :param id: The assistant ID. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Assistants/{id}/Feedbacks".format(**self._solution) + + def create( + self, + assistants_v1_service_create_feedback_request: AssistantsV1ServiceCreateFeedbackRequest, + ) -> FeedbackInstance: + """ + Create the FeedbackInstance + + :param assistants_v1_service_create_feedback_request: + + :returns: The created FeedbackInstance + """ + data = assistants_v1_service_create_feedback_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return FeedbackInstance(self._version, payload, id=self._solution["id"]) + + async def create_async( + self, + assistants_v1_service_create_feedback_request: AssistantsV1ServiceCreateFeedbackRequest, + ) -> FeedbackInstance: + """ + Asynchronously create the FeedbackInstance + + :param assistants_v1_service_create_feedback_request: + + :returns: The created FeedbackInstance + """ + data = assistants_v1_service_create_feedback_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return FeedbackInstance(self._version, payload, id=self._solution["id"]) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[FeedbackInstance]: + """ + Streams FeedbackInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[FeedbackInstance]: + """ + Asynchronously streams FeedbackInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[FeedbackInstance]: + """ + Lists FeedbackInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[FeedbackInstance]: + """ + Asynchronously lists FeedbackInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> FeedbackPage: + """ + Retrieve a single page of FeedbackInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of FeedbackInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return FeedbackPage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> FeedbackPage: + """ + Asynchronously retrieve a single page of FeedbackInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of FeedbackInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return FeedbackPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> FeedbackPage: + """ + Retrieve a specific page of FeedbackInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of FeedbackInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return FeedbackPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> FeedbackPage: + """ + Asynchronously retrieve a specific page of FeedbackInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of FeedbackInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return FeedbackPage(self._version, response, self._solution) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/knowledge/__init__.py b/twilio/rest/assistants/v1/knowledge/__init__.py new file mode 100644 index 0000000000..32b17e2353 --- /dev/null +++ b/twilio/rest/assistants/v1/knowledge/__init__.py @@ -0,0 +1,712 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page +from twilio.rest.assistants.v1.knowledge.chunk import ChunkList + + +class KnowledgeInstance(InstanceResource): + """ + :ivar description: The type of knowledge source. + :ivar id: The description of knowledge. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') + :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') + :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], id: Optional[str] = None + ): + super().__init__(version) + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.account_sid: Optional[str] = payload.get("account_sid") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.status: Optional[str] = payload.get("status") + self.type: Optional[str] = payload.get("type") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id or self.id, + } + self._context: Optional[KnowledgeContext] = None + + @property + def _proxy(self) -> "KnowledgeContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: KnowledgeContext for this KnowledgeInstance + """ + if self._context is None: + self._context = KnowledgeContext( + self._version, + id=self._solution["id"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "KnowledgeInstance": + """ + Fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "KnowledgeInstance": + """ + Asynchronous coroutine to fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + return await self._proxy.fetch_async() + + def update( + self, + assistants_v1_service_update_knowledge_request: Union[ + AssistantsV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> "KnowledgeInstance": + """ + Update the KnowledgeInstance + + :param assistants_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + return self._proxy.update( + assistants_v1_service_update_knowledge_request=assistants_v1_service_update_knowledge_request, + ) + + async def update_async( + self, + assistants_v1_service_update_knowledge_request: Union[ + AssistantsV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> "KnowledgeInstance": + """ + Asynchronous coroutine to update the KnowledgeInstance + + :param assistants_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + return await self._proxy.update_async( + assistants_v1_service_update_knowledge_request=assistants_v1_service_update_knowledge_request, + ) + + @property + def chunks(self) -> ChunkList: + """ + Access the chunks + """ + return self._proxy.chunks + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgeContext(InstanceContext): + + def __init__(self, version: Version, id: str): + """ + Initialize the KnowledgeContext + + :param version: Version that contains the resource + :param id: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Knowledge/{id}".format(**self._solution) + + self._chunks: Optional[ChunkList] = None + + def delete(self) -> bool: + """ + Deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def fetch(self) -> KnowledgeInstance: + """ + Fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return KnowledgeInstance( + self._version, + payload, + id=self._solution["id"], + ) + + async def fetch_async(self) -> KnowledgeInstance: + """ + Asynchronous coroutine to fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return KnowledgeInstance( + self._version, + payload, + id=self._solution["id"], + ) + + def update( + self, + assistants_v1_service_update_knowledge_request: Union[ + AssistantsV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> KnowledgeInstance: + """ + Update the KnowledgeInstance + + :param assistants_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + data = values.of({}) + headers = values.of( + { + "AssistantsV1ServiceUpdateKnowledgeRequest": assistants_v1_service_update_knowledge_request, + } + ) + + payload = self._version.update( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload, id=self._solution["id"]) + + async def update_async( + self, + assistants_v1_service_update_knowledge_request: Union[ + AssistantsV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> KnowledgeInstance: + """ + Asynchronous coroutine to update the KnowledgeInstance + + :param assistants_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + data = values.of({}) + headers = values.of( + { + "AssistantsV1ServiceUpdateKnowledgeRequest": assistants_v1_service_update_knowledge_request, + } + ) + + payload = await self._version.update_async( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload, id=self._solution["id"]) + + @property + def chunks(self) -> ChunkList: + """ + Access the chunks + """ + if self._chunks is None: + self._chunks = ChunkList( + self._version, + self._solution["id"], + ) + return self._chunks + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgePage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> KnowledgeInstance: + """ + Build an instance of KnowledgeInstance + + :param payload: Payload response from the API + """ + return KnowledgeInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class KnowledgeList(ListResource): + + class AssistantsV1ServiceCreateKnowledgeRequest(object): + """ + :ivar assistant_id: The Assistant ID. + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the knowledge source. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.AssistantsV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "assistant_id": self.assistant_id, + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict(), + "type": self.type, + } + + class AssistantsV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class AssistantsV1ServiceUpdateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar policy: + :ivar type: The description of the knowledge source. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.AssistantsV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict(), + "type": self.type, + } + + def __init__(self, version: Version): + """ + Initialize the KnowledgeList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Knowledge" + + def create( + self, + assistants_v1_service_create_knowledge_request: AssistantsV1ServiceCreateKnowledgeRequest, + ) -> KnowledgeInstance: + """ + Create the KnowledgeInstance + + :param assistants_v1_service_create_knowledge_request: + + :returns: The created KnowledgeInstance + """ + data = assistants_v1_service_create_knowledge_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload) + + async def create_async( + self, + assistants_v1_service_create_knowledge_request: AssistantsV1ServiceCreateKnowledgeRequest, + ) -> KnowledgeInstance: + """ + Asynchronously create the KnowledgeInstance + + :param assistants_v1_service_create_knowledge_request: + + :returns: The created KnowledgeInstance + """ + data = assistants_v1_service_create_knowledge_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload) + + def stream( + self, + assistant_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[KnowledgeInstance]: + """ + Streams KnowledgeInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str assistant_id: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(assistant_id=assistant_id, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + assistant_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[KnowledgeInstance]: + """ + Asynchronously streams KnowledgeInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str assistant_id: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + assistant_id=assistant_id, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + assistant_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[KnowledgeInstance]: + """ + Lists KnowledgeInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str assistant_id: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + assistant_id=assistant_id, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + assistant_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[KnowledgeInstance]: + """ + Asynchronously lists KnowledgeInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str assistant_id: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + assistant_id=assistant_id, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + assistant_id: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> KnowledgePage: + """ + Retrieve a single page of KnowledgeInstance records from the API. + Request is executed immediately + + :param assistant_id: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of KnowledgeInstance + """ + data = values.of( + { + "AssistantId": assistant_id, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return KnowledgePage(self._version, response) + + async def page_async( + self, + assistant_id: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> KnowledgePage: + """ + Asynchronously retrieve a single page of KnowledgeInstance records from the API. + Request is executed immediately + + :param assistant_id: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of KnowledgeInstance + """ + data = values.of( + { + "AssistantId": assistant_id, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return KnowledgePage(self._version, response) + + def get_page(self, target_url: str) -> KnowledgePage: + """ + Retrieve a specific page of KnowledgeInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of KnowledgeInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return KnowledgePage(self._version, response) + + async def get_page_async(self, target_url: str) -> KnowledgePage: + """ + Asynchronously retrieve a specific page of KnowledgeInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of KnowledgeInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return KnowledgePage(self._version, response) + + def get(self, id: str) -> KnowledgeContext: + """ + Constructs a KnowledgeContext + + :param id: + """ + return KnowledgeContext(self._version, id=id) + + def __call__(self, id: str) -> KnowledgeContext: + """ + Constructs a KnowledgeContext + + :param id: + """ + return KnowledgeContext(self._version, id=id) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/knowledge/chunk.py b/twilio/rest/assistants/v1/knowledge/chunk.py new file mode 100644 index 0000000000..29e1a34945 --- /dev/null +++ b/twilio/rest/assistants/v1/knowledge/chunk.py @@ -0,0 +1,287 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class ChunkInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. + :ivar content: The chunk content. + :ivar metadata: The metadata of the chunk. + :ivar date_created: The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], id: str): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.content: Optional[str] = payload.get("content") + self.metadata: Optional[Dict[str, object]] = payload.get("metadata") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ChunkPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> ChunkInstance: + """ + Build an instance of ChunkInstance + + :param payload: Payload response from the API + """ + return ChunkInstance(self._version, payload, id=self._solution["id"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class ChunkList(ListResource): + + def __init__(self, version: Version, id: str): + """ + Initialize the ChunkList + + :param version: Version that contains the resource + :param id: The knowledge ID. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Knowledge/{id}/Chunks".format(**self._solution) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[ChunkInstance]: + """ + Streams ChunkInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[ChunkInstance]: + """ + Asynchronously streams ChunkInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ChunkInstance]: + """ + Lists ChunkInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ChunkInstance]: + """ + Asynchronously lists ChunkInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ChunkPage: + """ + Retrieve a single page of ChunkInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ChunkInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return ChunkPage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ChunkPage: + """ + Asynchronously retrieve a single page of ChunkInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ChunkInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return ChunkPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> ChunkPage: + """ + Retrieve a specific page of ChunkInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ChunkInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return ChunkPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> ChunkPage: + """ + Asynchronously retrieve a specific page of ChunkInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ChunkInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return ChunkPage(self._version, response, self._solution) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/policy.py b/twilio/rest/assistants/v1/policy.py new file mode 100644 index 0000000000..c63eee2e2f --- /dev/null +++ b/twilio/rest/assistants/v1/policy.py @@ -0,0 +1,322 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class PolicyInstance(InstanceResource): + """ + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar description: The description of the policy. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Policy resource. + :ivar user_sid: The SID of the User that created the Policy resource. + :ivar type: The type of the policy. + :ivar policy_details: The details of the policy based on the type. + :ivar date_created: The date and time in GMT when the Policy was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Policy was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.description: Optional[str] = payload.get("description") + self.account_sid: Optional[str] = payload.get("account_sid") + self.user_sid: Optional[str] = payload.get("user_sid") + self.type: Optional[str] = payload.get("type") + self.policy_details: Optional[Dict[str, object]] = payload.get("policy_details") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class PolicyPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> PolicyInstance: + """ + Build an instance of PolicyInstance + + :param payload: Payload response from the API + """ + return PolicyInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class PolicyList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the PolicyList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Policies" + + def stream( + self, + tool_id: Union[str, object] = values.unset, + knowledge_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[PolicyInstance]: + """ + Streams PolicyInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str tool_id: The tool ID. + :param str knowledge_id: The knowledge ID. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page( + tool_id=tool_id, knowledge_id=knowledge_id, page_size=limits["page_size"] + ) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + tool_id: Union[str, object] = values.unset, + knowledge_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[PolicyInstance]: + """ + Asynchronously streams PolicyInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str tool_id: The tool ID. + :param str knowledge_id: The knowledge ID. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + tool_id=tool_id, knowledge_id=knowledge_id, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + tool_id: Union[str, object] = values.unset, + knowledge_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PolicyInstance]: + """ + Lists PolicyInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str tool_id: The tool ID. + :param str knowledge_id: The knowledge ID. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + tool_id=tool_id, + knowledge_id=knowledge_id, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + tool_id: Union[str, object] = values.unset, + knowledge_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[PolicyInstance]: + """ + Asynchronously lists PolicyInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str tool_id: The tool ID. + :param str knowledge_id: The knowledge ID. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + tool_id=tool_id, + knowledge_id=knowledge_id, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + tool_id: Union[str, object] = values.unset, + knowledge_id: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PolicyPage: + """ + Retrieve a single page of PolicyInstance records from the API. + Request is executed immediately + + :param tool_id: The tool ID. + :param knowledge_id: The knowledge ID. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PolicyInstance + """ + data = values.of( + { + "ToolId": tool_id, + "KnowledgeId": knowledge_id, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return PolicyPage(self._version, response) + + async def page_async( + self, + tool_id: Union[str, object] = values.unset, + knowledge_id: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> PolicyPage: + """ + Asynchronously retrieve a single page of PolicyInstance records from the API. + Request is executed immediately + + :param tool_id: The tool ID. + :param knowledge_id: The knowledge ID. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of PolicyInstance + """ + data = values.of( + { + "ToolId": tool_id, + "KnowledgeId": knowledge_id, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return PolicyPage(self._version, response) + + def get_page(self, target_url: str) -> PolicyPage: + """ + Retrieve a specific page of PolicyInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PolicyInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return PolicyPage(self._version, response) + + async def get_page_async(self, target_url: str) -> PolicyPage: + """ + Asynchronously retrieve a specific page of PolicyInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of PolicyInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return PolicyPage(self._version, response) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/session/__init__.py b/twilio/rest/assistants/v1/session/__init__.py new file mode 100644 index 0000000000..1faf9c9174 --- /dev/null +++ b/twilio/rest/assistants/v1/session/__init__.py @@ -0,0 +1,425 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page +from twilio.rest.assistants.v1.session.message import MessageList + + +class SessionInstance(InstanceResource): + """ + :ivar id: The Session ID. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Session resource. + :ivar assistant_id: The Assistant ID. + :ivar verified: True if the session is verified. + :ivar identity: The unique identity of user for the session. + :ivar date_created: The date and time in GMT when the Session was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Session was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], id: Optional[str] = None + ): + super().__init__(version) + + self.id: Optional[str] = payload.get("id") + self.account_sid: Optional[str] = payload.get("account_sid") + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.verified: Optional[bool] = payload.get("verified") + self.identity: Optional[str] = payload.get("identity") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id or self.id, + } + self._context: Optional[SessionContext] = None + + @property + def _proxy(self) -> "SessionContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: SessionContext for this SessionInstance + """ + if self._context is None: + self._context = SessionContext( + self._version, + id=self._solution["id"], + ) + return self._context + + def fetch(self) -> "SessionInstance": + """ + Fetch the SessionInstance + + + :returns: The fetched SessionInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "SessionInstance": + """ + Asynchronous coroutine to fetch the SessionInstance + + + :returns: The fetched SessionInstance + """ + return await self._proxy.fetch_async() + + @property + def messages(self) -> MessageList: + """ + Access the messages + """ + return self._proxy.messages + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class SessionContext(InstanceContext): + + def __init__(self, version: Version, id: str): + """ + Initialize the SessionContext + + :param version: Version that contains the resource + :param id: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Sessions/{id}".format(**self._solution) + + self._messages: Optional[MessageList] = None + + def fetch(self) -> SessionInstance: + """ + Fetch the SessionInstance + + + :returns: The fetched SessionInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return SessionInstance( + self._version, + payload, + id=self._solution["id"], + ) + + async def fetch_async(self) -> SessionInstance: + """ + Asynchronous coroutine to fetch the SessionInstance + + + :returns: The fetched SessionInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return SessionInstance( + self._version, + payload, + id=self._solution["id"], + ) + + @property + def messages(self) -> MessageList: + """ + Access the messages + """ + if self._messages is None: + self._messages = MessageList( + self._version, + self._solution["id"], + ) + return self._messages + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class SessionPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> SessionInstance: + """ + Build an instance of SessionInstance + + :param payload: Payload response from the API + """ + return SessionInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class SessionList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the SessionList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Sessions" + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[SessionInstance]: + """ + Streams SessionInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[SessionInstance]: + """ + Asynchronously streams SessionInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[SessionInstance]: + """ + Lists SessionInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[SessionInstance]: + """ + Asynchronously lists SessionInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> SessionPage: + """ + Retrieve a single page of SessionInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of SessionInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return SessionPage(self._version, response) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> SessionPage: + """ + Asynchronously retrieve a single page of SessionInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of SessionInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return SessionPage(self._version, response) + + def get_page(self, target_url: str) -> SessionPage: + """ + Retrieve a specific page of SessionInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of SessionInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return SessionPage(self._version, response) + + async def get_page_async(self, target_url: str) -> SessionPage: + """ + Asynchronously retrieve a specific page of SessionInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of SessionInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return SessionPage(self._version, response) + + def get(self, id: str) -> SessionContext: + """ + Constructs a SessionContext + + :param id: + """ + return SessionContext(self._version, id=id) + + def __call__(self, id: str) -> SessionContext: + """ + Constructs a SessionContext + + :param id: + """ + return SessionContext(self._version, id=id) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/session/message.py b/twilio/rest/assistants/v1/session/message.py new file mode 100644 index 0000000000..b2d2921dfb --- /dev/null +++ b/twilio/rest/assistants/v1/session/message.py @@ -0,0 +1,299 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class MessageInstance(InstanceResource): + """ + :ivar id: The message ID. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Message resource. + :ivar assistant_id: The Assistant ID. + :ivar session_id: The Session ID. + :ivar identity: The identity of the user. + :ivar role: The role of the user associated with the message. + :ivar content: The content of the message. + :ivar meta: The metadata of the message. + :ivar date_created: The date and time in GMT when the Message was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Message was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], session_id: str): + super().__init__(version) + + self.id: Optional[str] = payload.get("id") + self.account_sid: Optional[str] = payload.get("account_sid") + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.session_id: Optional[str] = payload.get("session_id") + self.identity: Optional[str] = payload.get("identity") + self.role: Optional[str] = payload.get("role") + self.content: Optional[Dict[str, object]] = payload.get("content") + self.meta: Optional[Dict[str, object]] = payload.get("meta") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "session_id": session_id, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class MessagePage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> MessageInstance: + """ + Build an instance of MessageInstance + + :param payload: Payload response from the API + """ + return MessageInstance( + self._version, payload, session_id=self._solution["session_id"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class MessageList(ListResource): + + def __init__(self, version: Version, session_id: str): + """ + Initialize the MessageList + + :param version: Version that contains the resource + :param session_id: Session id or name + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "session_id": session_id, + } + self._uri = "/Sessions/{session_id}/Messages".format(**self._solution) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[MessageInstance]: + """ + Streams MessageInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[MessageInstance]: + """ + Asynchronously streams MessageInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[MessageInstance]: + """ + Lists MessageInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[MessageInstance]: + """ + Asynchronously lists MessageInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> MessagePage: + """ + Retrieve a single page of MessageInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of MessageInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return MessagePage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> MessagePage: + """ + Asynchronously retrieve a single page of MessageInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of MessageInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return MessagePage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> MessagePage: + """ + Retrieve a specific page of MessageInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of MessageInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return MessagePage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> MessagePage: + """ + Asynchronously retrieve a specific page of MessageInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of MessageInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return MessagePage(self._version, response, self._solution) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/tool.py b/twilio/rest/assistants/v1/tool.py new file mode 100644 index 0000000000..a66a818b5d --- /dev/null +++ b/twilio/rest/assistants/v1/tool.py @@ -0,0 +1,639 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class ToolInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Tool resource. + :ivar description: The description of the tool. + :ivar enabled: True if the tool is enabled. + :ivar id: The tool ID. + :ivar meta: The metadata related to method, url, input_schema to used with the Tool. + :ivar name: The name of the tool. + :ivar requires_auth: The authentication requirement for the tool. + :ivar type: The type of the tool. ('WEBHOOK') + :ivar date_created: The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Tool was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], id: Optional[str] = None + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.description: Optional[str] = payload.get("description") + self.enabled: Optional[bool] = payload.get("enabled") + self.id: Optional[str] = payload.get("id") + self.meta: Optional[Dict[str, object]] = payload.get("meta") + self.name: Optional[str] = payload.get("name") + self.requires_auth: Optional[bool] = payload.get("requires_auth") + self.type: Optional[str] = payload.get("type") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id or self.id, + } + self._context: Optional[ToolContext] = None + + @property + def _proxy(self) -> "ToolContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: ToolContext for this ToolInstance + """ + if self._context is None: + self._context = ToolContext( + self._version, + id=self._solution["id"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the ToolInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the ToolInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def update( + self, + assistants_v1_service_update_tool_request: Union[ + AssistantsV1ServiceUpdateToolRequest, object + ] = values.unset, + ) -> "ToolInstance": + """ + Update the ToolInstance + + :param assistants_v1_service_update_tool_request: + + :returns: The updated ToolInstance + """ + return self._proxy.update( + assistants_v1_service_update_tool_request=assistants_v1_service_update_tool_request, + ) + + async def update_async( + self, + assistants_v1_service_update_tool_request: Union[ + AssistantsV1ServiceUpdateToolRequest, object + ] = values.unset, + ) -> "ToolInstance": + """ + Asynchronous coroutine to update the ToolInstance + + :param assistants_v1_service_update_tool_request: + + :returns: The updated ToolInstance + """ + return await self._proxy.update_async( + assistants_v1_service_update_tool_request=assistants_v1_service_update_tool_request, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ToolContext(InstanceContext): + + def __init__(self, version: Version, id: str): + """ + Initialize the ToolContext + + :param version: Version that contains the resource + :param id: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Tools/{id}".format(**self._solution) + + def delete(self) -> bool: + """ + Deletes the ToolInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the ToolInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def update( + self, + assistants_v1_service_update_tool_request: Union[ + AssistantsV1ServiceUpdateToolRequest, object + ] = values.unset, + ) -> ToolInstance: + """ + Update the ToolInstance + + :param assistants_v1_service_update_tool_request: + + :returns: The updated ToolInstance + """ + data = values.of({}) + headers = values.of( + { + "AssistantsV1ServiceUpdateToolRequest": assistants_v1_service_update_tool_request, + } + ) + + payload = self._version.update( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return ToolInstance(self._version, payload, id=self._solution["id"]) + + async def update_async( + self, + assistants_v1_service_update_tool_request: Union[ + AssistantsV1ServiceUpdateToolRequest, object + ] = values.unset, + ) -> ToolInstance: + """ + Asynchronous coroutine to update the ToolInstance + + :param assistants_v1_service_update_tool_request: + + :returns: The updated ToolInstance + """ + data = values.of({}) + headers = values.of( + { + "AssistantsV1ServiceUpdateToolRequest": assistants_v1_service_update_tool_request, + } + ) + + payload = await self._version.update_async( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return ToolInstance(self._version, payload, id=self._solution["id"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ToolPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> ToolInstance: + """ + Build an instance of ToolInstance + + :param payload: Payload response from the API + """ + return ToolInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class ToolList(ListResource): + + class AssistantsV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class AssistantsV1ServiceCreateToolRequest(object): + """ + :ivar assistant_id: The Assistant ID. + :ivar description: The description of the tool. + :ivar enabled: True if the tool is enabled. + :ivar meta: The metadata related to method, url, input_schema to used with the Tool. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The description of the tool. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.description: Optional[str] = payload.get("description") + self.enabled: Optional[bool] = payload.get("enabled") + self.meta: Optional[Dict[str, object]] = payload.get("meta") + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ToolList.AssistantsV1ServiceCreatePolicyRequest] = ( + payload.get("policy") + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "assistant_id": self.assistant_id, + "description": self.description, + "enabled": self.enabled, + "meta": self.meta, + "name": self.name, + "policy": self.policy.to_dict(), + "type": self.type, + } + + class AssistantsV1ServiceUpdateToolRequest(object): + """ + :ivar assistant_id: The Assistant ID. + :ivar description: The description of the tool. + :ivar enabled: True if the tool is enabled. + :ivar meta: The metadata related to method, url, input_schema to used with the Tool. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the tool. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.description: Optional[str] = payload.get("description") + self.enabled: Optional[bool] = payload.get("enabled") + self.meta: Optional[Dict[str, object]] = payload.get("meta") + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ToolList.AssistantsV1ServiceCreatePolicyRequest] = ( + payload.get("policy") + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "assistant_id": self.assistant_id, + "description": self.description, + "enabled": self.enabled, + "meta": self.meta, + "name": self.name, + "policy": self.policy.to_dict(), + "type": self.type, + } + + def __init__(self, version: Version): + """ + Initialize the ToolList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Tools" + + def create( + self, + assistants_v1_service_create_tool_request: AssistantsV1ServiceCreateToolRequest, + ) -> ToolInstance: + """ + Create the ToolInstance + + :param assistants_v1_service_create_tool_request: + + :returns: The created ToolInstance + """ + data = assistants_v1_service_create_tool_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ToolInstance(self._version, payload) + + async def create_async( + self, + assistants_v1_service_create_tool_request: AssistantsV1ServiceCreateToolRequest, + ) -> ToolInstance: + """ + Asynchronously create the ToolInstance + + :param assistants_v1_service_create_tool_request: + + :returns: The created ToolInstance + """ + data = assistants_v1_service_create_tool_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ToolInstance(self._version, payload) + + def stream( + self, + assistant_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[ToolInstance]: + """ + Streams ToolInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str assistant_id: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(assistant_id=assistant_id, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + assistant_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[ToolInstance]: + """ + Asynchronously streams ToolInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str assistant_id: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + assistant_id=assistant_id, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + assistant_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ToolInstance]: + """ + Lists ToolInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str assistant_id: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + assistant_id=assistant_id, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + assistant_id: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ToolInstance]: + """ + Asynchronously lists ToolInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str assistant_id: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + assistant_id=assistant_id, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + assistant_id: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ToolPage: + """ + Retrieve a single page of ToolInstance records from the API. + Request is executed immediately + + :param assistant_id: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ToolInstance + """ + data = values.of( + { + "AssistantId": assistant_id, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return ToolPage(self._version, response) + + async def page_async( + self, + assistant_id: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ToolPage: + """ + Asynchronously retrieve a single page of ToolInstance records from the API. + Request is executed immediately + + :param assistant_id: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ToolInstance + """ + data = values.of( + { + "AssistantId": assistant_id, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return ToolPage(self._version, response) + + def get_page(self, target_url: str) -> ToolPage: + """ + Retrieve a specific page of ToolInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ToolInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return ToolPage(self._version, response) + + async def get_page_async(self, target_url: str) -> ToolPage: + """ + Asynchronously retrieve a specific page of ToolInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ToolInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return ToolPage(self._version, response) + + def get(self, id: str) -> ToolContext: + """ + Constructs a ToolContext + + :param id: + """ + return ToolContext(self._version, id=id) + + def __call__(self, id: str) -> ToolContext: + """ + Constructs a ToolContext + + :param id: + """ + return ToolContext(self._version, id=id) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index f679a920a1..f35ef6a48f 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -27,7 +27,7 @@ class ApprovalFetchInstance(InstanceResource): :ivar url: The URL of the resource, relative to `https://content.twilio.com`. """ - def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): + def __init__(self, version: Version, payload: Dict[str, Any], sid: str): super().__init__(version) self.sid: Optional[str] = payload.get("sid") @@ -36,7 +36,7 @@ def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): self.url: Optional[str] = payload.get("url") self._solution = { - "content_sid": content_sid, + "sid": sid, } self._context: Optional[ApprovalFetchContext] = None @@ -51,7 +51,7 @@ def _proxy(self) -> "ApprovalFetchContext": if self._context is None: self._context = ApprovalFetchContext( self._version, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) return self._context @@ -85,20 +85,20 @@ def __repr__(self) -> str: class ApprovalFetchContext(InstanceContext): - def __init__(self, version: Version, content_sid: str): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchContext :param version: Version that contains the resource - :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "content_sid": content_sid, + "sid": sid, } - self._uri = "/Content/{content_sid}/ApprovalRequests".format(**self._solution) + self._uri = "/Content/{sid}/ApprovalRequests".format(**self._solution) def fetch(self) -> ApprovalFetchInstance: """ @@ -116,7 +116,7 @@ def fetch(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) async def fetch_async(self) -> ApprovalFetchInstance: @@ -135,7 +135,7 @@ async def fetch_async(self) -> ApprovalFetchInstance: return ApprovalFetchInstance( self._version, payload, - content_sid=self._solution["content_sid"], + sid=self._solution["sid"], ) def __repr__(self) -> str: @@ -150,19 +150,19 @@ def __repr__(self) -> str: class ApprovalFetchList(ListResource): - def __init__(self, version: Version, content_sid: str): + def __init__(self, version: Version, sid: str): """ Initialize the ApprovalFetchList :param version: Version that contains the resource - :param content_sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. + :param sid: The Twilio-provided string that uniquely identifies the Content resource whose approval information to fetch. """ super().__init__(version) # Path Solution self._solution = { - "content_sid": content_sid, + "sid": sid, } def get(self) -> ApprovalFetchContext: @@ -170,18 +170,14 @@ def get(self) -> ApprovalFetchContext: Constructs a ApprovalFetchContext """ - return ApprovalFetchContext( - self._version, content_sid=self._solution["content_sid"] - ) + return ApprovalFetchContext(self._version, sid=self._solution["sid"]) def __call__(self) -> ApprovalFetchContext: """ Constructs a ApprovalFetchContext """ - return ApprovalFetchContext( - self._version, content_sid=self._solution["content_sid"] - ) + return ApprovalFetchContext(self._version, sid=self._solution["sid"]) def __repr__(self) -> str: """ diff --git a/twilio/rest/intelligence/v2/operator_type.py b/twilio/rest/intelligence/v2/operator_type.py index ff2403b1cb..f1f839fe79 100644 --- a/twilio/rest/intelligence/v2/operator_type.py +++ b/twilio/rest/intelligence/v2/operator_type.py @@ -27,8 +27,9 @@ class OperatorTypeInstance(InstanceResource): class Availability(object): INTERNAL = "internal" BETA = "beta" - PUBLIC = "public" + GENERAL_AVAILABILITY = "general-availability" RETIRED = "retired" + DEPRECATED = "deprecated" class OutputType(object): TEXT_CLASSIFICATION = "text-classification" diff --git a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py index 7e44ac4e0e..47a9a7c13b 100644 --- a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py +++ b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py @@ -22,8 +22,8 @@ class InstalledAddOnUsageInstance(InstanceResource): """ + :ivar total_submitted: Total amount in local currency that was billed in this request. Aggregates all billable_items that were successfully submitted. :ivar billable_items: - :ivar total_submitted: Represents the total quantity submitted. """ def __init__( @@ -31,10 +31,12 @@ def __init__( ): super().__init__(version) - self.billable_items: Optional[List[str]] = payload.get("billable_items") self.total_submitted: Optional[float] = deserialize.decimal( payload.get("total_submitted") ) + self.billable_items: Optional[List[InstalledAddOnUsageList.str]] = payload.get( + "billable_items" + ) self._solution = { "installed_add_on_sid": installed_add_on_sid, @@ -54,11 +56,15 @@ class InstalledAddOnUsageList(ListResource): class MarketplaceV1InstalledAddOnInstalledAddOnUsage(object): """ + :ivar total_submitted: Total amount in local currency that was billed in this request. Aggregates all billable_items that were successfully submitted. :ivar billable_items: """ def __init__(self, payload: Dict[str, Any]): + self.total_submitted: Optional[float] = deserialize.decimal( + payload.get("total_submitted") + ) self.billable_items: Optional[ List[ InstalledAddOnUsageList.MarketplaceV1InstalledAddOnInstalledAddOnUsageBillableItems @@ -67,34 +73,18 @@ def __init__(self, payload: Dict[str, Any]): def to_dict(self): return { + "total_submitted": self.total_submitted, "billable_items": [ billable_items.to_dict() for billable_items in self.billable_items ], } - class MarketplaceV1InstalledAddOnInstalledAddOnUsageBillableItems(object): - """ - :ivar quantity: Any floating number greater than 0. - :ivar sid: BillingSid to use for billing. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.quantity: Optional[float] = payload.get("quantity") - self.sid: Optional[str] = payload.get("sid") - - def to_dict(self): - return { - "quantity": self.quantity, - "sid": self.sid, - } - def __init__(self, version: Version, installed_add_on_sid: str): """ Initialize the InstalledAddOnUsageList :param version: Version that contains the resource - :param installed_add_on_sid: + :param installed_add_on_sid: Customer Installation SID to report usage on. """ super().__init__(version) diff --git a/twilio/rest/marketplace/v1/module_data_management.py b/twilio/rest/marketplace/v1/module_data_management.py index 837f5fc3f7..8ef224cec1 100644 --- a/twilio/rest/marketplace/v1/module_data_management.py +++ b/twilio/rest/marketplace/v1/module_data_management.py @@ -30,6 +30,7 @@ class ModuleDataManagementInstance(InstanceResource): :ivar module_info: A JSON object containing essential attributes that define a module. This information is presented on the Module detail page in the Twilio Marketplace Catalog. You can pass the following attributes in the JSON object :ivar documentation: A JSON object for providing comprehensive information, instructions, and resources related to the module :ivar configuration: A JSON object for providing listing specific configuration. Contains button setup, notification url, among others. + :ivar pricing: A JSON object for providing Listing specific pricing information. """ def __init__( @@ -45,6 +46,7 @@ def __init__( self.module_info: Optional[Dict[str, object]] = payload.get("module_info") self.documentation: Optional[Dict[str, object]] = payload.get("documentation") self.configuration: Optional[Dict[str, object]] = payload.get("configuration") + self.pricing: Optional[Dict[str, object]] = payload.get("pricing") self._solution = { "sid": sid or self.sid, @@ -92,16 +94,18 @@ def update( policies: Union[str, object] = values.unset, support: Union[str, object] = values.unset, configuration: Union[str, object] = values.unset, + pricing: Union[str, object] = values.unset, ) -> "ModuleDataManagementInstance": """ Update the ModuleDataManagementInstance - :param module_info: - :param description: - :param documentation: - :param policies: - :param support: - :param configuration: + :param module_info: A JSON object containing essential attributes that define a Listing. + :param description: A JSON object describing the Listing. You can define the main body of the description, highlight key features or aspects of the Listing, and provide code samples for developers if applicable. + :param documentation: A JSON object for providing comprehensive information, instructions, and resources related to the Listing. + :param policies: A JSON object describing the Listing's privacy and legal policies. The maximum file size for Policies is 5MB. + :param support: A JSON object containing information on how Marketplace users can obtain support for the Listing. Use this parameter to provide details such as contact information and support description. + :param configuration: A JSON object for providing Listing-specific configuration. Contains button setup, notification URL, and more. + :param pricing: A JSON object for providing Listing's purchase options. :returns: The updated ModuleDataManagementInstance """ @@ -112,6 +116,7 @@ def update( policies=policies, support=support, configuration=configuration, + pricing=pricing, ) async def update_async( @@ -122,16 +127,18 @@ async def update_async( policies: Union[str, object] = values.unset, support: Union[str, object] = values.unset, configuration: Union[str, object] = values.unset, + pricing: Union[str, object] = values.unset, ) -> "ModuleDataManagementInstance": """ Asynchronous coroutine to update the ModuleDataManagementInstance - :param module_info: - :param description: - :param documentation: - :param policies: - :param support: - :param configuration: + :param module_info: A JSON object containing essential attributes that define a Listing. + :param description: A JSON object describing the Listing. You can define the main body of the description, highlight key features or aspects of the Listing, and provide code samples for developers if applicable. + :param documentation: A JSON object for providing comprehensive information, instructions, and resources related to the Listing. + :param policies: A JSON object describing the Listing's privacy and legal policies. The maximum file size for Policies is 5MB. + :param support: A JSON object containing information on how Marketplace users can obtain support for the Listing. Use this parameter to provide details such as contact information and support description. + :param configuration: A JSON object for providing Listing-specific configuration. Contains button setup, notification URL, and more. + :param pricing: A JSON object for providing Listing's purchase options. :returns: The updated ModuleDataManagementInstance """ @@ -142,6 +149,7 @@ async def update_async( policies=policies, support=support, configuration=configuration, + pricing=pricing, ) def __repr__(self) -> str: @@ -161,7 +169,7 @@ def __init__(self, version: Version, sid: str): Initialize the ModuleDataManagementContext :param version: Version that contains the resource - :param sid: + :param sid: SID that uniquely identifies the Listing. """ super().__init__(version) @@ -217,16 +225,18 @@ def update( policies: Union[str, object] = values.unset, support: Union[str, object] = values.unset, configuration: Union[str, object] = values.unset, + pricing: Union[str, object] = values.unset, ) -> ModuleDataManagementInstance: """ Update the ModuleDataManagementInstance - :param module_info: - :param description: - :param documentation: - :param policies: - :param support: - :param configuration: + :param module_info: A JSON object containing essential attributes that define a Listing. + :param description: A JSON object describing the Listing. You can define the main body of the description, highlight key features or aspects of the Listing, and provide code samples for developers if applicable. + :param documentation: A JSON object for providing comprehensive information, instructions, and resources related to the Listing. + :param policies: A JSON object describing the Listing's privacy and legal policies. The maximum file size for Policies is 5MB. + :param support: A JSON object containing information on how Marketplace users can obtain support for the Listing. Use this parameter to provide details such as contact information and support description. + :param configuration: A JSON object for providing Listing-specific configuration. Contains button setup, notification URL, and more. + :param pricing: A JSON object for providing Listing's purchase options. :returns: The updated ModuleDataManagementInstance """ @@ -238,6 +248,7 @@ def update( "Policies": policies, "Support": support, "Configuration": configuration, + "Pricing": pricing, } ) @@ -259,16 +270,18 @@ async def update_async( policies: Union[str, object] = values.unset, support: Union[str, object] = values.unset, configuration: Union[str, object] = values.unset, + pricing: Union[str, object] = values.unset, ) -> ModuleDataManagementInstance: """ Asynchronous coroutine to update the ModuleDataManagementInstance - :param module_info: - :param description: - :param documentation: - :param policies: - :param support: - :param configuration: + :param module_info: A JSON object containing essential attributes that define a Listing. + :param description: A JSON object describing the Listing. You can define the main body of the description, highlight key features or aspects of the Listing, and provide code samples for developers if applicable. + :param documentation: A JSON object for providing comprehensive information, instructions, and resources related to the Listing. + :param policies: A JSON object describing the Listing's privacy and legal policies. The maximum file size for Policies is 5MB. + :param support: A JSON object containing information on how Marketplace users can obtain support for the Listing. Use this parameter to provide details such as contact information and support description. + :param configuration: A JSON object for providing Listing-specific configuration. Contains button setup, notification URL, and more. + :param pricing: A JSON object for providing Listing's purchase options. :returns: The updated ModuleDataManagementInstance """ @@ -280,6 +293,7 @@ async def update_async( "Policies": policies, "Support": support, "Configuration": configuration, + "Pricing": pricing, } ) @@ -318,7 +332,7 @@ def get(self, sid: str) -> ModuleDataManagementContext: """ Constructs a ModuleDataManagementContext - :param sid: + :param sid: SID that uniquely identifies the Listing. """ return ModuleDataManagementContext(self._version, sid=sid) @@ -326,7 +340,7 @@ def __call__(self, sid: str) -> ModuleDataManagementContext: """ Constructs a ModuleDataManagementContext - :param sid: + :param sid: SID that uniquely identifies the Listing. """ return ModuleDataManagementContext(self._version, sid=sid) diff --git a/twilio/rest/numbers/v2/bundle_clone.py b/twilio/rest/numbers/v2/bundle_clone.py index ff24e29063..820fbc9db5 100644 --- a/twilio/rest/numbers/v2/bundle_clone.py +++ b/twilio/rest/numbers/v2/bundle_clone.py @@ -101,7 +101,7 @@ def create( Create the BundleCloneInstance :param target_account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) where the bundle needs to be cloned. - :param move_to_draft: This is to determine whether the cloned bundle needs to be in draft state or not. + :param move_to_draft: If set to true, the cloned bundle will be in the DRAFT state, else it will be twilio-approved :param friendly_name: The string that you assigned to describe the cloned bundle. :returns: The created BundleCloneInstance @@ -122,7 +122,7 @@ async def create_async( Asynchronous coroutine to create the BundleCloneInstance :param target_account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) where the bundle needs to be cloned. - :param move_to_draft: This is to determine whether the cloned bundle needs to be in draft state or not. + :param move_to_draft: If set to true, the cloned bundle will be in the DRAFT state, else it will be twilio-approved :param friendly_name: The string that you assigned to describe the cloned bundle. :returns: The created BundleCloneInstance @@ -172,7 +172,7 @@ def create( Create the BundleCloneInstance :param target_account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) where the bundle needs to be cloned. - :param move_to_draft: This is to determine whether the cloned bundle needs to be in draft state or not. + :param move_to_draft: If set to true, the cloned bundle will be in the DRAFT state, else it will be twilio-approved :param friendly_name: The string that you assigned to describe the cloned bundle. :returns: The created BundleCloneInstance @@ -201,7 +201,7 @@ async def create_async( Asynchronous coroutine to create the BundleCloneInstance :param target_account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) where the bundle needs to be cloned. - :param move_to_draft: This is to determine whether the cloned bundle needs to be in draft state or not. + :param move_to_draft: If set to true, the cloned bundle will be in the DRAFT state, else it will be twilio-approved :param friendly_name: The string that you assigned to describe the cloned bundle. :returns: The created BundleCloneInstance diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index 5c8b48f11d..8ad16f21ce 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -499,7 +499,7 @@ def create( :param regulation_sid: The unique string of a regulation that is associated to the Bundle resource. :param iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. :param end_user_type: - :param number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. + :param number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. :param is_test: Indicates that Bundle is a Test Bundle and will be Auto-Rejected :returns: The created BundleInstance @@ -545,7 +545,7 @@ async def create_async( :param regulation_sid: The unique string of a regulation that is associated to the Bundle resource. :param iso_country: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. :param end_user_type: - :param number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. + :param number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. :param is_test: Indicates that Bundle is a Test Bundle and will be Auto-Rejected :returns: The created BundleInstance @@ -597,7 +597,7 @@ def stream( :param str friendly_name: The string that you assigned to describe the resource. The column can contain 255 variable characters. :param str regulation_sid: The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. :param str iso_country: The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. - :param str number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + :param str number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. :param bool has_valid_until_date: Indicates that the Bundle is a valid Bundle until a specified expiration date. :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. @@ -657,7 +657,7 @@ async def stream_async( :param str friendly_name: The string that you assigned to describe the resource. The column can contain 255 variable characters. :param str regulation_sid: The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. :param str iso_country: The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. - :param str number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + :param str number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. :param bool has_valid_until_date: Indicates that the Bundle is a valid Bundle until a specified expiration date. :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. @@ -716,7 +716,7 @@ def list( :param str friendly_name: The string that you assigned to describe the resource. The column can contain 255 variable characters. :param str regulation_sid: The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. :param str iso_country: The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. - :param str number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + :param str number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. :param bool has_valid_until_date: Indicates that the Bundle is a valid Bundle until a specified expiration date. :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. @@ -775,7 +775,7 @@ async def list_async( :param str friendly_name: The string that you assigned to describe the resource. The column can contain 255 variable characters. :param str regulation_sid: The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. :param str iso_country: The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. - :param str number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + :param str number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. :param bool has_valid_until_date: Indicates that the Bundle is a valid Bundle until a specified expiration date. :param "BundleInstance.SortBy" sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param "BundleInstance.SortDirection" sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. @@ -835,7 +835,7 @@ def page( :param friendly_name: The string that you assigned to describe the resource. The column can contain 255 variable characters. :param regulation_sid: The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. :param iso_country: The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. - :param number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + :param number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. :param has_valid_until_date: Indicates that the Bundle is a valid Bundle until a specified expiration date. :param sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. @@ -895,7 +895,7 @@ async def page_async( :param friendly_name: The string that you assigned to describe the resource. The column can contain 255 variable characters. :param regulation_sid: The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. :param iso_country: The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. - :param number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + :param number_type: The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll-free`. :param has_valid_until_date: Indicates that the Bundle is a valid Bundle until a specified expiration date. :param sort_by: Can be `valid-until` or `date-updated`. Defaults to `date-created`. :param sort_direction: Default is `DESC`. Can be `ASC` or `DESC`. From 4168b097641b9d0f4b0d60dc632650eb4babec92 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 18 Sep 2024 13:23:24 +0000 Subject: [PATCH 048/113] Release 9.3.1 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6366ea68eb..c3b935f109 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.3.0", + version="9.3.1", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 529960ecb5..de97d54994 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "3", "0") +__version_info__ = ("9", "3", "1") __version__ = ".".join(__version_info__) From 75e8b145c05da7e6cf9fc9a06812cbf102a65d90 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 25 Sep 2024 11:48:41 +0000 Subject: [PATCH 049/113] [Librarian] Regenerated @ 08245333f4a8c9235d547b189cd9c422f73e0e7e 7bb98153c25ebfee95e6e85bd4c57969e6d02435 --- CHANGES.md | 11 + twilio/rest/accounts/v1/__init__.py | 16 + twilio/rest/accounts/v1/bulk_consents.py | 106 ++++ twilio/rest/accounts/v1/bulk_contacts.py | 106 ++++ .../rest/assistants/v1/assistant/__init__.py | 67 +++ .../v1/assistant/assistants_knowledge.py | 506 ++++++++++++++++++ .../v1/assistant/assistants_tool.py | 506 ++++++++++++++++++ .../rest/assistants/v1/assistant/message.py | 153 ++++++ .../rest/assistants/v1/knowledge/__init__.py | 23 + .../v1/knowledge/knowledge_status.py | 192 +++++++ twilio/rest/assistants/v1/tool.py | 60 +++ twilio/rest/numbers/v1/__init__.py | 24 +- ...hook_configuration_fetch.py => webhook.py} | 26 +- .../v1/service/environment/deployment.py | 14 +- 14 files changed, 1778 insertions(+), 32 deletions(-) create mode 100644 twilio/rest/accounts/v1/bulk_consents.py create mode 100644 twilio/rest/accounts/v1/bulk_contacts.py create mode 100644 twilio/rest/assistants/v1/assistant/assistants_knowledge.py create mode 100644 twilio/rest/assistants/v1/assistant/assistants_tool.py create mode 100644 twilio/rest/assistants/v1/assistant/message.py create mode 100644 twilio/rest/assistants/v1/knowledge/knowledge_status.py rename twilio/rest/numbers/v1/{porting_webhook_configuration_fetch.py => webhook.py} (77%) diff --git a/CHANGES.md b/CHANGES.md index e8d6748656..307f94f7d0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,17 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-09-25] Version 9.3.2 +-------------------------- +**Accounts** +- Update docs and mounts. +- Change library visibility to public +- Enable consent and contact bulk upsert APIs in prod. + +**Serverless** +- Add is_plugin parameter in deployments api to check if it is plugins deployment + + [2024-09-18] Version 9.3.1 -------------------------- **Library - Chore** diff --git a/twilio/rest/accounts/v1/__init__.py b/twilio/rest/accounts/v1/__init__.py index 142d5c7a96..6f5012d0fa 100644 --- a/twilio/rest/accounts/v1/__init__.py +++ b/twilio/rest/accounts/v1/__init__.py @@ -16,6 +16,8 @@ from twilio.base.version import Version from twilio.base.domain import Domain from twilio.rest.accounts.v1.auth_token_promotion import AuthTokenPromotionList +from twilio.rest.accounts.v1.bulk_consents import BulkConsentsList +from twilio.rest.accounts.v1.bulk_contacts import BulkContactsList from twilio.rest.accounts.v1.credential import CredentialList from twilio.rest.accounts.v1.safelist import SafelistList from twilio.rest.accounts.v1.secondary_auth_token import SecondaryAuthTokenList @@ -31,6 +33,8 @@ def __init__(self, domain: Domain): """ super().__init__(domain, "v1") self._auth_token_promotion: Optional[AuthTokenPromotionList] = None + self._bulk_consents: Optional[BulkConsentsList] = None + self._bulk_contacts: Optional[BulkContactsList] = None self._credentials: Optional[CredentialList] = None self._safelist: Optional[SafelistList] = None self._secondary_auth_token: Optional[SecondaryAuthTokenList] = None @@ -41,6 +45,18 @@ def auth_token_promotion(self) -> AuthTokenPromotionList: self._auth_token_promotion = AuthTokenPromotionList(self) return self._auth_token_promotion + @property + def bulk_consents(self) -> BulkConsentsList: + if self._bulk_consents is None: + self._bulk_consents = BulkConsentsList(self) + return self._bulk_consents + + @property + def bulk_contacts(self) -> BulkContactsList: + if self._bulk_contacts is None: + self._bulk_contacts = BulkContactsList(self) + return self._bulk_contacts + @property def credentials(self) -> CredentialList: if self._credentials is None: diff --git a/twilio/rest/accounts/v1/bulk_consents.py b/twilio/rest/accounts/v1/bulk_consents.py new file mode 100644 index 0000000000..850d72162e --- /dev/null +++ b/twilio/rest/accounts/v1/bulk_consents.py @@ -0,0 +1,106 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Accounts + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional +from twilio.base import serialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class BulkConsentsInstance(InstanceResource): + """ + :ivar items: A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.items: Optional[Dict[str, object]] = payload.get("items") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class BulkConsentsList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the BulkConsentsList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Consents/Bulk" + + def create(self, items: List[object]) -> BulkConsentsInstance: + """ + Create the BulkConsentsInstance + + :param items: This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; and `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`]. + + :returns: The created BulkConsentsInstance + """ + + data = values.of( + { + "Items": serialize.map(items, lambda e: serialize.object(e)), + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return BulkConsentsInstance(self._version, payload) + + async def create_async(self, items: List[object]) -> BulkConsentsInstance: + """ + Asynchronously create the BulkConsentsInstance + + :param items: This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; and `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`]. + + :returns: The created BulkConsentsInstance + """ + + data = values.of( + { + "Items": serialize.map(items, lambda e: serialize.object(e)), + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return BulkConsentsInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/accounts/v1/bulk_contacts.py b/twilio/rest/accounts/v1/bulk_contacts.py new file mode 100644 index 0000000000..0d68908e31 --- /dev/null +++ b/twilio/rest/accounts/v1/bulk_contacts.py @@ -0,0 +1,106 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Accounts + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional +from twilio.base import serialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class BulkContactsInstance(InstanceResource): + """ + :ivar items: A list of objects where each object represents the result of processing a `correlation_id`. Each object contains the following fields: `correlation_id`, a unique 32-character UUID that maps the response to the original request; `error_code`, an integer where 0 indicates success and any non-zero value represents an error; and `error_messages`, an array of strings describing specific validation errors encountered. If the request is successful, the error_messages array will be empty. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.items: Optional[Dict[str, object]] = payload.get("items") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class BulkContactsList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the BulkContactsList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Contacts/Bulk" + + def create(self, items: List[object]) -> BulkContactsInstance: + """ + Create the BulkContactsInstance + + :param items: A list of objects where each object represents a contact's details. Each object includes the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID that maps the response to the original request; `country_iso_code`, a string representing the country using the ISO format (e.g., US for the United States); and `zip_code`, a string representing the postal code. + + :returns: The created BulkContactsInstance + """ + + data = values.of( + { + "Items": serialize.map(items, lambda e: serialize.object(e)), + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return BulkContactsInstance(self._version, payload) + + async def create_async(self, items: List[object]) -> BulkContactsInstance: + """ + Asynchronously create the BulkContactsInstance + + :param items: A list of objects where each object represents a contact's details. Each object includes the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID that maps the response to the original request; `country_iso_code`, a string representing the country using the ISO format (e.g., US for the United States); and `zip_code`, a string representing the postal code. + + :returns: The created BulkContactsInstance + """ + + data = values.of( + { + "Items": serialize.map(items, lambda e: serialize.object(e)), + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return BulkContactsInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/assistant/__init__.py b/twilio/rest/assistants/v1/assistant/__init__.py index 10e90c4743..a865a040eb 100644 --- a/twilio/rest/assistants/v1/assistant/__init__.py +++ b/twilio/rest/assistants/v1/assistant/__init__.py @@ -20,7 +20,12 @@ from twilio.base.list_resource import ListResource from twilio.base.version import Version from twilio.base.page import Page +from twilio.rest.assistants.v1.assistant.assistants_knowledge import ( + AssistantsKnowledgeList, +) +from twilio.rest.assistants.v1.assistant.assistants_tool import AssistantsToolList from twilio.rest.assistants.v1.assistant.feedback import FeedbackList +from twilio.rest.assistants.v1.assistant.message import MessageList class AssistantInstance(InstanceResource): @@ -31,6 +36,7 @@ class AssistantInstance(InstanceResource): :ivar model: The default model used by the assistant. :ivar name: The name of the assistant. :ivar owner: The owner/company of the assistant. + :ivar url: The url of the assistant resource. :ivar personality_prompt: The personality prompt to be used for assistant. :ivar date_created: The date and time in GMT when the Assistant was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the Assistant was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. @@ -49,6 +55,7 @@ def __init__( self.model: Optional[str] = payload.get("model") self.name: Optional[str] = payload.get("name") self.owner: Optional[str] = payload.get("owner") + self.url: Optional[str] = payload.get("url") self.personality_prompt: Optional[str] = payload.get("personality_prompt") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") @@ -149,6 +156,20 @@ async def update_async( assistants_v1_service_update_assistant_request=assistants_v1_service_update_assistant_request, ) + @property + def assistants_knowledge(self) -> AssistantsKnowledgeList: + """ + Access the assistants_knowledge + """ + return self._proxy.assistants_knowledge + + @property + def assistants_tools(self) -> AssistantsToolList: + """ + Access the assistants_tools + """ + return self._proxy.assistants_tools + @property def feedbacks(self) -> FeedbackList: """ @@ -156,6 +177,13 @@ def feedbacks(self) -> FeedbackList: """ return self._proxy.feedbacks + @property + def messages(self) -> MessageList: + """ + Access the messages + """ + return self._proxy.messages + def __repr__(self) -> str: """ Provide a friendly representation @@ -183,7 +211,10 @@ def __init__(self, version: Version, id: str): } self._uri = "/Assistants/{id}".format(**self._solution) + self._assistants_knowledge: Optional[AssistantsKnowledgeList] = None + self._assistants_tools: Optional[AssistantsToolList] = None self._feedbacks: Optional[FeedbackList] = None + self._messages: Optional[MessageList] = None def delete(self) -> bool: """ @@ -299,6 +330,30 @@ async def update_async( return AssistantInstance(self._version, payload, id=self._solution["id"]) + @property + def assistants_knowledge(self) -> AssistantsKnowledgeList: + """ + Access the assistants_knowledge + """ + if self._assistants_knowledge is None: + self._assistants_knowledge = AssistantsKnowledgeList( + self._version, + self._solution["id"], + ) + return self._assistants_knowledge + + @property + def assistants_tools(self) -> AssistantsToolList: + """ + Access the assistants_tools + """ + if self._assistants_tools is None: + self._assistants_tools = AssistantsToolList( + self._version, + self._solution["id"], + ) + return self._assistants_tools + @property def feedbacks(self) -> FeedbackList: """ @@ -311,6 +366,18 @@ def feedbacks(self) -> FeedbackList: ) return self._feedbacks + @property + def messages(self) -> MessageList: + """ + Access the messages + """ + if self._messages is None: + self._messages = MessageList( + self._version, + self._solution["id"], + ) + return self._messages + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/assistants/v1/assistant/assistants_knowledge.py b/twilio/rest/assistants/v1/assistant/assistants_knowledge.py new file mode 100644 index 0000000000..b3c7e9ae0e --- /dev/null +++ b/twilio/rest/assistants/v1/assistant/assistants_knowledge.py @@ -0,0 +1,506 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class AssistantsKnowledgeInstance(InstanceResource): + """ + :ivar description: The type of knowledge source. + :ivar id: The description of knowledge. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') + :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') + :ivar url: The url of the knowledge resource. + :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + assistant_id: str, + id: Optional[str] = None, + ): + super().__init__(version) + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.account_sid: Optional[str] = payload.get("account_sid") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.status: Optional[str] = payload.get("status") + self.type: Optional[str] = payload.get("type") + self.url: Optional[str] = payload.get("url") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "assistant_id": assistant_id, + "id": id or self.id, + } + self._context: Optional[AssistantsKnowledgeContext] = None + + @property + def _proxy(self) -> "AssistantsKnowledgeContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: AssistantsKnowledgeContext for this AssistantsKnowledgeInstance + """ + if self._context is None: + self._context = AssistantsKnowledgeContext( + self._version, + assistant_id=self._solution["assistant_id"], + id=self._solution["id"], + ) + return self._context + + def create(self) -> "AssistantsKnowledgeInstance": + """ + Create the AssistantsKnowledgeInstance + + + :returns: The created AssistantsKnowledgeInstance + """ + return self._proxy.create() + + async def create_async(self) -> "AssistantsKnowledgeInstance": + """ + Asynchronous coroutine to create the AssistantsKnowledgeInstance + + + :returns: The created AssistantsKnowledgeInstance + """ + return await self._proxy.create_async() + + def delete(self) -> bool: + """ + Deletes the AssistantsKnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the AssistantsKnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AssistantsKnowledgeContext(InstanceContext): + + def __init__(self, version: Version, assistant_id: str, id: str): + """ + Initialize the AssistantsKnowledgeContext + + :param version: Version that contains the resource + :param assistant_id: The assistant ID. + :param id: The knowledge ID. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "assistant_id": assistant_id, + "id": id, + } + self._uri = "/Assistants/{assistant_id}/Knowledge/{id}".format(**self._solution) + + def create(self) -> AssistantsKnowledgeInstance: + """ + Create the AssistantsKnowledgeInstance + + + :returns: The created AssistantsKnowledgeInstance + """ + data = values.of({}) + + payload = self._version.create(method="POST", uri=self._uri, data=data) + + return AssistantsKnowledgeInstance( + self._version, + payload, + assistant_id=self._solution["assistant_id"], + id=self._solution["id"], + ) + + async def create_async(self) -> AssistantsKnowledgeInstance: + """ + Asynchronous coroutine to create the AssistantsKnowledgeInstance + + + :returns: The created AssistantsKnowledgeInstance + """ + data = values.of({}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data + ) + + return AssistantsKnowledgeInstance( + self._version, + payload, + assistant_id=self._solution["assistant_id"], + id=self._solution["id"], + ) + + def delete(self) -> bool: + """ + Deletes the AssistantsKnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the AssistantsKnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AssistantsKnowledgePage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> AssistantsKnowledgeInstance: + """ + Build an instance of AssistantsKnowledgeInstance + + :param payload: Payload response from the API + """ + return AssistantsKnowledgeInstance( + self._version, payload, assistant_id=self._solution["assistant_id"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class AssistantsKnowledgeList(ListResource): + + def __init__(self, version: Version, assistant_id: str): + """ + Initialize the AssistantsKnowledgeList + + :param version: Version that contains the resource + :param assistant_id: The assistant ID. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "assistant_id": assistant_id, + } + self._uri = "/Assistants/{assistant_id}/Knowledge".format(**self._solution) + + def create(self) -> AssistantsKnowledgeInstance: + """ + Create the AssistantsKnowledgeInstance + + + :returns: The created AssistantsKnowledgeInstance + """ + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create(method="POST", uri=self._uri, headers=headers) + + return AssistantsKnowledgeInstance( + self._version, payload, assistant_id=self._solution["assistant_id"] + ) + + async def create_async(self) -> AssistantsKnowledgeInstance: + """ + Asynchronously create the AssistantsKnowledgeInstance + + + :returns: The created AssistantsKnowledgeInstance + """ + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, headers=headers + ) + + return AssistantsKnowledgeInstance( + self._version, payload, assistant_id=self._solution["assistant_id"] + ) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[AssistantsKnowledgeInstance]: + """ + Streams AssistantsKnowledgeInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[AssistantsKnowledgeInstance]: + """ + Asynchronously streams AssistantsKnowledgeInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AssistantsKnowledgeInstance]: + """ + Lists AssistantsKnowledgeInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AssistantsKnowledgeInstance]: + """ + Asynchronously lists AssistantsKnowledgeInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AssistantsKnowledgePage: + """ + Retrieve a single page of AssistantsKnowledgeInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AssistantsKnowledgeInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return AssistantsKnowledgePage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AssistantsKnowledgePage: + """ + Asynchronously retrieve a single page of AssistantsKnowledgeInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AssistantsKnowledgeInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return AssistantsKnowledgePage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> AssistantsKnowledgePage: + """ + Retrieve a specific page of AssistantsKnowledgeInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AssistantsKnowledgeInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return AssistantsKnowledgePage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> AssistantsKnowledgePage: + """ + Asynchronously retrieve a specific page of AssistantsKnowledgeInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AssistantsKnowledgeInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return AssistantsKnowledgePage(self._version, response, self._solution) + + def get(self, id: str) -> AssistantsKnowledgeContext: + """ + Constructs a AssistantsKnowledgeContext + + :param id: The knowledge ID. + """ + return AssistantsKnowledgeContext( + self._version, assistant_id=self._solution["assistant_id"], id=id + ) + + def __call__(self, id: str) -> AssistantsKnowledgeContext: + """ + Constructs a AssistantsKnowledgeContext + + :param id: The knowledge ID. + """ + return AssistantsKnowledgeContext( + self._version, assistant_id=self._solution["assistant_id"], id=id + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/assistant/assistants_tool.py b/twilio/rest/assistants/v1/assistant/assistants_tool.py new file mode 100644 index 0000000000..0bed2b76a3 --- /dev/null +++ b/twilio/rest/assistants/v1/assistant/assistants_tool.py @@ -0,0 +1,506 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class AssistantsToolInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Tool resource. + :ivar description: The description of the tool. + :ivar enabled: True if the tool is enabled. + :ivar id: The tool ID. + :ivar meta: The metadata related to method, url, input_schema to used with the Tool. + :ivar name: The name of the tool. + :ivar requires_auth: The authentication requirement for the tool. + :ivar type: The type of the tool. ('WEBHOOK') + :ivar url: The url of the tool resource. + :ivar date_created: The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Tool was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + assistant_id: str, + id: Optional[str] = None, + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.description: Optional[str] = payload.get("description") + self.enabled: Optional[bool] = payload.get("enabled") + self.id: Optional[str] = payload.get("id") + self.meta: Optional[Dict[str, object]] = payload.get("meta") + self.name: Optional[str] = payload.get("name") + self.requires_auth: Optional[bool] = payload.get("requires_auth") + self.type: Optional[str] = payload.get("type") + self.url: Optional[str] = payload.get("url") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "assistant_id": assistant_id, + "id": id or self.id, + } + self._context: Optional[AssistantsToolContext] = None + + @property + def _proxy(self) -> "AssistantsToolContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: AssistantsToolContext for this AssistantsToolInstance + """ + if self._context is None: + self._context = AssistantsToolContext( + self._version, + assistant_id=self._solution["assistant_id"], + id=self._solution["id"], + ) + return self._context + + def create(self) -> "AssistantsToolInstance": + """ + Create the AssistantsToolInstance + + + :returns: The created AssistantsToolInstance + """ + return self._proxy.create() + + async def create_async(self) -> "AssistantsToolInstance": + """ + Asynchronous coroutine to create the AssistantsToolInstance + + + :returns: The created AssistantsToolInstance + """ + return await self._proxy.create_async() + + def delete(self) -> bool: + """ + Deletes the AssistantsToolInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the AssistantsToolInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AssistantsToolContext(InstanceContext): + + def __init__(self, version: Version, assistant_id: str, id: str): + """ + Initialize the AssistantsToolContext + + :param version: Version that contains the resource + :param assistant_id: The assistant ID. + :param id: The tool ID. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "assistant_id": assistant_id, + "id": id, + } + self._uri = "/Assistants/{assistant_id}/Tools/{id}".format(**self._solution) + + def create(self) -> AssistantsToolInstance: + """ + Create the AssistantsToolInstance + + + :returns: The created AssistantsToolInstance + """ + data = values.of({}) + + payload = self._version.create(method="POST", uri=self._uri, data=data) + + return AssistantsToolInstance( + self._version, + payload, + assistant_id=self._solution["assistant_id"], + id=self._solution["id"], + ) + + async def create_async(self) -> AssistantsToolInstance: + """ + Asynchronous coroutine to create the AssistantsToolInstance + + + :returns: The created AssistantsToolInstance + """ + data = values.of({}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data + ) + + return AssistantsToolInstance( + self._version, + payload, + assistant_id=self._solution["assistant_id"], + id=self._solution["id"], + ) + + def delete(self) -> bool: + """ + Deletes the AssistantsToolInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._version.delete( + method="DELETE", + uri=self._uri, + ) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the AssistantsToolInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._version.delete_async( + method="DELETE", + uri=self._uri, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AssistantsToolPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> AssistantsToolInstance: + """ + Build an instance of AssistantsToolInstance + + :param payload: Payload response from the API + """ + return AssistantsToolInstance( + self._version, payload, assistant_id=self._solution["assistant_id"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class AssistantsToolList(ListResource): + + def __init__(self, version: Version, assistant_id: str): + """ + Initialize the AssistantsToolList + + :param version: Version that contains the resource + :param assistant_id: The assistant ID. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "assistant_id": assistant_id, + } + self._uri = "/Assistants/{assistant_id}/Tools".format(**self._solution) + + def create(self) -> AssistantsToolInstance: + """ + Create the AssistantsToolInstance + + + :returns: The created AssistantsToolInstance + """ + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create(method="POST", uri=self._uri, headers=headers) + + return AssistantsToolInstance( + self._version, payload, assistant_id=self._solution["assistant_id"] + ) + + async def create_async(self) -> AssistantsToolInstance: + """ + Asynchronously create the AssistantsToolInstance + + + :returns: The created AssistantsToolInstance + """ + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, headers=headers + ) + + return AssistantsToolInstance( + self._version, payload, assistant_id=self._solution["assistant_id"] + ) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[AssistantsToolInstance]: + """ + Streams AssistantsToolInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[AssistantsToolInstance]: + """ + Asynchronously streams AssistantsToolInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AssistantsToolInstance]: + """ + Lists AssistantsToolInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AssistantsToolInstance]: + """ + Asynchronously lists AssistantsToolInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AssistantsToolPage: + """ + Retrieve a single page of AssistantsToolInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AssistantsToolInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = self._version.page(method="GET", uri=self._uri, params=data) + return AssistantsToolPage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AssistantsToolPage: + """ + Asynchronously retrieve a single page of AssistantsToolInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AssistantsToolInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data + ) + return AssistantsToolPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> AssistantsToolPage: + """ + Retrieve a specific page of AssistantsToolInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AssistantsToolInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return AssistantsToolPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> AssistantsToolPage: + """ + Asynchronously retrieve a specific page of AssistantsToolInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AssistantsToolInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return AssistantsToolPage(self._version, response, self._solution) + + def get(self, id: str) -> AssistantsToolContext: + """ + Constructs a AssistantsToolContext + + :param id: The tool ID. + """ + return AssistantsToolContext( + self._version, assistant_id=self._solution["assistant_id"], id=id + ) + + def __call__(self, id: str) -> AssistantsToolContext: + """ + Constructs a AssistantsToolContext + + :param id: The tool ID. + """ + return AssistantsToolContext( + self._version, assistant_id=self._solution["assistant_id"], id=id + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/assistant/message.py b/twilio/rest/assistants/v1/assistant/message.py new file mode 100644 index 0000000000..b42514cb38 --- /dev/null +++ b/twilio/rest/assistants/v1/assistant/message.py @@ -0,0 +1,153 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional +from twilio.base import values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class MessageInstance(InstanceResource): + """ + :ivar status: success or failure based on whether the request successfully generated a response. + :ivar flagged: If successful, this property will denote whether the response was flagged or not. + :ivar aborted: This property will denote whether the request was aborted or not. + :ivar session_id: The unique name for the session. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that sent the Message. + :ivar body: If successful, the body of the generated response + :ivar error: The error message if generation was not successful + """ + + def __init__(self, version: Version, payload: Dict[str, Any], id: str): + super().__init__(version) + + self.status: Optional[str] = payload.get("status") + self.flagged: Optional[bool] = payload.get("flagged") + self.aborted: Optional[bool] = payload.get("aborted") + self.session_id: Optional[str] = payload.get("session_id") + self.account_sid: Optional[str] = payload.get("account_sid") + self.body: Optional[str] = payload.get("body") + self.error: Optional[str] = payload.get("error") + + self._solution = { + "id": id, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class MessageList(ListResource): + + class AssistantsV1ServiceAssistantSendMessageRequest(object): + """ + :ivar identity: The unique identity of user for the session. + :ivar session_id: The unique name for the session. + :ivar body: The query to ask the assistant. + :ivar webhook: The webhook url to call after the assistant has generated a response or report an error. + :ivar mode: one of the modes 'chat', 'email' or 'voice' + """ + + def __init__(self, payload: Dict[str, Any]): + + self.identity: Optional[str] = payload.get("identity") + self.session_id: Optional[str] = payload.get("session_id") + self.body: Optional[str] = payload.get("body") + self.webhook: Optional[str] = payload.get("webhook") + self.mode: Optional[str] = payload.get("mode") + + def to_dict(self): + return { + "identity": self.identity, + "session_id": self.session_id, + "body": self.body, + "webhook": self.webhook, + "mode": self.mode, + } + + def __init__(self, version: Version, id: str): + """ + Initialize the MessageList + + :param version: Version that contains the resource + :param id: the Assistant ID. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Assistants/{id}/Messages".format(**self._solution) + + def create( + self, + assistants_v1_service_assistant_send_message_request: AssistantsV1ServiceAssistantSendMessageRequest, + ) -> MessageInstance: + """ + Create the MessageInstance + + :param assistants_v1_service_assistant_send_message_request: + + :returns: The created MessageInstance + """ + data = assistants_v1_service_assistant_send_message_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return MessageInstance(self._version, payload, id=self._solution["id"]) + + async def create_async( + self, + assistants_v1_service_assistant_send_message_request: AssistantsV1ServiceAssistantSendMessageRequest, + ) -> MessageInstance: + """ + Asynchronously create the MessageInstance + + :param assistants_v1_service_assistant_send_message_request: + + :returns: The created MessageInstance + """ + data = assistants_v1_service_assistant_send_message_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return MessageInstance(self._version, payload, id=self._solution["id"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/knowledge/__init__.py b/twilio/rest/assistants/v1/knowledge/__init__.py index 32b17e2353..498bc80f95 100644 --- a/twilio/rest/assistants/v1/knowledge/__init__.py +++ b/twilio/rest/assistants/v1/knowledge/__init__.py @@ -21,6 +21,7 @@ from twilio.base.version import Version from twilio.base.page import Page from twilio.rest.assistants.v1.knowledge.chunk import ChunkList +from twilio.rest.assistants.v1.knowledge.knowledge_status import KnowledgeStatusList class KnowledgeInstance(InstanceResource): @@ -32,6 +33,7 @@ class KnowledgeInstance(InstanceResource): :ivar name: The name of the knowledge source. :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') + :ivar url: The url of the knowledge resource. :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. """ @@ -50,6 +52,7 @@ def __init__( self.name: Optional[str] = payload.get("name") self.status: Optional[str] = payload.get("status") self.type: Optional[str] = payload.get("type") + self.url: Optional[str] = payload.get("url") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -154,6 +157,13 @@ def chunks(self) -> ChunkList: """ return self._proxy.chunks + @property + def knowledge_status(self) -> KnowledgeStatusList: + """ + Access the knowledge_status + """ + return self._proxy.knowledge_status + def __repr__(self) -> str: """ Provide a friendly representation @@ -182,6 +192,7 @@ def __init__(self, version: Version, id: str): self._uri = "/Knowledge/{id}".format(**self._solution) self._chunks: Optional[ChunkList] = None + self._knowledge_status: Optional[KnowledgeStatusList] = None def delete(self) -> bool: """ @@ -309,6 +320,18 @@ def chunks(self) -> ChunkList: ) return self._chunks + @property + def knowledge_status(self) -> KnowledgeStatusList: + """ + Access the knowledge_status + """ + if self._knowledge_status is None: + self._knowledge_status = KnowledgeStatusList( + self._version, + self._solution["id"], + ) + return self._knowledge_status + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/assistants/v1/knowledge/knowledge_status.py b/twilio/rest/assistants/v1/knowledge/knowledge_status.py new file mode 100644 index 0000000000..14a56b0cc2 --- /dev/null +++ b/twilio/rest/assistants/v1/knowledge/knowledge_status.py @@ -0,0 +1,192 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Assistants + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional +from twilio.base import deserialize +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class KnowledgeStatusInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. + :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') + :ivar last_status: The last status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') + :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], id: str): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.status: Optional[str] = payload.get("status") + self.last_status: Optional[str] = payload.get("last_status") + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id, + } + self._context: Optional[KnowledgeStatusContext] = None + + @property + def _proxy(self) -> "KnowledgeStatusContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: KnowledgeStatusContext for this KnowledgeStatusInstance + """ + if self._context is None: + self._context = KnowledgeStatusContext( + self._version, + id=self._solution["id"], + ) + return self._context + + def fetch(self) -> "KnowledgeStatusInstance": + """ + Fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "KnowledgeStatusInstance": + """ + Asynchronous coroutine to fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgeStatusContext(InstanceContext): + + def __init__(self, version: Version, id: str): + """ + Initialize the KnowledgeStatusContext + + :param version: Version that contains the resource + :param id: the Knowledge ID. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Knowledge/{id}/Status".format(**self._solution) + + def fetch(self) -> KnowledgeStatusInstance: + """ + Fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return KnowledgeStatusInstance( + self._version, + payload, + id=self._solution["id"], + ) + + async def fetch_async(self) -> KnowledgeStatusInstance: + """ + Asynchronous coroutine to fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return KnowledgeStatusInstance( + self._version, + payload, + id=self._solution["id"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgeStatusList(ListResource): + + def __init__(self, version: Version, id: str): + """ + Initialize the KnowledgeStatusList + + :param version: Version that contains the resource + :param id: the Knowledge ID. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + + def get(self) -> KnowledgeStatusContext: + """ + Constructs a KnowledgeStatusContext + + """ + return KnowledgeStatusContext(self._version, id=self._solution["id"]) + + def __call__(self) -> KnowledgeStatusContext: + """ + Constructs a KnowledgeStatusContext + + """ + return KnowledgeStatusContext(self._version, id=self._solution["id"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/assistants/v1/tool.py b/twilio/rest/assistants/v1/tool.py index a66a818b5d..a8b1ac6472 100644 --- a/twilio/rest/assistants/v1/tool.py +++ b/twilio/rest/assistants/v1/tool.py @@ -32,8 +32,10 @@ class ToolInstance(InstanceResource): :ivar name: The name of the tool. :ivar requires_auth: The authentication requirement for the tool. :ivar type: The type of the tool. ('WEBHOOK') + :ivar url: The url of the tool resource. :ivar date_created: The date and time in GMT when the Tool was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the Tool was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar policies: The Policies associated with the tool. """ def __init__( @@ -49,12 +51,14 @@ def __init__( self.name: Optional[str] = payload.get("name") self.requires_auth: Optional[bool] = payload.get("requires_auth") self.type: Optional[str] = payload.get("type") + self.url: Optional[str] = payload.get("url") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_updated") ) + self.policies: Optional[List[str]] = payload.get("policies") self._solution = { "id": id or self.id, @@ -94,6 +98,24 @@ async def delete_async(self) -> bool: """ return await self._proxy.delete_async() + def fetch(self) -> "ToolInstance": + """ + Fetch the ToolInstance + + + :returns: The fetched ToolInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "ToolInstance": + """ + Asynchronous coroutine to fetch the ToolInstance + + + :returns: The fetched ToolInstance + """ + return await self._proxy.fetch_async() + def update( self, assistants_v1_service_update_tool_request: Union[ @@ -179,6 +201,44 @@ async def delete_async(self) -> bool: uri=self._uri, ) + def fetch(self) -> ToolInstance: + """ + Fetch the ToolInstance + + + :returns: The fetched ToolInstance + """ + + payload = self._version.fetch( + method="GET", + uri=self._uri, + ) + + return ToolInstance( + self._version, + payload, + id=self._solution["id"], + ) + + async def fetch_async(self) -> ToolInstance: + """ + Asynchronous coroutine to fetch the ToolInstance + + + :returns: The fetched ToolInstance + """ + + payload = await self._version.fetch_async( + method="GET", + uri=self._uri, + ) + + return ToolInstance( + self._version, + payload, + id=self._solution["id"], + ) + def update( self, assistants_v1_service_update_tool_request: Union[ diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 043364c3d5..68f078a88d 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,12 +28,10 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) -from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( - PortingWebhookConfigurationFetchList, -) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) +from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -58,12 +56,10 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None - self._porting_webhook_configuration_fetch: Optional[ - PortingWebhookConfigurationFetchList - ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None + self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -111,22 +107,18 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete - @property - def porting_webhook_configuration_fetch( - self, - ) -> PortingWebhookConfigurationFetchList: - if self._porting_webhook_configuration_fetch is None: - self._porting_webhook_configuration_fetch = ( - PortingWebhookConfigurationFetchList(self) - ) - return self._porting_webhook_configuration_fetch - @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations + @property + def webhook(self) -> WebhookList: + if self._webhook is None: + self._webhook = WebhookList(self) + return self._webhook + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/webhook.py similarity index 77% rename from twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py rename to twilio/rest/numbers/v1/webhook.py index 89b8064bdb..88ca64e9e1 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py +++ b/twilio/rest/numbers/v1/webhook.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class PortingWebhookConfigurationFetchInstance(InstanceResource): +class WebhookInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class PortingWebhookConfigurationFetchList(ListResource): +class WebhookList(ListResource): def __init__(self, version: Version): """ - Initialize the PortingWebhookConfigurationFetchList + Initialize the WebhookList :param version: Version that contains the resource @@ -68,25 +68,25 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> PortingWebhookConfigurationFetchInstance: + def fetch(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) - async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: + async def fetch_async(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -94,7 +94,7 @@ async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: method="GET", uri=self._uri, headers=headers ) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) def __repr__(self) -> str: """ @@ -102,4 +102,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/serverless/v1/service/environment/deployment.py b/twilio/rest/serverless/v1/service/environment/deployment.py index 63ef1b4610..e9d86d0c37 100644 --- a/twilio/rest/serverless/v1/service/environment/deployment.py +++ b/twilio/rest/serverless/v1/service/environment/deployment.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import deserialize, serialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -235,12 +235,15 @@ def __init__(self, version: Version, service_sid: str, environment_sid: str): ) def create( - self, build_sid: Union[str, object] = values.unset + self, + build_sid: Union[str, object] = values.unset, + is_plugin: Union[bool, object] = values.unset, ) -> DeploymentInstance: """ Create the DeploymentInstance :param build_sid: The SID of the Build for the Deployment. + :param is_plugin: Whether the Deployment is a plugin. :returns: The created DeploymentInstance """ @@ -248,6 +251,7 @@ def create( data = values.of( { "BuildSid": build_sid, + "IsPlugin": serialize.boolean_to_string(is_plugin), } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -264,12 +268,15 @@ def create( ) async def create_async( - self, build_sid: Union[str, object] = values.unset + self, + build_sid: Union[str, object] = values.unset, + is_plugin: Union[bool, object] = values.unset, ) -> DeploymentInstance: """ Asynchronously create the DeploymentInstance :param build_sid: The SID of the Build for the Deployment. + :param is_plugin: Whether the Deployment is a plugin. :returns: The created DeploymentInstance """ @@ -277,6 +284,7 @@ async def create_async( data = values.of( { "BuildSid": build_sid, + "IsPlugin": serialize.boolean_to_string(is_plugin), } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) From 0f81bbb865e29b67ab7bcc0cfe084894023faca5 Mon Sep 17 00:00:00 2001 From: Twilio Date: Wed, 25 Sep 2024 11:53:24 +0000 Subject: [PATCH 050/113] Release 9.3.2 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index c3b935f109..be0c82e703 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.3.1", + version="9.3.2", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index de97d54994..9c85cf3a45 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "3", "1") +__version_info__ = ("9", "3", "2") __version__ = ".".join(__version_info__) From 7fc68cb385b22a783ed63fb503fca21828fe4d68 Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 3 Oct 2024 15:08:15 +0530 Subject: [PATCH 051/113] chore: add assistants init files (#816) --- twilio/rest/assistants/__init__.py | 56 ++++++++++++++++++++++++++++++ twilio/rest/iam/__init__.py | 2 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 twilio/rest/assistants/__init__.py diff --git a/twilio/rest/assistants/__init__.py b/twilio/rest/assistants/__init__.py new file mode 100644 index 0000000000..60c812014d --- /dev/null +++ b/twilio/rest/assistants/__init__.py @@ -0,0 +1,56 @@ +from warnings import warn + +from twilio.rest.assistants import AssistantsBase +from twilio.rest.assistants.v1.assistant import AssistantList +from twilio.rest.assistants.v1.knowledge import KnowledgeList +from twilio.rest.assistants.v1.policy import PolicyList +from twilio.rest.assistants.v1.session import SessionList +from twilio.rest.assistants.v1.tool import ToolList + + +class Assistants(AssistantsBase): + + @property + def assistants(self) -> AssistantList: + warn( + "assistants is deprecated. Use v1.assistants instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.v1.assistants + + @property + def knowledge(self) -> KnowledgeList: + warn( + "knowledge is deprecated. Use v1.knowledge instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.v1.knowledge + + @property + def policies(self) -> PolicyList: + warn( + "policies is deprecated. Use v1.policies instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.v1.policies + + @property + def sessions(self) -> SessionList: + warn( + "sessions is deprecated. Use v1.sessions instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.v1.sessions + + @property + def tools(self) -> ToolList: + warn( + "tools is deprecated. Use v1.tools instead.", + DeprecationWarning, + stacklevel=2, + ) + return self.v1.tools diff --git a/twilio/rest/iam/__init__.py b/twilio/rest/iam/__init__.py index 7a7819bcc2..f992caa578 100644 --- a/twilio/rest/iam/__init__.py +++ b/twilio/rest/iam/__init__.py @@ -6,7 +6,7 @@ from twilio.rest.iam.v1.new_api_key import NewApiKeyList -class Accounts(IamBase): +class Iam(IamBase): @property def api_key(self) -> ApiKeyList: warn( From 726c36a09758eeddb7f07fcd9859ac365c3c805a Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 3 Oct 2024 15:38:15 +0000 Subject: [PATCH 052/113] [Librarian] Regenerated @ 021bab52f93b55d7a5786bd27716bf3a0be2d7b9 aa81ca7c51512c448626fafb32aeb46838510334 --- CHANGES.md | 16 + twilio/rest/iam/v1/__init__.py | 12 +- twilio/rest/iam/v1/{new_api_key.py => key.py} | 30 +- twilio/rest/numbers/v1/porting_portability.py | 24 +- twilio/rest/preview/PreviewBase.py | 11 - .../rest/preview/deployed_devices/__init__.py | 43 -- .../deployed_devices/fleet/__init__.py | 674 ----------------- .../deployed_devices/fleet/certificate.py | 656 ---------------- .../deployed_devices/fleet/deployment.py | 630 ---------------- .../preview/deployed_devices/fleet/device.py | 700 ------------------ .../preview/deployed_devices/fleet/key.py | 646 ---------------- .../taskrouter/v1/workspace/task/__init__.py | 12 +- twilio/rest/verify/v2/service/verification.py | 10 + .../verify/v2/service/verification_check.py | 6 + 14 files changed, 79 insertions(+), 3391 deletions(-) rename twilio/rest/iam/v1/{new_api_key.py => key.py} (88%) delete mode 100644 twilio/rest/preview/deployed_devices/__init__.py delete mode 100644 twilio/rest/preview/deployed_devices/fleet/__init__.py delete mode 100644 twilio/rest/preview/deployed_devices/fleet/certificate.py delete mode 100644 twilio/rest/preview/deployed_devices/fleet/deployment.py delete mode 100644 twilio/rest/preview/deployed_devices/fleet/device.py delete mode 100644 twilio/rest/preview/deployed_devices/fleet/key.py diff --git a/CHANGES.md b/CHANGES.md index 307f94f7d0..5808d307b5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,22 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-10-03] Version 9.3.3 +-------------------------- +**Library - Chore** +- [PR #816](https://github.com/twilio/twilio-python/pull/816): add assistants init files. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Messaging** +- Add A2P external campaign CnpMigration flag + +**Numbers** +- Add address sid to portability API + +**Verify** +- Add `SnaClientToken` optional parameter on Verification check. +- Add `EnableSnaClientToken` optional parameter for Verification creation. + + [2024-09-25] Version 9.3.2 -------------------------- **Accounts** diff --git a/twilio/rest/iam/v1/__init__.py b/twilio/rest/iam/v1/__init__.py index 0c46947341..408de11acb 100644 --- a/twilio/rest/iam/v1/__init__.py +++ b/twilio/rest/iam/v1/__init__.py @@ -17,7 +17,7 @@ from twilio.base.domain import Domain from twilio.rest.iam.v1.api_key import ApiKeyList from twilio.rest.iam.v1.get_api_keys import GetApiKeysList -from twilio.rest.iam.v1.new_api_key import NewApiKeyList +from twilio.rest.iam.v1.key import KeyList class V1(Version): @@ -31,7 +31,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._api_key: Optional[ApiKeyList] = None self._get_api_keys: Optional[GetApiKeysList] = None - self._new_api_key: Optional[NewApiKeyList] = None + self._keys: Optional[KeyList] = None @property def api_key(self) -> ApiKeyList: @@ -46,10 +46,10 @@ def get_api_keys(self) -> GetApiKeysList: return self._get_api_keys @property - def new_api_key(self) -> NewApiKeyList: - if self._new_api_key is None: - self._new_api_key = NewApiKeyList(self) - return self._new_api_key + def keys(self) -> KeyList: + if self._keys is None: + self._keys = KeyList(self) + return self._keys def __repr__(self) -> str: """ diff --git a/twilio/rest/iam/v1/new_api_key.py b/twilio/rest/iam/v1/key.py similarity index 88% rename from twilio/rest/iam/v1/new_api_key.py rename to twilio/rest/iam/v1/key.py index e3f9fa05a6..5adcbc6939 100644 --- a/twilio/rest/iam/v1/new_api_key.py +++ b/twilio/rest/iam/v1/key.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class NewApiKeyInstance(InstanceResource): +class KeyInstance(InstanceResource): class Keytype(object): RESTRICTED = "restricted" @@ -56,14 +56,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class NewApiKeyList(ListResource): +class KeyList(ListResource): def __init__(self, version: Version): """ - Initialize the NewApiKeyList + Initialize the KeyList :param version: Version that contains the resource @@ -76,18 +76,18 @@ def create( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, + key_type: Union["KeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> NewApiKeyInstance: + ) -> KeyInstance: """ - Create the NewApiKeyInstance + Create the KeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created NewApiKeyInstance + :returns: The created KeyInstance """ data = values.of( @@ -104,24 +104,24 @@ def create( method="POST", uri=self._uri, data=data, headers=headers ) - return NewApiKeyInstance(self._version, payload) + return KeyInstance(self._version, payload) async def create_async( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, + key_type: Union["KeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> NewApiKeyInstance: + ) -> KeyInstance: """ - Asynchronously create the NewApiKeyInstance + Asynchronously create the KeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created NewApiKeyInstance + :returns: The created KeyInstance """ data = values.of( @@ -138,7 +138,7 @@ async def create_async( method="POST", uri=self._uri, data=data, headers=headers ) - return NewApiKeyInstance(self._version, payload) + return KeyInstance(self._version, payload) def __repr__(self) -> str: """ @@ -146,4 +146,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/numbers/v1/porting_portability.py b/twilio/rest/numbers/v1/porting_portability.py index 1f0fc210a4..826a69a243 100644 --- a/twilio/rest/numbers/v1/porting_portability.py +++ b/twilio/rest/numbers/v1/porting_portability.py @@ -85,31 +85,39 @@ def _proxy(self) -> "PortingPortabilityContext": return self._context def fetch( - self, target_account_sid: Union[str, object] = values.unset + self, + target_account_sid: Union[str, object] = values.unset, + address_sid: Union[str, object] = values.unset, ) -> "PortingPortabilityInstance": """ Fetch the PortingPortabilityInstance :param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account. + :param address_sid: Address Sid of customer to which the number will be ported. :returns: The fetched PortingPortabilityInstance """ return self._proxy.fetch( target_account_sid=target_account_sid, + address_sid=address_sid, ) async def fetch_async( - self, target_account_sid: Union[str, object] = values.unset + self, + target_account_sid: Union[str, object] = values.unset, + address_sid: Union[str, object] = values.unset, ) -> "PortingPortabilityInstance": """ Asynchronous coroutine to fetch the PortingPortabilityInstance :param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account. + :param address_sid: Address Sid of customer to which the number will be ported. :returns: The fetched PortingPortabilityInstance """ return await self._proxy.fetch_async( target_account_sid=target_account_sid, + address_sid=address_sid, ) def __repr__(self) -> str: @@ -142,12 +150,15 @@ def __init__(self, version: Version, phone_number: str): ) def fetch( - self, target_account_sid: Union[str, object] = values.unset + self, + target_account_sid: Union[str, object] = values.unset, + address_sid: Union[str, object] = values.unset, ) -> PortingPortabilityInstance: """ Fetch the PortingPortabilityInstance :param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account. + :param address_sid: Address Sid of customer to which the number will be ported. :returns: The fetched PortingPortabilityInstance """ @@ -155,6 +166,7 @@ def fetch( data = values.of( { "TargetAccountSid": target_account_sid, + "AddressSid": address_sid, } ) @@ -167,12 +179,15 @@ def fetch( ) async def fetch_async( - self, target_account_sid: Union[str, object] = values.unset + self, + target_account_sid: Union[str, object] = values.unset, + address_sid: Union[str, object] = values.unset, ) -> PortingPortabilityInstance: """ Asynchronous coroutine to fetch the PortingPortabilityInstance :param target_account_sid: Account Sid to which the number will be ported. This can be used to determine if a sub account already has the number in its inventory or a different sub account. If this is not provided, the authenticated account will be assumed to be the target account. + :param address_sid: Address Sid of customer to which the number will be ported. :returns: The fetched PortingPortabilityInstance """ @@ -180,6 +195,7 @@ async def fetch_async( data = values.of( { "TargetAccountSid": target_account_sid, + "AddressSid": address_sid, } ) diff --git a/twilio/rest/preview/PreviewBase.py b/twilio/rest/preview/PreviewBase.py index 6608a69a2c..2b44efaf63 100644 --- a/twilio/rest/preview/PreviewBase.py +++ b/twilio/rest/preview/PreviewBase.py @@ -13,7 +13,6 @@ from twilio.base.domain import Domain from twilio.rest import Client -from twilio.rest.preview.deployed_devices import DeployedDevices from twilio.rest.preview.hosted_numbers import HostedNumbers from twilio.rest.preview.sync import Sync from twilio.rest.preview.marketplace import Marketplace @@ -29,21 +28,11 @@ def __init__(self, twilio: Client): :returns: Domain for Preview """ super().__init__(twilio, "https://preview.twilio.com") - self._deployed_devices: Optional[DeployedDevices] = None self._hosted_numbers: Optional[HostedNumbers] = None self._sync: Optional[Sync] = None self._marketplace: Optional[Marketplace] = None self._wireless: Optional[Wireless] = None - @property - def deployed_devices(self) -> DeployedDevices: - """ - :returns: Versions deployed_devices of Preview - """ - if self._deployed_devices is None: - self._deployed_devices = DeployedDevices(self) - return self._deployed_devices - @property def hosted_numbers(self) -> HostedNumbers: """ diff --git a/twilio/rest/preview/deployed_devices/__init__.py b/twilio/rest/preview/deployed_devices/__init__.py deleted file mode 100644 index 795ee96566..0000000000 --- a/twilio/rest/preview/deployed_devices/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.preview.deployed_devices.fleet import FleetList - - -class DeployedDevices(Version): - - def __init__(self, domain: Domain): - """ - Initialize the DeployedDevices version of Preview - - :param domain: The Twilio.preview domain - """ - super().__init__(domain, "DeployedDevices") - self._fleets: Optional[FleetList] = None - - @property - def fleets(self) -> FleetList: - if self._fleets is None: - self._fleets = FleetList(self) - return self._fleets - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/deployed_devices/fleet/__init__.py b/twilio/rest/preview/deployed_devices/fleet/__init__.py deleted file mode 100644 index f7321fdb2b..0000000000 --- a/twilio/rest/preview/deployed_devices/fleet/__init__.py +++ /dev/null @@ -1,674 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.preview.deployed_devices.fleet.certificate import CertificateList -from twilio.rest.preview.deployed_devices.fleet.deployment import DeploymentList -from twilio.rest.preview.deployed_devices.fleet.device import DeviceList -from twilio.rest.preview.deployed_devices.fleet.key import KeyList - - -class FleetInstance(InstanceResource): - """ - :ivar sid: Contains a 34 character string that uniquely identifies this Fleet resource. - :ivar url: Contains an absolute URL for this Fleet resource. - :ivar unique_name: Contains a unique and addressable name of this Fleet, e.g. 'default', up to 128 characters long. - :ivar friendly_name: Contains a human readable descriptive text for this Fleet, up to 256 characters long. - :ivar account_sid: Speicifies the unique string identifier of the Account responsible for this Fleet. - :ivar default_deployment_sid: Contains the string identifier of the automatically provisioned default Deployment of this Fleet. - :ivar date_created: Specifies the date this Fleet was created, given in UTC ISO 8601 format. - :ivar date_updated: Specifies the date this Fleet was last updated, given in UTC ISO 8601 format. - :ivar links: Contains a dictionary of URL links to nested resources of this Fleet. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.url: Optional[str] = payload.get("url") - self.unique_name: Optional[str] = payload.get("unique_name") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.account_sid: Optional[str] = payload.get("account_sid") - self.default_deployment_sid: Optional[str] = payload.get( - "default_deployment_sid" - ) - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.links: Optional[Dict[str, object]] = payload.get("links") - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[FleetContext] = None - - @property - def _proxy(self) -> "FleetContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: FleetContext for this FleetInstance - """ - if self._context is None: - self._context = FleetContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the FleetInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FleetInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "FleetInstance": - """ - Fetch the FleetInstance - - - :returns: The fetched FleetInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "FleetInstance": - """ - Asynchronous coroutine to fetch the FleetInstance - - - :returns: The fetched FleetInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - default_deployment_sid: Union[str, object] = values.unset, - ) -> "FleetInstance": - """ - Update the FleetInstance - - :param friendly_name: Provides a human readable descriptive text for this Fleet, up to 256 characters long. - :param default_deployment_sid: Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. - - :returns: The updated FleetInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - default_deployment_sid=default_deployment_sid, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - default_deployment_sid: Union[str, object] = values.unset, - ) -> "FleetInstance": - """ - Asynchronous coroutine to update the FleetInstance - - :param friendly_name: Provides a human readable descriptive text for this Fleet, up to 256 characters long. - :param default_deployment_sid: Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. - - :returns: The updated FleetInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - default_deployment_sid=default_deployment_sid, - ) - - @property - def certificates(self) -> CertificateList: - """ - Access the certificates - """ - return self._proxy.certificates - - @property - def deployments(self) -> DeploymentList: - """ - Access the deployments - """ - return self._proxy.deployments - - @property - def devices(self) -> DeviceList: - """ - Access the devices - """ - return self._proxy.devices - - @property - def keys(self) -> KeyList: - """ - Access the keys - """ - return self._proxy.keys - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FleetContext(InstanceContext): - - def __init__(self, version: Version, sid: str): - """ - Initialize the FleetContext - - :param version: Version that contains the resource - :param sid: Provides a 34 character string that uniquely identifies the requested Fleet resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/Fleets/{sid}".format(**self._solution) - - self._certificates: Optional[CertificateList] = None - self._deployments: Optional[DeploymentList] = None - self._devices: Optional[DeviceList] = None - self._keys: Optional[KeyList] = None - - def delete(self) -> bool: - """ - Deletes the FleetInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the FleetInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> FleetInstance: - """ - Fetch the FleetInstance - - - :returns: The fetched FleetInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return FleetInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> FleetInstance: - """ - Asynchronous coroutine to fetch the FleetInstance - - - :returns: The fetched FleetInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return FleetInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - default_deployment_sid: Union[str, object] = values.unset, - ) -> FleetInstance: - """ - Update the FleetInstance - - :param friendly_name: Provides a human readable descriptive text for this Fleet, up to 256 characters long. - :param default_deployment_sid: Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. - - :returns: The updated FleetInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "DefaultDeploymentSid": default_deployment_sid, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return FleetInstance(self._version, payload, sid=self._solution["sid"]) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - default_deployment_sid: Union[str, object] = values.unset, - ) -> FleetInstance: - """ - Asynchronous coroutine to update the FleetInstance - - :param friendly_name: Provides a human readable descriptive text for this Fleet, up to 256 characters long. - :param default_deployment_sid: Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. - - :returns: The updated FleetInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "DefaultDeploymentSid": default_deployment_sid, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return FleetInstance(self._version, payload, sid=self._solution["sid"]) - - @property - def certificates(self) -> CertificateList: - """ - Access the certificates - """ - if self._certificates is None: - self._certificates = CertificateList( - self._version, - self._solution["sid"], - ) - return self._certificates - - @property - def deployments(self) -> DeploymentList: - """ - Access the deployments - """ - if self._deployments is None: - self._deployments = DeploymentList( - self._version, - self._solution["sid"], - ) - return self._deployments - - @property - def devices(self) -> DeviceList: - """ - Access the devices - """ - if self._devices is None: - self._devices = DeviceList( - self._version, - self._solution["sid"], - ) - return self._devices - - @property - def keys(self) -> KeyList: - """ - Access the keys - """ - if self._keys is None: - self._keys = KeyList( - self._version, - self._solution["sid"], - ) - return self._keys - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class FleetPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> FleetInstance: - """ - Build an instance of FleetInstance - - :param payload: Payload response from the API - """ - return FleetInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class FleetList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the FleetList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Fleets" - - def create(self, friendly_name: Union[str, object] = values.unset) -> FleetInstance: - """ - Create the FleetInstance - - :param friendly_name: Provides a human readable descriptive text for this Fleet, up to 256 characters long. - - :returns: The created FleetInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return FleetInstance(self._version, payload) - - async def create_async( - self, friendly_name: Union[str, object] = values.unset - ) -> FleetInstance: - """ - Asynchronously create the FleetInstance - - :param friendly_name: Provides a human readable descriptive text for this Fleet, up to 256 characters long. - - :returns: The created FleetInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return FleetInstance(self._version, payload) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[FleetInstance]: - """ - Streams FleetInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[FleetInstance]: - """ - Asynchronously streams FleetInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FleetInstance]: - """ - Lists FleetInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[FleetInstance]: - """ - Asynchronously lists FleetInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FleetPage: - """ - Retrieve a single page of FleetInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FleetInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return FleetPage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> FleetPage: - """ - Asynchronously retrieve a single page of FleetInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of FleetInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return FleetPage(self._version, response) - - def get_page(self, target_url: str) -> FleetPage: - """ - Retrieve a specific page of FleetInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FleetInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return FleetPage(self._version, response) - - async def get_page_async(self, target_url: str) -> FleetPage: - """ - Asynchronously retrieve a specific page of FleetInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of FleetInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return FleetPage(self._version, response) - - def get(self, sid: str) -> FleetContext: - """ - Constructs a FleetContext - - :param sid: Provides a 34 character string that uniquely identifies the requested Fleet resource. - """ - return FleetContext(self._version, sid=sid) - - def __call__(self, sid: str) -> FleetContext: - """ - Constructs a FleetContext - - :param sid: Provides a 34 character string that uniquely identifies the requested Fleet resource. - """ - return FleetContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/deployed_devices/fleet/certificate.py b/twilio/rest/preview/deployed_devices/fleet/certificate.py deleted file mode 100644 index 895bdc5682..0000000000 --- a/twilio/rest/preview/deployed_devices/fleet/certificate.py +++ /dev/null @@ -1,656 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class CertificateInstance(InstanceResource): - """ - :ivar sid: Contains a 34 character string that uniquely identifies this Certificate credential resource. - :ivar url: Contains an absolute URL for this Certificate credential resource. - :ivar friendly_name: Contains a human readable descriptive text for this Certificate credential, up to 256 characters long. - :ivar fleet_sid: Specifies the unique string identifier of the Fleet that the given Certificate credential belongs to. - :ivar account_sid: Specifies the unique string identifier of the Account responsible for this Certificate credential. - :ivar device_sid: Specifies the unique string identifier of a Device authenticated with this Certificate credential. - :ivar thumbprint: Contains a unique hash of the payload of this Certificate credential, used to authenticate the Device. - :ivar date_created: Specifies the date this Certificate credential was created, given in UTC ISO 8601 format. - :ivar date_updated: Specifies the date this Certificate credential was last updated, given in UTC ISO 8601 format. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - fleet_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.url: Optional[str] = payload.get("url") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.fleet_sid: Optional[str] = payload.get("fleet_sid") - self.account_sid: Optional[str] = payload.get("account_sid") - self.device_sid: Optional[str] = payload.get("device_sid") - self.thumbprint: Optional[str] = payload.get("thumbprint") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - - self._solution = { - "fleet_sid": fleet_sid, - "sid": sid or self.sid, - } - self._context: Optional[CertificateContext] = None - - @property - def _proxy(self) -> "CertificateContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: CertificateContext for this CertificateInstance - """ - if self._context is None: - self._context = CertificateContext( - self._version, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the CertificateInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the CertificateInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "CertificateInstance": - """ - Fetch the CertificateInstance - - - :returns: The fetched CertificateInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "CertificateInstance": - """ - Asynchronous coroutine to fetch the CertificateInstance - - - :returns: The fetched CertificateInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> "CertificateInstance": - """ - Update the CertificateInstance - - :param friendly_name: Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. - - :returns: The updated CertificateInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - device_sid=device_sid, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> "CertificateInstance": - """ - Asynchronous coroutine to update the CertificateInstance - - :param friendly_name: Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. - - :returns: The updated CertificateInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - device_sid=device_sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class CertificateContext(InstanceContext): - - def __init__(self, version: Version, fleet_sid: str, sid: str): - """ - Initialize the CertificateContext - - :param version: Version that contains the resource - :param fleet_sid: - :param sid: Provides a 34 character string that uniquely identifies the requested Certificate credential resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "fleet_sid": fleet_sid, - "sid": sid, - } - self._uri = "/Fleets/{fleet_sid}/Certificates/{sid}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the CertificateInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the CertificateInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> CertificateInstance: - """ - Fetch the CertificateInstance - - - :returns: The fetched CertificateInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return CertificateInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> CertificateInstance: - """ - Asynchronous coroutine to fetch the CertificateInstance - - - :returns: The fetched CertificateInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return CertificateInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> CertificateInstance: - """ - Update the CertificateInstance - - :param friendly_name: Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. - - :returns: The updated CertificateInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "DeviceSid": device_sid, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return CertificateInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> CertificateInstance: - """ - Asynchronous coroutine to update the CertificateInstance - - :param friendly_name: Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. - - :returns: The updated CertificateInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "DeviceSid": device_sid, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return CertificateInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class CertificatePage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> CertificateInstance: - """ - Build an instance of CertificateInstance - - :param payload: Payload response from the API - """ - return CertificateInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class CertificateList(ListResource): - - def __init__(self, version: Version, fleet_sid: str): - """ - Initialize the CertificateList - - :param version: Version that contains the resource - :param fleet_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "fleet_sid": fleet_sid, - } - self._uri = "/Fleets/{fleet_sid}/Certificates".format(**self._solution) - - def create( - self, - certificate_data: str, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> CertificateInstance: - """ - Create the CertificateInstance - - :param certificate_data: Provides a URL encoded representation of the public certificate in PEM format. - :param friendly_name: Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. - - :returns: The created CertificateInstance - """ - - data = values.of( - { - "CertificateData": certificate_data, - "FriendlyName": friendly_name, - "DeviceSid": device_sid, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return CertificateInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - async def create_async( - self, - certificate_data: str, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> CertificateInstance: - """ - Asynchronously create the CertificateInstance - - :param certificate_data: Provides a URL encoded representation of the public certificate in PEM format. - :param friendly_name: Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. - - :returns: The created CertificateInstance - """ - - data = values.of( - { - "CertificateData": certificate_data, - "FriendlyName": friendly_name, - "DeviceSid": device_sid, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return CertificateInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - def stream( - self, - device_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[CertificateInstance]: - """ - Streams CertificateInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str device_sid: Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(device_sid=device_sid, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - device_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[CertificateInstance]: - """ - Asynchronously streams CertificateInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str device_sid: Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - device_sid=device_sid, page_size=limits["page_size"] - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - device_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[CertificateInstance]: - """ - Lists CertificateInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str device_sid: Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - device_sid=device_sid, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - device_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[CertificateInstance]: - """ - Asynchronously lists CertificateInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str device_sid: Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - device_sid=device_sid, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - device_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> CertificatePage: - """ - Retrieve a single page of CertificateInstance records from the API. - Request is executed immediately - - :param device_sid: Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of CertificateInstance - """ - data = values.of( - { - "DeviceSid": device_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return CertificatePage(self._version, response, self._solution) - - async def page_async( - self, - device_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> CertificatePage: - """ - Asynchronously retrieve a single page of CertificateInstance records from the API. - Request is executed immediately - - :param device_sid: Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of CertificateInstance - """ - data = values.of( - { - "DeviceSid": device_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return CertificatePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> CertificatePage: - """ - Retrieve a specific page of CertificateInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of CertificateInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return CertificatePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> CertificatePage: - """ - Asynchronously retrieve a specific page of CertificateInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of CertificateInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return CertificatePage(self._version, response, self._solution) - - def get(self, sid: str) -> CertificateContext: - """ - Constructs a CertificateContext - - :param sid: Provides a 34 character string that uniquely identifies the requested Certificate credential resource. - """ - return CertificateContext( - self._version, fleet_sid=self._solution["fleet_sid"], sid=sid - ) - - def __call__(self, sid: str) -> CertificateContext: - """ - Constructs a CertificateContext - - :param sid: Provides a 34 character string that uniquely identifies the requested Certificate credential resource. - """ - return CertificateContext( - self._version, fleet_sid=self._solution["fleet_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/deployed_devices/fleet/deployment.py b/twilio/rest/preview/deployed_devices/fleet/deployment.py deleted file mode 100644 index 80f9f2372d..0000000000 --- a/twilio/rest/preview/deployed_devices/fleet/deployment.py +++ /dev/null @@ -1,630 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class DeploymentInstance(InstanceResource): - """ - :ivar sid: Contains a 34 character string that uniquely identifies this Deployment resource. - :ivar url: Contains an absolute URL for this Deployment resource. - :ivar friendly_name: Contains a human readable descriptive text for this Deployment, up to 64 characters long - :ivar fleet_sid: Specifies the unique string identifier of the Fleet that the given Deployment belongs to. - :ivar account_sid: Specifies the unique string identifier of the Account responsible for this Deployment. - :ivar sync_service_sid: Specifies the unique string identifier of the Twilio Sync service instance linked to and accessible by this Deployment. - :ivar date_created: Specifies the date this Deployment was created, given in UTC ISO 8601 format. - :ivar date_updated: Specifies the date this Deployment was last updated, given in UTC ISO 8601 format. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - fleet_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.url: Optional[str] = payload.get("url") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.fleet_sid: Optional[str] = payload.get("fleet_sid") - self.account_sid: Optional[str] = payload.get("account_sid") - self.sync_service_sid: Optional[str] = payload.get("sync_service_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - - self._solution = { - "fleet_sid": fleet_sid, - "sid": sid or self.sid, - } - self._context: Optional[DeploymentContext] = None - - @property - def _proxy(self) -> "DeploymentContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DeploymentContext for this DeploymentInstance - """ - if self._context is None: - self._context = DeploymentContext( - self._version, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the DeploymentInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DeploymentInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "DeploymentInstance": - """ - Fetch the DeploymentInstance - - - :returns: The fetched DeploymentInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DeploymentInstance": - """ - Asynchronous coroutine to fetch the DeploymentInstance - - - :returns: The fetched DeploymentInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - sync_service_sid: Union[str, object] = values.unset, - ) -> "DeploymentInstance": - """ - Update the DeploymentInstance - - :param friendly_name: Provides a human readable descriptive text for this Deployment, up to 64 characters long - :param sync_service_sid: Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. - - :returns: The updated DeploymentInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - sync_service_sid=sync_service_sid, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - sync_service_sid: Union[str, object] = values.unset, - ) -> "DeploymentInstance": - """ - Asynchronous coroutine to update the DeploymentInstance - - :param friendly_name: Provides a human readable descriptive text for this Deployment, up to 64 characters long - :param sync_service_sid: Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. - - :returns: The updated DeploymentInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - sync_service_sid=sync_service_sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DeploymentContext(InstanceContext): - - def __init__(self, version: Version, fleet_sid: str, sid: str): - """ - Initialize the DeploymentContext - - :param version: Version that contains the resource - :param fleet_sid: - :param sid: Provides a 34 character string that uniquely identifies the requested Deployment resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "fleet_sid": fleet_sid, - "sid": sid, - } - self._uri = "/Fleets/{fleet_sid}/Deployments/{sid}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the DeploymentInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DeploymentInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> DeploymentInstance: - """ - Fetch the DeploymentInstance - - - :returns: The fetched DeploymentInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return DeploymentInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> DeploymentInstance: - """ - Asynchronous coroutine to fetch the DeploymentInstance - - - :returns: The fetched DeploymentInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return DeploymentInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - sync_service_sid: Union[str, object] = values.unset, - ) -> DeploymentInstance: - """ - Update the DeploymentInstance - - :param friendly_name: Provides a human readable descriptive text for this Deployment, up to 64 characters long - :param sync_service_sid: Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. - - :returns: The updated DeploymentInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "SyncServiceSid": sync_service_sid, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return DeploymentInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - sync_service_sid: Union[str, object] = values.unset, - ) -> DeploymentInstance: - """ - Asynchronous coroutine to update the DeploymentInstance - - :param friendly_name: Provides a human readable descriptive text for this Deployment, up to 64 characters long - :param sync_service_sid: Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. - - :returns: The updated DeploymentInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "SyncServiceSid": sync_service_sid, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return DeploymentInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DeploymentPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> DeploymentInstance: - """ - Build an instance of DeploymentInstance - - :param payload: Payload response from the API - """ - return DeploymentInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class DeploymentList(ListResource): - - def __init__(self, version: Version, fleet_sid: str): - """ - Initialize the DeploymentList - - :param version: Version that contains the resource - :param fleet_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "fleet_sid": fleet_sid, - } - self._uri = "/Fleets/{fleet_sid}/Deployments".format(**self._solution) - - def create( - self, - friendly_name: Union[str, object] = values.unset, - sync_service_sid: Union[str, object] = values.unset, - ) -> DeploymentInstance: - """ - Create the DeploymentInstance - - :param friendly_name: Provides a human readable descriptive text for this Deployment, up to 256 characters long. - :param sync_service_sid: Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. - - :returns: The created DeploymentInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - "SyncServiceSid": sync_service_sid, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeploymentInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - async def create_async( - self, - friendly_name: Union[str, object] = values.unset, - sync_service_sid: Union[str, object] = values.unset, - ) -> DeploymentInstance: - """ - Asynchronously create the DeploymentInstance - - :param friendly_name: Provides a human readable descriptive text for this Deployment, up to 256 characters long. - :param sync_service_sid: Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. - - :returns: The created DeploymentInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - "SyncServiceSid": sync_service_sid, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeploymentInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[DeploymentInstance]: - """ - Streams DeploymentInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[DeploymentInstance]: - """ - Asynchronously streams DeploymentInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DeploymentInstance]: - """ - Lists DeploymentInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DeploymentInstance]: - """ - Asynchronously lists DeploymentInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DeploymentPage: - """ - Retrieve a single page of DeploymentInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DeploymentInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return DeploymentPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DeploymentPage: - """ - Asynchronously retrieve a single page of DeploymentInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DeploymentInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return DeploymentPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> DeploymentPage: - """ - Retrieve a specific page of DeploymentInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DeploymentInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return DeploymentPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> DeploymentPage: - """ - Asynchronously retrieve a specific page of DeploymentInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DeploymentInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return DeploymentPage(self._version, response, self._solution) - - def get(self, sid: str) -> DeploymentContext: - """ - Constructs a DeploymentContext - - :param sid: Provides a 34 character string that uniquely identifies the requested Deployment resource. - """ - return DeploymentContext( - self._version, fleet_sid=self._solution["fleet_sid"], sid=sid - ) - - def __call__(self, sid: str) -> DeploymentContext: - """ - Constructs a DeploymentContext - - :param sid: Provides a 34 character string that uniquely identifies the requested Deployment resource. - """ - return DeploymentContext( - self._version, fleet_sid=self._solution["fleet_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/deployed_devices/fleet/device.py b/twilio/rest/preview/deployed_devices/fleet/device.py deleted file mode 100644 index 3cacc88f2b..0000000000 --- a/twilio/rest/preview/deployed_devices/fleet/device.py +++ /dev/null @@ -1,700 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class DeviceInstance(InstanceResource): - """ - :ivar sid: Contains a 34 character string that uniquely identifies this Device resource. - :ivar url: Contains an absolute URL for this Device resource. - :ivar unique_name: Contains a unique and addressable name of this Device, assigned by the developer, up to 128 characters long. - :ivar friendly_name: Contains a human readable descriptive text for this Device, up to 256 characters long - :ivar fleet_sid: Specifies the unique string identifier of the Fleet that the given Device belongs to. - :ivar enabled: Contains a boolean flag indicating whether the device is enabled or not, blocks device connectivity if set to false. - :ivar account_sid: Specifies the unique string identifier of the Account responsible for this Device. - :ivar identity: Contains an arbitrary string identifier representing a human user associated with this Device, assigned by the developer, up to 256 characters long. - :ivar deployment_sid: Specifies the unique string identifier of the Deployment group that this Device is associated with. - :ivar date_created: Specifies the date this Device was created, given in UTC ISO 8601 format. - :ivar date_updated: Specifies the date this Device was last updated, given in UTC ISO 8601 format. - :ivar date_authenticated: Specifies the date this Device was last authenticated, given in UTC ISO 8601 format. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - fleet_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.url: Optional[str] = payload.get("url") - self.unique_name: Optional[str] = payload.get("unique_name") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.fleet_sid: Optional[str] = payload.get("fleet_sid") - self.enabled: Optional[bool] = payload.get("enabled") - self.account_sid: Optional[str] = payload.get("account_sid") - self.identity: Optional[str] = payload.get("identity") - self.deployment_sid: Optional[str] = payload.get("deployment_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.date_authenticated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_authenticated") - ) - - self._solution = { - "fleet_sid": fleet_sid, - "sid": sid or self.sid, - } - self._context: Optional[DeviceContext] = None - - @property - def _proxy(self) -> "DeviceContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DeviceContext for this DeviceInstance - """ - if self._context is None: - self._context = DeviceContext( - self._version, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the DeviceInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DeviceInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "DeviceInstance": - """ - Fetch the DeviceInstance - - - :returns: The fetched DeviceInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DeviceInstance": - """ - Asynchronous coroutine to fetch the DeviceInstance - - - :returns: The fetched DeviceInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - identity: Union[str, object] = values.unset, - deployment_sid: Union[str, object] = values.unset, - enabled: Union[bool, object] = values.unset, - ) -> "DeviceInstance": - """ - Update the DeviceInstance - - :param friendly_name: Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. - :param identity: Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. - :param deployment_sid: Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. - :param enabled: - - :returns: The updated DeviceInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - identity=identity, - deployment_sid=deployment_sid, - enabled=enabled, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - identity: Union[str, object] = values.unset, - deployment_sid: Union[str, object] = values.unset, - enabled: Union[bool, object] = values.unset, - ) -> "DeviceInstance": - """ - Asynchronous coroutine to update the DeviceInstance - - :param friendly_name: Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. - :param identity: Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. - :param deployment_sid: Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. - :param enabled: - - :returns: The updated DeviceInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - identity=identity, - deployment_sid=deployment_sid, - enabled=enabled, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DeviceContext(InstanceContext): - - def __init__(self, version: Version, fleet_sid: str, sid: str): - """ - Initialize the DeviceContext - - :param version: Version that contains the resource - :param fleet_sid: - :param sid: Provides a 34 character string that uniquely identifies the requested Device resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "fleet_sid": fleet_sid, - "sid": sid, - } - self._uri = "/Fleets/{fleet_sid}/Devices/{sid}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the DeviceInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DeviceInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> DeviceInstance: - """ - Fetch the DeviceInstance - - - :returns: The fetched DeviceInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return DeviceInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> DeviceInstance: - """ - Asynchronous coroutine to fetch the DeviceInstance - - - :returns: The fetched DeviceInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return DeviceInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - identity: Union[str, object] = values.unset, - deployment_sid: Union[str, object] = values.unset, - enabled: Union[bool, object] = values.unset, - ) -> DeviceInstance: - """ - Update the DeviceInstance - - :param friendly_name: Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. - :param identity: Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. - :param deployment_sid: Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. - :param enabled: - - :returns: The updated DeviceInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "Identity": identity, - "DeploymentSid": deployment_sid, - "Enabled": serialize.boolean_to_string(enabled), - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return DeviceInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - identity: Union[str, object] = values.unset, - deployment_sid: Union[str, object] = values.unset, - enabled: Union[bool, object] = values.unset, - ) -> DeviceInstance: - """ - Asynchronous coroutine to update the DeviceInstance - - :param friendly_name: Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. - :param identity: Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. - :param deployment_sid: Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. - :param enabled: - - :returns: The updated DeviceInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "Identity": identity, - "DeploymentSid": deployment_sid, - "Enabled": serialize.boolean_to_string(enabled), - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return DeviceInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DevicePage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> DeviceInstance: - """ - Build an instance of DeviceInstance - - :param payload: Payload response from the API - """ - return DeviceInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class DeviceList(ListResource): - - def __init__(self, version: Version, fleet_sid: str): - """ - Initialize the DeviceList - - :param version: Version that contains the resource - :param fleet_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "fleet_sid": fleet_sid, - } - self._uri = "/Fleets/{fleet_sid}/Devices".format(**self._solution) - - def create( - self, - unique_name: Union[str, object] = values.unset, - friendly_name: Union[str, object] = values.unset, - identity: Union[str, object] = values.unset, - deployment_sid: Union[str, object] = values.unset, - enabled: Union[bool, object] = values.unset, - ) -> DeviceInstance: - """ - Create the DeviceInstance - - :param unique_name: Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. - :param friendly_name: Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. - :param identity: Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. - :param deployment_sid: Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. - :param enabled: - - :returns: The created DeviceInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - "Identity": identity, - "DeploymentSid": deployment_sid, - "Enabled": serialize.boolean_to_string(enabled), - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - async def create_async( - self, - unique_name: Union[str, object] = values.unset, - friendly_name: Union[str, object] = values.unset, - identity: Union[str, object] = values.unset, - deployment_sid: Union[str, object] = values.unset, - enabled: Union[bool, object] = values.unset, - ) -> DeviceInstance: - """ - Asynchronously create the DeviceInstance - - :param unique_name: Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. - :param friendly_name: Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. - :param identity: Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. - :param deployment_sid: Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. - :param enabled: - - :returns: The created DeviceInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "FriendlyName": friendly_name, - "Identity": identity, - "DeploymentSid": deployment_sid, - "Enabled": serialize.boolean_to_string(enabled), - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - def stream( - self, - deployment_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[DeviceInstance]: - """ - Streams DeviceInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str deployment_sid: Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(deployment_sid=deployment_sid, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - deployment_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[DeviceInstance]: - """ - Asynchronously streams DeviceInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str deployment_sid: Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - deployment_sid=deployment_sid, page_size=limits["page_size"] - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - deployment_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DeviceInstance]: - """ - Lists DeviceInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str deployment_sid: Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - deployment_sid=deployment_sid, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - deployment_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DeviceInstance]: - """ - Asynchronously lists DeviceInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str deployment_sid: Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - deployment_sid=deployment_sid, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - deployment_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DevicePage: - """ - Retrieve a single page of DeviceInstance records from the API. - Request is executed immediately - - :param deployment_sid: Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DeviceInstance - """ - data = values.of( - { - "DeploymentSid": deployment_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return DevicePage(self._version, response, self._solution) - - async def page_async( - self, - deployment_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DevicePage: - """ - Asynchronously retrieve a single page of DeviceInstance records from the API. - Request is executed immediately - - :param deployment_sid: Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DeviceInstance - """ - data = values.of( - { - "DeploymentSid": deployment_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return DevicePage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> DevicePage: - """ - Retrieve a specific page of DeviceInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DeviceInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return DevicePage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> DevicePage: - """ - Asynchronously retrieve a specific page of DeviceInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DeviceInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return DevicePage(self._version, response, self._solution) - - def get(self, sid: str) -> DeviceContext: - """ - Constructs a DeviceContext - - :param sid: Provides a 34 character string that uniquely identifies the requested Device resource. - """ - return DeviceContext( - self._version, fleet_sid=self._solution["fleet_sid"], sid=sid - ) - - def __call__(self, sid: str) -> DeviceContext: - """ - Constructs a DeviceContext - - :param sid: Provides a 34 character string that uniquely identifies the requested Device resource. - """ - return DeviceContext( - self._version, fleet_sid=self._solution["fleet_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/deployed_devices/fleet/key.py b/twilio/rest/preview/deployed_devices/fleet/key.py deleted file mode 100644 index 1b7c06e1f9..0000000000 --- a/twilio/rest/preview/deployed_devices/fleet/key.py +++ /dev/null @@ -1,646 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class KeyInstance(InstanceResource): - """ - :ivar sid: Contains a 34 character string that uniquely identifies this Key credential resource. - :ivar url: Contains an absolute URL for this Key credential resource. - :ivar friendly_name: Contains a human readable descriptive text for this Key credential, up to 256 characters long. - :ivar fleet_sid: Specifies the unique string identifier of the Fleet that the given Key credential belongs to. - :ivar account_sid: Specifies the unique string identifier of the Account responsible for this Key credential. - :ivar device_sid: Specifies the unique string identifier of a Device authenticated with this Key credential. - :ivar secret: Contains the automatically generated secret belonging to this Key credential, used to authenticate the Device. - :ivar date_created: Specifies the date this Key credential was created, given in UTC ISO 8601 format. - :ivar date_updated: Specifies the date this Key credential was last updated, given in UTC ISO 8601 format. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - fleet_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.url: Optional[str] = payload.get("url") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.fleet_sid: Optional[str] = payload.get("fleet_sid") - self.account_sid: Optional[str] = payload.get("account_sid") - self.device_sid: Optional[str] = payload.get("device_sid") - self.secret: Optional[str] = payload.get("secret") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - - self._solution = { - "fleet_sid": fleet_sid, - "sid": sid or self.sid, - } - self._context: Optional[KeyContext] = None - - @property - def _proxy(self) -> "KeyContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: KeyContext for this KeyInstance - """ - if self._context is None: - self._context = KeyContext( - self._version, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the KeyInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the KeyInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "KeyInstance": - """ - Fetch the KeyInstance - - - :returns: The fetched KeyInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "KeyInstance": - """ - Asynchronous coroutine to fetch the KeyInstance - - - :returns: The fetched KeyInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> "KeyInstance": - """ - Update the KeyInstance - - :param friendly_name: Provides a human readable descriptive text for this Key credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Key credential. - - :returns: The updated KeyInstance - """ - return self._proxy.update( - friendly_name=friendly_name, - device_sid=device_sid, - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> "KeyInstance": - """ - Asynchronous coroutine to update the KeyInstance - - :param friendly_name: Provides a human readable descriptive text for this Key credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Key credential. - - :returns: The updated KeyInstance - """ - return await self._proxy.update_async( - friendly_name=friendly_name, - device_sid=device_sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class KeyContext(InstanceContext): - - def __init__(self, version: Version, fleet_sid: str, sid: str): - """ - Initialize the KeyContext - - :param version: Version that contains the resource - :param fleet_sid: - :param sid: Provides a 34 character string that uniquely identifies the requested Key credential resource. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "fleet_sid": fleet_sid, - "sid": sid, - } - self._uri = "/Fleets/{fleet_sid}/Keys/{sid}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the KeyInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the KeyInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._version.delete_async( - method="DELETE", - uri=self._uri, - ) - - def fetch(self) -> KeyInstance: - """ - Fetch the KeyInstance - - - :returns: The fetched KeyInstance - """ - - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) - - return KeyInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> KeyInstance: - """ - Asynchronous coroutine to fetch the KeyInstance - - - :returns: The fetched KeyInstance - """ - - payload = await self._version.fetch_async( - method="GET", - uri=self._uri, - ) - - return KeyInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - def update( - self, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> KeyInstance: - """ - Update the KeyInstance - - :param friendly_name: Provides a human readable descriptive text for this Key credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Key credential. - - :returns: The updated KeyInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "DeviceSid": device_sid, - } - ) - - payload = self._version.update( - method="POST", - uri=self._uri, - data=data, - ) - - return KeyInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> KeyInstance: - """ - Asynchronous coroutine to update the KeyInstance - - :param friendly_name: Provides a human readable descriptive text for this Key credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Key credential. - - :returns: The updated KeyInstance - """ - data = values.of( - { - "FriendlyName": friendly_name, - "DeviceSid": device_sid, - } - ) - - payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, - ) - - return KeyInstance( - self._version, - payload, - fleet_sid=self._solution["fleet_sid"], - sid=self._solution["sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class KeyPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> KeyInstance: - """ - Build an instance of KeyInstance - - :param payload: Payload response from the API - """ - return KeyInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class KeyList(ListResource): - - def __init__(self, version: Version, fleet_sid: str): - """ - Initialize the KeyList - - :param version: Version that contains the resource - :param fleet_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "fleet_sid": fleet_sid, - } - self._uri = "/Fleets/{fleet_sid}/Keys".format(**self._solution) - - def create( - self, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> KeyInstance: - """ - Create the KeyInstance - - :param friendly_name: Provides a human readable descriptive text for this Key credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Key credential. - - :returns: The created KeyInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - "DeviceSid": device_sid, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return KeyInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - async def create_async( - self, - friendly_name: Union[str, object] = values.unset, - device_sid: Union[str, object] = values.unset, - ) -> KeyInstance: - """ - Asynchronously create the KeyInstance - - :param friendly_name: Provides a human readable descriptive text for this Key credential, up to 256 characters long. - :param device_sid: Provides the unique string identifier of an existing Device to become authenticated with this Key credential. - - :returns: The created KeyInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - "DeviceSid": device_sid, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return KeyInstance( - self._version, payload, fleet_sid=self._solution["fleet_sid"] - ) - - def stream( - self, - device_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[KeyInstance]: - """ - Streams KeyInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str device_sid: Filters the resulting list of Keys by a unique string identifier of an authenticated Device. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(device_sid=device_sid, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - device_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[KeyInstance]: - """ - Asynchronously streams KeyInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str device_sid: Filters the resulting list of Keys by a unique string identifier of an authenticated Device. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - device_sid=device_sid, page_size=limits["page_size"] - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - device_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[KeyInstance]: - """ - Lists KeyInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str device_sid: Filters the resulting list of Keys by a unique string identifier of an authenticated Device. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - device_sid=device_sid, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - device_sid: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[KeyInstance]: - """ - Asynchronously lists KeyInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str device_sid: Filters the resulting list of Keys by a unique string identifier of an authenticated Device. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - device_sid=device_sid, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - device_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> KeyPage: - """ - Retrieve a single page of KeyInstance records from the API. - Request is executed immediately - - :param device_sid: Filters the resulting list of Keys by a unique string identifier of an authenticated Device. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of KeyInstance - """ - data = values.of( - { - "DeviceSid": device_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = self._version.page(method="GET", uri=self._uri, params=data) - return KeyPage(self._version, response, self._solution) - - async def page_async( - self, - device_sid: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> KeyPage: - """ - Asynchronously retrieve a single page of KeyInstance records from the API. - Request is executed immediately - - :param device_sid: Filters the resulting list of Keys by a unique string identifier of an authenticated Device. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of KeyInstance - """ - data = values.of( - { - "DeviceSid": device_sid, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data - ) - return KeyPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> KeyPage: - """ - Retrieve a specific page of KeyInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of KeyInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return KeyPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> KeyPage: - """ - Asynchronously retrieve a specific page of KeyInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of KeyInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return KeyPage(self._version, response, self._solution) - - def get(self, sid: str) -> KeyContext: - """ - Constructs a KeyContext - - :param sid: Provides a 34 character string that uniquely identifies the requested Key credential resource. - """ - return KeyContext(self._version, fleet_sid=self._solution["fleet_sid"], sid=sid) - - def __call__(self, sid: str) -> KeyContext: - """ - Constructs a KeyContext - - :param sid: Provides a 34 character string that uniquely identifies the requested Key credential resource. - """ - return KeyContext(self._version, fleet_sid=self._solution["fleet_sid"], sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index 631b8f8bdb..ed25dc71d1 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -193,7 +193,7 @@ def update( :param reason: The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. :param priority: The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). :param task_channel: When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. - :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. + :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future or before the year of 1900. :returns: The updated TaskInstance """ @@ -226,7 +226,7 @@ async def update_async( :param reason: The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. :param priority: The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). :param task_channel: When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. - :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. + :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future or before the year of 1900. :returns: The updated TaskInstance """ @@ -371,7 +371,7 @@ def update( :param reason: The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. :param priority: The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). :param task_channel: When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. - :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. + :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future or before the year of 1900. :returns: The updated TaskInstance """ @@ -421,7 +421,7 @@ async def update_async( :param reason: The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. :param priority: The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). :param task_channel: When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. - :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future. + :param virtual_start_time: The task's new virtual start time value. When supplied, the Task takes on the specified virtual start time. Value can't be in the future or before the year of 1900. :returns: The updated TaskInstance """ @@ -534,7 +534,7 @@ def create( :param task_channel: When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. :param workflow_sid: The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. :param attributes: A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. - :param virtual_start_time: The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. + :param virtual_start_time: The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future or before the year of 1900. :param routing_target: A SID of a Worker, Queue, or Workflow to route a Task to :param ignore_capacity: A boolean that indicates if the Task should respect a Worker's capacity and availability during assignment. This field can only be used when the `RoutingTarget` field is set to a Worker SID. By setting `IgnoreCapacity` to a value of `true`, `1`, or `yes`, the Task will be routed to the Worker without respecting their capacity and availability. Any other value will enforce the Worker's capacity and availability. The default value of `IgnoreCapacity` is `true` when the `RoutingTarget` is set to a Worker SID. :param task_queue_sid: The SID of the TaskQueue in which the Task belongs @@ -585,7 +585,7 @@ async def create_async( :param task_channel: When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. :param workflow_sid: The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. :param attributes: A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. - :param virtual_start_time: The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future. + :param virtual_start_time: The virtual start time to assign the new task and override the default. When supplied, the new task will have this virtual start time. When not supplied, the new task will have the virtual start time equal to `date_created`. Value can't be in the future or before the year of 1900. :param routing_target: A SID of a Worker, Queue, or Workflow to route a Task to :param ignore_capacity: A boolean that indicates if the Task should respect a Worker's capacity and availability during assignment. This field can only be used when the `RoutingTarget` field is set to a Worker SID. By setting `IgnoreCapacity` to a value of `true`, `1`, or `yes`, the Task will be routed to the Worker without respecting their capacity and availability. Any other value will enforce the Worker's capacity and availability. The default value of `IgnoreCapacity` is `true` when the `RoutingTarget` is set to a Worker SID. :param task_queue_sid: The SID of the TaskQueue in which the Task belongs diff --git a/twilio/rest/verify/v2/service/verification.py b/twilio/rest/verify/v2/service/verification.py index c8deef535b..23a956b65f 100644 --- a/twilio/rest/verify/v2/service/verification.py +++ b/twilio/rest/verify/v2/service/verification.py @@ -325,6 +325,7 @@ def create( template_sid: Union[str, object] = values.unset, template_custom_substitutions: Union[str, object] = values.unset, device_ip: Union[str, object] = values.unset, + enable_sna_client_token: Union[bool, object] = values.unset, risk_check: Union["VerificationInstance.RiskCheck", object] = values.unset, tags: Union[str, object] = values.unset, ) -> VerificationInstance: @@ -346,6 +347,7 @@ def create( :param template_sid: The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. :param template_custom_substitutions: A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. :param device_ip: Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. + :param enable_sna_client_token: An optional Boolean value to indicate the requirement of sna client token in the SNA URL invocation response for added security. This token must match in the Verification Check request to confirm phone number verification. :param risk_check: :param tags: A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. @@ -369,6 +371,9 @@ def create( "TemplateSid": template_sid, "TemplateCustomSubstitutions": template_custom_substitutions, "DeviceIp": device_ip, + "EnableSnaClientToken": serialize.boolean_to_string( + enable_sna_client_token + ), "RiskCheck": risk_check, "Tags": tags, } @@ -400,6 +405,7 @@ async def create_async( template_sid: Union[str, object] = values.unset, template_custom_substitutions: Union[str, object] = values.unset, device_ip: Union[str, object] = values.unset, + enable_sna_client_token: Union[bool, object] = values.unset, risk_check: Union["VerificationInstance.RiskCheck", object] = values.unset, tags: Union[str, object] = values.unset, ) -> VerificationInstance: @@ -421,6 +427,7 @@ async def create_async( :param template_sid: The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. :param template_custom_substitutions: A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. :param device_ip: Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. + :param enable_sna_client_token: An optional Boolean value to indicate the requirement of sna client token in the SNA URL invocation response for added security. This token must match in the Verification Check request to confirm phone number verification. :param risk_check: :param tags: A string containing a JSON map of key value pairs of tags to be recorded as metadata for the message. The object may contain up to 10 tags. Keys and values can each be up to 128 characters in length. @@ -444,6 +451,9 @@ async def create_async( "TemplateSid": template_sid, "TemplateCustomSubstitutions": template_custom_substitutions, "DeviceIp": device_ip, + "EnableSnaClientToken": serialize.boolean_to_string( + enable_sna_client_token + ), "RiskCheck": risk_check, "Tags": tags, } diff --git a/twilio/rest/verify/v2/service/verification_check.py b/twilio/rest/verify/v2/service/verification_check.py index af216a39f6..fd1b3f897c 100644 --- a/twilio/rest/verify/v2/service/verification_check.py +++ b/twilio/rest/verify/v2/service/verification_check.py @@ -108,6 +108,7 @@ def create( verification_sid: Union[str, object] = values.unset, amount: Union[str, object] = values.unset, payee: Union[str, object] = values.unset, + sna_client_token: Union[str, object] = values.unset, ) -> VerificationCheckInstance: """ Create the VerificationCheckInstance @@ -117,6 +118,7 @@ def create( :param verification_sid: A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. :param amount: The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. :param payee: The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + :param sna_client_token: A sna client token received in sna url invocation response needs to be passed in Verification Check request and should match to get successful response. :returns: The created VerificationCheckInstance """ @@ -128,6 +130,7 @@ def create( "VerificationSid": verification_sid, "Amount": amount, "Payee": payee, + "SnaClientToken": sna_client_token, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -147,6 +150,7 @@ async def create_async( verification_sid: Union[str, object] = values.unset, amount: Union[str, object] = values.unset, payee: Union[str, object] = values.unset, + sna_client_token: Union[str, object] = values.unset, ) -> VerificationCheckInstance: """ Asynchronously create the VerificationCheckInstance @@ -156,6 +160,7 @@ async def create_async( :param verification_sid: A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. :param amount: The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. :param payee: The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + :param sna_client_token: A sna client token received in sna url invocation response needs to be passed in Verification Check request and should match to get successful response. :returns: The created VerificationCheckInstance """ @@ -167,6 +172,7 @@ async def create_async( "VerificationSid": verification_sid, "Amount": amount, "Payee": payee, + "SnaClientToken": sna_client_token, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) From 69b9ae8b978aef665c56ff4e3ab09004d505a679 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 3 Oct 2024 15:43:07 +0000 Subject: [PATCH 053/113] Release 9.3.3 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index be0c82e703..911ec6d8a4 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.3.2", + version="9.3.3", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 9c85cf3a45..e5ba728ee2 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "3", "2") +__version_info__ = ("9", "3", "3") __version__ = ".".join(__version_info__) From ccce7138163fad28f6d0055197367c2392676551 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 17 Oct 2024 14:06:21 +0000 Subject: [PATCH 054/113] [Librarian] Regenerated @ d97b0740a0c7cf86beebd56c6973927b07719cde 1fc3bb6195ebcbd02451fb8fc9080c695b075d4f --- CHANGES.md | 9 + twilio/rest/messaging/v1/__init__.py | 8 + .../rest/messaging/v1/request_managed_cert.py | 209 ++++++++++++++++++ twilio/rest/video/v1/room/__init__.py | 42 ++-- 4 files changed, 247 insertions(+), 21 deletions(-) create mode 100644 twilio/rest/messaging/v1/request_managed_cert.py diff --git a/CHANGES.md b/CHANGES.md index 5808d307b5..bdadc9361c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,15 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-10-17] Version 9.3.4 +-------------------------- +**Api** +- Add response key `country` to fetch AvailablePhoneNumber resource by specific country. + +**Messaging** +- Make library and doc public for requestManagedCert Endpoint + + [2024-10-03] Version 9.3.3 -------------------------- **Library - Chore** diff --git a/twilio/rest/messaging/v1/__init__.py b/twilio/rest/messaging/v1/__init__.py index 6262dfe938..6bd630fbd8 100644 --- a/twilio/rest/messaging/v1/__init__.py +++ b/twilio/rest/messaging/v1/__init__.py @@ -29,6 +29,7 @@ from twilio.rest.messaging.v1.linkshortening_messaging_service_domain_association import ( LinkshorteningMessagingServiceDomainAssociationList, ) +from twilio.rest.messaging.v1.request_managed_cert import RequestManagedCertList from twilio.rest.messaging.v1.service import ServiceList from twilio.rest.messaging.v1.tollfree_verification import TollfreeVerificationList from twilio.rest.messaging.v1.usecase import UsecaseList @@ -57,6 +58,7 @@ def __init__(self, domain: Domain): self._linkshortening_messaging_service_domain_association: Optional[ LinkshorteningMessagingServiceDomainAssociationList ] = None + self._request_managed_cert: Optional[RequestManagedCertList] = None self._services: Optional[ServiceList] = None self._tollfree_verifications: Optional[TollfreeVerificationList] = None self._usecases: Optional[UsecaseList] = None @@ -117,6 +119,12 @@ def linkshortening_messaging_service_domain_association( ) return self._linkshortening_messaging_service_domain_association + @property + def request_managed_cert(self) -> RequestManagedCertList: + if self._request_managed_cert is None: + self._request_managed_cert = RequestManagedCertList(self) + return self._request_managed_cert + @property def services(self) -> ServiceList: if self._services is None: diff --git a/twilio/rest/messaging/v1/request_managed_cert.py b/twilio/rest/messaging/v1/request_managed_cert.py new file mode 100644 index 0000000000..fd79b5a686 --- /dev/null +++ b/twilio/rest/messaging/v1/request_managed_cert.py @@ -0,0 +1,209 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Messaging + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class RequestManagedCertInstance(InstanceResource): + """ + :ivar domain_sid: The unique string that we created to identify the Domain resource. + :ivar date_updated: Date that this Domain was last updated. + :ivar date_created: Date that this Domain was registered to the Twilio platform to create a new Domain object. + :ivar date_expires: Date that the private certificate associated with this domain expires. This is the expiration date of your existing cert. + :ivar domain_name: Full url path for this domain. + :ivar certificate_sid: The unique string that we created to identify this Certificate resource. + :ivar url: + :ivar managed: A boolean flag indicating if the certificate is managed by Twilio. + :ivar requesting: A boolean flag indicating if a managed certificate needs to be fulfilled by Twilio. + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + domain_sid: Optional[str] = None, + ): + super().__init__(version) + + self.domain_sid: Optional[str] = payload.get("domain_sid") + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_expires: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_expires") + ) + self.domain_name: Optional[str] = payload.get("domain_name") + self.certificate_sid: Optional[str] = payload.get("certificate_sid") + self.url: Optional[str] = payload.get("url") + self.managed: Optional[bool] = payload.get("managed") + self.requesting: Optional[bool] = payload.get("requesting") + + self._solution = { + "domain_sid": domain_sid or self.domain_sid, + } + self._context: Optional[RequestManagedCertContext] = None + + @property + def _proxy(self) -> "RequestManagedCertContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: RequestManagedCertContext for this RequestManagedCertInstance + """ + if self._context is None: + self._context = RequestManagedCertContext( + self._version, + domain_sid=self._solution["domain_sid"], + ) + return self._context + + def update(self) -> "RequestManagedCertInstance": + """ + Update the RequestManagedCertInstance + + + :returns: The updated RequestManagedCertInstance + """ + return self._proxy.update() + + async def update_async(self) -> "RequestManagedCertInstance": + """ + Asynchronous coroutine to update the RequestManagedCertInstance + + + :returns: The updated RequestManagedCertInstance + """ + return await self._proxy.update_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class RequestManagedCertContext(InstanceContext): + + def __init__(self, version: Version, domain_sid: str): + """ + Initialize the RequestManagedCertContext + + :param version: Version that contains the resource + :param domain_sid: Unique string used to identify the domain that this certificate should be associated with. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "domain_sid": domain_sid, + } + self._uri = "/LinkShortening/Domains/{domain_sid}/RequestManagedCert".format( + **self._solution + ) + + def update(self) -> RequestManagedCertInstance: + """ + Update the RequestManagedCertInstance + + + :returns: The updated RequestManagedCertInstance + """ + data = values.of({}) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return RequestManagedCertInstance( + self._version, payload, domain_sid=self._solution["domain_sid"] + ) + + async def update_async(self) -> RequestManagedCertInstance: + """ + Asynchronous coroutine to update the RequestManagedCertInstance + + + :returns: The updated RequestManagedCertInstance + """ + data = values.of({}) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return RequestManagedCertInstance( + self._version, payload, domain_sid=self._solution["domain_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class RequestManagedCertList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the RequestManagedCertList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, domain_sid: str) -> RequestManagedCertContext: + """ + Constructs a RequestManagedCertContext + + :param domain_sid: Unique string used to identify the domain that this certificate should be associated with. + """ + return RequestManagedCertContext(self._version, domain_sid=domain_sid) + + def __call__(self, domain_sid: str) -> RequestManagedCertContext: + """ + Constructs a RequestManagedCertContext + + :param domain_sid: Unique string used to identify the domain that this certificate should be associated with. + """ + return RequestManagedCertContext(self._version, domain_sid=domain_sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index c735e5516f..4a6822c94b 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -43,25 +43,25 @@ class VideoCodec(object): H264 = "H264" """ - :ivar sid: The unique string that we created to identify the Room resource. + :ivar sid: The unique string that Twilio created to identify the Room resource. :ivar status: :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Room resource. :ivar enable_turn: Deprecated, now always considered to be true. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. - :ivar status_callback: The URL we call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. - :ivar status_callback_method: The HTTP method we use to call `status_callback`. Can be `POST` or `GET` and defaults to `POST`. + :ivar status_callback: The URL Twilio calls using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. + :ivar status_callback_method: The HTTP method Twilio uses to call `status_callback`. Can be `POST` or `GET` and defaults to `POST`. :ivar end_time: The UTC end time of the room in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. :ivar duration: The duration of the room in seconds. :ivar type: :ivar max_participants: The maximum number of concurrent Participants allowed in the room. :ivar max_participant_duration: The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). :ivar max_concurrent_published_tracks: The maximum number of published audio, video, and data tracks all participants combined are allowed to publish in the room at the same time. Check [Programmable Video Limits](https://www.twilio.com/docs/video/programmable-video-limits) for more details. If it is set to 0 it means unconstrained. - :ivar record_participants_on_connect: Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** - :ivar video_codecs: An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** - :ivar media_region: The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#media-servers). ***This feature is not available in `peer-to-peer` rooms.*** - :ivar audio_only: When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. + :ivar record_participants_on_connect: Whether to start recording when Participants connect. + :ivar video_codecs: An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. + :ivar media_region: The region for the Room's media server. Can be one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#media-servers). + :ivar audio_only: When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. :ivar empty_room_timeout: Specifies how long (in minutes) a room will remain active after last participant leaves. Can be configured when creating a room via REST API. For Ad-Hoc rooms this value cannot be changed. :ivar unused_room_timeout: Specifies how long (in minutes) a room will remain active if no one joins. Can be configured when creating a room via REST API. For Ad-Hoc rooms this value cannot be changed. :ivar large_room: Indicates if this is a large room. @@ -419,14 +419,14 @@ def create( :param enable_turn: Deprecated, now always considered to be true. :param type: :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. - :param status_callback: The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. - :param status_callback_method: The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. - :param max_participants: The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. - :param record_participants_on_connect: Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** - :param video_codecs: An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** - :param media_region: The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** + :param status_callback: The URL Twilio should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. + :param status_callback_method: The HTTP method Twilio should use to call `status_callback`. Can be `POST` or `GET`. + :param max_participants: The maximum number of concurrent Participants allowed in the room. The maximum allowed value is 50. + :param record_participants_on_connect: Whether to start recording when Participants connect. + :param video_codecs: An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. + :param media_region: The region for the Room's media server. Can be one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). :param recording_rules: A collection of Recording Rules that describe how to include or exclude matching tracks for recording - :param audio_only: When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. + :param audio_only: When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. :param max_participant_duration: The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). :param empty_room_timeout: Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). :param unused_room_timeout: Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). @@ -488,14 +488,14 @@ async def create_async( :param enable_turn: Deprecated, now always considered to be true. :param type: :param unique_name: An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. - :param status_callback: The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. - :param status_callback_method: The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. - :param max_participants: The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. - :param record_participants_on_connect: Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** - :param video_codecs: An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** - :param media_region: The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** + :param status_callback: The URL Twilio should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. + :param status_callback_method: The HTTP method Twilio should use to call `status_callback`. Can be `POST` or `GET`. + :param max_participants: The maximum number of concurrent Participants allowed in the room. The maximum allowed value is 50. + :param record_participants_on_connect: Whether to start recording when Participants connect. + :param video_codecs: An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. + :param media_region: The region for the Room's media server. Can be one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). :param recording_rules: A collection of Recording Rules that describe how to include or exclude matching tracks for recording - :param audio_only: When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. + :param audio_only: When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. :param max_participant_duration: The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). :param empty_room_timeout: Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). :param unused_room_timeout: Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). From 9f1414d97a6566d31a380dc884925847233f958a Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 17 Oct 2024 14:11:00 +0000 Subject: [PATCH 055/113] Release 9.3.4 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 911ec6d8a4..a81b74cc51 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.3.3", + version="9.3.4", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index e5ba728ee2..a14d90732d 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "3", "3") +__version_info__ = ("9", "3", "4") __version__ = ".".join(__version_info__) From 086bc6bb518fa77c6f042f7a52d1c15d03cc4bc7 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 24 Oct 2024 13:27:35 +0000 Subject: [PATCH 056/113] [Librarian] Regenerated @ 2e932f6c59e0f9fb6cb96952802e5ebedd83b6f0 1852557f82faade033dbd5bd0615c9e1aa4d9fae --- CHANGES.md | 6 + twilio/rest/conversations/v1/__init__.py | 14 + .../v1/conversation_with_participants.py | 243 ++++++++++++++++ .../rest/conversations/v1/service/__init__.py | 25 ++ .../service/conversation_with_participants.py | 264 ++++++++++++++++++ .../marketplace/v1/referral_conversion.py | 140 ++-------- twilio/rest/numbers/v1/__init__.py | 24 +- ...=> porting_webhook_configuration_fetch.py} | 26 +- 8 files changed, 612 insertions(+), 130 deletions(-) create mode 100644 twilio/rest/conversations/v1/conversation_with_participants.py create mode 100644 twilio/rest/conversations/v1/service/conversation_with_participants.py rename twilio/rest/numbers/v1/{webhook.py => porting_webhook_configuration_fetch.py} (77%) diff --git a/CHANGES.md b/CHANGES.md index bdadc9361c..a0c6db00a2 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,12 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-10-24] Version 9.3.5 +-------------------------- +**Conversations** +- Expose ConversationWithParticipants resource that allows creating a conversation with participants + + [2024-10-17] Version 9.3.4 -------------------------- **Api** diff --git a/twilio/rest/conversations/v1/__init__.py b/twilio/rest/conversations/v1/__init__.py index 3296ba2b46..1ec6c22a7b 100644 --- a/twilio/rest/conversations/v1/__init__.py +++ b/twilio/rest/conversations/v1/__init__.py @@ -18,6 +18,9 @@ from twilio.rest.conversations.v1.address_configuration import AddressConfigurationList from twilio.rest.conversations.v1.configuration import ConfigurationList from twilio.rest.conversations.v1.conversation import ConversationList +from twilio.rest.conversations.v1.conversation_with_participants import ( + ConversationWithParticipantsList, +) from twilio.rest.conversations.v1.credential import CredentialList from twilio.rest.conversations.v1.participant_conversation import ( ParticipantConversationList, @@ -39,6 +42,9 @@ def __init__(self, domain: Domain): self._address_configurations: Optional[AddressConfigurationList] = None self._configuration: Optional[ConfigurationList] = None self._conversations: Optional[ConversationList] = None + self._conversation_with_participants: Optional[ + ConversationWithParticipantsList + ] = None self._credentials: Optional[CredentialList] = None self._participant_conversations: Optional[ParticipantConversationList] = None self._roles: Optional[RoleList] = None @@ -63,6 +69,14 @@ def conversations(self) -> ConversationList: self._conversations = ConversationList(self) return self._conversations + @property + def conversation_with_participants(self) -> ConversationWithParticipantsList: + if self._conversation_with_participants is None: + self._conversation_with_participants = ConversationWithParticipantsList( + self + ) + return self._conversation_with_participants + @property def credentials(self) -> CredentialList: if self._credentials is None: diff --git a/twilio/rest/conversations/v1/conversation_with_participants.py b/twilio/rest/conversations/v1/conversation_with_participants.py new file mode 100644 index 0000000000..402f7adde7 --- /dev/null +++ b/twilio/rest/conversations/v1/conversation_with_participants.py @@ -0,0 +1,243 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Conversations + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, serialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ConversationWithParticipantsInstance(InstanceResource): + + class State(object): + INACTIVE = "inactive" + ACTIVE = "active" + CLOSED = "closed" + + class WebhookEnabledType(object): + TRUE = "true" + FALSE = "false" + + """ + :ivar account_sid: The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + :ivar chat_service_sid: The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. + :ivar messaging_service_sid: The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + :ivar sid: A 34 character string that uniquely identifies this resource. + :ivar friendly_name: The human-readable name of this conversation, limited to 256 characters. Optional. + :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + :ivar attributes: An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + :ivar state: + :ivar date_created: The date that this resource was created. + :ivar date_updated: The date that this resource was last updated. + :ivar timers: Timer date values representing state update for this conversation. + :ivar links: Contains absolute URLs to access the [participants](https://www.twilio.com/docs/conversations/api/conversation-participant-resource), [messages](https://www.twilio.com/docs/conversations/api/conversation-message-resource) and [webhooks](https://www.twilio.com/docs/conversations/api/conversation-scoped-webhook-resource) of this conversation. + :ivar bindings: + :ivar url: An absolute API resource URL for this conversation. + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.chat_service_sid: Optional[str] = payload.get("chat_service_sid") + self.messaging_service_sid: Optional[str] = payload.get("messaging_service_sid") + self.sid: Optional[str] = payload.get("sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.unique_name: Optional[str] = payload.get("unique_name") + self.attributes: Optional[str] = payload.get("attributes") + self.state: Optional["ConversationWithParticipantsInstance.State"] = ( + payload.get("state") + ) + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.timers: Optional[Dict[str, object]] = payload.get("timers") + self.links: Optional[Dict[str, object]] = payload.get("links") + self.bindings: Optional[Dict[str, object]] = payload.get("bindings") + self.url: Optional[str] = payload.get("url") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ConversationWithParticipantsList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the ConversationWithParticipantsList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/ConversationWithParticipants" + + def create( + self, + x_twilio_webhook_enabled: Union[ + "ConversationWithParticipantsInstance.WebhookEnabledType", object + ] = values.unset, + friendly_name: Union[str, object] = values.unset, + unique_name: Union[str, object] = values.unset, + date_created: Union[datetime, object] = values.unset, + date_updated: Union[datetime, object] = values.unset, + messaging_service_sid: Union[str, object] = values.unset, + attributes: Union[str, object] = values.unset, + state: Union[ + "ConversationWithParticipantsInstance.State", object + ] = values.unset, + timers_inactive: Union[str, object] = values.unset, + timers_closed: Union[str, object] = values.unset, + bindings_email_address: Union[str, object] = values.unset, + bindings_email_name: Union[str, object] = values.unset, + participant: Union[List[str], object] = values.unset, + ) -> ConversationWithParticipantsInstance: + """ + Create the ConversationWithParticipantsInstance + + :param x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :param friendly_name: The human-readable name of this conversation, limited to 256 characters. Optional. + :param unique_name: An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + :param date_created: The date that this resource was created. + :param date_updated: The date that this resource was last updated. + :param messaging_service_sid: The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + :param attributes: An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + :param state: + :param timers_inactive: ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + :param timers_closed: ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + :param bindings_email_address: The default email address that will be used when sending outbound emails in this conversation. + :param bindings_email_name: The default name that will be used when sending outbound emails in this conversation. + :param participant: The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. + + :returns: The created ConversationWithParticipantsInstance + """ + + data = values.of( + { + "FriendlyName": friendly_name, + "UniqueName": unique_name, + "DateCreated": serialize.iso8601_datetime(date_created), + "DateUpdated": serialize.iso8601_datetime(date_updated), + "MessagingServiceSid": messaging_service_sid, + "Attributes": attributes, + "State": state, + "Timers.Inactive": timers_inactive, + "Timers.Closed": timers_closed, + "Bindings.Email.Address": bindings_email_address, + "Bindings.Email.Name": bindings_email_name, + "Participant": serialize.map(participant, lambda e: e), + } + ) + headers = values.of( + { + "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ConversationWithParticipantsInstance(self._version, payload) + + async def create_async( + self, + x_twilio_webhook_enabled: Union[ + "ConversationWithParticipantsInstance.WebhookEnabledType", object + ] = values.unset, + friendly_name: Union[str, object] = values.unset, + unique_name: Union[str, object] = values.unset, + date_created: Union[datetime, object] = values.unset, + date_updated: Union[datetime, object] = values.unset, + messaging_service_sid: Union[str, object] = values.unset, + attributes: Union[str, object] = values.unset, + state: Union[ + "ConversationWithParticipantsInstance.State", object + ] = values.unset, + timers_inactive: Union[str, object] = values.unset, + timers_closed: Union[str, object] = values.unset, + bindings_email_address: Union[str, object] = values.unset, + bindings_email_name: Union[str, object] = values.unset, + participant: Union[List[str], object] = values.unset, + ) -> ConversationWithParticipantsInstance: + """ + Asynchronously create the ConversationWithParticipantsInstance + + :param x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :param friendly_name: The human-readable name of this conversation, limited to 256 characters. Optional. + :param unique_name: An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + :param date_created: The date that this resource was created. + :param date_updated: The date that this resource was last updated. + :param messaging_service_sid: The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + :param attributes: An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + :param state: + :param timers_inactive: ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + :param timers_closed: ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + :param bindings_email_address: The default email address that will be used when sending outbound emails in this conversation. + :param bindings_email_name: The default name that will be used when sending outbound emails in this conversation. + :param participant: The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. + + :returns: The created ConversationWithParticipantsInstance + """ + + data = values.of( + { + "FriendlyName": friendly_name, + "UniqueName": unique_name, + "DateCreated": serialize.iso8601_datetime(date_created), + "DateUpdated": serialize.iso8601_datetime(date_updated), + "MessagingServiceSid": messaging_service_sid, + "Attributes": attributes, + "State": state, + "Timers.Inactive": timers_inactive, + "Timers.Closed": timers_closed, + "Bindings.Email.Address": bindings_email_address, + "Bindings.Email.Name": bindings_email_name, + "Participant": serialize.map(participant, lambda e: e), + } + ) + headers = values.of( + { + "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ConversationWithParticipantsInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/conversations/v1/service/__init__.py b/twilio/rest/conversations/v1/service/__init__.py index a06afa2f77..415c252290 100644 --- a/twilio/rest/conversations/v1/service/__init__.py +++ b/twilio/rest/conversations/v1/service/__init__.py @@ -23,6 +23,9 @@ from twilio.rest.conversations.v1.service.binding import BindingList from twilio.rest.conversations.v1.service.configuration import ConfigurationList from twilio.rest.conversations.v1.service.conversation import ConversationList +from twilio.rest.conversations.v1.service.conversation_with_participants import ( + ConversationWithParticipantsList, +) from twilio.rest.conversations.v1.service.participant_conversation import ( ParticipantConversationList, ) @@ -135,6 +138,13 @@ def conversations(self) -> ConversationList: """ return self._proxy.conversations + @property + def conversation_with_participants(self) -> ConversationWithParticipantsList: + """ + Access the conversation_with_participants + """ + return self._proxy.conversation_with_participants + @property def participant_conversations(self) -> ParticipantConversationList: """ @@ -186,6 +196,9 @@ def __init__(self, version: Version, sid: str): self._bindings: Optional[BindingList] = None self._configuration: Optional[ConfigurationList] = None self._conversations: Optional[ConversationList] = None + self._conversation_with_participants: Optional[ + ConversationWithParticipantsList + ] = None self._participant_conversations: Optional[ParticipantConversationList] = None self._roles: Optional[RoleList] = None self._users: Optional[UserList] = None @@ -288,6 +301,18 @@ def conversations(self) -> ConversationList: ) return self._conversations + @property + def conversation_with_participants(self) -> ConversationWithParticipantsList: + """ + Access the conversation_with_participants + """ + if self._conversation_with_participants is None: + self._conversation_with_participants = ConversationWithParticipantsList( + self._version, + self._solution["sid"], + ) + return self._conversation_with_participants + @property def participant_conversations(self) -> ParticipantConversationList: """ diff --git a/twilio/rest/conversations/v1/service/conversation_with_participants.py b/twilio/rest/conversations/v1/service/conversation_with_participants.py new file mode 100644 index 0000000000..123f159764 --- /dev/null +++ b/twilio/rest/conversations/v1/service/conversation_with_participants.py @@ -0,0 +1,264 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Conversations + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union +from twilio.base import deserialize, serialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ConversationWithParticipantsInstance(InstanceResource): + + class State(object): + INACTIVE = "inactive" + ACTIVE = "active" + CLOSED = "closed" + + class WebhookEnabledType(object): + TRUE = "true" + FALSE = "false" + + """ + :ivar account_sid: The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. + :ivar chat_service_sid: The unique ID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) this conversation belongs to. + :ivar messaging_service_sid: The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + :ivar sid: A 34 character string that uniquely identifies this resource. + :ivar friendly_name: The human-readable name of this conversation, limited to 256 characters. Optional. + :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + :ivar attributes: An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \"{}\" will be returned. + :ivar state: + :ivar date_created: The date that this resource was created. + :ivar date_updated: The date that this resource was last updated. + :ivar timers: Timer date values representing state update for this conversation. + :ivar links: Contains absolute URLs to access the [participants](https://www.twilio.com/docs/conversations/api/conversation-participant-resource), [messages](https://www.twilio.com/docs/conversations/api/conversation-message-resource) and [webhooks](https://www.twilio.com/docs/conversations/api/conversation-scoped-webhook-resource) of this conversation. + :ivar bindings: + :ivar url: An absolute API resource URL for this conversation. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], chat_service_sid: str + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.chat_service_sid: Optional[str] = payload.get("chat_service_sid") + self.messaging_service_sid: Optional[str] = payload.get("messaging_service_sid") + self.sid: Optional[str] = payload.get("sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.unique_name: Optional[str] = payload.get("unique_name") + self.attributes: Optional[str] = payload.get("attributes") + self.state: Optional["ConversationWithParticipantsInstance.State"] = ( + payload.get("state") + ) + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.timers: Optional[Dict[str, object]] = payload.get("timers") + self.links: Optional[Dict[str, object]] = payload.get("links") + self.bindings: Optional[Dict[str, object]] = payload.get("bindings") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "chat_service_sid": chat_service_sid, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return ( + "".format( + context + ) + ) + + +class ConversationWithParticipantsList(ListResource): + + def __init__(self, version: Version, chat_service_sid: str): + """ + Initialize the ConversationWithParticipantsList + + :param version: Version that contains the resource + :param chat_service_sid: The SID of the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) the Conversation resource is associated with. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "chat_service_sid": chat_service_sid, + } + self._uri = "/Services/{chat_service_sid}/ConversationWithParticipants".format( + **self._solution + ) + + def create( + self, + x_twilio_webhook_enabled: Union[ + "ConversationWithParticipantsInstance.WebhookEnabledType", object + ] = values.unset, + friendly_name: Union[str, object] = values.unset, + unique_name: Union[str, object] = values.unset, + date_created: Union[datetime, object] = values.unset, + date_updated: Union[datetime, object] = values.unset, + messaging_service_sid: Union[str, object] = values.unset, + attributes: Union[str, object] = values.unset, + state: Union[ + "ConversationWithParticipantsInstance.State", object + ] = values.unset, + timers_inactive: Union[str, object] = values.unset, + timers_closed: Union[str, object] = values.unset, + bindings_email_address: Union[str, object] = values.unset, + bindings_email_name: Union[str, object] = values.unset, + participant: Union[List[str], object] = values.unset, + ) -> ConversationWithParticipantsInstance: + """ + Create the ConversationWithParticipantsInstance + + :param x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :param friendly_name: The human-readable name of this conversation, limited to 256 characters. Optional. + :param unique_name: An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + :param date_created: The date that this resource was created. + :param date_updated: The date that this resource was last updated. + :param messaging_service_sid: The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + :param attributes: An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + :param state: + :param timers_inactive: ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + :param timers_closed: ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + :param bindings_email_address: The default email address that will be used when sending outbound emails in this conversation. + :param bindings_email_name: The default name that will be used when sending outbound emails in this conversation. + :param participant: The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. + + :returns: The created ConversationWithParticipantsInstance + """ + + data = values.of( + { + "FriendlyName": friendly_name, + "UniqueName": unique_name, + "DateCreated": serialize.iso8601_datetime(date_created), + "DateUpdated": serialize.iso8601_datetime(date_updated), + "MessagingServiceSid": messaging_service_sid, + "Attributes": attributes, + "State": state, + "Timers.Inactive": timers_inactive, + "Timers.Closed": timers_closed, + "Bindings.Email.Address": bindings_email_address, + "Bindings.Email.Name": bindings_email_name, + "Participant": serialize.map(participant, lambda e: e), + } + ) + headers = values.of( + { + "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ConversationWithParticipantsInstance( + self._version, payload, chat_service_sid=self._solution["chat_service_sid"] + ) + + async def create_async( + self, + x_twilio_webhook_enabled: Union[ + "ConversationWithParticipantsInstance.WebhookEnabledType", object + ] = values.unset, + friendly_name: Union[str, object] = values.unset, + unique_name: Union[str, object] = values.unset, + date_created: Union[datetime, object] = values.unset, + date_updated: Union[datetime, object] = values.unset, + messaging_service_sid: Union[str, object] = values.unset, + attributes: Union[str, object] = values.unset, + state: Union[ + "ConversationWithParticipantsInstance.State", object + ] = values.unset, + timers_inactive: Union[str, object] = values.unset, + timers_closed: Union[str, object] = values.unset, + bindings_email_address: Union[str, object] = values.unset, + bindings_email_name: Union[str, object] = values.unset, + participant: Union[List[str], object] = values.unset, + ) -> ConversationWithParticipantsInstance: + """ + Asynchronously create the ConversationWithParticipantsInstance + + :param x_twilio_webhook_enabled: The X-Twilio-Webhook-Enabled HTTP request header + :param friendly_name: The human-readable name of this conversation, limited to 256 characters. Optional. + :param unique_name: An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + :param date_created: The date that this resource was created. + :param date_updated: The date that this resource was last updated. + :param messaging_service_sid: The unique ID of the [Messaging Service](https://www.twilio.com/docs/messaging/api/service-resource) this conversation belongs to. + :param attributes: An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + :param state: + :param timers_inactive: ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + :param timers_closed: ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + :param bindings_email_address: The default email address that will be used when sending outbound emails in this conversation. + :param bindings_email_name: The default name that will be used when sending outbound emails in this conversation. + :param participant: The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. + + :returns: The created ConversationWithParticipantsInstance + """ + + data = values.of( + { + "FriendlyName": friendly_name, + "UniqueName": unique_name, + "DateCreated": serialize.iso8601_datetime(date_created), + "DateUpdated": serialize.iso8601_datetime(date_updated), + "MessagingServiceSid": messaging_service_sid, + "Attributes": attributes, + "State": state, + "Timers.Inactive": timers_inactive, + "Timers.Closed": timers_closed, + "Bindings.Email.Address": bindings_email_address, + "Bindings.Email.Name": bindings_email_name, + "Participant": serialize.map(participant, lambda e: e), + } + ) + headers = values.of( + { + "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ConversationWithParticipantsInstance( + self._version, payload, chat_service_sid=self._solution["chat_service_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/marketplace/v1/referral_conversion.py b/twilio/rest/marketplace/v1/referral_conversion.py index 62d6ad84fd..47bb191ed7 100644 --- a/twilio/rest/marketplace/v1/referral_conversion.py +++ b/twilio/rest/marketplace/v1/referral_conversion.py @@ -14,7 +14,7 @@ from typing import Any, Dict, Optional from twilio.base import values -from twilio.base.instance_context import InstanceContext + from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource from twilio.base.version import Version @@ -30,67 +30,40 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.converted_account_sid: Optional[str] = payload.get("converted_account_sid") - self._context: Optional[ReferralConversionContext] = None - - @property - def _proxy(self) -> "ReferralConversionContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: ReferralConversionContext for this ReferralConversionInstance - """ - if self._context is None: - self._context = ReferralConversionContext( - self._version, - ) - return self._context - - def create( - self, create_referral_conversion_request: CreateReferralConversionRequest - ) -> "ReferralConversionInstance": + def __repr__(self) -> str: """ - Create the ReferralConversionInstance - - :param create_referral_conversion_request: + Provide a friendly representation - :returns: The created ReferralConversionInstance + :returns: Machine friendly representation """ - return self._proxy.create( - create_referral_conversion_request, - ) - async def create_async( - self, create_referral_conversion_request: CreateReferralConversionRequest - ) -> "ReferralConversionInstance": - """ - Asynchronous coroutine to create the ReferralConversionInstance + return "" - :param create_referral_conversion_request: - :returns: The created ReferralConversionInstance - """ - return await self._proxy.create_async( - create_referral_conversion_request, - ) +class ReferralConversionList(ListResource): - def __repr__(self) -> str: + class CreateReferralConversionRequest(object): """ - Provide a friendly representation - - :returns: Machine friendly representation + :ivar referral_account_sid: """ - return "" + def __init__(self, payload: Dict[str, Any]): + self.referral_account_sid: Optional[str] = payload.get( + "referral_account_sid" + ) -class ReferralConversionContext(InstanceContext): + def to_dict(self): + return { + "referral_account_sid": self.referral_account_sid, + } def __init__(self, version: Version): """ - Initialize the ReferralConversionContext + Initialize the ReferralConversionList :param version: Version that contains the resource + """ super().__init__(version) @@ -106,13 +79,14 @@ def create( :returns: The created ReferralConversionInstance """ - data = values.of( - { - "CreateReferralConversionRequest": create_referral_conversion_request, - } - ) + data = create_referral_conversion_request.to_dict() - payload = self._version.create(method="POST", uri=self._uri, data=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) return ReferralConversionInstance(self._version, payload) @@ -120,75 +94,23 @@ async def create_async( self, create_referral_conversion_request: CreateReferralConversionRequest ) -> ReferralConversionInstance: """ - Asynchronous coroutine to create the ReferralConversionInstance + Asynchronously create the ReferralConversionInstance :param create_referral_conversion_request: :returns: The created ReferralConversionInstance """ - data = values.of( - { - "CreateReferralConversionRequest": create_referral_conversion_request, - } - ) + data = create_referral_conversion_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" payload = await self._version.create_async( - method="POST", uri=self._uri, data=data + method="POST", uri=self._uri, data=data, headers=headers ) return ReferralConversionInstance(self._version, payload) - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - - return "" - - -class ReferralConversionList(ListResource): - - class CreateReferralConversionRequest(object): - """ - :ivar referral_account_sid: - """ - - def __init__(self, payload: Dict[str, Any]): - - self.referral_account_sid: Optional[str] = payload.get( - "referral_account_sid" - ) - - def to_dict(self): - return { - "referral_account_sid": self.referral_account_sid, - } - - def __init__(self, version: Version): - """ - Initialize the ReferralConversionList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - def get(self) -> ReferralConversionContext: - """ - Constructs a ReferralConversionContext - - """ - return ReferralConversionContext(self._version) - - def __call__(self) -> ReferralConversionContext: - """ - Constructs a ReferralConversionContext - - """ - return ReferralConversionContext(self._version) - def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 68f078a88d..043364c3d5 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,10 +28,12 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) +from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( + PortingWebhookConfigurationFetchList, +) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) -from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -56,10 +58,12 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None + self._porting_webhook_configuration_fetch: Optional[ + PortingWebhookConfigurationFetchList + ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None - self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -107,18 +111,22 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete + @property + def porting_webhook_configuration_fetch( + self, + ) -> PortingWebhookConfigurationFetchList: + if self._porting_webhook_configuration_fetch is None: + self._porting_webhook_configuration_fetch = ( + PortingWebhookConfigurationFetchList(self) + ) + return self._porting_webhook_configuration_fetch + @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations - @property - def webhook(self) -> WebhookList: - if self._webhook is None: - self._webhook = WebhookList(self) - return self._webhook - def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/webhook.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py similarity index 77% rename from twilio/rest/numbers/v1/webhook.py rename to twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py index 88ca64e9e1..89b8064bdb 100644 --- a/twilio/rest/numbers/v1/webhook.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class WebhookInstance(InstanceResource): +class PortingWebhookConfigurationFetchInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class WebhookList(ListResource): +class PortingWebhookConfigurationFetchList(ListResource): def __init__(self, version: Version): """ - Initialize the WebhookList + Initialize the PortingWebhookConfigurationFetchList :param version: Version that contains the resource @@ -68,25 +68,25 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> WebhookInstance: + def fetch(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) - async def fetch_async(self) -> WebhookInstance: + async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -94,7 +94,7 @@ async def fetch_async(self) -> WebhookInstance: method="GET", uri=self._uri, headers=headers ) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) def __repr__(self) -> str: """ @@ -102,4 +102,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" From 19e54f9c1e3ed865326641f7cbfb94d9555e2a94 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 24 Oct 2024 13:34:35 +0000 Subject: [PATCH 057/113] Release 9.3.5 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index a81b74cc51..2350dbfc2c 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.3.4", + version="9.3.5", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index a14d90732d..03a9b11574 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "3", "4") +__version_info__ = ("9", "3", "5") __version__ = ".".join(__version_info__) From efa28037b00092721feb27ee517df2063954d482 Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 25 Oct 2024 17:11:20 +0530 Subject: [PATCH 058/113] chore: removing unavailable references from init files (#818) --- twilio/rest/autopilot/__init__.py | 25 --------------- twilio/rest/iam/__init__.py | 10 ------ twilio/rest/media/__init__.py | 35 -------------------- twilio/rest/oauth/__init__.py | 39 ----------------------- twilio/rest/preview/__init__.py | 9 ------ twilio/rest/preview_messaging/__init__.py | 13 -------- 6 files changed, 131 deletions(-) delete mode 100644 twilio/rest/autopilot/__init__.py delete mode 100644 twilio/rest/media/__init__.py delete mode 100644 twilio/rest/preview_messaging/__init__.py diff --git a/twilio/rest/autopilot/__init__.py b/twilio/rest/autopilot/__init__.py deleted file mode 100644 index f382325023..0000000000 --- a/twilio/rest/autopilot/__init__.py +++ /dev/null @@ -1,25 +0,0 @@ -from warnings import warn - -from twilio.rest.autopilot.AutopilotBase import AutopilotBase -from twilio.rest.autopilot.v1.assistant import AssistantList -from twilio.rest.autopilot.v1.restore_assistant import RestoreAssistantList - - -class Autopilot(AutopilotBase): - @property - def assistants(self) -> AssistantList: - warn( - "assistants is deprecated. Use v1.assistants instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.assistants - - @property - def restore_assistant(self) -> RestoreAssistantList: - warn( - "restore_assistant is deprecated. Use v1.restore_assistant instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.restore_assistant diff --git a/twilio/rest/iam/__init__.py b/twilio/rest/iam/__init__.py index f992caa578..994ecee62f 100644 --- a/twilio/rest/iam/__init__.py +++ b/twilio/rest/iam/__init__.py @@ -3,7 +3,6 @@ from twilio.rest.iam.IamBase import IamBase from twilio.rest.iam.v1.api_key import ApiKeyList from twilio.rest.iam.v1.get_api_keys import GetApiKeysList -from twilio.rest.iam.v1.new_api_key import NewApiKeyList class Iam(IamBase): @@ -24,12 +23,3 @@ def get_api_keys(self) -> GetApiKeysList: stacklevel=2, ) return self.v1.get_api_keys - - @property - def new_api_key(self) -> NewApiKeyList: - warn( - "new_api_key is deprecated. Use v1.new_api_key instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.new_api_key diff --git a/twilio/rest/media/__init__.py b/twilio/rest/media/__init__.py deleted file mode 100644 index ce6207e29a..0000000000 --- a/twilio/rest/media/__init__.py +++ /dev/null @@ -1,35 +0,0 @@ -from warnings import warn - -from twilio.rest.media.MediaBase import MediaBase -from twilio.rest.media.v1.media_processor import MediaProcessorList -from twilio.rest.media.v1.media_recording import MediaRecordingList -from twilio.rest.media.v1.player_streamer import PlayerStreamerList - - -class Media(MediaBase): - @property - def media_processor(self) -> MediaProcessorList: - warn( - "media_processor is deprecated. Use v1.media_processor instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.media_processor - - @property - def media_recording(self) -> MediaRecordingList: - warn( - "media_recording is deprecated. Use v1.media_recording instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.media_recording - - @property - def player_streamer(self) -> PlayerStreamerList: - warn( - "player_streamer is deprecated. Use v1.player_streamer instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.player_streamer diff --git a/twilio/rest/oauth/__init__.py b/twilio/rest/oauth/__init__.py index 709150e9e0..586cf6b4d9 100644 --- a/twilio/rest/oauth/__init__.py +++ b/twilio/rest/oauth/__init__.py @@ -1,40 +1,10 @@ from warnings import warn from twilio.rest.oauth.OauthBase import OauthBase -from twilio.rest.oauth.v1.device_code import DeviceCodeList -from twilio.rest.oauth.v1.oauth import OauthList -from twilio.rest.oauth.v1.openid_discovery import OpenidDiscoveryList from twilio.rest.oauth.v1.token import TokenList -from twilio.rest.oauth.v1.user_info import UserInfoList class Oauth(OauthBase): - @property - def oauth(self) -> OauthList: - warn( - "oauth is deprecated. Use v1.oauth instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.oauth - - @property - def device_code(self) -> DeviceCodeList: - warn( - "device_code is deprecated. Use v1.device_code instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.device_code - - @property - def openid_discovery(self) -> OpenidDiscoveryList: - warn( - "openid_discovery is deprecated. Use v1.openid_discovery instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.openid_discovery @property def token(self) -> TokenList: @@ -44,12 +14,3 @@ def token(self) -> TokenList: stacklevel=2, ) return self.v1.token - - @property - def user_info(self) -> UserInfoList: - warn( - "user_info is deprecated. Use v1.user_info instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.user_info diff --git a/twilio/rest/preview/__init__.py b/twilio/rest/preview/__init__.py index 79d870e134..501ae417d0 100644 --- a/twilio/rest/preview/__init__.py +++ b/twilio/rest/preview/__init__.py @@ -1,7 +1,6 @@ from warnings import warn from twilio.rest.preview.PreviewBase import PreviewBase -from twilio.rest.preview.deployed_devices.fleet import FleetList from twilio.rest.preview.hosted_numbers.authorization_document import ( AuthorizationDocumentList, ) @@ -15,14 +14,6 @@ class Preview(PreviewBase): - @property - def fleets(self) -> FleetList: - warn( - "fleets is deprecated. Use deployed_devices.fleets instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.deployed_devices.fleets @property def authorization_documents(self) -> AuthorizationDocumentList: diff --git a/twilio/rest/preview_messaging/__init__.py b/twilio/rest/preview_messaging/__init__.py deleted file mode 100644 index 73bf67969d..0000000000 --- a/twilio/rest/preview_messaging/__init__.py +++ /dev/null @@ -1,13 +0,0 @@ -from twilio.rest.preview_messaging.PreviewMessagingBase import PreviewMessagingBase -from twilio.rest.preview_messaging.v1.broadcast import BroadcastList -from twilio.rest.preview_messaging.v1.message import MessageList - - -class PreviewMessaging(PreviewMessagingBase): - @property - def broadcast(self) -> BroadcastList: - return self.v1.broadcasts - - @property - def messages(self) -> MessageList: - return self.v1.messages From 15ee3e665980b6dc6bd66fac56e58ff8adc12b33 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 25 Oct 2024 11:45:55 +0000 Subject: [PATCH 059/113] [Librarian] Regenerated @ 2e932f6c59e0f9fb6cb96952802e5ebedd83b6f0 1852557f82faade033dbd5bd0615c9e1aa4d9fae --- CHANGES.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index a0c6db00a2..f031545e18 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,12 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-10-25] Version 9.3.6 +-------------------------- +**Library - Chore** +- [PR #818](https://github.com/twilio/twilio-python/pull/818): removing unavailable references from init files. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + + [2024-10-24] Version 9.3.5 -------------------------- **Conversations** From 3fc2d25d6e7ceedf463f99ebceaaf56dde3de7bf Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 25 Oct 2024 11:52:41 +0000 Subject: [PATCH 060/113] Release 9.3.6 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 2350dbfc2c..152d6f98b5 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.3.5", + version="9.3.6", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 03a9b11574..5fe186e287 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "3", "5") +__version_info__ = ("9", "3", "6") __version__ = ".".join(__version_info__) From 5aa42dc526d486140fd5c021a5e7da4e76318978 Mon Sep 17 00:00:00 2001 From: sbansla <104902068+sbansla@users.noreply.github.com> Date: Mon, 28 Oct 2024 17:32:59 +0530 Subject: [PATCH 061/113] chore: use older verison of aiohttp_retry (#819) * use older verison of aiohttp_retry --- requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index a29abc4d1e..3de95e70c9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,5 @@ pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability requests>=2.31.0 PyJWT>=2.0.0, <3.0.0 aiohttp>=3.9.4 -aiohttp-retry>=2.8.3 +aiohttp-retry==2.8.3 certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/setup.py b/setup.py index 152d6f98b5..b769d7ff4a 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ "requests >= 2.0.0", "PyJWT >= 2.0.0, < 3.0.0", "aiohttp>=3.8.4", - "aiohttp-retry>=2.8.3", + "aiohttp-retry==2.8.3", ], packages=find_packages(exclude=["tests", "tests.*"]), include_package_data=True, From 4f1e7d2d02b811035c3872a72e2f9d1a05a4544e Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 15 Nov 2024 07:13:32 +0000 Subject: [PATCH 062/113] [Librarian] Regenerated @ 51e40434baa37a97b298d416220c6de10d9698c4 1ac2fcf2e173acdee4491031f59034933467a82c --- CHANGES.md | 14 ++++++++++ .../v2010/account/usage/record/__init__.py | 2 ++ .../v2010/account/usage/record/all_time.py | 2 ++ .../api/v2010/account/usage/record/daily.py | 2 ++ .../v2010/account/usage/record/last_month.py | 2 ++ .../api/v2010/account/usage/record/monthly.py | 2 ++ .../v2010/account/usage/record/this_month.py | 2 ++ .../api/v2010/account/usage/record/today.py | 2 ++ .../api/v2010/account/usage/record/yearly.py | 2 ++ .../v2010/account/usage/record/yesterday.py | 2 ++ .../rest/api/v2010/account/usage/trigger.py | 2 ++ twilio/rest/content/v1/content/__init__.py | 1 + .../v1/conversation_with_participants.py | 4 +-- .../service/conversation_with_participants.py | 4 +-- .../rest/insights/v1/conference/__init__.py | 1 + twilio/rest/insights/v1/room/__init__.py | 3 +++ twilio/rest/insights/v1/room/participant.py | 3 +++ twilio/rest/numbers/v1/__init__.py | 24 ++++++----------- ...hook_configuration_fetch.py => webhook.py} | 26 +++++++++---------- 19 files changed, 67 insertions(+), 33 deletions(-) rename twilio/rest/numbers/v1/{porting_webhook_configuration_fetch.py => webhook.py} (77%) diff --git a/CHANGES.md b/CHANGES.md index f031545e18..c879894ab3 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,20 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-11-15] Version 9.3.7 +-------------------------- +**Library - Chore** +- [PR #819](https://github.com/twilio/twilio-python/pull/819): use older verison of aiohttp_retry. Thanks to [@sbansla](https://github.com/sbansla)! + +**Api** +- Added `ivr-virtual-agent-custom-voices` and `ivr-virtual-agent-genai` to `usage_record` API. +- Add open-api file tag to realtime_transcriptions + +**Taskrouter** +- Add `api-tag` property to workers reservation +- Add `api-tag` property to task reservation + + [2024-10-25] Version 9.3.6 -------------------------- **Library - Chore** diff --git a/twilio/rest/api/v2010/account/usage/record/__init__.py b/twilio/rest/api/v2010/account/usage/record/__init__.py index 0afc8e3472..509b98e5a2 100644 --- a/twilio/rest/api/v2010/account/usage/record/__init__.py +++ b/twilio/rest/api/v2010/account/usage/record/__init__.py @@ -80,6 +80,8 @@ class Category(object): GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" IMP_V1_USAGE = "imp-v1-usage" + IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" + IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( diff --git a/twilio/rest/api/v2010/account/usage/record/all_time.py b/twilio/rest/api/v2010/account/usage/record/all_time.py index 7c0b6f5ce4..f7da24250d 100644 --- a/twilio/rest/api/v2010/account/usage/record/all_time.py +++ b/twilio/rest/api/v2010/account/usage/record/all_time.py @@ -72,6 +72,8 @@ class Category(object): GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" IMP_V1_USAGE = "imp-v1-usage" + IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" + IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( diff --git a/twilio/rest/api/v2010/account/usage/record/daily.py b/twilio/rest/api/v2010/account/usage/record/daily.py index a0acd62b2a..6eff180bae 100644 --- a/twilio/rest/api/v2010/account/usage/record/daily.py +++ b/twilio/rest/api/v2010/account/usage/record/daily.py @@ -72,6 +72,8 @@ class Category(object): GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" IMP_V1_USAGE = "imp-v1-usage" + IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" + IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( diff --git a/twilio/rest/api/v2010/account/usage/record/last_month.py b/twilio/rest/api/v2010/account/usage/record/last_month.py index 21fa1e1b61..bcaacc4ae7 100644 --- a/twilio/rest/api/v2010/account/usage/record/last_month.py +++ b/twilio/rest/api/v2010/account/usage/record/last_month.py @@ -72,6 +72,8 @@ class Category(object): GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" IMP_V1_USAGE = "imp-v1-usage" + IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" + IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( diff --git a/twilio/rest/api/v2010/account/usage/record/monthly.py b/twilio/rest/api/v2010/account/usage/record/monthly.py index 0eff14396a..3b606977cc 100644 --- a/twilio/rest/api/v2010/account/usage/record/monthly.py +++ b/twilio/rest/api/v2010/account/usage/record/monthly.py @@ -72,6 +72,8 @@ class Category(object): GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" IMP_V1_USAGE = "imp-v1-usage" + IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" + IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( diff --git a/twilio/rest/api/v2010/account/usage/record/this_month.py b/twilio/rest/api/v2010/account/usage/record/this_month.py index 646b4a49d5..9b7fc8a51d 100644 --- a/twilio/rest/api/v2010/account/usage/record/this_month.py +++ b/twilio/rest/api/v2010/account/usage/record/this_month.py @@ -72,6 +72,8 @@ class Category(object): GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" IMP_V1_USAGE = "imp-v1-usage" + IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" + IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( diff --git a/twilio/rest/api/v2010/account/usage/record/today.py b/twilio/rest/api/v2010/account/usage/record/today.py index 30de9d4cb7..fed8286f7d 100644 --- a/twilio/rest/api/v2010/account/usage/record/today.py +++ b/twilio/rest/api/v2010/account/usage/record/today.py @@ -72,6 +72,8 @@ class Category(object): GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" IMP_V1_USAGE = "imp-v1-usage" + IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" + IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( diff --git a/twilio/rest/api/v2010/account/usage/record/yearly.py b/twilio/rest/api/v2010/account/usage/record/yearly.py index fbe9dd1f6f..e773670d27 100644 --- a/twilio/rest/api/v2010/account/usage/record/yearly.py +++ b/twilio/rest/api/v2010/account/usage/record/yearly.py @@ -72,6 +72,8 @@ class Category(object): GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" IMP_V1_USAGE = "imp-v1-usage" + IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" + IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( diff --git a/twilio/rest/api/v2010/account/usage/record/yesterday.py b/twilio/rest/api/v2010/account/usage/record/yesterday.py index db5f9eb472..a0efe356e4 100644 --- a/twilio/rest/api/v2010/account/usage/record/yesterday.py +++ b/twilio/rest/api/v2010/account/usage/record/yesterday.py @@ -72,6 +72,8 @@ class Category(object): GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" IMP_V1_USAGE = "imp-v1-usage" + IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" + IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( diff --git a/twilio/rest/api/v2010/account/usage/trigger.py b/twilio/rest/api/v2010/account/usage/trigger.py index c3a1b241ca..ba63beec11 100644 --- a/twilio/rest/api/v2010/account/usage/trigger.py +++ b/twilio/rest/api/v2010/account/usage/trigger.py @@ -83,6 +83,8 @@ class UsageCategory(object): GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" IMP_V1_USAGE = "imp-v1-usage" + IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" + IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 3ddc8b926e..b5261516a6 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -34,6 +34,7 @@ class CallToActionActionType(object): PHONE_NUMBER = "PHONE_NUMBER" COPY_CODE = "COPY_CODE" VOICE_CALL = "VOICE_CALL" + VOICE_CALL_REQUEST = "VOICE_CALL_REQUEST" class CardActionType(object): URL = "URL" diff --git a/twilio/rest/conversations/v1/conversation_with_participants.py b/twilio/rest/conversations/v1/conversation_with_participants.py index 402f7adde7..b50c2da1a7 100644 --- a/twilio/rest/conversations/v1/conversation_with_participants.py +++ b/twilio/rest/conversations/v1/conversation_with_participants.py @@ -131,7 +131,7 @@ def create( :param timers_closed: ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. :param bindings_email_address: The default email address that will be used when sending outbound emails in this conversation. :param bindings_email_name: The default name that will be used when sending outbound emails in this conversation. - :param participant: The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. + :param participant: The participant to be added to the conversation in JSON format. The JSON object attributes are as parameters in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. :returns: The created ConversationWithParticipantsInstance """ @@ -200,7 +200,7 @@ async def create_async( :param timers_closed: ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. :param bindings_email_address: The default email address that will be used when sending outbound emails in this conversation. :param bindings_email_name: The default name that will be used when sending outbound emails in this conversation. - :param participant: The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. + :param participant: The participant to be added to the conversation in JSON format. The JSON object attributes are as parameters in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. :returns: The created ConversationWithParticipantsInstance """ diff --git a/twilio/rest/conversations/v1/service/conversation_with_participants.py b/twilio/rest/conversations/v1/service/conversation_with_participants.py index 123f159764..ef1495debb 100644 --- a/twilio/rest/conversations/v1/service/conversation_with_participants.py +++ b/twilio/rest/conversations/v1/service/conversation_with_participants.py @@ -148,7 +148,7 @@ def create( :param timers_closed: ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. :param bindings_email_address: The default email address that will be used when sending outbound emails in this conversation. :param bindings_email_name: The default name that will be used when sending outbound emails in this conversation. - :param participant: The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. + :param participant: The participant to be added to the conversation in JSON format. The JSON object attributes are as parameters in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. :returns: The created ConversationWithParticipantsInstance """ @@ -219,7 +219,7 @@ async def create_async( :param timers_closed: ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. :param bindings_email_address: The default email address that will be used when sending outbound emails in this conversation. :param bindings_email_name: The default name that will be used when sending outbound emails in this conversation. - :param participant: The participant to be added to the conversation in JSON format. The parameters are as in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. + :param participant: The participant to be added to the conversation in JSON format. The JSON object attributes are as parameters in [Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource). The maximum number of participants that can be added in a single request is 10. :returns: The created ConversationWithParticipantsInstance """ diff --git a/twilio/rest/insights/v1/conference/__init__.py b/twilio/rest/insights/v1/conference/__init__.py index 1ee8c09dc8..63b8abbf9a 100644 --- a/twilio/rest/insights/v1/conference/__init__.py +++ b/twilio/rest/insights/v1/conference/__init__.py @@ -70,6 +70,7 @@ class Tag(object): HIGH_LATENCY = "high_latency" LOW_MOS = "low_mos" DETECTED_SILENCE = "detected_silence" + NO_CONCURRENT_PARTICIPANTS = "no_concurrent_participants" """ :ivar conference_sid: The unique SID identifier of the Conference. diff --git a/twilio/rest/insights/v1/room/__init__.py b/twilio/rest/insights/v1/room/__init__.py index 7361018e23..abcc9f8c5b 100644 --- a/twilio/rest/insights/v1/room/__init__.py +++ b/twilio/rest/insights/v1/room/__init__.py @@ -29,6 +29,7 @@ class Codec(object): VP8 = "VP8" H264 = "H264" VP9 = "VP9" + OPUS = "opus" class CreatedMethod(object): SDK = "sdk" @@ -75,6 +76,8 @@ class TwilioRealm(object): IN1 = "in1" DE1 = "de1" GLL = "gll" + STAGE_US1 = "stage_us1" + DEV_US1 = "dev_us1" """ :ivar account_sid: Account SID associated with this room. diff --git a/twilio/rest/insights/v1/room/participant.py b/twilio/rest/insights/v1/room/participant.py index 0f6617f549..6c2b8448cf 100644 --- a/twilio/rest/insights/v1/room/participant.py +++ b/twilio/rest/insights/v1/room/participant.py @@ -28,6 +28,7 @@ class Codec(object): VP8 = "VP8" H264 = "H264" VP9 = "VP9" + OPUS = "opus" class EdgeLocation(object): ASHBURN = "ashburn" @@ -55,6 +56,8 @@ class TwilioRealm(object): IN1 = "in1" DE1 = "de1" GLL = "gll" + STAGE_US1 = "stage_us1" + DEV_US1 = "dev_us1" """ :ivar participant_sid: Unique identifier for the participant. diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 043364c3d5..68f078a88d 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,12 +28,10 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) -from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( - PortingWebhookConfigurationFetchList, -) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) +from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -58,12 +56,10 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None - self._porting_webhook_configuration_fetch: Optional[ - PortingWebhookConfigurationFetchList - ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None + self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -111,22 +107,18 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete - @property - def porting_webhook_configuration_fetch( - self, - ) -> PortingWebhookConfigurationFetchList: - if self._porting_webhook_configuration_fetch is None: - self._porting_webhook_configuration_fetch = ( - PortingWebhookConfigurationFetchList(self) - ) - return self._porting_webhook_configuration_fetch - @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations + @property + def webhook(self) -> WebhookList: + if self._webhook is None: + self._webhook = WebhookList(self) + return self._webhook + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/webhook.py similarity index 77% rename from twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py rename to twilio/rest/numbers/v1/webhook.py index 89b8064bdb..88ca64e9e1 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py +++ b/twilio/rest/numbers/v1/webhook.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class PortingWebhookConfigurationFetchInstance(InstanceResource): +class WebhookInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class PortingWebhookConfigurationFetchList(ListResource): +class WebhookList(ListResource): def __init__(self, version: Version): """ - Initialize the PortingWebhookConfigurationFetchList + Initialize the WebhookList :param version: Version that contains the resource @@ -68,25 +68,25 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> PortingWebhookConfigurationFetchInstance: + def fetch(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) - async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: + async def fetch_async(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -94,7 +94,7 @@ async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: method="GET", uri=self._uri, headers=headers ) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) def __repr__(self) -> str: """ @@ -102,4 +102,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" From ce5ce5d68511b26d60bb4a0f79a0597fe8b1adeb Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 15 Nov 2024 07:18:24 +0000 Subject: [PATCH 063/113] Release 9.3.7 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b769d7ff4a..f46054d7e7 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.3.6", + version="9.3.7", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 5fe186e287..86740d01f9 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "3", "6") +__version_info__ = ("9", "3", "7") __version__ = ".".join(__version_info__) From bae3eca0fb53619a3796badd083406d04b907767 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 5 Dec 2024 10:12:33 +0000 Subject: [PATCH 064/113] [Librarian] Regenerated @ 45fa5159053e1c1f62f6d613f3b67a9239b43a5f 2551818144b7f525e66740ded45831b930db82b8 --- CHANGES.md | 16 ++ .../api/v2010/account/call/transcription.py | 6 + twilio/rest/numbers/v1/__init__.py | 24 +- ...=> porting_webhook_configuration_fetch.py} | 26 +- twilio/rest/numbers/v2/hosted_number_order.py | 140 +++++++++- twilio/twiml/voice_response.py | 251 ++++++++++++++++++ 6 files changed, 439 insertions(+), 24 deletions(-) rename twilio/rest/numbers/v1/{webhook.py => porting_webhook_configuration_fetch.py} (77%) diff --git a/CHANGES.md b/CHANGES.md index c879894ab3..aa224e00fd 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,22 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-12-05] Version 9.3.8 +-------------------------- +**Api** +- Add optional parameter `intelligence_service` to `transcription` +- Updated `phone_number_sid` to be populated for sip trunking terminating calls. + +**Numbers** +- Add Update Hosted Number Order V2 API endpoint +- Update Port in docs + +**Twiml** +- Add optional parameter `intelligence_service` to `` +- Add support for new `` and `` noun +- Add `events` attribute to `` verb + + [2024-11-15] Version 9.3.7 -------------------------- **Library - Chore** diff --git a/twilio/rest/api/v2010/account/call/transcription.py b/twilio/rest/api/v2010/account/call/transcription.py index d4aa87e3df..c649b8ad1b 100644 --- a/twilio/rest/api/v2010/account/call/transcription.py +++ b/twilio/rest/api/v2010/account/call/transcription.py @@ -261,6 +261,7 @@ def create( speech_model: Union[str, object] = values.unset, hints: Union[str, object] = values.unset, enable_automatic_punctuation: Union[bool, object] = values.unset, + intelligence_service: Union[str, object] = values.unset, ) -> TranscriptionInstance: """ Create the TranscriptionInstance @@ -278,6 +279,7 @@ def create( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result + :param intelligence_service: The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. :returns: The created TranscriptionInstance """ @@ -299,6 +301,7 @@ def create( "EnableAutomaticPunctuation": serialize.boolean_to_string( enable_automatic_punctuation ), + "IntelligenceService": intelligence_service, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -329,6 +332,7 @@ async def create_async( speech_model: Union[str, object] = values.unset, hints: Union[str, object] = values.unset, enable_automatic_punctuation: Union[bool, object] = values.unset, + intelligence_service: Union[str, object] = values.unset, ) -> TranscriptionInstance: """ Asynchronously create the TranscriptionInstance @@ -346,6 +350,7 @@ async def create_async( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result + :param intelligence_service: The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. :returns: The created TranscriptionInstance """ @@ -367,6 +372,7 @@ async def create_async( "EnableAutomaticPunctuation": serialize.boolean_to_string( enable_automatic_punctuation ), + "IntelligenceService": intelligence_service, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 68f078a88d..043364c3d5 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,10 +28,12 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) +from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( + PortingWebhookConfigurationFetchList, +) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) -from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -56,10 +58,12 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None + self._porting_webhook_configuration_fetch: Optional[ + PortingWebhookConfigurationFetchList + ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None - self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -107,18 +111,22 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete + @property + def porting_webhook_configuration_fetch( + self, + ) -> PortingWebhookConfigurationFetchList: + if self._porting_webhook_configuration_fetch is None: + self._porting_webhook_configuration_fetch = ( + PortingWebhookConfigurationFetchList(self) + ) + return self._porting_webhook_configuration_fetch + @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations - @property - def webhook(self) -> WebhookList: - if self._webhook is None: - self._webhook = WebhookList(self) - return self._webhook - def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/webhook.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py similarity index 77% rename from twilio/rest/numbers/v1/webhook.py rename to twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py index 88ca64e9e1..89b8064bdb 100644 --- a/twilio/rest/numbers/v1/webhook.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class WebhookInstance(InstanceResource): +class PortingWebhookConfigurationFetchInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class WebhookList(ListResource): +class PortingWebhookConfigurationFetchList(ListResource): def __init__(self, version: Version): """ - Initialize the WebhookList + Initialize the PortingWebhookConfigurationFetchList :param version: Version that contains the resource @@ -68,25 +68,25 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> WebhookInstance: + def fetch(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) - async def fetch_async(self) -> WebhookInstance: + async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -94,7 +94,7 @@ async def fetch_async(self) -> WebhookInstance: method="GET", uri=self._uri, headers=headers ) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) def __repr__(self) -> str: """ @@ -102,4 +102,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index b2660cfc30..0fab0fe34a 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -26,6 +26,7 @@ class HostedNumberOrderInstance(InstanceResource): class Status(object): RECEIVED = "received" + PENDING_VERIFICATION = "pending-verification" VERIFIED = "verified" PENDING_LOA = "pending-loa" CARRIER_PROCESSING = "carrier-processing" @@ -33,6 +34,9 @@ class Status(object): FAILED = "failed" ACTION_REQUIRED = "action-required" + class VerificationType(object): + PHONE_CALL = "phone-call" + """ :ivar sid: A 34 character string that uniquely identifies this HostedNumberOrder. :ivar account_sid: A 34 character string that uniquely identifies the account. @@ -53,6 +57,12 @@ class Status(object): :ivar contact_phone_number: The contact phone number of the person authorized to sign the Authorization Document. :ivar bulk_hosting_request_sid: A 34 character string that uniquely identifies the bulk hosting request associated with this HostedNumberOrder. :ivar next_step: The next step you need to take to complete the hosted number order and request it successfully. + :ivar verification_attempts: The number of attempts made to verify ownership via a call for the hosted phone number. + :ivar verification_call_sids: The Call SIDs that identify the calls placed to verify ownership. + :ivar verification_call_delay: The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. + :ivar verification_call_extension: The numerical extension to dial when making the ownership verification call. + :ivar verification_code: The digits the user must pass in the ownership verification call. + :ivar verification_type: """ def __init__( @@ -89,6 +99,22 @@ def __init__( "bulk_hosting_request_sid" ) self.next_step: Optional[str] = payload.get("next_step") + self.verification_attempts: Optional[int] = deserialize.integer( + payload.get("verification_attempts") + ) + self.verification_call_sids: Optional[List[str]] = payload.get( + "verification_call_sids" + ) + self.verification_call_delay: Optional[int] = deserialize.integer( + payload.get("verification_call_delay") + ) + self.verification_call_extension: Optional[str] = payload.get( + "verification_call_extension" + ) + self.verification_code: Optional[str] = payload.get("verification_code") + self.verification_type: Optional[ + "HostedNumberOrderInstance.VerificationType" + ] = payload.get("verification_type") self._solution = { "sid": sid or self.sid, @@ -146,6 +172,48 @@ async def fetch_async(self) -> "HostedNumberOrderInstance": """ return await self._proxy.fetch_async() + def update( + self, + status: "HostedNumberOrderInstance.Status", + verification_call_delay: Union[int, object] = values.unset, + verification_call_extension: Union[str, object] = values.unset, + ) -> "HostedNumberOrderInstance": + """ + Update the HostedNumberOrderInstance + + :param status: + :param verification_call_delay: The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. + :param verification_call_extension: The numerical extension to dial when making the ownership verification call. + + :returns: The updated HostedNumberOrderInstance + """ + return self._proxy.update( + status=status, + verification_call_delay=verification_call_delay, + verification_call_extension=verification_call_extension, + ) + + async def update_async( + self, + status: "HostedNumberOrderInstance.Status", + verification_call_delay: Union[int, object] = values.unset, + verification_call_extension: Union[str, object] = values.unset, + ) -> "HostedNumberOrderInstance": + """ + Asynchronous coroutine to update the HostedNumberOrderInstance + + :param status: + :param verification_call_delay: The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. + :param verification_call_extension: The numerical extension to dial when making the ownership verification call. + + :returns: The updated HostedNumberOrderInstance + """ + return await self._proxy.update_async( + status=status, + verification_call_delay=verification_call_delay, + verification_call_extension=verification_call_extension, + ) + def __repr__(self) -> str: """ Provide a friendly representation @@ -163,7 +231,7 @@ def __init__(self, version: Version, sid: str): Initialize the HostedNumberOrderContext :param version: Version that contains the resource - :param sid: A 34 character string that uniquely identifies this HostedNumberOrder. + :param sid: The SID of the HostedNumberOrder resource to update. """ super().__init__(version) @@ -235,6 +303,72 @@ async def fetch_async(self) -> HostedNumberOrderInstance: sid=self._solution["sid"], ) + def update( + self, + status: "HostedNumberOrderInstance.Status", + verification_call_delay: Union[int, object] = values.unset, + verification_call_extension: Union[str, object] = values.unset, + ) -> HostedNumberOrderInstance: + """ + Update the HostedNumberOrderInstance + + :param status: + :param verification_call_delay: The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. + :param verification_call_extension: The numerical extension to dial when making the ownership verification call. + + :returns: The updated HostedNumberOrderInstance + """ + data = values.of( + { + "Status": status, + "VerificationCallDelay": verification_call_delay, + "VerificationCallExtension": verification_call_extension, + } + ) + + payload = self._version.update( + method="POST", + uri=self._uri, + data=data, + ) + + return HostedNumberOrderInstance( + self._version, payload, sid=self._solution["sid"] + ) + + async def update_async( + self, + status: "HostedNumberOrderInstance.Status", + verification_call_delay: Union[int, object] = values.unset, + verification_call_extension: Union[str, object] = values.unset, + ) -> HostedNumberOrderInstance: + """ + Asynchronous coroutine to update the HostedNumberOrderInstance + + :param status: + :param verification_call_delay: The number of seconds to wait before initiating the ownership verification call. Can be a value between 0 and 60, inclusive. + :param verification_call_extension: The numerical extension to dial when making the ownership verification call. + + :returns: The updated HostedNumberOrderInstance + """ + data = values.of( + { + "Status": status, + "VerificationCallDelay": verification_call_delay, + "VerificationCallExtension": verification_call_extension, + } + ) + + payload = await self._version.update_async( + method="POST", + uri=self._uri, + data=data, + ) + + return HostedNumberOrderInstance( + self._version, payload, sid=self._solution["sid"] + ) + def __repr__(self) -> str: """ Provide a friendly representation @@ -698,7 +832,7 @@ def get(self, sid: str) -> HostedNumberOrderContext: """ Constructs a HostedNumberOrderContext - :param sid: A 34 character string that uniquely identifies this HostedNumberOrder. + :param sid: The SID of the HostedNumberOrder resource to update. """ return HostedNumberOrderContext(self._version, sid=sid) @@ -706,7 +840,7 @@ def __call__(self, sid: str) -> HostedNumberOrderContext: """ Constructs a HostedNumberOrderContext - :param sid: A 34 character string that uniquely identifies this HostedNumberOrder. + :param sid: The SID of the HostedNumberOrder resource to update. """ return HostedNumberOrderContext(self._version, sid=sid) diff --git a/twilio/twiml/voice_response.py b/twilio/twiml/voice_response.py index c6d453e143..6f3d17e92c 100644 --- a/twilio/twiml/voice_response.py +++ b/twilio/twiml/voice_response.py @@ -50,6 +50,7 @@ def dial( sequential=None, refer_url=None, refer_method=None, + events=None, **kwargs ): """ @@ -73,6 +74,7 @@ def dial( :param sequential: Used to determine if child TwiML nouns should be dialed in order, one after the other (sequential) or dial all at once (parallel). Default is false, parallel :param refer_url: Webhook that will receive future SIP REFER requests :param refer_method: The HTTP method to use for the refer Webhook + :param events: Subscription to events :param kwargs: additional attributes :returns: element @@ -97,6 +99,7 @@ def dial( sequential=sequential, refer_url=refer_url, refer_method=refer_method, + events=events, **kwargs ) ) @@ -678,6 +681,7 @@ def transcription( speech_model=None, hints=None, enable_automatic_punctuation=None, + intelligence_service=None, **kwargs ): """ @@ -696,6 +700,7 @@ def transcription( :param speech_model: Speech Model used by the transcription engine :param hints: Hints to be provided to the transcription engine :param enable_automatic_punctuation: Enable Automatic Punctuation + :param intelligence_service: The SID or the unique name of the Intelligence Service to be used :param kwargs: additional attributes :returns: element @@ -715,6 +720,7 @@ def transcription( speech_model=speech_model, hints=hints, enable_automatic_punctuation=enable_automatic_punctuation, + intelligence_service=intelligence_service, **kwargs ) ) @@ -897,6 +903,7 @@ def transcription( speech_model=None, hints=None, enable_automatic_punctuation=None, + intelligence_service=None, **kwargs ): """ @@ -915,6 +922,7 @@ def transcription( :param speech_model: Speech Model used by the transcription engine :param hints: Hints to be provided to the transcription engine :param enable_automatic_punctuation: Enable Automatic Punctuation + :param intelligence_service: The SID or the unique name of the Intelligence Service to be used :param kwargs: additional attributes :returns: element @@ -934,6 +942,7 @@ def transcription( speech_model=speech_model, hints=hints, enable_automatic_punctuation=enable_automatic_punctuation, + intelligence_service=intelligence_service, **kwargs ) ) @@ -2725,6 +2734,248 @@ def conversation( ) ) + def conversation_relay( + self, + url=None, + language=None, + tts_language=None, + transcription_language=None, + tts_provider=None, + voice=None, + transcription_provider=None, + speech_model=None, + profanity_filter=None, + dtmf_detection=None, + welcome_greeting=None, + partial_prompts=None, + interruptible=None, + interrupt_by_dtmf=None, + welcome_greeting_interruptible=None, + debug=None, + **kwargs + ): + """ + Create a element + + :param url: URL of the remote service where the session is connected to + :param language: Language to be used for both text-to-speech and transcription + :param tts_language: Language to be used for text-to-speech + :param transcription_language: Language to be used for transcription + :param tts_provider: Provider to be used for text-to-speech + :param voice: Voice to be used for text-to-speech + :param transcription_provider: Provider to be used for transcription + :param speech_model: Speech model to be used for transcription + :param profanity_filter: Whether profanities should be filtered out of the speech transcription + :param dtmf_detection: Whether DTMF tones should be detected and reported in speech transcription + :param welcome_greeting: The sentence to be played automatically when the session is connected + :param partial_prompts: Whether partial prompts should be reported to WebSocket server before the caller finishes speaking + :param interruptible: Whether caller's speaking can interrupt the play of text-to-speech + :param interrupt_by_dtmf: Whether DTMF tone can interrupt the play of text-to-speech + :param welcome_greeting_interruptible: Whether caller's speaking can interrupt the welcome greeting + :param debug: Whether debugging on the session is enabled + :param kwargs: additional attributes + + :returns: element + """ + return self.nest( + ConversationRelay( + url=url, + language=language, + tts_language=tts_language, + transcription_language=transcription_language, + tts_provider=tts_provider, + voice=voice, + transcription_provider=transcription_provider, + speech_model=speech_model, + profanity_filter=profanity_filter, + dtmf_detection=dtmf_detection, + welcome_greeting=welcome_greeting, + partial_prompts=partial_prompts, + interruptible=interruptible, + interrupt_by_dtmf=interrupt_by_dtmf, + welcome_greeting_interruptible=welcome_greeting_interruptible, + debug=debug, + **kwargs + ) + ) + + def assistant( + self, + id=None, + language=None, + tts_language=None, + transcription_language=None, + tts_provider=None, + voice=None, + transcription_provider=None, + speech_model=None, + profanity_filter=None, + dtmf_detection=None, + welcome_greeting=None, + partial_prompts=None, + interruptible=None, + interrupt_by_dtmf=None, + welcome_greeting_interruptible=None, + debug=None, + **kwargs + ): + """ + Create a element + + :param id: The assistant ID of the AI Assistant + :param language: Language to be used for both text-to-speech and transcription + :param tts_language: Language to be used for text-to-speech + :param transcription_language: Language to be used for transcription + :param tts_provider: Provider to be used for text-to-speech + :param voice: Voice to be used for text-to-speech + :param transcription_provider: Provider to be used for transcription + :param speech_model: Speech model to be used for transcription + :param profanity_filter: Whether profanities should be filtered out of the speech transcription + :param dtmf_detection: Whether DTMF tones should be detected and reported in speech transcription + :param welcome_greeting: The sentence to be played automatically when the session is connected + :param partial_prompts: Whether partial prompts should be reported to WebSocket server before the caller finishes speaking + :param interruptible: Whether caller's speaking can interrupt the play of text-to-speech + :param interrupt_by_dtmf: Whether DTMF tone can interrupt the play of text-to-speech + :param welcome_greeting_interruptible: Whether caller's speaking can interrupt the welcome greeting + :param debug: Whether debugging on the session is enabled + :param kwargs: additional attributes + + :returns: element + """ + return self.nest( + Assistant( + id=id, + language=language, + tts_language=tts_language, + transcription_language=transcription_language, + tts_provider=tts_provider, + voice=voice, + transcription_provider=transcription_provider, + speech_model=speech_model, + profanity_filter=profanity_filter, + dtmf_detection=dtmf_detection, + welcome_greeting=welcome_greeting, + partial_prompts=partial_prompts, + interruptible=interruptible, + interrupt_by_dtmf=interrupt_by_dtmf, + welcome_greeting_interruptible=welcome_greeting_interruptible, + debug=debug, + **kwargs + ) + ) + + +class Assistant(TwiML): + """ TwiML Noun""" + + def __init__(self, **kwargs): + super(Assistant, self).__init__(**kwargs) + self.name = "Assistant" + + def language( + self, + code=None, + tts_provider=None, + voice=None, + transcription_provider=None, + speech_model=None, + **kwargs + ): + """ + Create a element + + :param code: Language code of this language setting is for + :param tts_provider: Provider to be used for text-to-speech of this language + :param voice: Voice to be used for text-to-speech of this language + :param transcription_provider: Provider to be used for transcription of this language + :param speech_model: Speech model to be used for transcription of this language + :param kwargs: additional attributes + + :returns: element + """ + return self.nest( + Language( + code=code, + tts_provider=tts_provider, + voice=voice, + transcription_provider=transcription_provider, + speech_model=speech_model, + **kwargs + ) + ) + + def parameter(self, name=None, value=None, **kwargs): + """ + Create a element + + :param name: The name of the custom parameter + :param value: The value of the custom parameter + :param kwargs: additional attributes + + :returns: element + """ + return self.nest(Parameter(name=name, value=value, **kwargs)) + + +class Language(TwiML): + """ TwiML Noun""" + + def __init__(self, **kwargs): + super(Language, self).__init__(**kwargs) + self.name = "Language" + + +class ConversationRelay(TwiML): + """ TwiML Noun""" + + def __init__(self, **kwargs): + super(ConversationRelay, self).__init__(**kwargs) + self.name = "ConversationRelay" + + def language( + self, + code=None, + tts_provider=None, + voice=None, + transcription_provider=None, + speech_model=None, + **kwargs + ): + """ + Create a element + + :param code: Language code of this language setting is for + :param tts_provider: Provider to be used for text-to-speech of this language + :param voice: Voice to be used for text-to-speech of this language + :param transcription_provider: Provider to be used for transcription of this language + :param speech_model: Speech model to be used for transcription of this language + :param kwargs: additional attributes + + :returns: element + """ + return self.nest( + Language( + code=code, + tts_provider=tts_provider, + voice=voice, + transcription_provider=transcription_provider, + speech_model=speech_model, + **kwargs + ) + ) + + def parameter(self, name=None, value=None, **kwargs): + """ + Create a element + + :param name: The name of the custom parameter + :param value: The value of the custom parameter + :param kwargs: additional attributes + + :returns: element + """ + return self.nest(Parameter(name=name, value=value, **kwargs)) + class Conversation(TwiML): """ TwiML Noun""" From fb5388940759d6e7db9cbfcd05b2cd91d883bff6 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 5 Dec 2024 10:17:17 +0000 Subject: [PATCH 065/113] Release 9.3.8 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f46054d7e7..016e3b95ca 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.3.7", + version="9.3.8", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 86740d01f9..a574bfeb0c 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "3", "7") +__version_info__ = ("9", "3", "8") __version__ = ".".join(__version_info__) From 6e78c789cfa31d79e5f2108e8e4a9bddf12decc2 Mon Sep 17 00:00:00 2001 From: Athira Sabu <102021496+AsabuHere@users.noreply.github.com> Date: Thu, 12 Dec 2024 14:05:37 +0530 Subject: [PATCH 066/113] feat: Organizations Api uptake for twilio-python (#815) * feat: oauth sdk implementation and organization api uptake (#799) --- twilio/auth_strategy/__init__.py | 0 twilio/auth_strategy/auth_strategy.py | 19 + twilio/auth_strategy/auth_type.py | 12 + twilio/auth_strategy/no_auth_strategy.py | 13 + twilio/auth_strategy/token_auth_strategy.py | 53 + twilio/base/client_base.py | 57 +- twilio/base/page.py | 2 + twilio/base/version.py | 3 - twilio/credential/__init__.py | 0 twilio/credential/credential_provider.py | 13 + twilio/credential/orgs_credential_provider.py | 28 + twilio/http/http_client.py | 6 +- twilio/http/orgs_token_manager.py | 41 + twilio/http/token_manager.py | 7 + twilio/rest/__init__.py | 17 + twilio/rest/preview_iam/PreviewIamBase.py | 47 + twilio/rest/preview_iam/__init__.py | 25 + twilio/rest/preview_iam/v1/__init__.py | 51 + twilio/rest/preview_iam/v1/authorize.py | 126 ++ twilio/rest/preview_iam/v1/token.py | 162 +++ .../rest/preview_iam/versionless/__init__.py | 43 + .../versionless/organization/__init__.py | 128 ++ .../versionless/organization/account.py | 438 +++++++ .../organization/role_assignment.py | 574 +++++++++ .../versionless/organization/user.py | 1050 +++++++++++++++++ 25 files changed, 2899 insertions(+), 16 deletions(-) create mode 100644 twilio/auth_strategy/__init__.py create mode 100644 twilio/auth_strategy/auth_strategy.py create mode 100644 twilio/auth_strategy/auth_type.py create mode 100644 twilio/auth_strategy/no_auth_strategy.py create mode 100644 twilio/auth_strategy/token_auth_strategy.py create mode 100644 twilio/credential/__init__.py create mode 100644 twilio/credential/credential_provider.py create mode 100644 twilio/credential/orgs_credential_provider.py create mode 100644 twilio/http/orgs_token_manager.py create mode 100644 twilio/http/token_manager.py create mode 100644 twilio/rest/preview_iam/PreviewIamBase.py create mode 100644 twilio/rest/preview_iam/__init__.py create mode 100644 twilio/rest/preview_iam/v1/__init__.py create mode 100644 twilio/rest/preview_iam/v1/authorize.py create mode 100644 twilio/rest/preview_iam/v1/token.py create mode 100644 twilio/rest/preview_iam/versionless/__init__.py create mode 100644 twilio/rest/preview_iam/versionless/organization/__init__.py create mode 100644 twilio/rest/preview_iam/versionless/organization/account.py create mode 100644 twilio/rest/preview_iam/versionless/organization/role_assignment.py create mode 100644 twilio/rest/preview_iam/versionless/organization/user.py diff --git a/twilio/auth_strategy/__init__.py b/twilio/auth_strategy/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/twilio/auth_strategy/auth_strategy.py b/twilio/auth_strategy/auth_strategy.py new file mode 100644 index 0000000000..223cbff08f --- /dev/null +++ b/twilio/auth_strategy/auth_strategy.py @@ -0,0 +1,19 @@ +from twilio.auth_strategy.auth_type import AuthType +from abc import abstractmethod + + +class AuthStrategy(object): + def __init__(self, auth_type: AuthType): + self._auth_type = auth_type + + @property + def auth_type(self) -> AuthType: + return self._auth_type + + @abstractmethod + def get_auth_string(self) -> str: + """Return the authentication string.""" + + @abstractmethod + def requires_authentication(self) -> bool: + """Return True if authentication is required, else False.""" diff --git a/twilio/auth_strategy/auth_type.py b/twilio/auth_strategy/auth_type.py new file mode 100644 index 0000000000..61886f925d --- /dev/null +++ b/twilio/auth_strategy/auth_type.py @@ -0,0 +1,12 @@ +from enum import Enum + + +class AuthType(Enum): + ORGS_TOKEN = "orgs_stoken" + NO_AUTH = "noauth" + BASIC = "basic" + API_KEY = "api_key" + CLIENT_CREDENTIALS = "client_credentials" + + def __str__(self): + return self.value diff --git a/twilio/auth_strategy/no_auth_strategy.py b/twilio/auth_strategy/no_auth_strategy.py new file mode 100644 index 0000000000..a5bfd6d27f --- /dev/null +++ b/twilio/auth_strategy/no_auth_strategy.py @@ -0,0 +1,13 @@ +from auth_type import AuthType +from twilio.auth_strategy.auth_strategy import AuthStrategy + + +class NoAuthStrategy(AuthStrategy): + def __init__(self): + super().__init__(AuthType.NO_AUTH) + + def get_auth_string(self) -> str: + return "" + + def requires_authentication(self) -> bool: + return False diff --git a/twilio/auth_strategy/token_auth_strategy.py b/twilio/auth_strategy/token_auth_strategy.py new file mode 100644 index 0000000000..ee51f05a43 --- /dev/null +++ b/twilio/auth_strategy/token_auth_strategy.py @@ -0,0 +1,53 @@ +import jwt +import threading +import logging +from datetime import datetime + +from twilio.auth_strategy.auth_type import AuthType +from twilio.auth_strategy.auth_strategy import AuthStrategy +from twilio.http.token_manager import TokenManager + + +class TokenAuthStrategy(AuthStrategy): + def __init__(self, token_manager: TokenManager): + super().__init__(AuthType.ORGS_TOKEN) + self.token_manager = token_manager + self.token = None + self.lock = threading.Lock() + logging.basicConfig(level=logging.INFO) + self.logger = logging.getLogger(__name__) + + def get_auth_string(self) -> str: + self.fetch_token() + return f"Bearer {self.token}" + + def requires_authentication(self) -> bool: + return True + + def fetch_token(self): + if self.token is None or self.token == "" or self.is_token_expired(self.token): + with self.lock: + if ( + self.token is None + or self.token == "" + or self.is_token_expired(self.token) + ): + self.logger.info("New token fetched for accessing organization API") + self.token = self.token_manager.fetch_access_token() + + def is_token_expired(self, token): + try: + decoded = jwt.decode(token, options={"verify_signature": False}) + exp = decoded.get("exp") + + if exp is None: + return True # No expiration time present, consider it expired + + # Check if the expiration time has passed + return datetime.fromtimestamp(exp) < datetime.utcnow() + + except jwt.DecodeError: + return True # Token is invalid + except Exception as e: + print(f"An error occurred: {e}") + return True diff --git a/twilio/base/client_base.py b/twilio/base/client_base.py index 5f17c75406..b16f85bf5b 100644 --- a/twilio/base/client_base.py +++ b/twilio/base/client_base.py @@ -4,10 +4,10 @@ from urllib.parse import urlparse, urlunparse from twilio import __version__ -from twilio.base.exceptions import TwilioException from twilio.http import HttpClient from twilio.http.http_client import TwilioHttpClient from twilio.http.response import Response +from twilio.credential.credential_provider import CredentialProvider class ClientBase(object): @@ -23,6 +23,7 @@ def __init__( environment: Optional[MutableMapping[str, str]] = None, edge: Optional[str] = None, user_agent_extensions: Optional[List[str]] = None, + credential_provider: Optional[CredentialProvider] = None, ): """ Initializes the Twilio Client @@ -35,7 +36,9 @@ def __init__( :param environment: Environment to look for auth details, defaults to os.environ :param edge: Twilio Edge to make requests to, defaults to None :param user_agent_extensions: Additions to the user agent string + :param credential_provider: credential provider for authentication method that needs to be used """ + environment = environment or os.environ self.username = username or environment.get("TWILIO_ACCOUNT_SID") @@ -48,9 +51,8 @@ def __init__( """ :type : str """ self.user_agent_extensions = user_agent_extensions or [] """ :type : list[str] """ - - if not self.username or not self.password: - raise TwilioException("Credentials are required to create a TwilioClient") + self.credential_provider = credential_provider or None + """ :type : CredentialProvider """ self.account_sid = account_sid or self.username """ :type : str """ @@ -85,15 +87,27 @@ def request( :returns: Response from the Twilio API """ - auth = self.get_auth(auth) headers = self.get_headers(method, headers) - uri = self.get_hostname(uri) + if self.credential_provider: + + auth_strategy = self.credential_provider.to_auth_strategy() + headers["Authorization"] = auth_strategy.get_auth_string() + elif self.username is not None and self.password is not None: + auth = self.get_auth(auth) + else: + auth = None + + if method == "DELETE": + del headers["Accept"] + + uri = self.get_hostname(uri) + filtered_data = self.copy_non_none_values(data) return self.http_client.request( method, uri, params=params, - data=data, + data=filtered_data, headers=headers, auth=auth, timeout=timeout, @@ -132,21 +146,44 @@ async def request_async( "http_client must be asynchronous to support async API requests" ) - auth = self.get_auth(auth) headers = self.get_headers(method, headers) - uri = self.get_hostname(uri) + if method == "DELETE": + del headers["Accept"] + + if self.credential_provider: + auth_strategy = self.credential_provider.to_auth_strategy() + headers["Authorization"] = auth_strategy.get_auth_string() + elif self.username is not None and self.password is not None: + auth = self.get_auth(auth) + else: + auth = None + uri = self.get_hostname(uri) + filtered_data = self.copy_non_none_values(data) return await self.http_client.request( method, uri, params=params, - data=data, + data=filtered_data, headers=headers, auth=auth, timeout=timeout, allow_redirects=allow_redirects, ) + def copy_non_none_values(self, data): + if isinstance(data, dict): + return { + k: self.copy_non_none_values(v) + for k, v in data.items() + if v is not None + } + elif isinstance(data, list): + return [ + self.copy_non_none_values(item) for item in data if item is not None + ] + return data + def get_auth(self, auth: Optional[Tuple[str, str]]) -> Tuple[str, str]: """ Get the request authentication object diff --git a/twilio/base/page.py b/twilio/base/page.py index 2238528da9..b5b2da7b26 100644 --- a/twilio/base/page.py +++ b/twilio/base/page.py @@ -77,6 +77,8 @@ def load_page(self, payload: Dict[str, Any]): key = keys - self.META_KEYS if len(key) == 1: return payload[key.pop()] + if "Resources" in payload: + return payload["Resources"] raise TwilioException("Page Records can not be deserialized") diff --git a/twilio/base/version.py b/twilio/base/version.py index 64cc601faa..ed7e86f499 100644 --- a/twilio/base/version.py +++ b/twilio/base/version.py @@ -164,7 +164,6 @@ async def fetch_async( timeout=timeout, allow_redirects=allow_redirects, ) - return self._parse_fetch(method, uri, response) def _parse_update(self, method: str, uri: str, response: Response) -> Any: @@ -461,7 +460,6 @@ def create( timeout=timeout, allow_redirects=allow_redirects, ) - return self._parse_create(method, uri, response) async def create_async( @@ -488,5 +486,4 @@ async def create_async( timeout=timeout, allow_redirects=allow_redirects, ) - return self._parse_create(method, uri, response) diff --git a/twilio/credential/__init__.py b/twilio/credential/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/twilio/credential/credential_provider.py b/twilio/credential/credential_provider.py new file mode 100644 index 0000000000..72aafeed47 --- /dev/null +++ b/twilio/credential/credential_provider.py @@ -0,0 +1,13 @@ +from twilio.auth_strategy.auth_type import AuthType + + +class CredentialProvider: + def __init__(self, auth_type: AuthType): + self._auth_type = auth_type + + @property + def auth_type(self) -> AuthType: + return self._auth_type + + def to_auth_strategy(self): + raise NotImplementedError("Subclasses must implement this method") diff --git a/twilio/credential/orgs_credential_provider.py b/twilio/credential/orgs_credential_provider.py new file mode 100644 index 0000000000..e623f52322 --- /dev/null +++ b/twilio/credential/orgs_credential_provider.py @@ -0,0 +1,28 @@ +from twilio.http.orgs_token_manager import OrgTokenManager +from twilio.base.exceptions import TwilioException +from twilio.credential.credential_provider import CredentialProvider +from twilio.auth_strategy.auth_type import AuthType +from twilio.auth_strategy.token_auth_strategy import TokenAuthStrategy + + +class OrgsCredentialProvider(CredentialProvider): + def __init__(self, client_id: str, client_secret: str, token_manager=None): + super().__init__(AuthType.CLIENT_CREDENTIALS) + + if client_id is None or client_secret is None: + raise TwilioException("Client id and Client secret are mandatory") + + self.grant_type = "client_credentials" + self.client_id = client_id + self.client_secret = client_secret + self.token_manager = token_manager + self.auth_strategy = None + + def to_auth_strategy(self): + if self.token_manager is None: + self.token_manager = OrgTokenManager( + self.grant_type, self.client_id, self.client_secret + ) + if self.auth_strategy is None: + self.auth_strategy = TokenAuthStrategy(self.token_manager) + return self.auth_strategy diff --git a/twilio/http/http_client.py b/twilio/http/http_client.py index 9d329c6aa7..e15be86354 100644 --- a/twilio/http/http_client.py +++ b/twilio/http/http_client.py @@ -88,10 +88,11 @@ def request( } if headers and headers.get("Content-Type") == "application/json": kwargs["json"] = data + elif headers and headers.get("Content-Type") == "application/scim+json": + kwargs["json"] = data else: kwargs["data"] = data self.log_request(kwargs) - self._test_only_last_response = None session = self.session or Session() request = Request(**kwargs) @@ -102,12 +103,11 @@ def request( settings = session.merge_environment_settings( prepped_request.url, self.proxy, None, None, None ) - response = session.send( prepped_request, allow_redirects=allow_redirects, timeout=timeout, - **settings + **settings, ) self.log_response(response.status_code, response) diff --git a/twilio/http/orgs_token_manager.py b/twilio/http/orgs_token_manager.py new file mode 100644 index 0000000000..767ed270af --- /dev/null +++ b/twilio/http/orgs_token_manager.py @@ -0,0 +1,41 @@ +from twilio.http.token_manager import TokenManager +from twilio.rest import Client + + +class OrgTokenManager(TokenManager): + """ + Orgs Token Manager + """ + + def __init__( + self, + grant_type: str, + client_id: str, + client_secret: str, + code: str = None, + redirect_uri: str = None, + audience: str = None, + refreshToken: str = None, + scope: str = None, + ): + self.grant_type = grant_type + self.client_id = client_id + self.client_secret = client_secret + self.code = code + self.redirect_uri = redirect_uri + self.audience = audience + self.refreshToken = refreshToken + self.scope = scope + self.client = Client() + + def fetch_access_token(self): + token_instance = self.client.preview_iam.v1.token.create( + grant_type=self.grant_type, + client_id=self.client_id, + client_secret=self.client_secret, + code=self.code, + redirect_uri=self.redirect_uri, + audience=self.audience, + scope=self.scope, + ) + return token_instance.access_token diff --git a/twilio/http/token_manager.py b/twilio/http/token_manager.py new file mode 100644 index 0000000000..28cc731019 --- /dev/null +++ b/twilio/http/token_manager.py @@ -0,0 +1,7 @@ +from twilio.base.version import Version + + +class TokenManager: + + def fetch_access_token(self, version: Version): + pass diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 5c8f3ebcfe..7874236a26 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -96,6 +96,7 @@ def __init__( environment=None, edge=None, user_agent_extensions=None, + credential_provider=None, ): """ Initializes the Twilio Client @@ -121,6 +122,7 @@ def __init__( environment, edge, user_agent_extensions, + credential_provider, ) # Domains @@ -135,6 +137,7 @@ def __init__( self._flex_api: Optional["FlexApi"] = None self._frontline_api: Optional["FrontlineApi"] = None self._iam: Optional["Iam"] = None + self._preview_iam: Optional["PreviewIam"] = None self._insights: Optional["Insights"] = None self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None @@ -147,6 +150,7 @@ def __init__( self._numbers: Optional["Numbers"] = None self._oauth: Optional["Oauth"] = None self._preview: Optional["Preview"] = None + self._preview_iam: Optional["PreviewIam"] = None self._pricing: Optional["Pricing"] = None self._proxy: Optional["Proxy"] = None self._routes: Optional["Routes"] = None @@ -396,6 +400,19 @@ def microvisor(self) -> "Microvisor": self._microvisor = Microvisor(self) return self._microvisor + @property + def preview_iam(self) -> "PreviewIam": + """ + Access the PreviewIam Twilio Domain + + :returns: PreviewIam Twilio Domain + """ + if self._preview_iam is None: + from twilio.rest.preview_iam import PreviewIam + + self._preview_iam = PreviewIam(self) + return self._preview_iam + @property def monitor(self) -> "Monitor": """ diff --git a/twilio/rest/preview_iam/PreviewIamBase.py b/twilio/rest/preview_iam/PreviewIamBase.py new file mode 100644 index 0000000000..d8735295d7 --- /dev/null +++ b/twilio/rest/preview_iam/PreviewIamBase.py @@ -0,0 +1,47 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from twilio.base.domain import Domain +from typing import Optional +from twilio.rest import Client + +from twilio.rest.preview_iam.v1 import V1 +from twilio.rest.preview_iam.versionless import Versionless + + +class PreviewIamBase(Domain): + def __init__(self, twilio: Client): + """ + Initialize the PreviewIam Domain + + :returns: Domain for PreviewIam + """ + super().__init__(twilio, "https://preview-iam.twilio.com") + self._versionless: Optional[Versionless] = None + self._v1: Optional[V1] = None + + @property + def versionless(self) -> Versionless: + """ + :returns: Versionless of PreviewIam + """ + if self._versionless is None: + self._versionless = Versionless(self) + return self._versionless + + @property + def v1(self) -> V1: + """ + :returns: V1 of PreviewIam + """ + if self._v1 is None: + self._v1 = V1(self) + return self._v1 diff --git a/twilio/rest/preview_iam/__init__.py b/twilio/rest/preview_iam/__init__.py new file mode 100644 index 0000000000..9103436220 --- /dev/null +++ b/twilio/rest/preview_iam/__init__.py @@ -0,0 +1,25 @@ +from twilio.rest.preview_iam.PreviewIamBase import PreviewIamBase + +from twilio.rest.preview_iam.v1.authorize import ( + AuthorizeList, +) +from twilio.rest.preview_iam.v1.token import ( + TokenList, +) +from twilio.rest.preview_iam.versionless.organization import ( + OrganizationList, +) + + +class PreviewIam(PreviewIamBase): + @property + def organization(self) -> OrganizationList: + return self.versionless.organization + + @property + def authorize(self) -> AuthorizeList: + return self.v1.authorize + + @property + def token(self) -> TokenList: + return self.v1.token diff --git a/twilio/rest/preview_iam/v1/__init__.py b/twilio/rest/preview_iam/v1/__init__.py new file mode 100644 index 0000000000..2243277793 --- /dev/null +++ b/twilio/rest/preview_iam/v1/__init__.py @@ -0,0 +1,51 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.preview_iam.v1.authorize import AuthorizeList +from twilio.rest.preview_iam.v1.token import TokenList + + +class V1(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V1 version of PreviewIam + + :param domain: The Twilio.preview_iam domain + """ + super().__init__(domain, "v1") + self._authorize: Optional[AuthorizeList] = None + self._token: Optional[TokenList] = None + + @property + def authorize(self) -> AuthorizeList: + if self._authorize is None: + self._authorize = AuthorizeList(self) + return self._authorize + + @property + def token(self) -> TokenList: + if self._token is None: + self._token = TokenList(self) + return self._token + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/v1/authorize.py b/twilio/rest/preview_iam/v1/authorize.py new file mode 100644 index 0000000000..051f13a8e6 --- /dev/null +++ b/twilio/rest/preview_iam/v1/authorize.py @@ -0,0 +1,126 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional, Union +from twilio.base import values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class AuthorizeInstance(InstanceResource): + """ + :ivar redirect_to: The callback URL + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.redirect_to: Optional[str] = payload.get("redirect_to") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class AuthorizeList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the AuthorizeList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/authorize" + + def fetch( + self, + response_type: Union[str, object] = values.unset, + client_id: Union[str, object] = values.unset, + redirect_uri: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + state: Union[str, object] = values.unset, + ) -> AuthorizeInstance: + """ + Asynchronously fetch the AuthorizeInstance + + :param response_type: Response Type:param client_id: The Client Identifier:param redirect_uri: The url to which response will be redirected to:param scope: The scope of the access request:param state: An opaque value which can be used to maintain state between the request and callback + :returns: The fetched AuthorizeInstance + """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + params = values.of( + { + "response_type": response_type, + "client_id": client_id, + "redirect_uri": redirect_uri, + "scope": scope, + "state": state, + } + ) + + payload = self._version.fetch( + method="GET", uri=self._uri, headers=headers, params=params + ) + + return AuthorizeInstance(self._version, payload) + + async def fetch_async( + self, + response_type: Union[str, object] = values.unset, + client_id: Union[str, object] = values.unset, + redirect_uri: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + state: Union[str, object] = values.unset, + ) -> AuthorizeInstance: + """ + Asynchronously fetch the AuthorizeInstance + + :param response_type: Response Type:param client_id: The Client Identifier:param redirect_uri: The url to which response will be redirected to:param scope: The scope of the access request:param state: An opaque value which can be used to maintain state between the request and callback + :returns: The fetched AuthorizeInstance + """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + params = values.of( + { + "response_type": response_type, + "client_id": client_id, + "redirect_uri": redirect_uri, + "scope": scope, + "state": state, + } + ) + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers, params=params + ) + + return AuthorizeInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/v1/token.py b/twilio/rest/preview_iam/v1/token.py new file mode 100644 index 0000000000..81eed237f7 --- /dev/null +++ b/twilio/rest/preview_iam/v1/token.py @@ -0,0 +1,162 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional, Union +from twilio.base import values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class TokenInstance(InstanceResource): + """ + :ivar access_token: Token which carries the necessary information to access a Twilio resource directly. + :ivar refresh_token: Token which carries the information necessary to get a new access token. + :ivar id_token: Token which carries the information necessary of user profile. + :ivar token_type: Token type + :ivar expires_in: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.access_token: Optional[str] = payload.get("access_token") + self.refresh_token: Optional[str] = payload.get("refresh_token") + self.id_token: Optional[str] = payload.get("id_token") + self.token_type: Optional[str] = payload.get("token_type") + self.expires_in: Optional[int] = payload.get("expires_in") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class TokenList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the TokenList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/token" + + def create( + self, + grant_type: str, + client_id: str, + client_secret: Union[str, object] = values.unset, + code: Union[str, object] = values.unset, + redirect_uri: Union[str, object] = values.unset, + audience: Union[str, object] = values.unset, + refresh_token: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + ) -> TokenInstance: + """ + Create the TokenInstance + + :param grant_type: Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. + :param client_id: A 34 character string that uniquely identifies this OAuth App. + :param client_secret: The credential for confidential OAuth App. + :param code: JWT token related to the authorization code grant type. + :param redirect_uri: The redirect uri + :param audience: The targeted audience uri + :param refresh_token: JWT token related to refresh access token. + :param scope: The scope of token + + :returns: The created TokenInstance + """ + + data = values.of( + { + "grant_type": grant_type, + "client_id": client_id, + "client_secret": client_secret, + "code": code, + "redirect_uri": redirect_uri, + "audience": audience, + "refresh_token": refresh_token, + "scope": scope, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return TokenInstance(self._version, payload) + + async def create_async( + self, + grant_type: str, + client_id: str, + client_secret: Union[str, object] = values.unset, + code: Union[str, object] = values.unset, + redirect_uri: Union[str, object] = values.unset, + audience: Union[str, object] = values.unset, + refresh_token: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + ) -> TokenInstance: + """ + Asynchronously create the TokenInstance + + :param grant_type: Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. + :param client_id: A 34 character string that uniquely identifies this OAuth App. + :param client_secret: The credential for confidential OAuth App. + :param code: JWT token related to the authorization code grant type. + :param redirect_uri: The redirect uri + :param audience: The targeted audience uri + :param refresh_token: JWT token related to refresh access token. + :param scope: The scope of token + + :returns: The created TokenInstance + """ + + data = values.of( + { + "grant_type": grant_type, + "client_id": client_id, + "client_secret": client_secret, + "code": code, + "redirect_uri": redirect_uri, + "audience": audience, + "refresh_token": refresh_token, + "scope": scope, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return TokenInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/versionless/__init__.py b/twilio/rest/preview_iam/versionless/__init__.py new file mode 100644 index 0000000000..7d6d210f14 --- /dev/null +++ b/twilio/rest/preview_iam/versionless/__init__.py @@ -0,0 +1,43 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.preview_iam.versionless.organization import OrganizationList + + +class Versionless(Version): + + def __init__(self, domain: Domain): + """ + Initialize the Versionless version of PreviewIam + + :param domain: The Twilio.preview_iam domain + """ + super().__init__(domain, "Organizations") + self._organization: Optional[OrganizationList] = None + + @property + def organization(self) -> OrganizationList: + if self._organization is None: + self._organization = OrganizationList(self) + return self._organization + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/versionless/organization/__init__.py b/twilio/rest/preview_iam/versionless/organization/__init__.py new file mode 100644 index 0000000000..ce6e70e978 --- /dev/null +++ b/twilio/rest/preview_iam/versionless/organization/__init__.py @@ -0,0 +1,128 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.instance_context import InstanceContext + +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + +from twilio.rest.preview_iam.versionless.organization.account import AccountList +from twilio.rest.preview_iam.versionless.organization.role_assignment import ( + RoleAssignmentList, +) +from twilio.rest.preview_iam.versionless.organization.user import UserList + + +class OrganizationContext(InstanceContext): + + def __init__(self, version: Version, organization_sid: str): + """ + Initialize the OrganizationContext + + :param version: Version that contains the resource + :param organization_sid: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + } + self._uri = "/{organization_sid}".format(**self._solution) + + self._accounts: Optional[AccountList] = None + self._role_assignments: Optional[RoleAssignmentList] = None + self._users: Optional[UserList] = None + + @property + def accounts(self) -> AccountList: + """ + Access the accounts + """ + if self._accounts is None: + self._accounts = AccountList( + self._version, + self._solution["organization_sid"], + ) + return self._accounts + + @property + def role_assignments(self) -> RoleAssignmentList: + """ + Access the role_assignments + """ + if self._role_assignments is None: + self._role_assignments = RoleAssignmentList( + self._version, + self._solution["organization_sid"], + ) + return self._role_assignments + + @property + def users(self) -> UserList: + """ + Access the users + """ + if self._users is None: + self._users = UserList( + self._version, + self._solution["organization_sid"], + ) + return self._users + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class OrganizationList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the OrganizationList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + def get(self, organization_sid: str) -> OrganizationContext: + """ + Constructs a OrganizationContext + + :param organization_sid: + """ + return OrganizationContext(self._version, organization_sid=organization_sid) + + def __call__(self, organization_sid: str) -> OrganizationContext: + """ + Constructs a OrganizationContext + + :param organization_sid: + """ + return OrganizationContext(self._version, organization_sid=organization_sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/versionless/organization/account.py b/twilio/rest/preview_iam/versionless/organization/account.py new file mode 100644 index 0000000000..f1c8019860 --- /dev/null +++ b/twilio/rest/preview_iam/versionless/organization/account.py @@ -0,0 +1,438 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class AccountInstance(InstanceResource): + """ + :ivar account_sid: Twilio account sid + :ivar friendly_name: Account friendly name + :ivar status: Account status + :ivar owner_sid: Twilio account sid + :ivar date_created: The date and time when the account was created in the system + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + organization_sid: str, + account_sid: Optional[str] = None, + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.status: Optional[str] = payload.get("status") + self.owner_sid: Optional[str] = payload.get("owner_sid") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + + self._solution = { + "organization_sid": organization_sid, + "account_sid": account_sid or self.account_sid, + } + self._context: Optional[AccountContext] = None + + @property + def _proxy(self) -> "AccountContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: AccountContext for this AccountInstance + """ + if self._context is None: + self._context = AccountContext( + self._version, + organization_sid=self._solution["organization_sid"], + account_sid=self._solution["account_sid"], + ) + return self._context + + def fetch(self) -> "AccountInstance": + """ + Fetch the AccountInstance + + + :returns: The fetched AccountInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "AccountInstance": + """ + Asynchronous coroutine to fetch the AccountInstance + + + :returns: The fetched AccountInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AccountContext(InstanceContext): + + def __init__(self, version: Version, organization_sid: str, account_sid: str): + """ + Initialize the AccountContext + + :param version: Version that contains the resource + :param organization_sid: + :param account_sid: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + "account_sid": account_sid, + } + self._uri = "/{organization_sid}/Accounts/{account_sid}".format( + **self._solution + ) + + def fetch(self) -> AccountInstance: + """ + Fetch the AccountInstance + + + :returns: The fetched AccountInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return AccountInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + account_sid=self._solution["account_sid"], + ) + + async def fetch_async(self) -> AccountInstance: + """ + Asynchronous coroutine to fetch the AccountInstance + + + :returns: The fetched AccountInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return AccountInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + account_sid=self._solution["account_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AccountPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> AccountInstance: + """ + Build an instance of AccountInstance + + :param payload: Payload response from the API + """ + return AccountInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class AccountList(ListResource): + + def __init__(self, version: Version, organization_sid: str): + """ + Initialize the AccountList + + :param version: Version that contains the resource + :param organization_sid: + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + } + self._uri = "/{organization_sid}/Accounts".format(**self._solution) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[AccountInstance]: + """ + Streams AccountInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[AccountInstance]: + """ + Asynchronously streams AccountInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AccountInstance]: + """ + Lists AccountInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AccountInstance]: + """ + Asynchronously lists AccountInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AccountPage: + """ + Retrieve a single page of AccountInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AccountInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return AccountPage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AccountPage: + """ + Asynchronously retrieve a single page of AccountInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AccountInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return AccountPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> AccountPage: + """ + Retrieve a specific page of AccountInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AccountInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return AccountPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> AccountPage: + """ + Asynchronously retrieve a specific page of AccountInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AccountInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return AccountPage(self._version, response, self._solution) + + def get(self, account_sid: str) -> AccountContext: + """ + Constructs a AccountContext + + :param account_sid: + """ + return AccountContext( + self._version, + organization_sid=self._solution["organization_sid"], + account_sid=account_sid, + ) + + def __call__(self, account_sid: str) -> AccountContext: + """ + Constructs a AccountContext + + :param account_sid: + """ + return AccountContext( + self._version, + organization_sid=self._solution["organization_sid"], + account_sid=account_sid, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/versionless/organization/role_assignment.py b/twilio/rest/preview_iam/versionless/organization/role_assignment.py new file mode 100644 index 0000000000..9d356f2c7c --- /dev/null +++ b/twilio/rest/preview_iam/versionless/organization/role_assignment.py @@ -0,0 +1,574 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class RoleAssignmentInstance(InstanceResource): + + class PublicApiCreateRoleAssignmentRequest(object): + """ + :ivar role_sid: Twilio Role Sid representing assigned role + :ivar scope: Twilio Sid representing scope of this assignment + :ivar identity: Twilio Sid representing identity of this assignment + """ + + def __init__(self, payload: Dict[str, Any]): + + self.role_sid: Optional[str] = payload.get("role_sid") + self.scope: Optional[str] = payload.get("scope") + self.identity: Optional[str] = payload.get("identity") + + def to_dict(self): + return { + "role_sid": self.role_sid, + "scope": self.scope, + "identity": self.identity, + } + + """ + :ivar sid: Twilio Role Assignment Sid representing this role assignment + :ivar role_sid: Twilio Role Sid representing assigned role + :ivar scope: Twilio Sid representing identity of this assignment + :ivar identity: Twilio Sid representing scope of this assignment + :ivar code: Twilio-specific error code + :ivar message: Error message + :ivar more_info: Link to Error Code References + :ivar status: HTTP response status code + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + organization_sid: str, + sid: Optional[str] = None, + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.role_sid: Optional[str] = payload.get("role_sid") + self.scope: Optional[str] = payload.get("scope") + self.identity: Optional[str] = payload.get("identity") + self.code: Optional[int] = payload.get("code") + self.message: Optional[str] = payload.get("message") + self.more_info: Optional[str] = payload.get("moreInfo") + self.status: Optional[int] = payload.get("status") + + self._solution = { + "organization_sid": organization_sid, + "sid": sid or self.sid, + } + self._context: Optional[RoleAssignmentContext] = None + + @property + def _proxy(self) -> "RoleAssignmentContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: RoleAssignmentContext for this RoleAssignmentInstance + """ + if self._context is None: + self._context = RoleAssignmentContext( + self._version, + organization_sid=self._solution["organization_sid"], + sid=self._solution["sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the RoleAssignmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the RoleAssignmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class RoleAssignmentContext(InstanceContext): + + class PublicApiCreateRoleAssignmentRequest(object): + """ + :ivar role_sid: Twilio Role Sid representing assigned role + :ivar scope: Twilio Sid representing scope of this assignment + :ivar identity: Twilio Sid representing identity of this assignment + """ + + def __init__(self, payload: Dict[str, Any]): + + self.role_sid: Optional[str] = payload.get("role_sid") + self.scope: Optional[str] = payload.get("scope") + self.identity: Optional[str] = payload.get("identity") + + def to_dict(self): + return { + "role_sid": self.role_sid, + "scope": self.scope, + "identity": self.identity, + } + + def __init__(self, version: Version, organization_sid: str, sid: str): + """ + Initialize the RoleAssignmentContext + + :param version: Version that contains the resource + :param organization_sid: + :param sid: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + "sid": sid, + } + self._uri = "/{organization_sid}/RoleAssignments/{sid}".format(**self._solution) + + def delete(self) -> bool: + """ + Deletes the RoleAssignmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the RoleAssignmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + return await self._version.delete_async( + method="DELETE", uri=self._uri, headers=headers + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class RoleAssignmentPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> RoleAssignmentInstance: + """ + Build an instance of RoleAssignmentInstance + + :param payload: Payload response from the API + """ + return RoleAssignmentInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class RoleAssignmentList(ListResource): + + class PublicApiCreateRoleAssignmentRequest(object): + """ + :ivar role_sid: Twilio Role Sid representing assigned role + :ivar scope: Twilio Sid representing scope of this assignment + :ivar identity: Twilio Sid representing identity of this assignment + """ + + def __init__(self, payload: Dict[str, Any]): + + self.role_sid: Optional[str] = payload.get("role_sid") + self.scope: Optional[str] = payload.get("scope") + self.identity: Optional[str] = payload.get("identity") + + def to_dict(self): + return { + "role_sid": self.role_sid, + "scope": self.scope, + "identity": self.identity, + } + + def __init__(self, version: Version, organization_sid: str): + """ + Initialize the RoleAssignmentList + + :param version: Version that contains the resource + :param organization_sid: + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + } + self._uri = "/{organization_sid}/RoleAssignments".format(**self._solution) + + def create( + self, + public_api_create_role_assignment_request: PublicApiCreateRoleAssignmentRequest, + ) -> RoleAssignmentInstance: + """ + Create the RoleAssignmentInstance + + :param public_api_create_role_assignment_request: + + :returns: The created RoleAssignmentInstance + """ + data = public_api_create_role_assignment_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return RoleAssignmentInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + async def create_async( + self, + public_api_create_role_assignment_request: PublicApiCreateRoleAssignmentRequest, + ) -> RoleAssignmentInstance: + """ + Asynchronously create the RoleAssignmentInstance + + :param public_api_create_role_assignment_request: + + :returns: The created RoleAssignmentInstance + """ + data = public_api_create_role_assignment_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return RoleAssignmentInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + def stream( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[RoleAssignmentInstance]: + """ + Streams RoleAssignmentInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str identity: + :param str scope: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(identity=identity, scope=scope, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[RoleAssignmentInstance]: + """ + Asynchronously streams RoleAssignmentInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str identity: + :param str scope: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + identity=identity, scope=scope, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[RoleAssignmentInstance]: + """ + Lists RoleAssignmentInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str identity: + :param str scope: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + identity=identity, + scope=scope, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[RoleAssignmentInstance]: + """ + Asynchronously lists RoleAssignmentInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str identity: + :param str scope: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + identity=identity, + scope=scope, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> RoleAssignmentPage: + """ + Retrieve a single page of RoleAssignmentInstance records from the API. + Request is executed immediately + + :param identity: + :param scope: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of RoleAssignmentInstance + """ + data = values.of( + { + "Identity": identity, + "Scope": scope, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return RoleAssignmentPage(self._version, response, self._solution) + + async def page_async( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> RoleAssignmentPage: + """ + Asynchronously retrieve a single page of RoleAssignmentInstance records from the API. + Request is executed immediately + + :param identity: + :param scope: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of RoleAssignmentInstance + """ + data = values.of( + { + "Identity": identity, + "Scope": scope, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return RoleAssignmentPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> RoleAssignmentPage: + """ + Retrieve a specific page of RoleAssignmentInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of RoleAssignmentInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return RoleAssignmentPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> RoleAssignmentPage: + """ + Asynchronously retrieve a specific page of RoleAssignmentInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of RoleAssignmentInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return RoleAssignmentPage(self._version, response, self._solution) + + def get(self, sid: str) -> RoleAssignmentContext: + """ + Constructs a RoleAssignmentContext + + :param sid: + """ + return RoleAssignmentContext( + self._version, organization_sid=self._solution["organization_sid"], sid=sid + ) + + def __call__(self, sid: str) -> RoleAssignmentContext: + """ + Constructs a RoleAssignmentContext + + :param sid: + """ + return RoleAssignmentContext( + self._version, organization_sid=self._solution["organization_sid"], sid=sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/versionless/organization/user.py b/twilio/rest/preview_iam/versionless/organization/user.py new file mode 100644 index 0000000000..166f76b421 --- /dev/null +++ b/twilio/rest/preview_iam/versionless/organization/user.py @@ -0,0 +1,1050 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class UserInstance(InstanceResource): + + class ScimEmailAddress(object): + """ + :ivar primary: Indicates if this email address is the primary one + :ivar value: The actual email address value + :ivar type: The type of email address (e.g., work, home, etc.) + """ + + def __init__(self, payload: Dict[str, Any]): + + self.primary: Optional[bool] = payload.get("primary") + self.value: Optional[str] = payload.get("value") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "primary": self.primary, + "value": self.value, + "type": self.type, + } + + class ScimMeta(object): + """ + :ivar resource_type: Indicates the type of the resource + :ivar created: The date and time when the resource was created in the system + :ivar last_modified: The date and time when the resource was last modified + :ivar version: A version identifier for the resource. This can be used to manage resource versioning and concurrency control. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.resource_type: Optional[str] = payload.get("resource_type") + self.created: Optional[datetime] = payload.get("created") + self.last_modified: Optional[datetime] = payload.get("last_modified") + self.version: Optional[str] = payload.get("version") + + def to_dict(self): + return { + "resource_type": self.resource_type, + "created": self.created, + "last_modified": self.last_modified, + "version": self.version, + } + + class ScimName(object): + """ + :ivar given_name: The user's first or given name + :ivar family_name: The user's last or family name + """ + + def __init__(self, payload: Dict[str, Any]): + + self.given_name: Optional[str] = payload.get("given_name") + self.family_name: Optional[str] = payload.get("family_name") + + def to_dict(self): + return { + "given_name": self.given_name, + "family_name": self.family_name, + } + + class ScimUser(object): + """ + :ivar id: Unique Twilio user sid + :ivar external_id: External unique resource id defined by provisioning client + :ivar user_name: Unique username, MUST be same as primary email address + :ivar display_name: User friendly display name + :ivar name: + :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. + :ivar active: Indicates whether the user is active + :ivar locale: User's locale + :ivar timezone: User's time zone + :ivar schemas: An array of URIs that indicate the schemas supported for this user resource + :ivar meta: + :ivar detail: A human-readable description of the error + :ivar scim_type: A scimType error code as defined in RFC7644 + :ivar status: Http status code + :ivar code: Twilio-specific error code + :ivar more_info: Link to Error Code References + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.external_id: Optional[str] = payload.get("external_id") + self.user_name: Optional[str] = payload.get("user_name") + self.display_name: Optional[str] = payload.get("display_name") + self.name: Optional[UserList.ScimName] = payload.get("name") + self.emails: Optional[List[UserList.ScimEmailAddress]] = payload.get( + "emails" + ) + self.active: Optional[bool] = payload.get("active") + self.locale: Optional[str] = payload.get("locale") + self.timezone: Optional[str] = payload.get("timezone") + self.schemas: Optional[List[str]] = payload.get("schemas") + self.meta: Optional[UserList.ScimMeta] = payload.get("meta") + self.detail: Optional[str] = payload.get("detail") + self.scim_type: Optional[str] = payload.get("scim_type") + self.status: Optional[str] = payload.get("status") + self.code: Optional[int] = payload.get("code") + self.more_info: Optional[str] = payload.get("more_info") + + def to_dict(self): + return { + "id": self.id, + "externalId": self.external_id, + "userName": self.user_name, + "displayName": self.display_name, + "name": self.name.to_dict() if self.name is not None else None, + "emails": ( + [emails.to_dict() for emails in self.emails] + if self.emails is not None + else None + ), + "active": self.active, + "locale": self.locale, + "timezone": self.timezone, + "schemas": self.schemas, + "meta": self.meta.to_dict() if self.meta is not None else None, + "detail": self.detail, + "scimType": self.scim_type, + "status": self.status, + "code": self.code, + "moreInfo": self.more_info, + } + + """ + :ivar id: Unique Twilio user sid + :ivar external_id: External unique resource id defined by provisioning client + :ivar user_name: Unique username, MUST be same as primary email address + :ivar display_name: User friendly display name + :ivar name: + :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. + :ivar active: Indicates whether the user is active + :ivar locale: User's locale + :ivar timezone: User's time zone + :ivar schemas: An array of URIs that indicate the schemas supported for this user resource + :ivar meta: + :ivar detail: A human-readable description of the error + :ivar scim_type: A scimType error code as defined in RFC7644 + :ivar status: Http status code + :ivar code: Twilio-specific error code + :ivar more_info: Link to Error Code References + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + organization_sid: str, + id: Optional[str] = None, + ): + super().__init__(version) + + self.id: Optional[str] = payload.get("id") + self.external_id: Optional[str] = payload.get("externalId") + self.user_name: Optional[str] = payload.get("userName") + self.display_name: Optional[str] = payload.get("displayName") + self.name: Optional[UserList.str] = payload.get("name") + self.emails: Optional[List[UserList.str]] = payload.get("emails") + self.active: Optional[bool] = payload.get("active") + self.locale: Optional[str] = payload.get("locale") + self.timezone: Optional[str] = payload.get("timezone") + self.schemas: Optional[List[str]] = payload.get("schemas") + self.meta: Optional[UserList.str] = payload.get("meta") + self.detail: Optional[str] = payload.get("detail") + self.scim_type: Optional[str] = payload.get("scimType") + self.status: Optional[str] = payload.get("status") + self.code: Optional[int] = payload.get("code") + self.more_info: Optional[str] = payload.get("moreInfo") + + self._solution = { + "organization_sid": organization_sid, + "id": id or self.id, + } + self._context: Optional[UserContext] = None + + @property + def _proxy(self) -> "UserContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: UserContext for this UserInstance + """ + if self._context is None: + self._context = UserContext( + self._version, + organization_sid=self._solution["organization_sid"], + id=self._solution["id"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the UserInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the UserInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "UserInstance": + """ + Fetch the UserInstance + + + :returns: The fetched UserInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "UserInstance": + """ + Asynchronous coroutine to fetch the UserInstance + + + :returns: The fetched UserInstance + """ + return await self._proxy.fetch_async() + + def update( + self, scim_user: ScimUser, if_match: Union[str, object] = values.unset + ) -> "UserInstance": + """ + Update the UserInstance + + :param scim_user: + :param if_match: + + :returns: The updated UserInstance + """ + return self._proxy.update( + scim_user=scim_user, + if_match=if_match, + ) + + async def update_async( + self, scim_user: ScimUser, if_match: Union[str, object] = values.unset + ) -> "UserInstance": + """ + Asynchronous coroutine to update the UserInstance + + :param scim_user: + :param if_match: + + :returns: The updated UserInstance + """ + return await self._proxy.update_async( + scim_user=scim_user, + if_match=if_match, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class UserContext(InstanceContext): + + class ScimEmailAddress(object): + """ + :ivar primary: Indicates if this email address is the primary one + :ivar value: The actual email address value + :ivar type: The type of email address (e.g., work, home, etc.) + """ + + def __init__(self, payload: Dict[str, Any]): + + self.primary: Optional[bool] = payload.get("primary") + self.value: Optional[str] = payload.get("value") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "primary": self.primary, + "value": self.value, + "type": self.type, + } + + class ScimMeta(object): + """ + :ivar resource_type: Indicates the type of the resource + :ivar created: The date and time when the resource was created in the system + :ivar last_modified: The date and time when the resource was last modified + :ivar version: A version identifier for the resource. This can be used to manage resource versioning and concurrency control. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.resource_type: Optional[str] = payload.get("resource_type") + self.created: Optional[datetime] = payload.get("created") + self.last_modified: Optional[datetime] = payload.get("last_modified") + self.version: Optional[str] = payload.get("version") + + def to_dict(self): + return { + "resource_type": self.resource_type, + "created": self.created, + "last_modified": self.last_modified, + "version": self.version, + } + + class ScimName(object): + """ + :ivar given_name: The user's first or given name + :ivar family_name: The user's last or family name + """ + + def __init__(self, payload: Dict[str, Any]): + + self.given_name: Optional[str] = payload.get("given_name") + self.family_name: Optional[str] = payload.get("family_name") + + def to_dict(self): + return { + "given_name": self.given_name, + "family_name": self.family_name, + } + + class ScimUser(object): + """ + :ivar id: Unique Twilio user sid + :ivar external_id: External unique resource id defined by provisioning client + :ivar user_name: Unique username, MUST be same as primary email address + :ivar display_name: User friendly display name + :ivar name: + :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. + :ivar active: Indicates whether the user is active + :ivar locale: User's locale + :ivar timezone: User's time zone + :ivar schemas: An array of URIs that indicate the schemas supported for this user resource + :ivar meta: + :ivar detail: A human-readable description of the error + :ivar scim_type: A scimType error code as defined in RFC7644 + :ivar status: Http status code + :ivar code: Twilio-specific error code + :ivar more_info: Link to Error Code References + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.external_id: Optional[str] = payload.get("external_id") + self.user_name: Optional[str] = payload.get("user_name") + self.display_name: Optional[str] = payload.get("display_name") + self.name: Optional[UserList.ScimName] = payload.get("name") + self.emails: Optional[List[UserList.ScimEmailAddress]] = payload.get( + "emails" + ) + self.active: Optional[bool] = payload.get("active") + self.locale: Optional[str] = payload.get("locale") + self.timezone: Optional[str] = payload.get("timezone") + self.schemas: Optional[List[str]] = payload.get("schemas") + self.meta: Optional[UserList.ScimMeta] = payload.get("meta") + self.detail: Optional[str] = payload.get("detail") + self.scim_type: Optional[str] = payload.get("scim_type") + self.status: Optional[str] = payload.get("status") + self.code: Optional[int] = payload.get("code") + self.more_info: Optional[str] = payload.get("more_info") + + def to_dict(self): + return { + "id": self.id, + "externalId": self.external_id, + "userName": self.user_name, + "displayName": self.display_name, + "name": self.name.to_dict() if self.name is not None else None, + "emails": ( + [emails.to_dict() for emails in self.emails] + if self.emails is not None + else None + ), + "active": self.active, + "locale": self.locale, + "timezone": self.timezone, + "schemas": self.schemas, + "meta": self.meta.to_dict() if self.meta is not None else None, + "detail": self.detail, + "scimType": self.scim_type, + "status": self.status, + "code": self.code, + "moreInfo": self.more_info, + } + + def __init__(self, version: Version, organization_sid: str, id: str): + """ + Initialize the UserContext + + :param version: Version that contains the resource + :param organization_sid: + :param id: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + "id": id, + } + self._uri = "/{organization_sid}/scim/Users/{id}".format(**self._solution) + + def delete(self) -> bool: + """ + Deletes the UserInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the UserInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + return await self._version.delete_async( + method="DELETE", uri=self._uri, headers=headers + ) + + def fetch(self) -> UserInstance: + """ + Fetch the UserInstance + + + :returns: The fetched UserInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return UserInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + id=self._solution["id"], + ) + + async def fetch_async(self) -> UserInstance: + """ + Asynchronous coroutine to fetch the UserInstance + + + :returns: The fetched UserInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return UserInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + id=self._solution["id"], + ) + + def update( + self, scim_user: ScimUser, if_match: Union[str, object] = values.unset + ) -> UserInstance: + """ + Update the UserInstance + + :param scim_user: + :param if_match: + + :returns: The updated UserInstance + """ + data = scim_user.to_dict() + + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/json" + + headers["Content-Type"] = "application/scim+json" + + headers["Accept"] = "application/scim+json" + + payload = self._version.update( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return UserInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + id=self._solution["id"], + ) + + async def update_async( + self, scim_user: ScimUser, if_match: Union[str, object] = values.unset + ) -> UserInstance: + """ + Asynchronous coroutine to update the UserInstance + + :param scim_user: + :param if_match: + + :returns: The updated UserInstance + """ + data = scim_user.to_dict() + + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/json" + + headers["Content-Type"] = "application/scim+json" + + headers["Accept"] = "application/scim+json" + + payload = await self._version.update_async( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return UserInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + id=self._solution["id"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class UserPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: + """ + Build an instance of UserInstance + + :param payload: Payload response from the API + """ + return UserInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class UserList(ListResource): + + class ScimEmailAddress(object): + """ + :ivar primary: Indicates if this email address is the primary one + :ivar value: The actual email address value + :ivar type: The type of email address (e.g., work, home, etc.) + """ + + def __init__(self, payload: Dict[str, Any]): + + self.primary: Optional[bool] = payload.get("primary") + self.value: Optional[str] = payload.get("value") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "primary": self.primary, + "value": self.value, + "type": self.type, + } + + class ScimMeta(object): + """ + :ivar resource_type: Indicates the type of the resource + :ivar created: The date and time when the resource was created in the system + :ivar last_modified: The date and time when the resource was last modified + :ivar version: A version identifier for the resource. This can be used to manage resource versioning and concurrency control. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.resource_type: Optional[str] = payload.get("resource_type") + self.created: Optional[datetime] = payload.get("created") + self.last_modified: Optional[datetime] = payload.get("last_modified") + self.version: Optional[str] = payload.get("version") + + def to_dict(self): + return { + "resource_type": self.resource_type, + "created": self.created, + "last_modified": self.last_modified, + "version": self.version, + } + + class ScimName(object): + """ + :ivar given_name: The user's first or given name + :ivar family_name: The user's last or family name + """ + + def __init__(self, payload: Dict[str, Any]): + + self.given_name: Optional[str] = payload.get("given_name") + self.family_name: Optional[str] = payload.get("family_name") + + def to_dict(self): + return { + "given_name": self.given_name, + "family_name": self.family_name, + } + + class ScimUser(object): + """ + :ivar id: Unique Twilio user sid + :ivar external_id: External unique resource id defined by provisioning client + :ivar user_name: Unique username, MUST be same as primary email address + :ivar display_name: User friendly display name + :ivar name: + :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. + :ivar active: Indicates whether the user is active + :ivar locale: User's locale + :ivar timezone: User's time zone + :ivar schemas: An array of URIs that indicate the schemas supported for this user resource + :ivar meta: + :ivar detail: A human-readable description of the error + :ivar scim_type: A scimType error code as defined in RFC7644 + :ivar status: Http status code + :ivar code: Twilio-specific error code + :ivar more_info: Link to Error Code References + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.external_id: Optional[str] = payload.get("external_id") + self.user_name: Optional[str] = payload.get("user_name") + self.display_name: Optional[str] = payload.get("display_name") + self.name: Optional[UserList.ScimName] = payload.get("name") + self.emails: Optional[List[UserList.ScimEmailAddress]] = payload.get( + "emails" + ) + self.active: Optional[bool] = payload.get("active") + self.locale: Optional[str] = payload.get("locale") + self.timezone: Optional[str] = payload.get("timezone") + self.schemas: Optional[List[str]] = payload.get("schemas") + self.meta: Optional[UserList.ScimMeta] = payload.get("meta") + self.detail: Optional[str] = payload.get("detail") + self.scim_type: Optional[str] = payload.get("scim_type") + self.status: Optional[str] = payload.get("status") + self.code: Optional[int] = payload.get("code") + self.more_info: Optional[str] = payload.get("more_info") + + def to_dict(self): + return { + "id": self.id, + "externalId": self.external_id, + "userName": self.user_name, + "displayName": self.display_name, + "name": self.name.to_dict() if self.name is not None else None, + "emails": ( + [emails.to_dict() for emails in self.emails] + if self.emails is not None + else None + ), + "active": self.active, + "locale": self.locale, + "timezone": self.timezone, + "schemas": self.schemas, + "meta": self.meta.to_dict() if self.meta is not None else None, + "detail": self.detail, + "scimType": self.scim_type, + "status": self.status, + "code": self.code, + "moreInfo": self.more_info, + } + + def __init__(self, version: Version, organization_sid: str): + """ + Initialize the UserList + + :param version: Version that contains the resource + :param organization_sid: + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + } + self._uri = "/{organization_sid}/scim/Users".format(**self._solution) + + def create(self, scim_user: ScimUser) -> UserInstance: + """ + Create the UserInstance + + :param scim_user: + + :returns: The created UserInstance + """ + data = scim_user.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Content-Type"] = "application/scim+json" + + headers["Accept"] = "application/scim+json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return UserInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + async def create_async(self, scim_user: ScimUser) -> UserInstance: + """ + Asynchronously create the UserInstance + + :param scim_user: + + :returns: The created UserInstance + """ + data = scim_user.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Content-Type"] = "application/scim+json" + + headers["Accept"] = "application/scim+json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return UserInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + def stream( + self, + filter: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[UserInstance]: + """ + Streams UserInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str filter: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(filter=filter, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + filter: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[UserInstance]: + """ + Asynchronously streams UserInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str filter: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(filter=filter, page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + filter: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[UserInstance]: + """ + Lists UserInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str filter: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + filter=filter, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + filter: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[UserInstance]: + """ + Asynchronously lists UserInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str filter: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + filter=filter, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + filter: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> UserPage: + """ + Retrieve a single page of UserInstance records from the API. + Request is executed immediately + + :param filter: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of UserInstance + """ + data = values.of( + { + "filter": filter, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/scim+json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return UserPage(self._version, response, self._solution) + + async def page_async( + self, + filter: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> UserPage: + """ + Asynchronously retrieve a single page of UserInstance records from the API. + Request is executed immediately + + :param filter: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of UserInstance + """ + data = values.of( + { + "filter": filter, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/scim+json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return UserPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> UserPage: + """ + Retrieve a specific page of UserInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of UserInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return UserPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> UserPage: + """ + Asynchronously retrieve a specific page of UserInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of UserInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return UserPage(self._version, response, self._solution) + + def get(self, id: str) -> UserContext: + """ + Constructs a UserContext + + :param id: + """ + return UserContext( + self._version, organization_sid=self._solution["organization_sid"], id=id + ) + + def __call__(self, id: str) -> UserContext: + """ + Constructs a UserContext + + :param id: + """ + return UserContext( + self._version, organization_sid=self._solution["organization_sid"], id=id + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" From 0b8aab400793efc06c1beb4a6a0f931b21df0ca1 Mon Sep 17 00:00:00 2001 From: Athira Sabu <102021496+AsabuHere@users.noreply.github.com> Date: Thu, 12 Dec 2024 16:01:56 +0530 Subject: [PATCH 067/113] feat: Docs update and examples for organization api uptake and public oauth (#825) * Docs update and examples --- README.md | 7 ++++ examples/organization_api.py | 30 ++++++++++++++ examples/public_oauth.py | 31 ++++++++++++++ .../credential/client_credential_provider.py | 28 +++++++++++++ twilio/http/client_token_manager.py | 41 +++++++++++++++++++ 5 files changed, 137 insertions(+) create mode 100644 examples/organization_api.py create mode 100644 examples/public_oauth.py create mode 100644 twilio/credential/client_credential_provider.py create mode 100644 twilio/http/client_token_manager.py diff --git a/README.md b/README.md index 50cc5509e1..bfbd6a14b5 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,13 @@ After a brief delay, you will receive the text message on your phone. > **Warning** > It's okay to hardcode your credentials when testing locally, but you should use environment variables to keep them secret before committing any code or deploying to production. Check out [How to Set Environment Variables](https://www.twilio.com/blog/2017/01/how-to-set-environment-variables.html) for more information. +## OAuth Feature for Twilio APIs +We are introducing Client Credentials Flow-based OAuth 2.0 authentication. This feature is currently in beta and its implementation is subject to change. + +API examples [here](https://github.com/twilio/twilio-python/blob/main/examples/public_oauth.py) + +Organisation API examples [here](https://github.com/twilio/twilio-python/blob/main/examples/organization_api.py) + ## Use the helper library ### API Credentials diff --git a/examples/organization_api.py b/examples/organization_api.py new file mode 100644 index 0000000000..f95df03c72 --- /dev/null +++ b/examples/organization_api.py @@ -0,0 +1,30 @@ +import os + +from twilio.rest import Client +from twilio.credential.orgs_credential_provider import OrgsCredentialProvider + +ACCOUNT_SID = os.environ.get("TWILIO_ACCOUNT_SID") +API_KEY = os.environ.get("TWILIO_API_KEY") +API_SECRET = os.environ.get("TWILIO_API_SECRET") + +CLIENT_ID = os.environ.get("TWILIO_CLIENT_ID") +CLIENT_SECRET = os.environ.get("CLIENT_SECRET") +ORGS_SID = os.environ.get("ORGS_SID") + + +def example(): + """ + Some example usage of using organization resources + """ + self.client = Client( + account_sid=ACCOUNT_SID, + credential_provider= OrgsCredentialProvider(CLIENT_ID,CLIENT_SECRET) + ) + + accounts = self.client.preview_iam.organization(organization_sid=ORGS_SID).accounts.stream() + for record in accounts: + print(record) + + +if __name__ == "__main__": + example() diff --git a/examples/public_oauth.py b/examples/public_oauth.py new file mode 100644 index 0000000000..a01d04a6c1 --- /dev/null +++ b/examples/public_oauth.py @@ -0,0 +1,31 @@ +import os + +from twilio.rest import Client +from twilio.credential.client_credential_provider import ClientCredentialProvider + +ACCOUNT_SID = os.environ.get("TWILIO_ACCOUNT_SID") +API_KEY = os.environ.get("TWILIO_API_KEY") +API_SECRET = os.environ.get("TWILIO_API_SECRET") +FROM_NUMBER = os.environ.get("TWILIO_FROM_NUMBER") +TO_NUMBER = os.environ.get("TWILIO_TO_NUMBER") + +CLIENT_ID = os.environ.get("TWILIO_CLIENT_ID") +CLIENT_SECRET = os.environ.get("CLIENT_SECRET") + + +def example(): + """ + Some example usage of message resources. + """ + self.client = Client( + account_sid=ACCOUNT_SID, + credential_provider= ClientCredentialProvider(CLIENT_ID,CLIENT_SECRET) + ) + + msg = self.client.messages.create( + to=self.to_number, from_=self.from_number, body="hello world" + ) + + +if __name__ == "__main__": + example() diff --git a/twilio/credential/client_credential_provider.py b/twilio/credential/client_credential_provider.py new file mode 100644 index 0000000000..656d446395 --- /dev/null +++ b/twilio/credential/client_credential_provider.py @@ -0,0 +1,28 @@ +from twilio.http.client_token_manager import ClientTokenManager +from twilio.base.exceptions import TwilioException +from twilio.credential.credential_provider import CredentialProvider +from twilio.auth_strategy.auth_type import AuthType +from twilio.auth_strategy.token_auth_strategy import TokenAuthStrategy + + +class ClientCredentialProvider(CredentialProvider): + def __init__(self, client_id: str, client_secret: str, token_manager=None): + super().__init__(AuthType.CLIENT_CREDENTIALS) + + if client_id is None or client_secret is None: + raise TwilioException("Client id and Client secret are mandatory") + + self.grant_type = "client_credentials" + self.client_id = client_id + self.client_secret = client_secret + self.token_manager = token_manager + self.auth_strategy = None + + def to_auth_strategy(self): + if self.token_manager is None: + self.token_manager = ClientTokenManager( + self.grant_type, self.client_id, self.client_secret + ) + if self.auth_strategy is None: + self.auth_strategy = TokenAuthStrategy(self.token_manager) + return self.auth_strategy diff --git a/twilio/http/client_token_manager.py b/twilio/http/client_token_manager.py new file mode 100644 index 0000000000..d65acb2ba2 --- /dev/null +++ b/twilio/http/client_token_manager.py @@ -0,0 +1,41 @@ +from twilio.http.token_manager import TokenManager +from twilio.rest import Client + + +class ClientTokenManager(TokenManager): + """ + Client Token Manager + """ + + def __init__( + self, + grant_type: str, + client_id: str, + client_secret: str, + code: str = None, + redirect_uri: str = None, + audience: str = None, + refreshToken: str = None, + scope: str = None, + ): + self.grant_type = grant_type + self.client_id = client_id + self.client_secret = client_secret + self.code = code + self.redirect_uri = redirect_uri + self.audience = audience + self.refreshToken = refreshToken + self.scope = scope + self.client = Client() + + def fetch_access_token(self): + token_instance = self.client.preview_iam.v1.token.create( + grant_type=self.grant_type, + client_id=self.client_id, + client_secret=self.client_secret, + code=self.code, + redirect_uri=self.redirect_uri, + audience=self.audience, + scope=self.scope, + ) + return token_instance.access_token From ec1b6bf43817919279052069ad0863c4fb96a739 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 12 Dec 2024 17:07:11 +0000 Subject: [PATCH 068/113] [Librarian] Regenerated @ ca4a5892d2b6a6161860845fe1152af07920bc07 403073118470eabf87311669c7fea876d35ced04 --- CHANGES.md | 7 + examples/organization_api.py | 6 +- examples/public_oauth.py | 2 +- twilio/rest/__init__.py | 32 +- .../rest/accounts/v1/auth_token_promotion.py | 16 +- twilio/rest/accounts/v1/bulk_consents.py | 8 + twilio/rest/accounts/v1/bulk_contacts.py | 8 + twilio/rest/accounts/v1/credential/aws.py | 72 +- .../rest/accounts/v1/credential/public_key.py | 72 +- twilio/rest/accounts/v1/safelist.py | 12 + .../rest/accounts/v1/secondary_auth_token.py | 14 +- twilio/rest/api/v2010/account/__init__.py | 58 +- .../api/v2010/account/address/__init__.py | 72 +- .../account/address/dependent_phone_number.py | 14 +- twilio/rest/api/v2010/account/application.py | 72 +- .../v2010/account/authorized_connect_app.py | 30 +- .../__init__.py | 30 +- .../available_phone_number_country/local.py | 14 +- .../machine_to_machine.py | 14 +- .../available_phone_number_country/mobile.py | 14 +- .../national.py | 14 +- .../shared_cost.py | 14 +- .../toll_free.py | 14 +- .../available_phone_number_country/voip.py | 14 +- twilio/rest/api/v2010/account/balance.py | 4 + .../rest/api/v2010/account/call/__init__.py | 72 +- twilio/rest/api/v2010/account/call/event.py | 14 +- .../api/v2010/account/call/notification.py | 30 +- twilio/rest/api/v2010/account/call/payment.py | 28 +- .../rest/api/v2010/account/call/recording.py | 72 +- twilio/rest/api/v2010/account/call/siprec.py | 28 +- twilio/rest/api/v2010/account/call/stream.py | 28 +- .../api/v2010/account/call/transcription.py | 28 +- .../account/call/user_defined_message.py | 8 + .../call/user_defined_message_subscription.py | 22 +- .../api/v2010/account/conference/__init__.py | 50 +- .../v2010/account/conference/participant.py | 72 +- .../api/v2010/account/conference/recording.py | 64 +- twilio/rest/api/v2010/account/connect_app.py | 64 +- .../account/incoming_phone_number/__init__.py | 72 +- .../assigned_add_on/__init__.py | 52 +- .../assigned_add_on_extension.py | 30 +- .../account/incoming_phone_number/local.py | 22 +- .../account/incoming_phone_number/mobile.py | 22 +- .../incoming_phone_number/toll_free.py | 22 +- twilio/rest/api/v2010/account/key.py | 64 +- .../api/v2010/account/message/__init__.py | 72 +- .../api/v2010/account/message/feedback.py | 8 + .../rest/api/v2010/account/message/media.py | 44 +- twilio/rest/api/v2010/account/new_key.py | 8 + .../rest/api/v2010/account/new_signing_key.py | 8 + twilio/rest/api/v2010/account/notification.py | 30 +- .../api/v2010/account/outgoing_caller_id.py | 64 +- .../rest/api/v2010/account/queue/__init__.py | 72 +- twilio/rest/api/v2010/account/queue/member.py | 50 +- .../api/v2010/account/recording/__init__.py | 42 +- .../recording/add_on_result/__init__.py | 44 +- .../add_on_result/payload/__init__.py | 44 +- .../recording/add_on_result/payload/data.py | 17 +- .../v2010/account/recording/transcription.py | 44 +- twilio/rest/api/v2010/account/short_code.py | 50 +- twilio/rest/api/v2010/account/signing_key.py | 64 +- .../account/sip/credential_list/__init__.py | 72 +- .../account/sip/credential_list/credential.py | 72 +- .../api/v2010/account/sip/domain/__init__.py | 72 +- .../auth_calls_credential_list_mapping.py | 52 +- ...th_calls_ip_access_control_list_mapping.py | 52 +- ...h_registrations_credential_list_mapping.py | 52 +- .../sip/domain/credential_list_mapping.py | 52 +- .../domain/ip_access_control_list_mapping.py | 52 +- .../sip/ip_access_control_list/__init__.py | 72 +- .../sip/ip_access_control_list/ip_address.py | 72 +- twilio/rest/api/v2010/account/token.py | 8 + .../rest/api/v2010/account/transcription.py | 44 +- .../v2010/account/usage/record/__init__.py | 14 +- .../v2010/account/usage/record/all_time.py | 14 +- .../api/v2010/account/usage/record/daily.py | 14 +- .../v2010/account/usage/record/last_month.py | 14 +- .../api/v2010/account/usage/record/monthly.py | 14 +- .../v2010/account/usage/record/this_month.py | 14 +- .../api/v2010/account/usage/record/today.py | 14 +- .../api/v2010/account/usage/record/yearly.py | 14 +- .../v2010/account/usage/record/yesterday.py | 14 +- .../rest/api/v2010/account/usage/trigger.py | 72 +- .../api/v2010/account/validation_request.py | 8 + .../rest/assistants/v1/assistant/__init__.py | 323 ++- .../v1/assistant/assistants_knowledge.py | 28 +- .../v1/assistant/assistants_tool.py | 28 +- .../rest/assistants/v1/assistant/feedback.py | 44 +- .../rest/assistants/v1/assistant/message.py | 33 + .../rest/assistants/v1/knowledge/__init__.py | 263 ++- twilio/rest/assistants/v1/knowledge/chunk.py | 14 +- .../v1/knowledge/knowledge_status.py | 18 +- twilio/rest/assistants/v1/policy.py | 14 +- twilio/rest/assistants/v1/session/__init__.py | 30 +- twilio/rest/assistants/v1/session/message.py | 14 +- twilio/rest/assistants/v1/tool.py | 273 ++- twilio/rest/bulkexports/v1/export/__init__.py | 17 +- twilio/rest/bulkexports/v1/export/day.py | 30 +- .../v1/export/export_custom_job.py | 22 +- twilio/rest/bulkexports/v1/export/job.py | 31 +- .../bulkexports/v1/export_configuration.py | 36 +- twilio/rest/chat/v1/credential.py | 72 +- twilio/rest/chat/v1/service/__init__.py | 72 +- .../rest/chat/v1/service/channel/__init__.py | 72 +- twilio/rest/chat/v1/service/channel/invite.py | 52 +- twilio/rest/chat/v1/service/channel/member.py | 72 +- .../rest/chat/v1/service/channel/message.py | 72 +- twilio/rest/chat/v1/service/role.py | 72 +- twilio/rest/chat/v1/service/user/__init__.py | 72 +- .../rest/chat/v1/service/user/user_channel.py | 14 +- twilio/rest/chat/v2/credential.py | 72 +- twilio/rest/chat/v2/service/__init__.py | 72 +- twilio/rest/chat/v2/service/binding.py | 44 +- .../rest/chat/v2/service/channel/__init__.py | 82 +- twilio/rest/chat/v2/service/channel/invite.py | 52 +- twilio/rest/chat/v2/service/channel/member.py | 82 +- .../rest/chat/v2/service/channel/message.py | 82 +- .../rest/chat/v2/service/channel/webhook.py | 72 +- twilio/rest/chat/v2/service/role.py | 72 +- twilio/rest/chat/v2/service/user/__init__.py | 92 +- .../rest/chat/v2/service/user/user_binding.py | 44 +- .../rest/chat/v2/service/user/user_channel.py | 54 +- twilio/rest/chat/v3/channel.py | 40 +- twilio/rest/content/v1/content/__init__.py | 1830 +++++++++++++++-- .../content/v1/content/approval_create.py | 36 +- .../rest/content/v1/content/approval_fetch.py | 17 +- .../rest/content/v1/content_and_approvals.py | 14 +- twilio/rest/content/v1/legacy_content.py | 14 +- twilio/rest/content/v2/content.py | 14 +- .../rest/content/v2/content_and_approvals.py | 14 +- .../conversations/v1/address_configuration.py | 72 +- .../v1/configuration/__init__.py | 36 +- .../conversations/v1/configuration/webhook.py | 36 +- .../conversations/v1/conversation/__init__.py | 82 +- .../v1/conversation/message/__init__.py | 82 +- .../conversation/message/delivery_receipt.py | 30 +- .../v1/conversation/participant.py | 82 +- .../conversations/v1/conversation/webhook.py | 72 +- .../v1/conversation_with_participants.py | 8 + twilio/rest/conversations/v1/credential.py | 72 +- .../v1/participant_conversation.py | 14 +- twilio/rest/conversations/v1/role.py | 72 +- .../rest/conversations/v1/service/__init__.py | 52 +- .../rest/conversations/v1/service/binding.py | 44 +- .../v1/service/configuration/__init__.py | 36 +- .../v1/service/configuration/notification.py | 36 +- .../v1/service/configuration/webhook.py | 36 +- .../v1/service/conversation/__init__.py | 82 +- .../service/conversation/message/__init__.py | 82 +- .../conversation/message/delivery_receipt.py | 30 +- .../v1/service/conversation/participant.py | 82 +- .../v1/service/conversation/webhook.py | 72 +- .../service/conversation_with_participants.py | 8 + .../v1/service/participant_conversation.py | 14 +- twilio/rest/conversations/v1/service/role.py | 72 +- .../conversations/v1/service/user/__init__.py | 82 +- .../v1/service/user/user_conversation.py | 64 +- twilio/rest/conversations/v1/user/__init__.py | 82 +- .../v1/user/user_conversation.py | 64 +- twilio/rest/events/v1/event_type.py | 30 +- twilio/rest/events/v1/schema/__init__.py | 18 +- .../rest/events/v1/schema/schema_version.py | 30 +- twilio/rest/events/v1/sink/__init__.py | 72 +- twilio/rest/events/v1/sink/sink_test.py | 4 + twilio/rest/events/v1/sink/sink_validate.py | 8 + .../rest/events/v1/subscription/__init__.py | 72 +- .../v1/subscription/subscribed_event.py | 72 +- twilio/rest/flex_api/v1/assessments.py | 66 +- twilio/rest/flex_api/v1/channel.py | 52 +- twilio/rest/flex_api/v1/configuration.py | 40 +- twilio/rest/flex_api/v1/flex_flow.py | 72 +- .../v1/insights_assessments_comment.py | 32 +- .../flex_api/v1/insights_conversations.py | 24 +- .../flex_api/v1/insights_questionnaires.py | 84 +- .../v1/insights_questionnaires_category.py | 70 +- .../v1/insights_questionnaires_question.py | 70 +- twilio/rest/flex_api/v1/insights_segments.py | 24 +- .../v1/insights_settings_answer_sets.py | 4 + .../flex_api/v1/insights_settings_comment.py | 4 + .../rest/flex_api/v1/insights_user_roles.py | 14 +- .../rest/flex_api/v1/interaction/__init__.py | 24 +- .../interaction_channel/__init__.py | 50 +- .../interaction_channel_invite.py | 22 +- .../interaction_channel_participant.py | 42 +- twilio/rest/flex_api/v1/plugin/__init__.py | 80 +- .../flex_api/v1/plugin/plugin_versions.py | 46 +- twilio/rest/flex_api/v1/plugin_archive.py | 30 +- .../v1/plugin_configuration/__init__.py | 46 +- .../plugin_configuration/configured_plugin.py | 38 +- .../v1/plugin_configuration_archive.py | 30 +- twilio/rest/flex_api/v1/plugin_release.py | 46 +- .../flex_api/v1/plugin_version_archive.py | 30 +- .../rest/flex_api/v1/provisioning_status.py | 17 +- twilio/rest/flex_api/v1/web_channel.py | 72 +- twilio/rest/flex_api/v2/flex_user.py | 36 +- twilio/rest/flex_api/v2/web_channels.py | 8 + twilio/rest/frontline_api/v1/user.py | 36 +- twilio/rest/iam/v1/__init__.py | 12 +- twilio/rest/iam/v1/api_key.py | 50 +- twilio/rest/iam/v1/get_api_keys.py | 14 +- twilio/rest/iam/v1/{key.py => new_api_key.py} | 38 +- twilio/rest/insights/v1/call/__init__.py | 17 +- twilio/rest/insights/v1/call/annotation.py | 36 +- twilio/rest/insights/v1/call/call_summary.py | 14 +- twilio/rest/insights/v1/call/event.py | 14 +- twilio/rest/insights/v1/call/metric.py | 14 +- twilio/rest/insights/v1/call_summaries.py | 14 +- .../rest/insights/v1/conference/__init__.py | 30 +- .../v1/conference/conference_participant.py | 28 +- twilio/rest/insights/v1/room/__init__.py | 30 +- twilio/rest/insights/v1/room/participant.py | 30 +- twilio/rest/insights/v1/setting.py | 34 +- .../rest/intelligence/v2/custom_operator.py | 84 +- twilio/rest/intelligence/v2/operator.py | 30 +- .../intelligence/v2/operator_attachment.py | 14 +- .../intelligence/v2/operator_attachments.py | 17 +- twilio/rest/intelligence/v2/operator_type.py | 30 +- .../rest/intelligence/v2/prebuilt_operator.py | 30 +- twilio/rest/intelligence/v2/service.py | 84 +- .../intelligence/v2/transcript/__init__.py | 52 +- .../rest/intelligence/v2/transcript/media.py | 14 +- .../v2/transcript/operator_result.py | 28 +- .../intelligence/v2/transcript/sentence.py | 14 +- twilio/rest/ip_messaging/v1/credential.py | 72 +- .../rest/ip_messaging/v1/service/__init__.py | 72 +- .../v1/service/channel/__init__.py | 72 +- .../ip_messaging/v1/service/channel/invite.py | 52 +- .../ip_messaging/v1/service/channel/member.py | 72 +- .../v1/service/channel/message.py | 72 +- twilio/rest/ip_messaging/v1/service/role.py | 72 +- .../ip_messaging/v1/service/user/__init__.py | 72 +- .../v1/service/user/user_channel.py | 14 +- twilio/rest/ip_messaging/v2/credential.py | 72 +- .../rest/ip_messaging/v2/service/__init__.py | 72 +- .../rest/ip_messaging/v2/service/binding.py | 44 +- .../v2/service/channel/__init__.py | 82 +- .../ip_messaging/v2/service/channel/invite.py | 52 +- .../ip_messaging/v2/service/channel/member.py | 82 +- .../v2/service/channel/message.py | 82 +- .../v2/service/channel/webhook.py | 72 +- twilio/rest/ip_messaging/v2/service/role.py | 72 +- .../ip_messaging/v2/service/user/__init__.py | 92 +- .../v2/service/user/user_binding.py | 44 +- .../v2/service/user/user_channel.py | 64 +- twilio/rest/lookups/v1/phone_number.py | 16 +- twilio/rest/lookups/v2/phone_number.py | 14 +- .../v1/available_add_on/__init__.py | 30 +- .../available_add_on_extension.py | 30 +- .../v1/installed_add_on/__init__.py | 72 +- .../installed_add_on_extension.py | 50 +- .../installed_add_on_usage.py | 84 +- .../marketplace/v1/module_data_management.py | 36 +- .../marketplace/v1/referral_conversion.py | 25 +- .../v1/brand_registration/__init__.py | 54 +- .../brand_registration_otp.py | 4 + .../v1/brand_registration/brand_vetting.py | 38 +- twilio/rest/messaging/v1/deactivations.py | 14 +- twilio/rest/messaging/v1/domain_certs.py | 50 +- twilio/rest/messaging/v1/domain_config.py | 36 +- .../v1/domain_config_messaging_service.py | 18 +- twilio/rest/messaging/v1/external_campaign.py | 8 + .../v1/linkshortening_messaging_service.py | 14 +- ...ng_messaging_service_domain_association.py | 17 +- .../rest/messaging/v1/request_managed_cert.py | 16 +- twilio/rest/messaging/v1/service/__init__.py | 72 +- .../rest/messaging/v1/service/alpha_sender.py | 52 +- .../messaging/v1/service/channel_sender.py | 52 +- .../rest/messaging/v1/service/phone_number.py | 52 +- .../rest/messaging/v1/service/short_code.py | 52 +- .../messaging/v1/service/us_app_to_person.py | 72 +- .../v1/service/us_app_to_person_usecase.py | 4 + .../messaging/v1/tollfree_verification.py | 72 +- twilio/rest/messaging/v1/usecase.py | 4 + twilio/rest/microvisor/v1/account_config.py | 72 +- twilio/rest/microvisor/v1/account_secret.py | 72 +- twilio/rest/microvisor/v1/app/__init__.py | 44 +- twilio/rest/microvisor/v1/app/app_manifest.py | 17 +- twilio/rest/microvisor/v1/device/__init__.py | 50 +- .../microvisor/v1/device/device_config.py | 72 +- .../microvisor/v1/device/device_secret.py | 72 +- twilio/rest/monitor/v1/alert.py | 30 +- twilio/rest/monitor/v1/event.py | 30 +- twilio/rest/notify/v1/credential.py | 72 +- twilio/rest/notify/v1/service/__init__.py | 72 +- twilio/rest/notify/v1/service/binding.py | 52 +- twilio/rest/notify/v1/service/notification.py | 8 + twilio/rest/numbers/v1/__init__.py | 24 +- twilio/rest/numbers/v1/bulk_eligibility.py | 22 +- twilio/rest/numbers/v1/eligibility.py | 6 + twilio/rest/numbers/v1/porting_port_in.py | 36 +- .../v1/porting_port_in_phone_number.py | 32 +- twilio/rest/numbers/v1/porting_portability.py | 14 +- .../v1/porting_webhook_configuration.py | 6 + .../porting_webhook_configuration_delete.py | 15 +- .../v1/signing_request_configuration.py | 20 +- ...hook_configuration_fetch.py => webhook.py} | 30 +- .../v2/authorization_document/__init__.py | 52 +- .../dependent_hosted_number_order.py | 14 +- .../numbers/v2/bulk_hosted_number_order.py | 20 +- twilio/rest/numbers/v2/hosted_number_order.py | 72 +- .../regulatory_compliance/bundle/__init__.py | 72 +- .../bundle/bundle_copy.py | 22 +- .../bundle/evaluation.py | 34 +- .../bundle/item_assignment.py | 52 +- .../bundle/replace_items.py | 8 + .../v2/regulatory_compliance/end_user.py | 72 +- .../v2/regulatory_compliance/end_user_type.py | 30 +- .../v2/regulatory_compliance/regulation.py | 28 +- .../supporting_document.py | 72 +- .../supporting_document_type.py | 30 +- twilio/rest/oauth/v1/authorize.py | 4 + twilio/rest/oauth/v1/token.py | 8 + .../authorization_document/__init__.py | 58 +- .../dependent_hosted_number_order.py | 14 +- .../hosted_numbers/hosted_number_order.py | 72 +- .../marketplace/available_add_on/__init__.py | 30 +- .../available_add_on_extension.py | 30 +- .../marketplace/installed_add_on/__init__.py | 72 +- .../installed_add_on_extension.py | 50 +- twilio/rest/preview/sync/service/__init__.py | 72 +- .../preview/sync/service/document/__init__.py | 84 +- .../service/document/document_permission.py | 64 +- .../sync/service/sync_list/__init__.py | 52 +- .../sync/service/sync_list/sync_list_item.py | 74 +- .../service/sync_list/sync_list_permission.py | 64 +- .../preview/sync/service/sync_map/__init__.py | 52 +- .../sync/service/sync_map/sync_map_item.py | 74 +- .../service/sync_map/sync_map_permission.py | 64 +- twilio/rest/preview/wireless/command.py | 38 +- twilio/rest/preview/wireless/rate_plan.py | 72 +- twilio/rest/preview/wireless/sim/__init__.py | 50 +- twilio/rest/preview/wireless/sim/usage.py | 14 +- twilio/rest/preview_iam/PreviewIamBase.py | 28 +- twilio/rest/preview_iam/__init__.py | 68 +- .../preview_iam/organizations/__init__.py | 59 + .../rest/preview_iam/organizations/account.py | 436 ++++ .../organizations/role_assignment.py | 588 ++++++ twilio/rest/preview_iam/organizations/user.py | 1052 ++++++++++ twilio/rest/preview_iam/v1/authorize.py | 4 + twilio/rest/preview_iam/v1/token.py | 8 + twilio/rest/pricing/v1/messaging/country.py | 30 +- .../rest/pricing/v1/phone_number/country.py | 30 +- twilio/rest/pricing/v1/voice/country.py | 30 +- twilio/rest/pricing/v1/voice/number.py | 17 +- twilio/rest/pricing/v2/country.py | 30 +- twilio/rest/pricing/v2/number.py | 14 +- twilio/rest/pricing/v2/voice/country.py | 30 +- twilio/rest/pricing/v2/voice/number.py | 14 +- twilio/rest/proxy/v1/service/__init__.py | 72 +- twilio/rest/proxy/v1/service/phone_number.py | 72 +- .../rest/proxy/v1/service/session/__init__.py | 72 +- .../proxy/v1/service/session/interaction.py | 44 +- .../service/session/participant/__init__.py | 52 +- .../participant/message_interaction.py | 38 +- twilio/rest/proxy/v1/service/short_code.py | 72 +- twilio/rest/routes/v2/phone_number.py | 36 +- twilio/rest/routes/v2/sip_domain.py | 36 +- twilio/rest/routes/v2/trunk.py | 36 +- twilio/rest/serverless/v1/service/__init__.py | 72 +- .../serverless/v1/service/asset/__init__.py | 72 +- .../v1/service/asset/asset_version.py | 30 +- .../serverless/v1/service/build/__init__.py | 62 +- .../v1/service/build/build_status.py | 18 +- .../v1/service/environment/__init__.py | 52 +- .../v1/service/environment/deployment.py | 38 +- .../serverless/v1/service/environment/log.py | 30 +- .../v1/service/environment/variable.py | 72 +- .../v1/service/function/__init__.py | 72 +- .../function/function_version/__init__.py | 30 +- .../function_version_content.py | 17 +- twilio/rest/studio/v1/flow/__init__.py | 44 +- .../studio/v1/flow/engagement/__init__.py | 52 +- .../v1/flow/engagement/engagement_context.py | 17 +- .../v1/flow/engagement/step/__init__.py | 30 +- .../v1/flow/engagement/step/step_context.py | 17 +- .../rest/studio/v1/flow/execution/__init__.py | 72 +- .../v1/flow/execution/execution_context.py | 17 +- .../flow/execution/execution_step/__init__.py | 30 +- .../execution_step/execution_step_context.py | 17 +- twilio/rest/studio/v2/flow/__init__.py | 72 +- .../rest/studio/v2/flow/execution/__init__.py | 72 +- .../v2/flow/execution/execution_context.py | 17 +- .../flow/execution/execution_step/__init__.py | 30 +- .../execution_step/execution_step_context.py | 17 +- twilio/rest/studio/v2/flow/flow_revision.py | 30 +- twilio/rest/studio/v2/flow/flow_test_user.py | 36 +- twilio/rest/studio/v2/flow_validate.py | 8 + twilio/rest/supersim/v1/esim_profile.py | 38 +- twilio/rest/supersim/v1/fleet.py | 58 +- twilio/rest/supersim/v1/ip_command.py | 38 +- twilio/rest/supersim/v1/network.py | 30 +- .../v1/network_access_profile/__init__.py | 58 +- .../network_access_profile_network.py | 52 +- twilio/rest/supersim/v1/settings_update.py | 14 +- twilio/rest/supersim/v1/sim/__init__.py | 58 +- twilio/rest/supersim/v1/sim/billing_period.py | 14 +- twilio/rest/supersim/v1/sim/sim_ip_address.py | 14 +- twilio/rest/supersim/v1/sms_command.py | 38 +- twilio/rest/supersim/v1/usage_record.py | 14 +- twilio/rest/sync/v1/service/__init__.py | 72 +- .../rest/sync/v1/service/document/__init__.py | 84 +- .../service/document/document_permission.py | 64 +- .../sync/v1/service/sync_list/__init__.py | 72 +- .../v1/service/sync_list/sync_list_item.py | 74 +- .../service/sync_list/sync_list_permission.py | 64 +- .../rest/sync/v1/service/sync_map/__init__.py | 72 +- .../sync/v1/service/sync_map/sync_map_item.py | 74 +- .../service/sync_map/sync_map_permission.py | 64 +- .../sync/v1/service/sync_stream/__init__.py | 72 +- .../v1/service/sync_stream/stream_message.py | 8 + .../rest/taskrouter/v1/workspace/__init__.py | 72 +- .../rest/taskrouter/v1/workspace/activity.py | 72 +- twilio/rest/taskrouter/v1/workspace/event.py | 30 +- .../taskrouter/v1/workspace/task/__init__.py | 74 +- .../v1/workspace/task/reservation.py | 62 +- .../taskrouter/v1/workspace/task_channel.py | 72 +- .../v1/workspace/task_queue/__init__.py | 72 +- .../task_queue_bulk_real_time_statistics.py | 6 + .../task_queue_cumulative_statistics.py | 14 +- .../task_queue_real_time_statistics.py | 14 +- .../task_queue/task_queue_statistics.py | 14 +- .../task_queue/task_queues_statistics.py | 14 +- .../v1/workspace/worker/__init__.py | 74 +- .../v1/workspace/worker/reservation.py | 62 +- .../v1/workspace/worker/worker_channel.py | 50 +- .../v1/workspace/worker/worker_statistics.py | 14 +- .../worker/workers_cumulative_statistics.py | 14 +- .../worker/workers_real_time_statistics.py | 14 +- .../v1/workspace/worker/workers_statistics.py | 14 +- .../v1/workspace/workflow/__init__.py | 72 +- .../workflow_cumulative_statistics.py | 14 +- .../workflow/workflow_real_time_statistics.py | 14 +- .../workspace/workflow/workflow_statistics.py | 14 +- .../workspace_cumulative_statistics.py | 14 +- .../workspace_real_time_statistics.py | 14 +- .../v1/workspace/workspace_statistics.py | 14 +- twilio/rest/trunking/v1/trunk/__init__.py | 72 +- .../rest/trunking/v1/trunk/credential_list.py | 52 +- .../v1/trunk/ip_access_control_list.py | 52 +- .../rest/trunking/v1/trunk/origination_url.py | 72 +- twilio/rest/trunking/v1/trunk/phone_number.py | 52 +- twilio/rest/trunking/v1/trunk/recording.py | 36 +- .../rest/trusthub/v1/compliance_inquiries.py | 28 +- .../v1/compliance_registration_inquiries.py | 28 +- .../v1/compliance_tollfree_inquiries.py | 8 + .../trusthub/v1/customer_profiles/__init__.py | 72 +- ...er_profiles_channel_endpoint_assignment.py | 52 +- .../customer_profiles_entity_assignments.py | 52 +- .../customer_profiles_evaluations.py | 38 +- twilio/rest/trusthub/v1/end_user.py | 72 +- twilio/rest/trusthub/v1/end_user_type.py | 30 +- twilio/rest/trusthub/v1/policies.py | 30 +- .../rest/trusthub/v1/supporting_document.py | 72 +- .../trusthub/v1/supporting_document_type.py | 30 +- .../trusthub/v1/trust_products/__init__.py | 72 +- ...st_products_channel_endpoint_assignment.py | 52 +- .../trust_products_entity_assignments.py | 52 +- .../trust_products_evaluations.py | 38 +- twilio/rest/verify/v2/form.py | 17 +- twilio/rest/verify/v2/safelist.py | 38 +- twilio/rest/verify/v2/service/__init__.py | 72 +- twilio/rest/verify/v2/service/access_token.py | 24 +- .../rest/verify/v2/service/entity/__init__.py | 52 +- .../v2/service/entity/challenge/__init__.py | 58 +- .../service/entity/challenge/notification.py | 8 + .../rest/verify/v2/service/entity/factor.py | 64 +- .../verify/v2/service/entity/new_factor.py | 8 + .../v2/service/messaging_configuration.py | 72 +- .../verify/v2/service/rate_limit/__init__.py | 72 +- .../verify/v2/service/rate_limit/bucket.py | 72 +- twilio/rest/verify/v2/service/verification.py | 44 +- .../verify/v2/service/verification_check.py | 8 + twilio/rest/verify/v2/service/webhook.py | 72 +- twilio/rest/verify/v2/template.py | 14 +- twilio/rest/verify/v2/verification_attempt.py | 30 +- .../v2/verification_attempts_summary.py | 14 +- twilio/rest/video/v1/composition.py | 52 +- twilio/rest/video/v1/composition_hook.py | 72 +- twilio/rest/video/v1/composition_settings.py | 16 +- twilio/rest/video/v1/recording.py | 44 +- twilio/rest/video/v1/recording_settings.py | 16 +- twilio/rest/video/v1/room/__init__.py | 58 +- .../video/v1/room/participant/__init__.py | 50 +- .../video/v1/room/participant/anonymize.py | 16 +- .../v1/room/participant/published_track.py | 30 +- .../v1/room/participant/subscribe_rules.py | 12 + .../v1/room/participant/subscribed_track.py | 30 +- twilio/rest/video/v1/room/recording_rules.py | 12 + twilio/rest/video/v1/room/room_recording.py | 44 +- twilio/rest/voice/v1/archived_call.py | 15 +- twilio/rest/voice/v1/byoc_trunk.py | 72 +- .../voice/v1/connection_policy/__init__.py | 72 +- .../connection_policy_target.py | 72 +- .../bulk_country_update.py | 8 + .../dialing_permissions/country/__init__.py | 30 +- .../country/highrisk_special_prefix.py | 14 +- .../voice/v1/dialing_permissions/settings.py | 36 +- twilio/rest/voice/v1/ip_record.py | 72 +- twilio/rest/voice/v1/source_ip_mapping.py | 72 +- twilio/rest/wireless/v1/command.py | 52 +- twilio/rest/wireless/v1/rate_plan.py | 72 +- twilio/rest/wireless/v1/sim/__init__.py | 64 +- twilio/rest/wireless/v1/sim/data_session.py | 14 +- twilio/rest/wireless/v1/sim/usage_record.py | 14 +- twilio/rest/wireless/v1/usage_record.py | 14 +- 506 files changed, 20008 insertions(+), 5625 deletions(-) rename twilio/rest/iam/v1/{key.py => new_api_key.py} (84%) rename twilio/rest/numbers/v1/{porting_webhook_configuration_fetch.py => webhook.py} (77%) create mode 100644 twilio/rest/preview_iam/organizations/__init__.py create mode 100644 twilio/rest/preview_iam/organizations/account.py create mode 100644 twilio/rest/preview_iam/organizations/role_assignment.py create mode 100644 twilio/rest/preview_iam/organizations/user.py diff --git a/CHANGES.md b/CHANGES.md index aa224e00fd..3c59707068 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,13 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-12-12] Version 9.4.0 +-------------------------- +**Library - Feature** +- [PR #825](https://github.com/twilio/twilio-python/pull/825): Docs update and examples for organization api uptake and public oauth. Thanks to [@AsabuHere](https://github.com/AsabuHere)! +- [PR #815](https://github.com/twilio/twilio-python/pull/815): Organizations Api uptake for twilio-python. Thanks to [@AsabuHere](https://github.com/AsabuHere)! + + [2024-12-05] Version 9.3.8 -------------------------- **Api** diff --git a/examples/organization_api.py b/examples/organization_api.py index f95df03c72..180f18c20b 100644 --- a/examples/organization_api.py +++ b/examples/organization_api.py @@ -18,10 +18,12 @@ def example(): """ self.client = Client( account_sid=ACCOUNT_SID, - credential_provider= OrgsCredentialProvider(CLIENT_ID,CLIENT_SECRET) + credential_provider=OrgsCredentialProvider(CLIENT_ID, CLIENT_SECRET), ) - accounts = self.client.preview_iam.organization(organization_sid=ORGS_SID).accounts.stream() + accounts = self.client.preview_iam.organization( + organization_sid=ORGS_SID + ).accounts.stream() for record in accounts: print(record) diff --git a/examples/public_oauth.py b/examples/public_oauth.py index a01d04a6c1..527961f4e3 100644 --- a/examples/public_oauth.py +++ b/examples/public_oauth.py @@ -19,7 +19,7 @@ def example(): """ self.client = Client( account_sid=ACCOUNT_SID, - credential_provider= ClientCredentialProvider(CLIENT_ID,CLIENT_SECRET) + credential_provider=ClientCredentialProvider(CLIENT_ID, CLIENT_SECRET), ) msg = self.client.messages.create( diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 7874236a26..d727b2467e 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -24,6 +24,7 @@ from twilio.rest.events import Events from twilio.rest.flex_api import FlexApi from twilio.rest.frontline_api import FrontlineApi + from twilio.rest.preview_iam import PreviewIam from twilio.rest.iam import Iam from twilio.rest.insights import Insights from twilio.rest.intelligence import Intelligence @@ -96,7 +97,6 @@ def __init__( environment=None, edge=None, user_agent_extensions=None, - credential_provider=None, ): """ Initializes the Twilio Client @@ -122,7 +122,6 @@ def __init__( environment, edge, user_agent_extensions, - credential_provider, ) # Domains @@ -136,8 +135,8 @@ def __init__( self._events: Optional["Events"] = None self._flex_api: Optional["FlexApi"] = None self._frontline_api: Optional["FrontlineApi"] = None - self._iam: Optional["Iam"] = None self._preview_iam: Optional["PreviewIam"] = None + self._iam: Optional["Iam"] = None self._insights: Optional["Insights"] = None self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None @@ -150,7 +149,6 @@ def __init__( self._numbers: Optional["Numbers"] = None self._oauth: Optional["Oauth"] = None self._preview: Optional["Preview"] = None - self._preview_iam: Optional["PreviewIam"] = None self._pricing: Optional["Pricing"] = None self._proxy: Optional["Proxy"] = None self._routes: Optional["Routes"] = None @@ -296,6 +294,19 @@ def frontline_api(self) -> "FrontlineApi": self._frontline_api = FrontlineApi(self) return self._frontline_api + @property + def preview_iam(self) -> "PreviewIam": + """ + Access the PreviewIam Twilio Domain + + :returns: PreviewIam Twilio Domain + """ + if self._preview_iam is None: + from twilio.rest.preview_iam import PreviewIam + + self._preview_iam = PreviewIam(self) + return self._preview_iam + @property def iam(self) -> "Iam": """ @@ -400,19 +411,6 @@ def microvisor(self) -> "Microvisor": self._microvisor = Microvisor(self) return self._microvisor - @property - def preview_iam(self) -> "PreviewIam": - """ - Access the PreviewIam Twilio Domain - - :returns: PreviewIam Twilio Domain - """ - if self._preview_iam is None: - from twilio.rest.preview_iam import PreviewIam - - self._preview_iam = PreviewIam(self) - return self._preview_iam - @property def monitor(self) -> "Monitor": """ diff --git a/twilio/rest/accounts/v1/auth_token_promotion.py b/twilio/rest/accounts/v1/auth_token_promotion.py index 7ab6c3f39d..8580538a9b 100644 --- a/twilio/rest/accounts/v1/auth_token_promotion.py +++ b/twilio/rest/accounts/v1/auth_token_promotion.py @@ -106,12 +106,14 @@ def update(self) -> AuthTokenPromotionInstance: :returns: The updated AuthTokenPromotionInstance """ + data = values.of({}) + headers = values.of({}) + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthTokenPromotionInstance(self._version, payload) @@ -123,12 +125,14 @@ async def update_async(self) -> AuthTokenPromotionInstance: :returns: The updated AuthTokenPromotionInstance """ + data = values.of({}) + headers = values.of({}) + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthTokenPromotionInstance(self._version, payload) diff --git a/twilio/rest/accounts/v1/bulk_consents.py b/twilio/rest/accounts/v1/bulk_consents.py index 850d72162e..3e4564386b 100644 --- a/twilio/rest/accounts/v1/bulk_consents.py +++ b/twilio/rest/accounts/v1/bulk_consents.py @@ -69,6 +69,10 @@ def create(self, items: List[object]) -> BulkConsentsInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -91,6 +95,10 @@ async def create_async(self, items: List[object]) -> BulkConsentsInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/accounts/v1/bulk_contacts.py b/twilio/rest/accounts/v1/bulk_contacts.py index 0d68908e31..17b6da33f3 100644 --- a/twilio/rest/accounts/v1/bulk_contacts.py +++ b/twilio/rest/accounts/v1/bulk_contacts.py @@ -69,6 +69,10 @@ def create(self, items: List[object]) -> BulkContactsInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -91,6 +95,10 @@ async def create_async(self, items: List[object]) -> BulkContactsInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/accounts/v1/credential/aws.py b/twilio/rest/accounts/v1/credential/aws.py index 05d92755c4..ba5335accd 100644 --- a/twilio/rest/accounts/v1/credential/aws.py +++ b/twilio/rest/accounts/v1/credential/aws.py @@ -164,10 +164,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -176,9 +176,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AwsInstance: @@ -189,10 +191,11 @@ def fetch(self) -> AwsInstance: :returns: The fetched AwsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AwsInstance( self._version, @@ -208,9 +211,12 @@ async def fetch_async(self) -> AwsInstance: :returns: The fetched AwsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AwsInstance( @@ -227,16 +233,20 @@ def update(self, friendly_name: Union[str, object] = values.unset) -> AwsInstanc :returns: The updated AwsInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AwsInstance(self._version, payload, sid=self._solution["sid"]) @@ -251,16 +261,20 @@ async def update_async( :returns: The updated AwsInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AwsInstance(self._version, payload, sid=self._solution["sid"]) @@ -332,6 +346,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -363,6 +381,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -496,7 +518,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AwsPage(self._version, response) async def page_async( @@ -523,8 +551,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AwsPage(self._version, response) diff --git a/twilio/rest/accounts/v1/credential/public_key.py b/twilio/rest/accounts/v1/credential/public_key.py index ec2a1f8660..c2b4f9bbee 100644 --- a/twilio/rest/accounts/v1/credential/public_key.py +++ b/twilio/rest/accounts/v1/credential/public_key.py @@ -166,10 +166,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -178,9 +178,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> PublicKeyInstance: @@ -191,10 +193,11 @@ def fetch(self) -> PublicKeyInstance: :returns: The fetched PublicKeyInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PublicKeyInstance( self._version, @@ -210,9 +213,12 @@ async def fetch_async(self) -> PublicKeyInstance: :returns: The fetched PublicKeyInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PublicKeyInstance( @@ -231,16 +237,20 @@ def update( :returns: The updated PublicKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PublicKeyInstance(self._version, payload, sid=self._solution["sid"]) @@ -255,16 +265,20 @@ async def update_async( :returns: The updated PublicKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PublicKeyInstance(self._version, payload, sid=self._solution["sid"]) @@ -336,6 +350,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -367,6 +385,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -500,7 +522,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PublicKeyPage(self._version, response) async def page_async( @@ -527,8 +555,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PublicKeyPage(self._version, response) diff --git a/twilio/rest/accounts/v1/safelist.py b/twilio/rest/accounts/v1/safelist.py index 51f00fd8ca..0bbbb32420 100644 --- a/twilio/rest/accounts/v1/safelist.py +++ b/twilio/rest/accounts/v1/safelist.py @@ -71,6 +71,10 @@ def create(self, phone_number: str) -> SafelistInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -93,6 +97,10 @@ async def create_async(self, phone_number: str) -> SafelistInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -148,6 +156,8 @@ def fetch( """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + params = values.of( { "PhoneNumber": phone_number, @@ -171,6 +181,8 @@ async def fetch_async( """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + params = values.of( { "PhoneNumber": phone_number, diff --git a/twilio/rest/accounts/v1/secondary_auth_token.py b/twilio/rest/accounts/v1/secondary_auth_token.py index 3735dd876a..f5e2b5c1a3 100644 --- a/twilio/rest/accounts/v1/secondary_auth_token.py +++ b/twilio/rest/accounts/v1/secondary_auth_token.py @@ -152,10 +152,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -164,9 +164,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def __repr__(self) -> str: diff --git a/twilio/rest/api/v2010/account/__init__.py b/twilio/rest/api/v2010/account/__init__.py index dc0c53c9c0..7c7e2c1069 100644 --- a/twilio/rest/api/v2010/account/__init__.py +++ b/twilio/rest/api/v2010/account/__init__.py @@ -398,10 +398,11 @@ def fetch(self) -> AccountInstance: :returns: The fetched AccountInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AccountInstance( self._version, @@ -417,9 +418,12 @@ async def fetch_async(self) -> AccountInstance: :returns: The fetched AccountInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AccountInstance( @@ -441,17 +445,21 @@ def update( :returns: The updated AccountInstance """ + data = values.of( { "FriendlyName": friendly_name, "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountInstance(self._version, payload, sid=self._solution["sid"]) @@ -469,17 +477,21 @@ async def update_async( :returns: The updated AccountInstance """ + data = values.of( { "FriendlyName": friendly_name, "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountInstance(self._version, payload, sid=self._solution["sid"]) @@ -832,6 +844,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -856,6 +872,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1019,7 +1039,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AccountPage(self._version, response) async def page_async( @@ -1052,8 +1078,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AccountPage(self._version, response) diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index 36ee8f2231..b97628fe87 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -258,10 +258,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -270,9 +270,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AddressInstance: @@ -283,10 +285,11 @@ def fetch(self) -> AddressInstance: :returns: The fetched AddressInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AddressInstance( self._version, @@ -303,9 +306,12 @@ async def fetch_async(self) -> AddressInstance: :returns: The fetched AddressInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AddressInstance( @@ -342,6 +348,7 @@ def update( :returns: The updated AddressInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -355,11 +362,14 @@ def update( "StreetSecondary": street_secondary, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressInstance( @@ -396,6 +406,7 @@ async def update_async( :returns: The updated AddressInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -409,11 +420,14 @@ async def update_async( "StreetSecondary": street_secondary, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressInstance( @@ -531,6 +545,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -585,6 +603,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -769,7 +791,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AddressPage(self._version, response, self._solution) async def page_async( @@ -805,8 +833,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AddressPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/address/dependent_phone_number.py b/twilio/rest/api/v2010/account/address/dependent_phone_number.py index 738f9baffd..504e69bc92 100644 --- a/twilio/rest/api/v2010/account/address/dependent_phone_number.py +++ b/twilio/rest/api/v2010/account/address/dependent_phone_number.py @@ -299,7 +299,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DependentPhoneNumberPage(self._version, response, self._solution) async def page_async( @@ -326,8 +332,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DependentPhoneNumberPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/application.py b/twilio/rest/api/v2010/account/application.py index d1e50c5f04..555ab72b4a 100644 --- a/twilio/rest/api/v2010/account/application.py +++ b/twilio/rest/api/v2010/account/application.py @@ -306,10 +306,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -318,9 +318,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ApplicationInstance: @@ -331,10 +333,11 @@ def fetch(self) -> ApplicationInstance: :returns: The fetched ApplicationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ApplicationInstance( self._version, @@ -351,9 +354,12 @@ async def fetch_async(self) -> ApplicationInstance: :returns: The fetched ApplicationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ApplicationInstance( @@ -404,6 +410,7 @@ def update( :returns: The updated ApplicationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -428,11 +435,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ApplicationInstance( @@ -483,6 +493,7 @@ async def update_async( :returns: The updated ApplicationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -507,11 +518,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ApplicationInstance( @@ -638,6 +652,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -714,6 +732,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -864,7 +886,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ApplicationPage(self._version, response, self._solution) async def page_async( @@ -894,8 +922,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ApplicationPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/authorized_connect_app.py b/twilio/rest/api/v2010/account/authorized_connect_app.py index 9359545cdb..cceb694c10 100644 --- a/twilio/rest/api/v2010/account/authorized_connect_app.py +++ b/twilio/rest/api/v2010/account/authorized_connect_app.py @@ -145,10 +145,11 @@ def fetch(self) -> AuthorizedConnectAppInstance: :returns: The fetched AuthorizedConnectAppInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AuthorizedConnectAppInstance( self._version, @@ -165,9 +166,12 @@ async def fetch_async(self) -> AuthorizedConnectAppInstance: :returns: The fetched AuthorizedConnectAppInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AuthorizedConnectAppInstance( @@ -355,7 +359,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AuthorizedConnectAppPage(self._version, response, self._solution) async def page_async( @@ -382,8 +392,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AuthorizedConnectAppPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py b/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py index 14fcfc28df..fc2a6f0600 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/__init__.py @@ -204,10 +204,11 @@ def fetch(self) -> AvailablePhoneNumberCountryInstance: :returns: The fetched AvailablePhoneNumberCountryInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AvailablePhoneNumberCountryInstance( self._version, @@ -224,9 +225,12 @@ async def fetch_async(self) -> AvailablePhoneNumberCountryInstance: :returns: The fetched AvailablePhoneNumberCountryInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AvailablePhoneNumberCountryInstance( @@ -509,7 +513,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AvailablePhoneNumberCountryPage(self._version, response, self._solution) async def page_async( @@ -536,8 +546,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AvailablePhoneNumberCountryPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/local.py b/twilio/rest/api/v2010/account/available_phone_number_country/local.py index 43118d9f72..4f0b2e7991 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/local.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/local.py @@ -529,7 +529,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return LocalPage(self._version, response, self._solution) async def page_async( @@ -616,8 +622,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return LocalPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py index ee94aa944e..5695c917c3 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/machine_to_machine.py @@ -529,7 +529,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MachineToMachinePage(self._version, response, self._solution) async def page_async( @@ -616,8 +622,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MachineToMachinePage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py index 622d2b8597..2382155ee5 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/mobile.py @@ -529,7 +529,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MobilePage(self._version, response, self._solution) async def page_async( @@ -616,8 +622,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MobilePage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/national.py b/twilio/rest/api/v2010/account/available_phone_number_country/national.py index d0f3a63dda..a5e926425a 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/national.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/national.py @@ -529,7 +529,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return NationalPage(self._version, response, self._solution) async def page_async( @@ -616,8 +622,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return NationalPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py index 7b5b9b11c8..3a9c02bab4 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/shared_cost.py @@ -529,7 +529,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SharedCostPage(self._version, response, self._solution) async def page_async( @@ -616,8 +622,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SharedCostPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py index 4368018001..de4a2d9885 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/toll_free.py @@ -529,7 +529,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TollFreePage(self._version, response, self._solution) async def page_async( @@ -616,8 +622,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TollFreePage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py index e0615d5a6e..9ebfae5396 100644 --- a/twilio/rest/api/v2010/account/available_phone_number_country/voip.py +++ b/twilio/rest/api/v2010/account/available_phone_number_country/voip.py @@ -529,7 +529,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return VoipPage(self._version, response, self._solution) async def page_async( @@ -616,8 +622,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return VoipPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/balance.py b/twilio/rest/api/v2010/account/balance.py index 97c7b33035..66bb91e9f9 100644 --- a/twilio/rest/api/v2010/account/balance.py +++ b/twilio/rest/api/v2010/account/balance.py @@ -75,6 +75,8 @@ def fetch(self) -> BalanceInstance: """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BalanceInstance( @@ -90,6 +92,8 @@ async def fetch_async(self) -> BalanceInstance: """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( method="GET", uri=self._uri, headers=headers ) diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index ff9e98b09f..b09550c326 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -373,10 +373,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -385,9 +385,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CallInstance: @@ -398,10 +400,11 @@ def fetch(self) -> CallInstance: :returns: The fetched CallInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CallInstance( self._version, @@ -418,9 +421,12 @@ async def fetch_async(self) -> CallInstance: :returns: The fetched CallInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CallInstance( @@ -457,6 +463,7 @@ def update( :returns: The updated CallInstance """ + data = values.of( { "Url": url, @@ -470,11 +477,14 @@ def update( "TimeLimit": time_limit, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CallInstance( @@ -511,6 +521,7 @@ async def update_async( :returns: The updated CallInstance """ + data = values.of( { "Url": url, @@ -524,11 +535,14 @@ async def update_async( "TimeLimit": time_limit, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CallInstance( @@ -831,6 +845,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -964,6 +982,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1253,7 +1275,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CallPage(self._version, response, self._solution) async def page_async( @@ -1310,8 +1338,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CallPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/call/event.py b/twilio/rest/api/v2010/account/call/event.py index 7993dd00a0..80eb8aa8ba 100644 --- a/twilio/rest/api/v2010/account/call/event.py +++ b/twilio/rest/api/v2010/account/call/event.py @@ -223,7 +223,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EventPage(self._version, response, self._solution) async def page_async( @@ -250,8 +256,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EventPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/call/notification.py b/twilio/rest/api/v2010/account/call/notification.py index 44291b8448..fd9e8c0d00 100644 --- a/twilio/rest/api/v2010/account/call/notification.py +++ b/twilio/rest/api/v2010/account/call/notification.py @@ -162,10 +162,11 @@ def fetch(self) -> NotificationInstance: :returns: The fetched NotificationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return NotificationInstance( self._version, @@ -183,9 +184,12 @@ async def fetch_async(self) -> NotificationInstance: :returns: The fetched NotificationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return NotificationInstance( @@ -445,7 +449,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return NotificationPage(self._version, response, self._solution) async def page_async( @@ -484,8 +494,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return NotificationPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/call/payment.py b/twilio/rest/api/v2010/account/call/payment.py index 00f76be814..0f91860987 100644 --- a/twilio/rest/api/v2010/account/call/payment.py +++ b/twilio/rest/api/v2010/account/call/payment.py @@ -203,6 +203,7 @@ def update( :returns: The updated PaymentInstance """ + data = values.of( { "IdempotencyKey": idempotency_key, @@ -211,11 +212,14 @@ def update( "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PaymentInstance( @@ -243,6 +247,7 @@ async def update_async( :returns: The updated PaymentInstance """ + data = values.of( { "IdempotencyKey": idempotency_key, @@ -251,11 +256,14 @@ async def update_async( "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PaymentInstance( @@ -364,6 +372,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -441,6 +453,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/api/v2010/account/call/recording.py b/twilio/rest/api/v2010/account/call/recording.py index 71158a2fe8..5b93ec6c95 100644 --- a/twilio/rest/api/v2010/account/call/recording.py +++ b/twilio/rest/api/v2010/account/call/recording.py @@ -237,10 +237,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -249,9 +249,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RecordingInstance: @@ -262,10 +264,11 @@ def fetch(self) -> RecordingInstance: :returns: The fetched RecordingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RecordingInstance( self._version, @@ -283,9 +286,12 @@ async def fetch_async(self) -> RecordingInstance: :returns: The fetched RecordingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RecordingInstance( @@ -309,17 +315,21 @@ def update( :returns: The updated RecordingInstance """ + data = values.of( { "Status": status, "PauseBehavior": pause_behavior, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingInstance( @@ -343,17 +353,21 @@ async def update_async( :returns: The updated RecordingInstance """ + data = values.of( { "Status": status, "PauseBehavior": pause_behavior, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingInstance( @@ -456,6 +470,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -503,6 +521,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -690,7 +712,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RecordingPage(self._version, response, self._solution) async def page_async( @@ -726,8 +754,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RecordingPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/call/siprec.py b/twilio/rest/api/v2010/account/call/siprec.py index 28a0734e19..d808331c64 100644 --- a/twilio/rest/api/v2010/account/call/siprec.py +++ b/twilio/rest/api/v2010/account/call/siprec.py @@ -156,16 +156,20 @@ def update(self, status: "SiprecInstance.UpdateStatus") -> SiprecInstance: :returns: The updated SiprecInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SiprecInstance( @@ -186,16 +190,20 @@ async def update_async( :returns: The updated SiprecInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SiprecInstance( @@ -863,6 +871,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1499,6 +1511,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/api/v2010/account/call/stream.py b/twilio/rest/api/v2010/account/call/stream.py index b3fa197bf8..1a506e6684 100644 --- a/twilio/rest/api/v2010/account/call/stream.py +++ b/twilio/rest/api/v2010/account/call/stream.py @@ -158,16 +158,20 @@ def update(self, status: "StreamInstance.UpdateStatus") -> StreamInstance: :returns: The updated StreamInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return StreamInstance( @@ -188,16 +192,20 @@ async def update_async( :returns: The updated StreamInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return StreamInstance( @@ -865,6 +873,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1501,6 +1513,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/api/v2010/account/call/transcription.py b/twilio/rest/api/v2010/account/call/transcription.py index c649b8ad1b..f415928cc8 100644 --- a/twilio/rest/api/v2010/account/call/transcription.py +++ b/twilio/rest/api/v2010/account/call/transcription.py @@ -162,16 +162,20 @@ def update( :returns: The updated TranscriptionInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TranscriptionInstance( @@ -192,16 +196,20 @@ async def update_async( :returns: The updated TranscriptionInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TranscriptionInstance( @@ -306,6 +314,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -377,6 +389,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/api/v2010/account/call/user_defined_message.py b/twilio/rest/api/v2010/account/call/user_defined_message.py index 4b43383711..bc66f8b8e1 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message.py @@ -100,6 +100,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -131,6 +135,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py b/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py index 677042bd7c..66923d4b79 100644 --- a/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py +++ b/twilio/rest/api/v2010/account/call/user_defined_message_subscription.py @@ -132,10 +132,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -144,9 +144,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def __repr__(self) -> str: @@ -208,6 +210,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -244,6 +250,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index 074ce8a587..1ff3289a6c 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -230,10 +230,11 @@ def fetch(self) -> ConferenceInstance: :returns: The fetched ConferenceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ConferenceInstance( self._version, @@ -250,9 +251,12 @@ async def fetch_async(self) -> ConferenceInstance: :returns: The fetched ConferenceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ConferenceInstance( @@ -277,6 +281,7 @@ def update( :returns: The updated ConferenceInstance """ + data = values.of( { "Status": status, @@ -284,11 +289,14 @@ def update( "AnnounceMethod": announce_method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConferenceInstance( @@ -313,6 +321,7 @@ async def update_async( :returns: The updated ConferenceInstance """ + data = values.of( { "Status": status, @@ -320,11 +329,14 @@ async def update_async( "AnnounceMethod": announce_method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConferenceInstance( @@ -660,7 +672,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConferencePage(self._version, response, self._solution) async def page_async( @@ -711,8 +729,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConferencePage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index 3706cd24fa..a93f9f9adc 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -282,10 +282,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -294,9 +294,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ParticipantInstance: @@ -307,10 +309,11 @@ def fetch(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ParticipantInstance( self._version, @@ -328,9 +331,12 @@ async def fetch_async(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ParticipantInstance( @@ -374,6 +380,7 @@ def update( :returns: The updated ParticipantInstance """ + data = values.of( { "Muted": serialize.boolean_to_string(muted), @@ -392,11 +399,14 @@ def update( "CallSidToCoach": call_sid_to_coach, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( @@ -440,6 +450,7 @@ async def update_async( :returns: The updated ParticipantInstance """ + data = values.of( { "Muted": serialize.boolean_to_string(muted), @@ -458,11 +469,14 @@ async def update_async( "CallSidToCoach": call_sid_to_coach, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( @@ -703,6 +717,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -888,6 +906,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1069,7 +1091,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ParticipantPage(self._version, response, self._solution) async def page_async( @@ -1105,8 +1133,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ParticipantPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/conference/recording.py b/twilio/rest/api/v2010/account/conference/recording.py index dfb1d406ee..12008ed37f 100644 --- a/twilio/rest/api/v2010/account/conference/recording.py +++ b/twilio/rest/api/v2010/account/conference/recording.py @@ -235,10 +235,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -247,9 +247,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RecordingInstance: @@ -260,10 +262,11 @@ def fetch(self) -> RecordingInstance: :returns: The fetched RecordingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RecordingInstance( self._version, @@ -281,9 +284,12 @@ async def fetch_async(self) -> RecordingInstance: :returns: The fetched RecordingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RecordingInstance( @@ -307,17 +313,21 @@ def update( :returns: The updated RecordingInstance """ + data = values.of( { "Status": status, "PauseBehavior": pause_behavior, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingInstance( @@ -341,17 +351,21 @@ async def update_async( :returns: The updated RecordingInstance """ + data = values.of( { "Status": status, "PauseBehavior": pause_behavior, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingInstance( @@ -594,7 +608,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RecordingPage(self._version, response, self._solution) async def page_async( @@ -630,8 +650,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RecordingPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/connect_app.py b/twilio/rest/api/v2010/account/connect_app.py index 722e4e9b3e..689a2b184a 100644 --- a/twilio/rest/api/v2010/account/connect_app.py +++ b/twilio/rest/api/v2010/account/connect_app.py @@ -242,10 +242,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -254,9 +254,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ConnectAppInstance: @@ -267,10 +269,11 @@ def fetch(self) -> ConnectAppInstance: :returns: The fetched ConnectAppInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ConnectAppInstance( self._version, @@ -287,9 +290,12 @@ async def fetch_async(self) -> ConnectAppInstance: :returns: The fetched ConnectAppInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ConnectAppInstance( @@ -326,6 +332,7 @@ def update( :returns: The updated ConnectAppInstance """ + data = values.of( { "AuthorizeRedirectUrl": authorize_redirect_url, @@ -338,11 +345,14 @@ def update( "Permissions": serialize.map(permissions, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectAppInstance( @@ -379,6 +389,7 @@ async def update_async( :returns: The updated ConnectAppInstance """ + data = values.of( { "AuthorizeRedirectUrl": authorize_redirect_url, @@ -391,11 +402,14 @@ async def update_async( "Permissions": serialize.map(permissions, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectAppInstance( @@ -581,7 +595,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConnectAppPage(self._version, response, self._solution) async def page_async( @@ -608,8 +628,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConnectAppPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py index d1001a7cae..c7c1eebcfd 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/__init__.py @@ -424,10 +424,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -436,9 +436,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> IncomingPhoneNumberInstance: @@ -449,10 +451,11 @@ def fetch(self) -> IncomingPhoneNumberInstance: :returns: The fetched IncomingPhoneNumberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return IncomingPhoneNumberInstance( self._version, @@ -469,9 +472,12 @@ async def fetch_async(self) -> IncomingPhoneNumberInstance: :returns: The fetched IncomingPhoneNumberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return IncomingPhoneNumberInstance( @@ -540,6 +546,7 @@ def update( :returns: The updated IncomingPhoneNumberInstance """ + data = values.of( { "AccountSid": account_sid, @@ -569,11 +576,14 @@ def update( "BundleSid": bundle_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IncomingPhoneNumberInstance( @@ -642,6 +652,7 @@ async def update_async( :returns: The updated IncomingPhoneNumberInstance """ + data = values.of( { "AccountSid": account_sid, @@ -671,11 +682,14 @@ async def update_async( "BundleSid": bundle_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IncomingPhoneNumberInstance( @@ -847,6 +861,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -949,6 +967,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1148,7 +1170,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return IncomingPhoneNumberPage(self._version, response, self._solution) async def page_async( @@ -1187,8 +1215,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return IncomingPhoneNumberPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py index a6ced82856..52fe2a52af 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/__init__.py @@ -177,10 +177,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -189,9 +189,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AssignedAddOnInstance: @@ -202,10 +204,11 @@ def fetch(self) -> AssignedAddOnInstance: :returns: The fetched AssignedAddOnInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AssignedAddOnInstance( self._version, @@ -223,9 +226,12 @@ async def fetch_async(self) -> AssignedAddOnInstance: :returns: The fetched AssignedAddOnInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AssignedAddOnInstance( @@ -322,6 +328,10 @@ def create(self, installed_add_on_sid: str) -> AssignedAddOnInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -349,6 +359,10 @@ async def create_async(self, installed_add_on_sid: str) -> AssignedAddOnInstance ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -487,7 +501,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AssignedAddOnPage(self._version, response, self._solution) async def page_async( @@ -514,8 +534,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AssignedAddOnPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py index 18504cafd8..1a7d9cdc34 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.py @@ -149,10 +149,11 @@ def fetch(self) -> AssignedAddOnExtensionInstance: :returns: The fetched AssignedAddOnExtensionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AssignedAddOnExtensionInstance( self._version, @@ -171,9 +172,12 @@ async def fetch_async(self) -> AssignedAddOnExtensionInstance: :returns: The fetched AssignedAddOnExtensionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AssignedAddOnExtensionInstance( @@ -377,7 +381,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AssignedAddOnExtensionPage(self._version, response, self._solution) async def page_async( @@ -404,8 +414,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AssignedAddOnExtensionPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/local.py b/twilio/rest/api/v2010/account/incoming_phone_number/local.py index ca7baa8552..af67fb0a2d 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/local.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/local.py @@ -281,6 +281,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -378,6 +382,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -577,7 +585,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return LocalPage(self._version, response, self._solution) async def page_async( @@ -616,8 +630,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return LocalPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py index 830897b178..27fc8a0e9f 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/mobile.py @@ -283,6 +283,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -382,6 +386,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -581,7 +589,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MobilePage(self._version, response, self._solution) async def page_async( @@ -620,8 +634,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MobilePage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py index 8625e318c6..86290ff9b2 100644 --- a/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py +++ b/twilio/rest/api/v2010/account/incoming_phone_number/toll_free.py @@ -283,6 +283,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -382,6 +386,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -581,7 +589,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TollFreePage(self._version, response, self._solution) async def page_async( @@ -620,8 +634,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TollFreePage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/key.py b/twilio/rest/api/v2010/account/key.py index 68a9feb0e1..8b18dbd4ba 100644 --- a/twilio/rest/api/v2010/account/key.py +++ b/twilio/rest/api/v2010/account/key.py @@ -168,10 +168,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -180,9 +180,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> KeyInstance: @@ -193,10 +195,11 @@ def fetch(self) -> KeyInstance: :returns: The fetched KeyInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return KeyInstance( self._version, @@ -213,9 +216,12 @@ async def fetch_async(self) -> KeyInstance: :returns: The fetched KeyInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return KeyInstance( @@ -233,16 +239,20 @@ def update(self, friendly_name: Union[str, object] = values.unset) -> KeyInstanc :returns: The updated KeyInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return KeyInstance( @@ -262,16 +272,20 @@ async def update_async( :returns: The updated KeyInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return KeyInstance( @@ -457,7 +471,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return KeyPage(self._version, response, self._solution) async def page_async( @@ -484,8 +504,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return KeyPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index 1b6d3aea81..f41c1c5ad7 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -275,10 +275,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -287,9 +287,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> MessageInstance: @@ -300,10 +302,11 @@ def fetch(self) -> MessageInstance: :returns: The fetched MessageInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MessageInstance( self._version, @@ -320,9 +323,12 @@ async def fetch_async(self) -> MessageInstance: :returns: The fetched MessageInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MessageInstance( @@ -345,17 +351,21 @@ def update( :returns: The updated MessageInstance """ + data = values.of( { "Body": body, "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -378,17 +388,21 @@ async def update_async( :returns: The updated MessageInstance """ + data = values.of( { "Body": body, "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -562,6 +576,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -659,6 +677,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -873,7 +895,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MessagePage(self._version, response, self._solution) async def page_async( @@ -915,8 +943,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MessagePage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/message/feedback.py b/twilio/rest/api/v2010/account/message/feedback.py index 797c9a7331..cda2de2ff6 100644 --- a/twilio/rest/api/v2010/account/message/feedback.py +++ b/twilio/rest/api/v2010/account/message/feedback.py @@ -113,6 +113,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -142,6 +146,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/api/v2010/account/message/media.py b/twilio/rest/api/v2010/account/message/media.py index 4068d0c35d..b5d2926d12 100644 --- a/twilio/rest/api/v2010/account/message/media.py +++ b/twilio/rest/api/v2010/account/message/media.py @@ -157,10 +157,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -169,9 +169,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> MediaInstance: @@ -182,10 +184,11 @@ def fetch(self) -> MediaInstance: :returns: The fetched MediaInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MediaInstance( self._version, @@ -203,9 +206,12 @@ async def fetch_async(self) -> MediaInstance: :returns: The fetched MediaInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MediaInstance( @@ -448,7 +454,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MediaPage(self._version, response, self._solution) async def page_async( @@ -484,8 +496,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MediaPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/new_key.py b/twilio/rest/api/v2010/account/new_key.py index fcefed5b62..ba811ec14f 100644 --- a/twilio/rest/api/v2010/account/new_key.py +++ b/twilio/rest/api/v2010/account/new_key.py @@ -93,6 +93,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -119,6 +123,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/api/v2010/account/new_signing_key.py b/twilio/rest/api/v2010/account/new_signing_key.py index bb9b0f2e2d..95341d31cb 100644 --- a/twilio/rest/api/v2010/account/new_signing_key.py +++ b/twilio/rest/api/v2010/account/new_signing_key.py @@ -93,6 +93,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -119,6 +123,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/api/v2010/account/notification.py b/twilio/rest/api/v2010/account/notification.py index 0a2e13da35..cd35efeabf 100644 --- a/twilio/rest/api/v2010/account/notification.py +++ b/twilio/rest/api/v2010/account/notification.py @@ -155,10 +155,11 @@ def fetch(self) -> NotificationInstance: :returns: The fetched NotificationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return NotificationInstance( self._version, @@ -175,9 +176,12 @@ async def fetch_async(self) -> NotificationInstance: :returns: The fetched NotificationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return NotificationInstance( @@ -429,7 +433,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return NotificationPage(self._version, response, self._solution) async def page_async( @@ -468,8 +478,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return NotificationPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/outgoing_caller_id.py b/twilio/rest/api/v2010/account/outgoing_caller_id.py index 65ddfa1cdb..eeb9954c75 100644 --- a/twilio/rest/api/v2010/account/outgoing_caller_id.py +++ b/twilio/rest/api/v2010/account/outgoing_caller_id.py @@ -178,10 +178,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -190,9 +190,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> OutgoingCallerIdInstance: @@ -203,10 +205,11 @@ def fetch(self) -> OutgoingCallerIdInstance: :returns: The fetched OutgoingCallerIdInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return OutgoingCallerIdInstance( self._version, @@ -223,9 +226,12 @@ async def fetch_async(self) -> OutgoingCallerIdInstance: :returns: The fetched OutgoingCallerIdInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return OutgoingCallerIdInstance( @@ -245,16 +251,20 @@ def update( :returns: The updated OutgoingCallerIdInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return OutgoingCallerIdInstance( @@ -274,16 +284,20 @@ async def update_async( :returns: The updated OutgoingCallerIdInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return OutgoingCallerIdInstance( @@ -505,7 +519,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return OutgoingCallerIdPage(self._version, response, self._solution) async def page_async( @@ -538,8 +558,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return OutgoingCallerIdPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/queue/__init__.py b/twilio/rest/api/v2010/account/queue/__init__.py index 4031ba8196..e76fda1259 100644 --- a/twilio/rest/api/v2010/account/queue/__init__.py +++ b/twilio/rest/api/v2010/account/queue/__init__.py @@ -202,10 +202,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -214,9 +214,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> QueueInstance: @@ -227,10 +229,11 @@ def fetch(self) -> QueueInstance: :returns: The fetched QueueInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return QueueInstance( self._version, @@ -247,9 +250,12 @@ async def fetch_async(self) -> QueueInstance: :returns: The fetched QueueInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return QueueInstance( @@ -272,17 +278,21 @@ def update( :returns: The updated QueueInstance """ + data = values.of( { "FriendlyName": friendly_name, "MaxSize": max_size, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return QueueInstance( @@ -305,17 +315,21 @@ async def update_async( :returns: The updated QueueInstance """ + data = values.of( { "FriendlyName": friendly_name, "MaxSize": max_size, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return QueueInstance( @@ -407,6 +421,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -435,6 +453,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -570,7 +592,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return QueuePage(self._version, response, self._solution) async def page_async( @@ -597,8 +625,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return QueuePage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/queue/member.py b/twilio/rest/api/v2010/account/queue/member.py index bf092ff283..30ff4abbc7 100644 --- a/twilio/rest/api/v2010/account/queue/member.py +++ b/twilio/rest/api/v2010/account/queue/member.py @@ -170,10 +170,11 @@ def fetch(self) -> MemberInstance: :returns: The fetched MemberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MemberInstance( self._version, @@ -191,9 +192,12 @@ async def fetch_async(self) -> MemberInstance: :returns: The fetched MemberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MemberInstance( @@ -215,17 +219,21 @@ def update( :returns: The updated MemberInstance """ + data = values.of( { "Url": url, "Method": method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( @@ -247,17 +255,21 @@ async def update_async( :returns: The updated MemberInstance """ + data = values.of( { "Url": url, "Method": method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( @@ -451,7 +463,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MemberPage(self._version, response, self._solution) async def page_async( @@ -478,8 +496,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MemberPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/recording/__init__.py b/twilio/rest/api/v2010/account/recording/__init__.py index 1766600ec3..ab5c1c8b7b 100644 --- a/twilio/rest/api/v2010/account/recording/__init__.py +++ b/twilio/rest/api/v2010/account/recording/__init__.py @@ -228,10 +228,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -240,9 +240,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch( @@ -262,7 +264,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return RecordingInstance( self._version, @@ -288,8 +296,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RecordingInstance( @@ -595,7 +607,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RecordingPage(self._version, response, self._solution) async def page_async( @@ -640,8 +658,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RecordingPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py b/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py index af1e75f4c6..95296f3cc4 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/__init__.py @@ -190,10 +190,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -202,9 +202,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AddOnResultInstance: @@ -215,10 +217,11 @@ def fetch(self) -> AddOnResultInstance: :returns: The fetched AddOnResultInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AddOnResultInstance( self._version, @@ -236,9 +239,12 @@ async def fetch_async(self) -> AddOnResultInstance: :returns: The fetched AddOnResultInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AddOnResultInstance( @@ -446,7 +452,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AddOnResultPage(self._version, response, self._solution) async def page_async( @@ -473,8 +485,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AddOnResultPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py b/twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py index 9008f6a688..08e6ea2109 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/payload/__init__.py @@ -189,10 +189,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -201,9 +201,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> PayloadInstance: @@ -214,10 +216,11 @@ def fetch(self) -> PayloadInstance: :returns: The fetched PayloadInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PayloadInstance( self._version, @@ -236,9 +239,12 @@ async def fetch_async(self) -> PayloadInstance: :returns: The fetched PayloadInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PayloadInstance( @@ -457,7 +463,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PayloadPage(self._version, response, self._solution) async def page_async( @@ -484,8 +496,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PayloadPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/recording/add_on_result/payload/data.py b/twilio/rest/api/v2010/account/recording/add_on_result/payload/data.py index 1cc931a693..48567badca 100644 --- a/twilio/rest/api/v2010/account/recording/add_on_result/payload/data.py +++ b/twilio/rest/api/v2010/account/recording/add_on_result/payload/data.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -131,10 +132,11 @@ def fetch(self) -> DataInstance: :returns: The fetched DataInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DataInstance( self._version, @@ -153,9 +155,12 @@ async def fetch_async(self) -> DataInstance: :returns: The fetched DataInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DataInstance( diff --git a/twilio/rest/api/v2010/account/recording/transcription.py b/twilio/rest/api/v2010/account/recording/transcription.py index bb6e0e405a..472f5b2bff 100644 --- a/twilio/rest/api/v2010/account/recording/transcription.py +++ b/twilio/rest/api/v2010/account/recording/transcription.py @@ -175,10 +175,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -187,9 +187,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TranscriptionInstance: @@ -200,10 +202,11 @@ def fetch(self) -> TranscriptionInstance: :returns: The fetched TranscriptionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TranscriptionInstance( self._version, @@ -221,9 +224,12 @@ async def fetch_async(self) -> TranscriptionInstance: :returns: The fetched TranscriptionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TranscriptionInstance( @@ -417,7 +423,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TranscriptionPage(self._version, response, self._solution) async def page_async( @@ -444,8 +456,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TranscriptionPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/short_code.py b/twilio/rest/api/v2010/account/short_code.py index 2af049a20b..eae35c4aa5 100644 --- a/twilio/rest/api/v2010/account/short_code.py +++ b/twilio/rest/api/v2010/account/short_code.py @@ -203,10 +203,11 @@ def fetch(self) -> ShortCodeInstance: :returns: The fetched ShortCodeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ShortCodeInstance( self._version, @@ -223,9 +224,12 @@ async def fetch_async(self) -> ShortCodeInstance: :returns: The fetched ShortCodeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ShortCodeInstance( @@ -256,6 +260,7 @@ def update( :returns: The updated ShortCodeInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -266,11 +271,14 @@ def update( "SmsFallbackMethod": sms_fallback_method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( @@ -301,6 +309,7 @@ async def update_async( :returns: The updated ShortCodeInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -311,11 +320,14 @@ async def update_async( "SmsFallbackMethod": sms_fallback_method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( @@ -537,7 +549,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ShortCodePage(self._version, response, self._solution) async def page_async( @@ -570,8 +588,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ShortCodePage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/signing_key.py b/twilio/rest/api/v2010/account/signing_key.py index 6ddc7b92b0..8e33f218f5 100644 --- a/twilio/rest/api/v2010/account/signing_key.py +++ b/twilio/rest/api/v2010/account/signing_key.py @@ -172,10 +172,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -184,9 +184,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SigningKeyInstance: @@ -197,10 +199,11 @@ def fetch(self) -> SigningKeyInstance: :returns: The fetched SigningKeyInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SigningKeyInstance( self._version, @@ -217,9 +220,12 @@ async def fetch_async(self) -> SigningKeyInstance: :returns: The fetched SigningKeyInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SigningKeyInstance( @@ -239,16 +245,20 @@ def update( :returns: The updated SigningKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SigningKeyInstance( @@ -268,16 +278,20 @@ async def update_async( :returns: The updated SigningKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SigningKeyInstance( @@ -463,7 +477,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SigningKeyPage(self._version, response, self._solution) async def page_async( @@ -490,8 +510,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SigningKeyPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py index 30bb7094e7..d1be747b6d 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/__init__.py @@ -186,10 +186,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -198,9 +198,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CredentialListInstance: @@ -211,10 +213,11 @@ def fetch(self) -> CredentialListInstance: :returns: The fetched CredentialListInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CredentialListInstance( self._version, @@ -231,9 +234,12 @@ async def fetch_async(self) -> CredentialListInstance: :returns: The fetched CredentialListInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CredentialListInstance( @@ -251,16 +257,20 @@ def update(self, friendly_name: str) -> CredentialListInstance: :returns: The updated CredentialListInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListInstance( @@ -278,16 +288,20 @@ async def update_async(self, friendly_name: str) -> CredentialListInstance: :returns: The updated CredentialListInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialListInstance( @@ -377,6 +391,10 @@ def create(self, friendly_name: str) -> CredentialListInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -401,6 +419,10 @@ async def create_async(self, friendly_name: str) -> CredentialListInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -536,7 +558,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CredentialListPage(self._version, response, self._solution) async def page_async( @@ -563,8 +591,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CredentialListPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/sip/credential_list/credential.py b/twilio/rest/api/v2010/account/sip/credential_list/credential.py index 1e46bfe16e..9c52a110e0 100644 --- a/twilio/rest/api/v2010/account/sip/credential_list/credential.py +++ b/twilio/rest/api/v2010/account/sip/credential_list/credential.py @@ -185,10 +185,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -197,9 +197,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CredentialInstance: @@ -210,10 +212,11 @@ def fetch(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CredentialInstance( self._version, @@ -231,9 +234,12 @@ async def fetch_async(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CredentialInstance( @@ -252,16 +258,20 @@ def update(self, password: Union[str, object] = values.unset) -> CredentialInsta :returns: The updated CredentialInstance """ + data = values.of( { "Password": password, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance( @@ -282,16 +292,20 @@ async def update_async( :returns: The updated CredentialInstance """ + data = values.of( { "Password": password, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance( @@ -376,6 +390,10 @@ def create(self, username: str, password: str) -> CredentialInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -405,6 +423,10 @@ async def create_async(self, username: str, password: str) -> CredentialInstance ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -543,7 +565,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CredentialPage(self._version, response, self._solution) async def page_async( @@ -570,8 +598,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CredentialPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/sip/domain/__init__.py b/twilio/rest/api/v2010/account/sip/domain/__init__.py index 9ea7260438..0a45e68273 100644 --- a/twilio/rest/api/v2010/account/sip/domain/__init__.py +++ b/twilio/rest/api/v2010/account/sip/domain/__init__.py @@ -322,10 +322,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -334,9 +334,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> DomainInstance: @@ -347,10 +349,11 @@ def fetch(self) -> DomainInstance: :returns: The fetched DomainInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DomainInstance( self._version, @@ -367,9 +370,12 @@ async def fetch_async(self) -> DomainInstance: :returns: The fetched DomainInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DomainInstance( @@ -414,6 +420,7 @@ def update( :returns: The updated DomainInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -433,11 +440,14 @@ def update( "EmergencyCallerSid": emergency_caller_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DomainInstance( @@ -482,6 +492,7 @@ async def update_async( :returns: The updated DomainInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -501,11 +512,14 @@ async def update_async( "EmergencyCallerSid": emergency_caller_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DomainInstance( @@ -660,6 +674,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -725,6 +743,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -860,7 +882,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DomainPage(self._version, response, self._solution) async def page_async( @@ -887,8 +915,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DomainPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py index ff6fd5136e..4839f17d48 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_credential_list_mapping.py @@ -153,10 +153,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -165,9 +165,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AuthCallsCredentialListMappingInstance: @@ -178,10 +180,11 @@ def fetch(self) -> AuthCallsCredentialListMappingInstance: :returns: The fetched AuthCallsCredentialListMappingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AuthCallsCredentialListMappingInstance( self._version, @@ -199,9 +202,12 @@ async def fetch_async(self) -> AuthCallsCredentialListMappingInstance: :returns: The fetched AuthCallsCredentialListMappingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AuthCallsCredentialListMappingInstance( @@ -290,6 +296,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -319,6 +329,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -457,7 +471,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AuthCallsCredentialListMappingPage( self._version, response, self._solution ) @@ -486,8 +506,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AuthCallsCredentialListMappingPage( self._version, response, self._solution diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py index 82099164e7..198f4fc406 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls/auth_calls_ip_access_control_list_mapping.py @@ -155,10 +155,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -167,9 +167,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AuthCallsIpAccessControlListMappingInstance: @@ -180,10 +182,11 @@ def fetch(self) -> AuthCallsIpAccessControlListMappingInstance: :returns: The fetched AuthCallsIpAccessControlListMappingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AuthCallsIpAccessControlListMappingInstance( self._version, @@ -201,9 +204,12 @@ async def fetch_async(self) -> AuthCallsIpAccessControlListMappingInstance: :returns: The fetched AuthCallsIpAccessControlListMappingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AuthCallsIpAccessControlListMappingInstance( @@ -294,6 +300,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -323,6 +333,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -461,7 +475,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AuthCallsIpAccessControlListMappingPage( self._version, response, self._solution ) @@ -490,8 +510,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AuthCallsIpAccessControlListMappingPage( self._version, response, self._solution diff --git a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py index 22acb7ef10..e4b1bf0d23 100644 --- a/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations/auth_registrations_credential_list_mapping.py @@ -153,10 +153,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -165,9 +165,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AuthRegistrationsCredentialListMappingInstance: @@ -178,10 +180,11 @@ def fetch(self) -> AuthRegistrationsCredentialListMappingInstance: :returns: The fetched AuthRegistrationsCredentialListMappingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AuthRegistrationsCredentialListMappingInstance( self._version, @@ -199,9 +202,12 @@ async def fetch_async(self) -> AuthRegistrationsCredentialListMappingInstance: :returns: The fetched AuthRegistrationsCredentialListMappingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AuthRegistrationsCredentialListMappingInstance( @@ -290,6 +296,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -319,6 +329,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -457,7 +471,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AuthRegistrationsCredentialListMappingPage( self._version, response, self._solution ) @@ -486,8 +506,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AuthRegistrationsCredentialListMappingPage( self._version, response, self._solution diff --git a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py index e20e08e0fb..b520f4813a 100644 --- a/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/credential_list_mapping.py @@ -155,10 +155,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -167,9 +167,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CredentialListMappingInstance: @@ -180,10 +182,11 @@ def fetch(self) -> CredentialListMappingInstance: :returns: The fetched CredentialListMappingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CredentialListMappingInstance( self._version, @@ -201,9 +204,12 @@ async def fetch_async(self) -> CredentialListMappingInstance: :returns: The fetched CredentialListMappingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CredentialListMappingInstance( @@ -286,6 +292,10 @@ def create(self, credential_list_sid: str) -> CredentialListMappingInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -315,6 +325,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -453,7 +467,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CredentialListMappingPage(self._version, response, self._solution) async def page_async( @@ -480,8 +500,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CredentialListMappingPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py index 607bb6ce12..4dfecfe826 100644 --- a/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py +++ b/twilio/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.py @@ -157,10 +157,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -169,9 +169,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> IpAccessControlListMappingInstance: @@ -182,10 +184,11 @@ def fetch(self) -> IpAccessControlListMappingInstance: :returns: The fetched IpAccessControlListMappingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return IpAccessControlListMappingInstance( self._version, @@ -203,9 +206,12 @@ async def fetch_async(self) -> IpAccessControlListMappingInstance: :returns: The fetched IpAccessControlListMappingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return IpAccessControlListMappingInstance( @@ -292,6 +298,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -321,6 +331,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -459,7 +473,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return IpAccessControlListMappingPage(self._version, response, self._solution) async def page_async( @@ -486,8 +506,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return IpAccessControlListMappingPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py index cf75721a96..afa504c208 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/__init__.py @@ -190,10 +190,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -202,9 +202,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> IpAccessControlListInstance: @@ -215,10 +217,11 @@ def fetch(self) -> IpAccessControlListInstance: :returns: The fetched IpAccessControlListInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return IpAccessControlListInstance( self._version, @@ -235,9 +238,12 @@ async def fetch_async(self) -> IpAccessControlListInstance: :returns: The fetched IpAccessControlListInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return IpAccessControlListInstance( @@ -255,16 +261,20 @@ def update(self, friendly_name: str) -> IpAccessControlListInstance: :returns: The updated IpAccessControlListInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListInstance( @@ -282,16 +292,20 @@ async def update_async(self, friendly_name: str) -> IpAccessControlListInstance: :returns: The updated IpAccessControlListInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAccessControlListInstance( @@ -381,6 +395,10 @@ def create(self, friendly_name: str) -> IpAccessControlListInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -405,6 +423,10 @@ async def create_async(self, friendly_name: str) -> IpAccessControlListInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -540,7 +562,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return IpAccessControlListPage(self._version, response, self._solution) async def page_async( @@ -567,8 +595,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return IpAccessControlListPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py index 106bd7400e..ca2f82eacc 100644 --- a/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py +++ b/twilio/rest/api/v2010/account/sip/ip_access_control_list/ip_address.py @@ -211,10 +211,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -223,9 +223,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> IpAddressInstance: @@ -236,10 +238,11 @@ def fetch(self) -> IpAddressInstance: :returns: The fetched IpAddressInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return IpAddressInstance( self._version, @@ -257,9 +260,12 @@ async def fetch_async(self) -> IpAddressInstance: :returns: The fetched IpAddressInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return IpAddressInstance( @@ -285,6 +291,7 @@ def update( :returns: The updated IpAddressInstance """ + data = values.of( { "IpAddress": ip_address, @@ -292,11 +299,14 @@ def update( "CidrPrefixLength": cidr_prefix_length, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAddressInstance( @@ -322,6 +332,7 @@ async def update_async( :returns: The updated IpAddressInstance """ + data = values.of( { "IpAddress": ip_address, @@ -329,11 +340,14 @@ async def update_async( "CidrPrefixLength": cidr_prefix_length, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpAddressInstance( @@ -427,6 +441,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -463,6 +481,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -601,7 +623,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return IpAddressPage(self._version, response, self._solution) async def page_async( @@ -628,8 +656,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return IpAddressPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/token.py b/twilio/rest/api/v2010/account/token.py index 6d5edcf3e8..fa43360fb1 100644 --- a/twilio/rest/api/v2010/account/token.py +++ b/twilio/rest/api/v2010/account/token.py @@ -95,6 +95,10 @@ def create(self, ttl: Union[int, object] = values.unset) -> TokenInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -121,6 +125,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/api/v2010/account/transcription.py b/twilio/rest/api/v2010/account/transcription.py index a77bc42fb4..386ff9ee74 100644 --- a/twilio/rest/api/v2010/account/transcription.py +++ b/twilio/rest/api/v2010/account/transcription.py @@ -168,10 +168,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -180,9 +180,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TranscriptionInstance: @@ -193,10 +195,11 @@ def fetch(self) -> TranscriptionInstance: :returns: The fetched TranscriptionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TranscriptionInstance( self._version, @@ -213,9 +216,12 @@ async def fetch_async(self) -> TranscriptionInstance: :returns: The fetched TranscriptionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TranscriptionInstance( @@ -403,7 +409,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TranscriptionPage(self._version, response, self._solution) async def page_async( @@ -430,8 +442,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TranscriptionPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/usage/record/__init__.py b/twilio/rest/api/v2010/account/usage/record/__init__.py index 509b98e5a2..1798eb4079 100644 --- a/twilio/rest/api/v2010/account/usage/record/__init__.py +++ b/twilio/rest/api/v2010/account/usage/record/__init__.py @@ -655,7 +655,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RecordPage(self._version, response, self._solution) async def page_async( @@ -694,8 +700,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RecordPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/usage/record/all_time.py b/twilio/rest/api/v2010/account/usage/record/all_time.py index f7da24250d..56145d98a9 100644 --- a/twilio/rest/api/v2010/account/usage/record/all_time.py +++ b/twilio/rest/api/v2010/account/usage/record/all_time.py @@ -638,7 +638,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AllTimePage(self._version, response, self._solution) async def page_async( @@ -677,8 +683,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AllTimePage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/usage/record/daily.py b/twilio/rest/api/v2010/account/usage/record/daily.py index 6eff180bae..49058b8ea2 100644 --- a/twilio/rest/api/v2010/account/usage/record/daily.py +++ b/twilio/rest/api/v2010/account/usage/record/daily.py @@ -638,7 +638,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DailyPage(self._version, response, self._solution) async def page_async( @@ -677,8 +683,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DailyPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/usage/record/last_month.py b/twilio/rest/api/v2010/account/usage/record/last_month.py index bcaacc4ae7..acd98874ca 100644 --- a/twilio/rest/api/v2010/account/usage/record/last_month.py +++ b/twilio/rest/api/v2010/account/usage/record/last_month.py @@ -638,7 +638,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return LastMonthPage(self._version, response, self._solution) async def page_async( @@ -677,8 +683,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return LastMonthPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/usage/record/monthly.py b/twilio/rest/api/v2010/account/usage/record/monthly.py index 3b606977cc..3258e5f4fe 100644 --- a/twilio/rest/api/v2010/account/usage/record/monthly.py +++ b/twilio/rest/api/v2010/account/usage/record/monthly.py @@ -638,7 +638,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MonthlyPage(self._version, response, self._solution) async def page_async( @@ -677,8 +683,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MonthlyPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/usage/record/this_month.py b/twilio/rest/api/v2010/account/usage/record/this_month.py index 9b7fc8a51d..cf120b91d3 100644 --- a/twilio/rest/api/v2010/account/usage/record/this_month.py +++ b/twilio/rest/api/v2010/account/usage/record/this_month.py @@ -638,7 +638,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ThisMonthPage(self._version, response, self._solution) async def page_async( @@ -677,8 +683,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ThisMonthPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/usage/record/today.py b/twilio/rest/api/v2010/account/usage/record/today.py index fed8286f7d..b2387c95b4 100644 --- a/twilio/rest/api/v2010/account/usage/record/today.py +++ b/twilio/rest/api/v2010/account/usage/record/today.py @@ -638,7 +638,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TodayPage(self._version, response, self._solution) async def page_async( @@ -677,8 +683,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TodayPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/usage/record/yearly.py b/twilio/rest/api/v2010/account/usage/record/yearly.py index e773670d27..490b317e72 100644 --- a/twilio/rest/api/v2010/account/usage/record/yearly.py +++ b/twilio/rest/api/v2010/account/usage/record/yearly.py @@ -638,7 +638,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return YearlyPage(self._version, response, self._solution) async def page_async( @@ -677,8 +683,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return YearlyPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/usage/record/yesterday.py b/twilio/rest/api/v2010/account/usage/record/yesterday.py index a0efe356e4..da5c9dc180 100644 --- a/twilio/rest/api/v2010/account/usage/record/yesterday.py +++ b/twilio/rest/api/v2010/account/usage/record/yesterday.py @@ -638,7 +638,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return YesterdayPage(self._version, response, self._solution) async def page_async( @@ -677,8 +683,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return YesterdayPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/usage/trigger.py b/twilio/rest/api/v2010/account/usage/trigger.py index ba63beec11..08ac52f605 100644 --- a/twilio/rest/api/v2010/account/usage/trigger.py +++ b/twilio/rest/api/v2010/account/usage/trigger.py @@ -553,10 +553,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -565,9 +565,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TriggerInstance: @@ -578,10 +580,11 @@ def fetch(self) -> TriggerInstance: :returns: The fetched TriggerInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TriggerInstance( self._version, @@ -598,9 +601,12 @@ async def fetch_async(self) -> TriggerInstance: :returns: The fetched TriggerInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TriggerInstance( @@ -625,6 +631,7 @@ def update( :returns: The updated TriggerInstance """ + data = values.of( { "CallbackMethod": callback_method, @@ -632,11 +639,14 @@ def update( "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TriggerInstance( @@ -661,6 +671,7 @@ async def update_async( :returns: The updated TriggerInstance """ + data = values.of( { "CallbackMethod": callback_method, @@ -668,11 +679,14 @@ async def update_async( "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TriggerInstance( @@ -770,6 +784,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -815,6 +833,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -999,7 +1021,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TriggerPage(self._version, response, self._solution) async def page_async( @@ -1035,8 +1063,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TriggerPage(self._version, response, self._solution) diff --git a/twilio/rest/api/v2010/account/validation_request.py b/twilio/rest/api/v2010/account/validation_request.py index 261322712f..d92f840e68 100644 --- a/twilio/rest/api/v2010/account/validation_request.py +++ b/twilio/rest/api/v2010/account/validation_request.py @@ -106,6 +106,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -148,6 +152,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/assistants/v1/assistant/__init__.py b/twilio/rest/assistants/v1/assistant/__init__.py index a865a040eb..8ab22a5dcf 100644 --- a/twilio/rest/assistants/v1/assistant/__init__.py +++ b/twilio/rest/assistants/v1/assistant/__init__.py @@ -29,6 +29,120 @@ class AssistantInstance(InstanceResource): + + class AssistantsV1ServiceCreateAssistantRequest(object): + """ + :ivar customer_ai: + :ivar name: The name of the assistant. + :ivar owner: The owner/company of the assistant. + :ivar personality_prompt: The personality prompt to be used for assistant. + :ivar segment_credential: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.customer_ai: Optional[AssistantList.AssistantsV1ServiceCustomerAi] = ( + payload.get("customer_ai") + ) + self.name: Optional[str] = payload.get("name") + self.owner: Optional[str] = payload.get("owner") + self.personality_prompt: Optional[str] = payload.get("personality_prompt") + self.segment_credential: Optional[ + AssistantList.AssistantsV1ServiceSegmentCredential + ] = payload.get("segment_credential") + + def to_dict(self): + return { + "customer_ai": ( + self.customer_ai.to_dict() if self.customer_ai is not None else None + ), + "name": self.name, + "owner": self.owner, + "personality_prompt": self.personality_prompt, + "segment_credential": ( + self.segment_credential.to_dict() + if self.segment_credential is not None + else None + ), + } + + class AssistantsV1ServiceCustomerAi(object): + """ + :ivar perception_engine_enabled: True if the perception engine is enabled. + :ivar personalization_engine_enabled: True if the personalization engine is enabled. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.perception_engine_enabled: Optional[bool] = payload.get( + "perception_engine_enabled" + ) + self.personalization_engine_enabled: Optional[bool] = payload.get( + "personalization_engine_enabled" + ) + + def to_dict(self): + return { + "perception_engine_enabled": self.perception_engine_enabled, + "personalization_engine_enabled": self.personalization_engine_enabled, + } + + class AssistantsV1ServiceSegmentCredential(object): + """ + :ivar profile_api_key: The profile API key. + :ivar space_id: The space ID. + :ivar write_key: The write key. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.profile_api_key: Optional[str] = payload.get("profile_api_key") + self.space_id: Optional[str] = payload.get("space_id") + self.write_key: Optional[str] = payload.get("write_key") + + def to_dict(self): + return { + "profile_api_key": self.profile_api_key, + "space_id": self.space_id, + "write_key": self.write_key, + } + + class AssistantsV1ServiceUpdateAssistantRequest(object): + """ + :ivar customer_ai: + :ivar name: The name of the assistant. + :ivar owner: The owner/company of the assistant. + :ivar personality_prompt: The personality prompt to be used for assistant. + :ivar segment_credential: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.customer_ai: Optional[AssistantList.AssistantsV1ServiceCustomerAi] = ( + payload.get("customer_ai") + ) + self.name: Optional[str] = payload.get("name") + self.owner: Optional[str] = payload.get("owner") + self.personality_prompt: Optional[str] = payload.get("personality_prompt") + self.segment_credential: Optional[ + AssistantList.AssistantsV1ServiceSegmentCredential + ] = payload.get("segment_credential") + + def to_dict(self): + return { + "customer_ai": ( + self.customer_ai.to_dict() if self.customer_ai is not None else None + ), + "name": self.name, + "owner": self.owner, + "personality_prompt": self.personality_prompt, + "segment_credential": ( + self.segment_credential.to_dict() + if self.segment_credential is not None + else None + ), + } + """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Assistant resource. :ivar customer_ai: The Personalization and Perception Engine settings. @@ -196,6 +310,119 @@ def __repr__(self) -> str: class AssistantContext(InstanceContext): + class AssistantsV1ServiceCreateAssistantRequest(object): + """ + :ivar customer_ai: + :ivar name: The name of the assistant. + :ivar owner: The owner/company of the assistant. + :ivar personality_prompt: The personality prompt to be used for assistant. + :ivar segment_credential: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.customer_ai: Optional[AssistantList.AssistantsV1ServiceCustomerAi] = ( + payload.get("customer_ai") + ) + self.name: Optional[str] = payload.get("name") + self.owner: Optional[str] = payload.get("owner") + self.personality_prompt: Optional[str] = payload.get("personality_prompt") + self.segment_credential: Optional[ + AssistantList.AssistantsV1ServiceSegmentCredential + ] = payload.get("segment_credential") + + def to_dict(self): + return { + "customer_ai": ( + self.customer_ai.to_dict() if self.customer_ai is not None else None + ), + "name": self.name, + "owner": self.owner, + "personality_prompt": self.personality_prompt, + "segment_credential": ( + self.segment_credential.to_dict() + if self.segment_credential is not None + else None + ), + } + + class AssistantsV1ServiceCustomerAi(object): + """ + :ivar perception_engine_enabled: True if the perception engine is enabled. + :ivar personalization_engine_enabled: True if the personalization engine is enabled. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.perception_engine_enabled: Optional[bool] = payload.get( + "perception_engine_enabled" + ) + self.personalization_engine_enabled: Optional[bool] = payload.get( + "personalization_engine_enabled" + ) + + def to_dict(self): + return { + "perception_engine_enabled": self.perception_engine_enabled, + "personalization_engine_enabled": self.personalization_engine_enabled, + } + + class AssistantsV1ServiceSegmentCredential(object): + """ + :ivar profile_api_key: The profile API key. + :ivar space_id: The space ID. + :ivar write_key: The write key. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.profile_api_key: Optional[str] = payload.get("profile_api_key") + self.space_id: Optional[str] = payload.get("space_id") + self.write_key: Optional[str] = payload.get("write_key") + + def to_dict(self): + return { + "profile_api_key": self.profile_api_key, + "space_id": self.space_id, + "write_key": self.write_key, + } + + class AssistantsV1ServiceUpdateAssistantRequest(object): + """ + :ivar customer_ai: + :ivar name: The name of the assistant. + :ivar owner: The owner/company of the assistant. + :ivar personality_prompt: The personality prompt to be used for assistant. + :ivar segment_credential: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.customer_ai: Optional[AssistantList.AssistantsV1ServiceCustomerAi] = ( + payload.get("customer_ai") + ) + self.name: Optional[str] = payload.get("name") + self.owner: Optional[str] = payload.get("owner") + self.personality_prompt: Optional[str] = payload.get("personality_prompt") + self.segment_credential: Optional[ + AssistantList.AssistantsV1ServiceSegmentCredential + ] = payload.get("segment_credential") + + def to_dict(self): + return { + "customer_ai": ( + self.customer_ai.to_dict() if self.customer_ai is not None else None + ), + "name": self.name, + "owner": self.owner, + "personality_prompt": self.personality_prompt, + "segment_credential": ( + self.segment_credential.to_dict() + if self.segment_credential is not None + else None + ), + } + def __init__(self, version: Version, id: str): """ Initialize the AssistantContext @@ -223,10 +450,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -235,9 +462,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AssistantInstance: @@ -248,10 +477,11 @@ def fetch(self) -> AssistantInstance: :returns: The fetched AssistantInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AssistantInstance( self._version, @@ -267,9 +497,12 @@ async def fetch_async(self) -> AssistantInstance: :returns: The fetched AssistantInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AssistantInstance( @@ -291,12 +524,13 @@ def update( :returns: The updated AssistantInstance """ - data = values.of({}) - headers = values.of( - { - "AssistantsV1ServiceUpdateAssistantRequest": assistants_v1_service_update_assistant_request, - } - ) + data = assistants_v1_service_update_assistant_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" payload = self._version.update( method="PUT", uri=self._uri, data=data, headers=headers @@ -317,12 +551,13 @@ async def update_async( :returns: The updated AssistantInstance """ - data = values.of({}) - headers = values.of( - { - "AssistantsV1ServiceUpdateAssistantRequest": assistants_v1_service_update_assistant_request, - } - ) + data = assistants_v1_service_update_assistant_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="PUT", uri=self._uri, data=data, headers=headers @@ -432,11 +667,17 @@ def __init__(self, payload: Dict[str, Any]): def to_dict(self): return { - "customer_ai": self.customer_ai.to_dict(), + "customer_ai": ( + self.customer_ai.to_dict() if self.customer_ai is not None else None + ), "name": self.name, "owner": self.owner, "personality_prompt": self.personality_prompt, - "segment_credential": self.segment_credential.to_dict(), + "segment_credential": ( + self.segment_credential.to_dict() + if self.segment_credential is not None + else None + ), } class AssistantsV1ServiceCustomerAi(object): @@ -503,11 +744,17 @@ def __init__(self, payload: Dict[str, Any]): def to_dict(self): return { - "customer_ai": self.customer_ai.to_dict(), + "customer_ai": ( + self.customer_ai.to_dict() if self.customer_ai is not None else None + ), "name": self.name, "owner": self.owner, "personality_prompt": self.personality_prompt, - "segment_credential": self.segment_credential.to_dict(), + "segment_credential": ( + self.segment_credential.to_dict() + if self.segment_credential is not None + else None + ), } def __init__(self, version: Version): @@ -535,8 +782,11 @@ def create( data = assistants_v1_service_create_assistant_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -557,8 +807,11 @@ async def create_async( data = assistants_v1_service_create_assistant_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -692,7 +945,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AssistantPage(self._version, response) async def page_async( @@ -719,8 +978,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AssistantPage(self._version, response) diff --git a/twilio/rest/assistants/v1/assistant/assistants_knowledge.py b/twilio/rest/assistants/v1/assistant/assistants_knowledge.py index b3c7e9ae0e..c3767223e1 100644 --- a/twilio/rest/assistants/v1/assistant/assistants_knowledge.py +++ b/twilio/rest/assistants/v1/assistant/assistants_knowledge.py @@ -194,10 +194,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -206,9 +206,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def __repr__(self) -> str: @@ -421,7 +423,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AssistantsKnowledgePage(self._version, response, self._solution) async def page_async( @@ -448,8 +456,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AssistantsKnowledgePage(self._version, response, self._solution) diff --git a/twilio/rest/assistants/v1/assistant/assistants_tool.py b/twilio/rest/assistants/v1/assistant/assistants_tool.py index 0bed2b76a3..ed02410d3c 100644 --- a/twilio/rest/assistants/v1/assistant/assistants_tool.py +++ b/twilio/rest/assistants/v1/assistant/assistants_tool.py @@ -194,10 +194,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -206,9 +206,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def __repr__(self) -> str: @@ -421,7 +423,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AssistantsToolPage(self._version, response, self._solution) async def page_async( @@ -448,8 +456,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AssistantsToolPage(self._version, response, self._solution) diff --git a/twilio/rest/assistants/v1/assistant/feedback.py b/twilio/rest/assistants/v1/assistant/feedback.py index 63a6d3b6b2..77c6d405f4 100644 --- a/twilio/rest/assistants/v1/assistant/feedback.py +++ b/twilio/rest/assistants/v1/assistant/feedback.py @@ -23,6 +23,30 @@ class FeedbackInstance(InstanceResource): + + class AssistantsV1ServiceCreateFeedbackRequest(object): + """ + :ivar message_id: The message ID. + :ivar score: The score to be given(0-1). + :ivar session_id: The Session ID. + :ivar text: The text to be given as feedback. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.message_id: Optional[str] = payload.get("message_id") + self.score: Optional[float] = payload.get("score") + self.session_id: Optional[str] = payload.get("session_id") + self.text: Optional[str] = payload.get("text") + + def to_dict(self): + return { + "message_id": self.message_id, + "score": self.score, + "session_id": self.session_id, + "text": self.text, + } + """ :ivar assistant_id: The Assistant ID. :ivar id: The Feedback ID. @@ -142,8 +166,11 @@ def create( data = assistants_v1_service_create_feedback_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -164,8 +191,11 @@ async def create_async( data = assistants_v1_service_create_feedback_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -299,7 +329,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return FeedbackPage(self._version, response, self._solution) async def page_async( @@ -326,8 +362,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return FeedbackPage(self._version, response, self._solution) diff --git a/twilio/rest/assistants/v1/assistant/message.py b/twilio/rest/assistants/v1/assistant/message.py index b42514cb38..11d73776b7 100644 --- a/twilio/rest/assistants/v1/assistant/message.py +++ b/twilio/rest/assistants/v1/assistant/message.py @@ -21,6 +21,33 @@ class MessageInstance(InstanceResource): + + class AssistantsV1ServiceAssistantSendMessageRequest(object): + """ + :ivar identity: The unique identity of user for the session. + :ivar session_id: The unique name for the session. + :ivar body: The query to ask the assistant. + :ivar webhook: The webhook url to call after the assistant has generated a response or report an error. + :ivar mode: one of the modes 'chat', 'email' or 'voice' + """ + + def __init__(self, payload: Dict[str, Any]): + + self.identity: Optional[str] = payload.get("identity") + self.session_id: Optional[str] = payload.get("session_id") + self.body: Optional[str] = payload.get("body") + self.webhook: Optional[str] = payload.get("webhook") + self.mode: Optional[str] = payload.get("mode") + + def to_dict(self): + return { + "identity": self.identity, + "session_id": self.session_id, + "body": self.body, + "webhook": self.webhook, + "mode": self.mode, + } + """ :ivar status: success or failure based on whether the request successfully generated a response. :ivar flagged: If successful, this property will denote whether the response was flagged or not. @@ -114,8 +141,11 @@ def create( data = assistants_v1_service_assistant_send_message_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -136,8 +166,11 @@ async def create_async( data = assistants_v1_service_assistant_send_message_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/assistants/v1/knowledge/__init__.py b/twilio/rest/assistants/v1/knowledge/__init__.py index 498bc80f95..993ed922ce 100644 --- a/twilio/rest/assistants/v1/knowledge/__init__.py +++ b/twilio/rest/assistants/v1/knowledge/__init__.py @@ -25,6 +25,98 @@ class KnowledgeInstance(InstanceResource): + + class AssistantsV1ServiceCreateKnowledgeRequest(object): + """ + :ivar assistant_id: The Assistant ID. + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the knowledge source. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.AssistantsV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "assistant_id": self.assistant_id, + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + } + + class AssistantsV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class AssistantsV1ServiceUpdateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar policy: + :ivar type: The description of the knowledge source. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.AssistantsV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + } + """ :ivar description: The type of knowledge source. :ivar id: The description of knowledge. @@ -176,6 +268,97 @@ def __repr__(self) -> str: class KnowledgeContext(InstanceContext): + class AssistantsV1ServiceCreateKnowledgeRequest(object): + """ + :ivar assistant_id: The Assistant ID. + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the knowledge source. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.AssistantsV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "assistant_id": self.assistant_id, + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + } + + class AssistantsV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class AssistantsV1ServiceUpdateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar policy: + :ivar type: The description of the knowledge source. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.AssistantsV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + } + def __init__(self, version: Version, id: str): """ Initialize the KnowledgeContext @@ -201,10 +384,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -213,9 +396,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> KnowledgeInstance: @@ -226,10 +411,11 @@ def fetch(self) -> KnowledgeInstance: :returns: The fetched KnowledgeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return KnowledgeInstance( self._version, @@ -245,9 +431,12 @@ async def fetch_async(self) -> KnowledgeInstance: :returns: The fetched KnowledgeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return KnowledgeInstance( @@ -269,12 +458,13 @@ def update( :returns: The updated KnowledgeInstance """ - data = values.of({}) - headers = values.of( - { - "AssistantsV1ServiceUpdateKnowledgeRequest": assistants_v1_service_update_knowledge_request, - } - ) + data = assistants_v1_service_update_knowledge_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" payload = self._version.update( method="PUT", uri=self._uri, data=data, headers=headers @@ -295,12 +485,13 @@ async def update_async( :returns: The updated KnowledgeInstance """ - data = values.of({}) - headers = values.of( - { - "AssistantsV1ServiceUpdateKnowledgeRequest": assistants_v1_service_update_knowledge_request, - } - ) + data = assistants_v1_service_update_knowledge_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="PUT", uri=self._uri, data=data, headers=headers @@ -392,7 +583,7 @@ def to_dict(self): "description": self.description, "knowledge_source_details": self.knowledge_source_details, "name": self.name, - "policy": self.policy.to_dict(), + "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, } @@ -450,7 +641,7 @@ def to_dict(self): "description": self.description, "knowledge_source_details": self.knowledge_source_details, "name": self.name, - "policy": self.policy.to_dict(), + "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, } @@ -479,8 +670,11 @@ def create( data = assistants_v1_service_create_knowledge_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -501,8 +695,11 @@ async def create_async( data = assistants_v1_service_create_knowledge_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -651,7 +848,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return KnowledgePage(self._version, response) async def page_async( @@ -681,8 +884,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return KnowledgePage(self._version, response) diff --git a/twilio/rest/assistants/v1/knowledge/chunk.py b/twilio/rest/assistants/v1/knowledge/chunk.py index 29e1a34945..be90a7626e 100644 --- a/twilio/rest/assistants/v1/knowledge/chunk.py +++ b/twilio/rest/assistants/v1/knowledge/chunk.py @@ -222,7 +222,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ChunkPage(self._version, response, self._solution) async def page_async( @@ -249,8 +255,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ChunkPage(self._version, response, self._solution) diff --git a/twilio/rest/assistants/v1/knowledge/knowledge_status.py b/twilio/rest/assistants/v1/knowledge/knowledge_status.py index 14a56b0cc2..fedbcaad25 100644 --- a/twilio/rest/assistants/v1/knowledge/knowledge_status.py +++ b/twilio/rest/assistants/v1/knowledge/knowledge_status.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, Optional -from twilio.base import deserialize +from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -112,10 +112,11 @@ def fetch(self) -> KnowledgeStatusInstance: :returns: The fetched KnowledgeStatusInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return KnowledgeStatusInstance( self._version, @@ -131,9 +132,12 @@ async def fetch_async(self) -> KnowledgeStatusInstance: :returns: The fetched KnowledgeStatusInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return KnowledgeStatusInstance( diff --git a/twilio/rest/assistants/v1/policy.py b/twilio/rest/assistants/v1/policy.py index c63eee2e2f..63854fb82b 100644 --- a/twilio/rest/assistants/v1/policy.py +++ b/twilio/rest/assistants/v1/policy.py @@ -251,7 +251,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PolicyPage(self._version, response) async def page_async( @@ -284,8 +290,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PolicyPage(self._version, response) diff --git a/twilio/rest/assistants/v1/session/__init__.py b/twilio/rest/assistants/v1/session/__init__.py index 1faf9c9174..3f0054ea55 100644 --- a/twilio/rest/assistants/v1/session/__init__.py +++ b/twilio/rest/assistants/v1/session/__init__.py @@ -133,10 +133,11 @@ def fetch(self) -> SessionInstance: :returns: The fetched SessionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SessionInstance( self._version, @@ -152,9 +153,12 @@ async def fetch_async(self) -> SessionInstance: :returns: The fetched SessionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SessionInstance( @@ -344,7 +348,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SessionPage(self._version, response) async def page_async( @@ -371,8 +381,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SessionPage(self._version, response) diff --git a/twilio/rest/assistants/v1/session/message.py b/twilio/rest/assistants/v1/session/message.py index b2d2921dfb..a7ea5ca213 100644 --- a/twilio/rest/assistants/v1/session/message.py +++ b/twilio/rest/assistants/v1/session/message.py @@ -234,7 +234,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MessagePage(self._version, response, self._solution) async def page_async( @@ -261,8 +267,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MessagePage(self._version, response, self._solution) diff --git a/twilio/rest/assistants/v1/tool.py b/twilio/rest/assistants/v1/tool.py index a8b1ac6472..648faca599 100644 --- a/twilio/rest/assistants/v1/tool.py +++ b/twilio/rest/assistants/v1/tool.py @@ -23,6 +23,103 @@ class ToolInstance(InstanceResource): + + class AssistantsV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class AssistantsV1ServiceCreateToolRequest(object): + """ + :ivar assistant_id: The Assistant ID. + :ivar description: The description of the tool. + :ivar enabled: True if the tool is enabled. + :ivar meta: The metadata related to method, url, input_schema to used with the Tool. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The description of the tool. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.description: Optional[str] = payload.get("description") + self.enabled: Optional[bool] = payload.get("enabled") + self.meta: Optional[Dict[str, object]] = payload.get("meta") + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ToolList.AssistantsV1ServiceCreatePolicyRequest] = ( + payload.get("policy") + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "assistant_id": self.assistant_id, + "description": self.description, + "enabled": self.enabled, + "meta": self.meta, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + } + + class AssistantsV1ServiceUpdateToolRequest(object): + """ + :ivar assistant_id: The Assistant ID. + :ivar description: The description of the tool. + :ivar enabled: True if the tool is enabled. + :ivar meta: The metadata related to method, url, input_schema to used with the Tool. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the tool. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.description: Optional[str] = payload.get("description") + self.enabled: Optional[bool] = payload.get("enabled") + self.meta: Optional[Dict[str, object]] = payload.get("meta") + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ToolList.AssistantsV1ServiceCreatePolicyRequest] = ( + payload.get("policy") + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "assistant_id": self.assistant_id, + "description": self.description, + "enabled": self.enabled, + "meta": self.meta, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + } + """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Tool resource. :ivar description: The description of the tool. @@ -162,6 +259,102 @@ def __repr__(self) -> str: class ToolContext(InstanceContext): + class AssistantsV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class AssistantsV1ServiceCreateToolRequest(object): + """ + :ivar assistant_id: The Assistant ID. + :ivar description: The description of the tool. + :ivar enabled: True if the tool is enabled. + :ivar meta: The metadata related to method, url, input_schema to used with the Tool. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The description of the tool. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.description: Optional[str] = payload.get("description") + self.enabled: Optional[bool] = payload.get("enabled") + self.meta: Optional[Dict[str, object]] = payload.get("meta") + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ToolList.AssistantsV1ServiceCreatePolicyRequest] = ( + payload.get("policy") + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "assistant_id": self.assistant_id, + "description": self.description, + "enabled": self.enabled, + "meta": self.meta, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + } + + class AssistantsV1ServiceUpdateToolRequest(object): + """ + :ivar assistant_id: The Assistant ID. + :ivar description: The description of the tool. + :ivar enabled: True if the tool is enabled. + :ivar meta: The metadata related to method, url, input_schema to used with the Tool. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the tool. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.assistant_id: Optional[str] = payload.get("assistant_id") + self.description: Optional[str] = payload.get("description") + self.enabled: Optional[bool] = payload.get("enabled") + self.meta: Optional[Dict[str, object]] = payload.get("meta") + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ToolList.AssistantsV1ServiceCreatePolicyRequest] = ( + payload.get("policy") + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "assistant_id": self.assistant_id, + "description": self.description, + "enabled": self.enabled, + "meta": self.meta, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + } + def __init__(self, version: Version, id: str): """ Initialize the ToolContext @@ -184,10 +377,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -196,9 +389,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ToolInstance: @@ -209,10 +404,11 @@ def fetch(self) -> ToolInstance: :returns: The fetched ToolInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ToolInstance( self._version, @@ -228,9 +424,12 @@ async def fetch_async(self) -> ToolInstance: :returns: The fetched ToolInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ToolInstance( @@ -252,12 +451,13 @@ def update( :returns: The updated ToolInstance """ - data = values.of({}) - headers = values.of( - { - "AssistantsV1ServiceUpdateToolRequest": assistants_v1_service_update_tool_request, - } - ) + data = assistants_v1_service_update_tool_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" payload = self._version.update( method="PUT", uri=self._uri, data=data, headers=headers @@ -278,12 +478,13 @@ async def update_async( :returns: The updated ToolInstance """ - data = values.of({}) - headers = values.of( - { - "AssistantsV1ServiceUpdateToolRequest": assistants_v1_service_update_tool_request, - } - ) + data = assistants_v1_service_update_tool_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="PUT", uri=self._uri, data=data, headers=headers @@ -380,7 +581,7 @@ def to_dict(self): "enabled": self.enabled, "meta": self.meta, "name": self.name, - "policy": self.policy.to_dict(), + "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, } @@ -414,7 +615,7 @@ def to_dict(self): "enabled": self.enabled, "meta": self.meta, "name": self.name, - "policy": self.policy.to_dict(), + "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, } @@ -443,8 +644,11 @@ def create( data = assistants_v1_service_create_tool_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -465,8 +669,11 @@ async def create_async( data = assistants_v1_service_create_tool_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -615,7 +822,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ToolPage(self._version, response) async def page_async( @@ -645,8 +858,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ToolPage(self._version, response) diff --git a/twilio/rest/bulkexports/v1/export/__init__.py b/twilio/rest/bulkexports/v1/export/__init__.py index c5c11df086..0ebf3a451b 100644 --- a/twilio/rest/bulkexports/v1/export/__init__.py +++ b/twilio/rest/bulkexports/v1/export/__init__.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -132,10 +133,11 @@ def fetch(self) -> ExportInstance: :returns: The fetched ExportInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ExportInstance( self._version, @@ -151,9 +153,12 @@ async def fetch_async(self) -> ExportInstance: :returns: The fetched ExportInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ExportInstance( diff --git a/twilio/rest/bulkexports/v1/export/day.py b/twilio/rest/bulkexports/v1/export/day.py index fcbc56e979..f4b2a0650f 100644 --- a/twilio/rest/bulkexports/v1/export/day.py +++ b/twilio/rest/bulkexports/v1/export/day.py @@ -124,10 +124,11 @@ def fetch(self) -> DayInstance: :returns: The fetched DayInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DayInstance( self._version, @@ -144,9 +145,12 @@ async def fetch_async(self) -> DayInstance: :returns: The fetched DayInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DayInstance( @@ -332,7 +336,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DayPage(self._version, response, self._solution) async def page_async( @@ -359,8 +369,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DayPage(self._version, response, self._solution) diff --git a/twilio/rest/bulkexports/v1/export/export_custom_job.py b/twilio/rest/bulkexports/v1/export/export_custom_job.py index 9a81fb23cb..72d0e9b328 100644 --- a/twilio/rest/bulkexports/v1/export/export_custom_job.py +++ b/twilio/rest/bulkexports/v1/export/export_custom_job.py @@ -140,6 +140,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -182,6 +186,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -317,7 +325,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ExportCustomJobPage(self._version, response, self._solution) async def page_async( @@ -344,8 +358,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ExportCustomJobPage(self._version, response, self._solution) diff --git a/twilio/rest/bulkexports/v1/export/job.py b/twilio/rest/bulkexports/v1/export/job.py index 48b2df1ab3..5358ffa83a 100644 --- a/twilio/rest/bulkexports/v1/export/job.py +++ b/twilio/rest/bulkexports/v1/export/job.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -145,10 +146,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -157,9 +158,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> JobInstance: @@ -170,10 +173,11 @@ def fetch(self) -> JobInstance: :returns: The fetched JobInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return JobInstance( self._version, @@ -189,9 +193,12 @@ async def fetch_async(self) -> JobInstance: :returns: The fetched JobInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return JobInstance( diff --git a/twilio/rest/bulkexports/v1/export_configuration.py b/twilio/rest/bulkexports/v1/export_configuration.py index c6629d21cf..207642769b 100644 --- a/twilio/rest/bulkexports/v1/export_configuration.py +++ b/twilio/rest/bulkexports/v1/export_configuration.py @@ -158,10 +158,11 @@ def fetch(self) -> ExportConfigurationInstance: :returns: The fetched ExportConfigurationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ExportConfigurationInstance( self._version, @@ -177,9 +178,12 @@ async def fetch_async(self) -> ExportConfigurationInstance: :returns: The fetched ExportConfigurationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ExportConfigurationInstance( @@ -203,6 +207,7 @@ def update( :returns: The updated ExportConfigurationInstance """ + data = values.of( { "Enabled": serialize.boolean_to_string(enabled), @@ -210,11 +215,14 @@ def update( "WebhookMethod": webhook_method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExportConfigurationInstance( @@ -236,6 +244,7 @@ async def update_async( :returns: The updated ExportConfigurationInstance """ + data = values.of( { "Enabled": serialize.boolean_to_string(enabled), @@ -243,11 +252,14 @@ async def update_async( "WebhookMethod": webhook_method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExportConfigurationInstance( diff --git a/twilio/rest/chat/v1/credential.py b/twilio/rest/chat/v1/credential.py index 6bb8b3f981..3bd48b1144 100644 --- a/twilio/rest/chat/v1/credential.py +++ b/twilio/rest/chat/v1/credential.py @@ -208,10 +208,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -220,9 +220,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CredentialInstance: @@ -233,10 +235,11 @@ def fetch(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CredentialInstance( self._version, @@ -252,9 +255,12 @@ async def fetch_async(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CredentialInstance( @@ -284,6 +290,7 @@ def update( :returns: The updated CredentialInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -294,11 +301,14 @@ def update( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -324,6 +334,7 @@ async def update_async( :returns: The updated CredentialInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -334,11 +345,14 @@ async def update_async( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -422,6 +436,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -465,6 +483,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -598,7 +620,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CredentialPage(self._version, response) async def page_async( @@ -625,8 +653,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CredentialPage(self._version, response) diff --git a/twilio/rest/chat/v1/service/__init__.py b/twilio/rest/chat/v1/service/__init__.py index 71825fe578..26fde4025b 100644 --- a/twilio/rest/chat/v1/service/__init__.py +++ b/twilio/rest/chat/v1/service/__init__.py @@ -554,10 +554,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -566,9 +566,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -579,10 +581,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -598,9 +601,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -726,6 +732,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -794,11 +801,14 @@ def update( "Limits.UserChannels": limits_user_channels, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -920,6 +930,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -988,11 +999,14 @@ async def update_async( "Limits.UserChannels": limits_user_channels, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -1091,6 +1105,10 @@ def create(self, friendly_name: str) -> ServiceInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1113,6 +1131,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1246,7 +1268,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -1273,8 +1301,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/chat/v1/service/channel/__init__.py b/twilio/rest/chat/v1/service/channel/__init__.py index 02c42f65cc..ffe42c0b5d 100644 --- a/twilio/rest/chat/v1/service/channel/__init__.py +++ b/twilio/rest/chat/v1/service/channel/__init__.py @@ -241,10 +241,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -253,9 +253,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ChannelInstance: @@ -266,10 +268,11 @@ def fetch(self) -> ChannelInstance: :returns: The fetched ChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ChannelInstance( self._version, @@ -286,9 +289,12 @@ async def fetch_async(self) -> ChannelInstance: :returns: The fetched ChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ChannelInstance( @@ -313,6 +319,7 @@ def update( :returns: The updated ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -320,11 +327,14 @@ def update( "Attributes": attributes, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( @@ -349,6 +359,7 @@ async def update_async( :returns: The updated ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -356,11 +367,14 @@ async def update_async( "Attributes": attributes, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( @@ -486,6 +500,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -522,6 +540,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -670,7 +692,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ChannelPage(self._version, response, self._solution) async def page_async( @@ -700,8 +728,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v1/service/channel/invite.py b/twilio/rest/chat/v1/service/channel/invite.py index c80732a2c0..e5cd4ebe36 100644 --- a/twilio/rest/chat/v1/service/channel/invite.py +++ b/twilio/rest/chat/v1/service/channel/invite.py @@ -163,10 +163,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -175,9 +175,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> InviteInstance: @@ -188,10 +190,11 @@ def fetch(self) -> InviteInstance: :returns: The fetched InviteInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InviteInstance( self._version, @@ -209,9 +212,12 @@ async def fetch_async(self) -> InviteInstance: :returns: The fetched InviteInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InviteInstance( @@ -298,6 +304,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -329,6 +339,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -480,7 +494,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InvitePage(self._version, response, self._solution) async def page_async( @@ -510,8 +530,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InvitePage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v1/service/channel/member.py b/twilio/rest/chat/v1/service/channel/member.py index 405662f02d..1262703ddc 100644 --- a/twilio/rest/chat/v1/service/channel/member.py +++ b/twilio/rest/chat/v1/service/channel/member.py @@ -205,10 +205,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -217,9 +217,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> MemberInstance: @@ -230,10 +232,11 @@ def fetch(self) -> MemberInstance: :returns: The fetched MemberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MemberInstance( self._version, @@ -251,9 +254,12 @@ async def fetch_async(self) -> MemberInstance: :returns: The fetched MemberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MemberInstance( @@ -277,17 +283,21 @@ def update( :returns: The updated MemberInstance """ + data = values.of( { "RoleSid": role_sid, "LastConsumedMessageIndex": last_consumed_message_index, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( @@ -311,17 +321,21 @@ async def update_async( :returns: The updated MemberInstance """ + data = values.of( { "RoleSid": role_sid, "LastConsumedMessageIndex": last_consumed_message_index, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( @@ -408,6 +422,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -439,6 +457,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -590,7 +612,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MemberPage(self._version, response, self._solution) async def page_async( @@ -620,8 +648,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MemberPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v1/service/channel/message.py b/twilio/rest/chat/v1/service/channel/message.py index 34d9e01fb3..e7cfc9217d 100644 --- a/twilio/rest/chat/v1/service/channel/message.py +++ b/twilio/rest/chat/v1/service/channel/message.py @@ -210,10 +210,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -222,9 +222,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> MessageInstance: @@ -235,10 +237,11 @@ def fetch(self) -> MessageInstance: :returns: The fetched MessageInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MessageInstance( self._version, @@ -256,9 +259,12 @@ async def fetch_async(self) -> MessageInstance: :returns: The fetched MessageInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MessageInstance( @@ -282,17 +288,21 @@ def update( :returns: The updated MessageInstance """ + data = values.of( { "Body": body, "Attributes": attributes, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -316,17 +326,21 @@ async def update_async( :returns: The updated MessageInstance """ + data = values.of( { "Body": body, "Attributes": attributes, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -418,6 +432,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -454,6 +472,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -605,7 +627,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MessagePage(self._version, response, self._solution) async def page_async( @@ -635,8 +663,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MessagePage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v1/service/role.py b/twilio/rest/chat/v1/service/role.py index 3ed57a6ee2..d81cbd55ac 100644 --- a/twilio/rest/chat/v1/service/role.py +++ b/twilio/rest/chat/v1/service/role.py @@ -181,10 +181,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -193,9 +193,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RoleInstance: @@ -206,10 +208,11 @@ def fetch(self) -> RoleInstance: :returns: The fetched RoleInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RoleInstance( self._version, @@ -226,9 +229,12 @@ async def fetch_async(self) -> RoleInstance: :returns: The fetched RoleInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RoleInstance( @@ -246,16 +252,20 @@ def update(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -273,16 +283,20 @@ async def update_async(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -363,6 +377,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -393,6 +411,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -528,7 +550,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RolePage(self._version, response, self._solution) async def page_async( @@ -555,8 +583,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RolePage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v1/service/user/__init__.py b/twilio/rest/chat/v1/service/user/__init__.py index 13c4b9bef6..c6b900957c 100644 --- a/twilio/rest/chat/v1/service/user/__init__.py +++ b/twilio/rest/chat/v1/service/user/__init__.py @@ -216,10 +216,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -228,9 +228,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> UserInstance: @@ -241,10 +243,11 @@ def fetch(self) -> UserInstance: :returns: The fetched UserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserInstance( self._version, @@ -261,9 +264,12 @@ async def fetch_async(self) -> UserInstance: :returns: The fetched UserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserInstance( @@ -288,6 +294,7 @@ def update( :returns: The updated UserInstance """ + data = values.of( { "RoleSid": role_sid, @@ -295,11 +302,14 @@ def update( "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( @@ -324,6 +334,7 @@ async def update_async( :returns: The updated UserInstance """ + data = values.of( { "RoleSid": role_sid, @@ -331,11 +342,14 @@ async def update_async( "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( @@ -435,6 +449,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -471,6 +489,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -606,7 +628,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserPage(self._version, response, self._solution) async def page_async( @@ -633,8 +661,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v1/service/user/user_channel.py b/twilio/rest/chat/v1/service/user/user_channel.py index 01e639ceab..b7f35aa9ef 100644 --- a/twilio/rest/chat/v1/service/user/user_channel.py +++ b/twilio/rest/chat/v1/service/user/user_channel.py @@ -247,7 +247,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserChannelPage(self._version, response, self._solution) async def page_async( @@ -274,8 +280,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v2/credential.py b/twilio/rest/chat/v2/credential.py index b098f6820c..5479abeca0 100644 --- a/twilio/rest/chat/v2/credential.py +++ b/twilio/rest/chat/v2/credential.py @@ -208,10 +208,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -220,9 +220,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CredentialInstance: @@ -233,10 +235,11 @@ def fetch(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CredentialInstance( self._version, @@ -252,9 +255,12 @@ async def fetch_async(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CredentialInstance( @@ -284,6 +290,7 @@ def update( :returns: The updated CredentialInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -294,11 +301,14 @@ def update( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -324,6 +334,7 @@ async def update_async( :returns: The updated CredentialInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -334,11 +345,14 @@ async def update_async( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -422,6 +436,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -465,6 +483,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -598,7 +620,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CredentialPage(self._version, response) async def page_async( @@ -625,8 +653,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CredentialPage(self._version, response) diff --git a/twilio/rest/chat/v2/service/__init__.py b/twilio/rest/chat/v2/service/__init__.py index 376043aed6..90a6c6cdba 100644 --- a/twilio/rest/chat/v2/service/__init__.py +++ b/twilio/rest/chat/v2/service/__init__.py @@ -437,10 +437,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -449,9 +449,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -462,10 +464,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -481,9 +484,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -565,6 +571,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -614,11 +621,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -696,6 +706,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -745,11 +756,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -860,6 +874,10 @@ def create(self, friendly_name: str) -> ServiceInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -882,6 +900,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1015,7 +1037,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -1042,8 +1070,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/chat/v2/service/binding.py b/twilio/rest/chat/v2/service/binding.py index 2f960c5135..125f4b9368 100644 --- a/twilio/rest/chat/v2/service/binding.py +++ b/twilio/rest/chat/v2/service/binding.py @@ -166,10 +166,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -178,9 +178,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> BindingInstance: @@ -191,10 +193,11 @@ def fetch(self) -> BindingInstance: :returns: The fetched BindingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BindingInstance( self._version, @@ -211,9 +214,12 @@ async def fetch_async(self) -> BindingInstance: :returns: The fetched BindingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return BindingInstance( @@ -429,7 +435,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return BindingPage(self._version, response, self._solution) async def page_async( @@ -462,8 +474,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BindingPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v2/service/channel/__init__.py b/twilio/rest/chat/v2/service/channel/__init__.py index b3796c30d8..36d08a3896 100644 --- a/twilio/rest/chat/v2/service/channel/__init__.py +++ b/twilio/rest/chat/v2/service/channel/__init__.py @@ -310,6 +310,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -331,6 +333,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -343,10 +347,11 @@ def fetch(self) -> ChannelInstance: :returns: The fetched ChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ChannelInstance( self._version, @@ -363,9 +368,12 @@ async def fetch_async(self) -> ChannelInstance: :returns: The fetched ChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ChannelInstance( @@ -400,6 +408,7 @@ def update( :returns: The updated ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -410,11 +419,20 @@ def update( "CreatedBy": created_by, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -452,6 +470,7 @@ async def update_async( :returns: The updated ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -462,11 +481,20 @@ async def update_async( "CreatedBy": created_by, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -626,6 +654,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -680,6 +712,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -828,7 +864,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ChannelPage(self._version, response, self._solution) async def page_async( @@ -858,8 +900,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v2/service/channel/invite.py b/twilio/rest/chat/v2/service/channel/invite.py index d0ef32e345..7c7f9f6211 100644 --- a/twilio/rest/chat/v2/service/channel/invite.py +++ b/twilio/rest/chat/v2/service/channel/invite.py @@ -163,10 +163,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -175,9 +175,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> InviteInstance: @@ -188,10 +190,11 @@ def fetch(self) -> InviteInstance: :returns: The fetched InviteInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InviteInstance( self._version, @@ -209,9 +212,12 @@ async def fetch_async(self) -> InviteInstance: :returns: The fetched InviteInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InviteInstance( @@ -298,6 +304,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -329,6 +339,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -480,7 +494,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InvitePage(self._version, response, self._solution) async def page_async( @@ -510,8 +530,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InvitePage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v2/service/channel/member.py b/twilio/rest/chat/v2/service/channel/member.py index 95e737b82a..f07cb21891 100644 --- a/twilio/rest/chat/v2/service/channel/member.py +++ b/twilio/rest/chat/v2/service/channel/member.py @@ -274,6 +274,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -295,6 +297,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -307,10 +311,11 @@ def fetch(self) -> MemberInstance: :returns: The fetched MemberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MemberInstance( self._version, @@ -328,9 +333,12 @@ async def fetch_async(self) -> MemberInstance: :returns: The fetched MemberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MemberInstance( @@ -366,6 +374,7 @@ def update( :returns: The updated MemberInstance """ + data = values.of( { "RoleSid": role_sid, @@ -378,11 +387,20 @@ def update( "Attributes": attributes, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -421,6 +439,7 @@ async def update_async( :returns: The updated MemberInstance """ + data = values.of( { "RoleSid": role_sid, @@ -433,11 +452,20 @@ async def update_async( "Attributes": attributes, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -555,6 +583,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -614,6 +646,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -765,7 +801,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MemberPage(self._version, response, self._solution) async def page_async( @@ -795,8 +837,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MemberPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v2/service/channel/message.py b/twilio/rest/chat/v2/service/channel/message.py index 1b2892176e..d0bf2e5ac7 100644 --- a/twilio/rest/chat/v2/service/channel/message.py +++ b/twilio/rest/chat/v2/service/channel/message.py @@ -282,6 +282,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -303,6 +305,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -315,10 +319,11 @@ def fetch(self) -> MessageInstance: :returns: The fetched MessageInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MessageInstance( self._version, @@ -336,9 +341,12 @@ async def fetch_async(self) -> MessageInstance: :returns: The fetched MessageInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MessageInstance( @@ -374,6 +382,7 @@ def update( :returns: The updated MessageInstance """ + data = values.of( { "Body": body, @@ -384,11 +393,20 @@ def update( "From": from_, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -427,6 +445,7 @@ async def update_async( :returns: The updated MessageInstance """ + data = values.of( { "Body": body, @@ -437,11 +456,20 @@ async def update_async( "From": from_, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -557,6 +585,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -614,6 +646,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -765,7 +801,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MessagePage(self._version, response, self._solution) async def page_async( @@ -795,8 +837,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MessagePage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v2/service/channel/webhook.py b/twilio/rest/chat/v2/service/channel/webhook.py index bc38198256..3e31df4288 100644 --- a/twilio/rest/chat/v2/service/channel/webhook.py +++ b/twilio/rest/chat/v2/service/channel/webhook.py @@ -231,10 +231,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -243,9 +243,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> WebhookInstance: @@ -256,10 +258,11 @@ def fetch(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WebhookInstance( self._version, @@ -277,9 +280,12 @@ async def fetch_async(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WebhookInstance( @@ -311,6 +317,7 @@ def update( :returns: The updated WebhookInstance """ + data = values.of( { "Configuration.Url": configuration_url, @@ -325,11 +332,14 @@ def update( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -361,6 +371,7 @@ async def update_async( :returns: The updated WebhookInstance """ + data = values.of( { "Configuration.Url": configuration_url, @@ -375,11 +386,14 @@ async def update_async( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -487,6 +501,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -539,6 +557,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -677,7 +699,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return WebhookPage(self._version, response, self._solution) async def page_async( @@ -704,8 +732,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WebhookPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v2/service/role.py b/twilio/rest/chat/v2/service/role.py index bcc0b6e5a9..fef06436d0 100644 --- a/twilio/rest/chat/v2/service/role.py +++ b/twilio/rest/chat/v2/service/role.py @@ -181,10 +181,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -193,9 +193,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RoleInstance: @@ -206,10 +208,11 @@ def fetch(self) -> RoleInstance: :returns: The fetched RoleInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RoleInstance( self._version, @@ -226,9 +229,12 @@ async def fetch_async(self) -> RoleInstance: :returns: The fetched RoleInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RoleInstance( @@ -246,16 +252,20 @@ def update(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -273,16 +283,20 @@ async def update_async(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -363,6 +377,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -393,6 +411,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -528,7 +550,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RolePage(self._version, response, self._solution) async def page_async( @@ -555,8 +583,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RolePage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v2/service/user/__init__.py b/twilio/rest/chat/v2/service/user/__init__.py index 768b78876e..9fbde6feda 100644 --- a/twilio/rest/chat/v2/service/user/__init__.py +++ b/twilio/rest/chat/v2/service/user/__init__.py @@ -240,10 +240,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -252,9 +252,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> UserInstance: @@ -265,10 +267,11 @@ def fetch(self) -> UserInstance: :returns: The fetched UserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserInstance( self._version, @@ -285,9 +288,12 @@ async def fetch_async(self) -> UserInstance: :returns: The fetched UserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserInstance( @@ -316,6 +322,7 @@ def update( :returns: The updated UserInstance """ + data = values.of( { "RoleSid": role_sid, @@ -323,11 +330,20 @@ def update( "FriendlyName": friendly_name, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -359,6 +375,7 @@ async def update_async( :returns: The updated UserInstance """ + data = values.of( { "RoleSid": role_sid, @@ -366,11 +383,20 @@ async def update_async( "FriendlyName": friendly_name, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -495,6 +521,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -540,6 +570,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -675,7 +709,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserPage(self._version, response, self._solution) async def page_async( @@ -702,8 +742,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v2/service/user/user_binding.py b/twilio/rest/chat/v2/service/user/user_binding.py index 4170c74fb6..8d79c551af 100644 --- a/twilio/rest/chat/v2/service/user/user_binding.py +++ b/twilio/rest/chat/v2/service/user/user_binding.py @@ -173,10 +173,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -185,9 +185,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> UserBindingInstance: @@ -198,10 +200,11 @@ def fetch(self) -> UserBindingInstance: :returns: The fetched UserBindingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserBindingInstance( self._version, @@ -219,9 +222,12 @@ async def fetch_async(self) -> UserBindingInstance: :returns: The fetched UserBindingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserBindingInstance( @@ -440,7 +446,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserBindingPage(self._version, response, self._solution) async def page_async( @@ -472,8 +484,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserBindingPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v2/service/user/user_channel.py b/twilio/rest/chat/v2/service/user/user_channel.py index 1fd25254a5..9fab357368 100644 --- a/twilio/rest/chat/v2/service/user/user_channel.py +++ b/twilio/rest/chat/v2/service/user/user_channel.py @@ -259,6 +259,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -280,6 +282,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -292,10 +296,11 @@ def fetch(self) -> UserChannelInstance: :returns: The fetched UserChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserChannelInstance( self._version, @@ -313,9 +318,12 @@ async def fetch_async(self) -> UserChannelInstance: :returns: The fetched UserChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserChannelInstance( @@ -343,6 +351,7 @@ def update( :returns: The updated UserChannelInstance """ + data = values.of( { "NotificationLevel": notification_level, @@ -352,11 +361,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserChannelInstance( @@ -384,6 +396,7 @@ async def update_async( :returns: The updated UserChannelInstance """ + data = values.of( { "NotificationLevel": notification_level, @@ -393,11 +406,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserChannelInstance( @@ -591,7 +607,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserChannelPage(self._version, response, self._solution) async def page_async( @@ -618,8 +640,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/chat/v3/channel.py b/twilio/rest/chat/v3/channel.py index e9d10b55bf..4682838fba 100644 --- a/twilio/rest/chat/v3/channel.py +++ b/twilio/rest/chat/v3/channel.py @@ -194,17 +194,27 @@ def update( :returns: The updated ChannelInstance """ + data = values.of( { "Type": type, "MessagingServiceSid": messaging_service_sid, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -234,17 +244,27 @@ async def update_async( :returns: The updated ChannelInstance """ + data = values.of( { "Type": type, "MessagingServiceSid": messaging_service_sid, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index b5261516a6..d877b63bc4 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -26,145 +26,1583 @@ class ContentInstance(InstanceResource): + class AuthenticationAction(object): + """ + :ivar type: + :ivar copy_code_text: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.AuthenticationActionType"] = ( + payload.get("type") + ) + self.copy_code_text: Optional[str] = payload.get("copy_code_text") + + def to_dict(self): + return { + "type": self.type, + "copy_code_text": self.copy_code_text, + } + + class CallToActionAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar code: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.CallToActionActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.code: Optional[str] = payload.get("code") + + def to_dict(self): + return { + "type": self.type, + "title": self.title, + "url": self.url, + "phone": self.phone, + "code": self.code, + } + + class CardAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + :ivar code: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.CardActionType"] = payload.get("type") + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + self.code: Optional[str] = payload.get("code") + + def to_dict(self): + return { + "type": self.type, + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + "code": self.code, + } + + class CarouselAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.CarouselActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type, + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class CarouselCard(object): + """ + :ivar title: + :ivar body: + :ivar media: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.title: Optional[str] = payload.get("title") + self.body: Optional[str] = payload.get("body") + self.media: Optional[str] = payload.get("media") + self.actions: Optional[List[ContentList.CarouselAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "title": self.title, + "body": self.body, + "media": self.media, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + + class CatalogItem(object): + """ + :ivar id: + :ivar section_title: + :ivar name: + :ivar media_url: + :ivar price: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.section_title: Optional[str] = payload.get("section_title") + self.name: Optional[str] = payload.get("name") + self.media_url: Optional[str] = payload.get("media_url") + self.price: Optional[float] = payload.get("price") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "section_title": self.section_title, + "name": self.name, + "media_url": self.media_url, + "price": self.price, + "description": self.description, + } + + class ContentCreateRequest(object): + """ + :ivar friendly_name: User defined name of the content + :ivar variables: Key value pairs of variable name to value + :ivar language: Language code for the content + :ivar types: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.variables: Optional[dict[str, str]] = payload.get("variables") + self.language: Optional[str] = payload.get("language") + self.types: Optional[ContentList.Types] = payload.get("types") + + def to_dict(self): + return { + "friendly_name": self.friendly_name, + "variables": self.variables, + "language": self.language, + "types": self.types.to_dict() if self.types is not None else None, + } + + class FlowsPage(object): + """ + :ivar id: + :ivar next_page_id: + :ivar title: + :ivar subtitle: + :ivar layout: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.next_page_id: Optional[str] = payload.get("next_page_id") + self.title: Optional[str] = payload.get("title") + self.subtitle: Optional[str] = payload.get("subtitle") + self.layout: Optional[List[ContentList.FlowsPageComponent]] = payload.get( + "layout" + ) + + def to_dict(self): + return { + "id": self.id, + "next_page_id": self.next_page_id, + "title": self.title, + "subtitle": self.subtitle, + "layout": ( + [layout.to_dict() for layout in self.layout] + if self.layout is not None + else None + ), + } + + class FlowsPageComponent(object): + """ + :ivar label: + :ivar type: + :ivar text: + :ivar options: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.label: Optional[str] = payload.get("label") + self.type: Optional[str] = payload.get("type") + self.text: Optional[str] = payload.get("text") + self.options: Optional[List[ContentList.FlowsPageComponentSelectItem]] = ( + payload.get("options") + ) + + def to_dict(self): + return { + "label": self.label, + "type": self.type, + "text": self.text, + "options": ( + [options.to_dict() for options in self.options] + if self.options is not None + else None + ), + } + + class FlowsPageComponentSelectItem(object): + """ + :ivar id: + :ivar title: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.title: Optional[str] = payload.get("title") + + def to_dict(self): + return { + "id": self.id, + "title": self.title, + } + + class ListItem(object): + """ + :ivar id: + :ivar item: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.item: Optional[str] = payload.get("item") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "item": self.item, + "description": self.description, + } + + class QuickReplyAction(object): + """ + :ivar type: + :ivar title: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.QuickReplyActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type, + "title": self.title, + "id": self.id, + } + + class TwilioCallToAction(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.CallToActionAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + + class TwilioCard(object): + """ + :ivar title: + :ivar subtitle: + :ivar media: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.title: Optional[str] = payload.get("title") + self.subtitle: Optional[str] = payload.get("subtitle") + self.media: Optional[List[str]] = payload.get("media") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "title": self.title, + "subtitle": self.subtitle, + "media": self.media, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + + class TwilioCarousel(object): + """ + :ivar body: + :ivar cards: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.cards: Optional[List[ContentList.CarouselCard]] = payload.get("cards") + + def to_dict(self): + return { + "body": self.body, + "cards": ( + [cards.to_dict() for cards in self.cards] + if self.cards is not None + else None + ), + } + + class TwilioCatalog(object): + """ + :ivar title: + :ivar body: + :ivar subtitle: + :ivar id: + :ivar items: + :ivar dynamic_items: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.title: Optional[str] = payload.get("title") + self.body: Optional[str] = payload.get("body") + self.subtitle: Optional[str] = payload.get("subtitle") + self.id: Optional[str] = payload.get("id") + self.items: Optional[List[ContentList.CatalogItem]] = payload.get("items") + self.dynamic_items: Optional[str] = payload.get("dynamic_items") + + def to_dict(self): + return { + "title": self.title, + "body": self.body, + "subtitle": self.subtitle, + "id": self.id, + "items": ( + [items.to_dict() for items in self.items] + if self.items is not None + else None + ), + "dynamic_items": self.dynamic_items, + } + + class TwilioFlows(object): + """ + :ivar body: + :ivar button_text: + :ivar subtitle: + :ivar media_url: + :ivar pages: + :ivar type: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.button_text: Optional[str] = payload.get("button_text") + self.subtitle: Optional[str] = payload.get("subtitle") + self.media_url: Optional[str] = payload.get("media_url") + self.pages: Optional[List[ContentList.FlowsPage]] = payload.get("pages") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "body": self.body, + "button_text": self.button_text, + "subtitle": self.subtitle, + "media_url": self.media_url, + "pages": ( + [pages.to_dict() for pages in self.pages] + if self.pages is not None + else None + ), + "type": self.type, + } + + class TwilioListPicker(object): + """ + :ivar body: + :ivar button: + :ivar items: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.button: Optional[str] = payload.get("button") + self.items: Optional[List[ContentList.ListItem]] = payload.get("items") + + def to_dict(self): + return { + "body": self.body, + "button": self.button, + "items": ( + [items.to_dict() for items in self.items] + if self.items is not None + else None + ), + } + + class TwilioLocation(object): + """ + :ivar latitude: + :ivar longitude: + :ivar label: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.latitude: Optional[float] = payload.get("latitude") + self.longitude: Optional[float] = payload.get("longitude") + self.label: Optional[str] = payload.get("label") + + def to_dict(self): + return { + "latitude": self.latitude, + "longitude": self.longitude, + "label": self.label, + } + + class TwilioMedia(object): + """ + :ivar body: + :ivar media: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.media: Optional[List[str]] = payload.get("media") + + def to_dict(self): + return { + "body": self.body, + "media": self.media, + } + + class TwilioQuickReply(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.QuickReplyAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + + class TwilioText(object): + """ + :ivar body: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + + def to_dict(self): + return { + "body": self.body, + } + + class Types(object): + """ + :ivar twilio_text: + :ivar twilio_media: + :ivar twilio_location: + :ivar twilio_list_picker: + :ivar twilio_call_to_action: + :ivar twilio_quick_reply: + :ivar twilio_card: + :ivar twilio_catalog: + :ivar twilio_carousel: + :ivar twilio_flows: + :ivar whatsapp_card: + :ivar whatsapp_authentication: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.twilio_text: Optional[ContentList.TwilioText] = payload.get( + "twilio_text" + ) + self.twilio_media: Optional[ContentList.TwilioMedia] = payload.get( + "twilio_media" + ) + self.twilio_location: Optional[ContentList.TwilioLocation] = payload.get( + "twilio_location" + ) + self.twilio_list_picker: Optional[ContentList.TwilioListPicker] = ( + payload.get("twilio_list_picker") + ) + self.twilio_call_to_action: Optional[ContentList.TwilioCallToAction] = ( + payload.get("twilio_call_to_action") + ) + self.twilio_quick_reply: Optional[ContentList.TwilioQuickReply] = ( + payload.get("twilio_quick_reply") + ) + self.twilio_card: Optional[ContentList.TwilioCard] = payload.get( + "twilio_card" + ) + self.twilio_catalog: Optional[ContentList.TwilioCatalog] = payload.get( + "twilio_catalog" + ) + self.twilio_carousel: Optional[ContentList.TwilioCarousel] = payload.get( + "twilio_carousel" + ) + self.twilio_flows: Optional[ContentList.TwilioFlows] = payload.get( + "twilio_flows" + ) + self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( + "whatsapp_card" + ) + self.whatsapp_authentication: Optional[ + ContentList.WhatsappAuthentication + ] = payload.get("whatsapp_authentication") + + def to_dict(self): + return { + "twilio_text": ( + self.twilio_text.to_dict() if self.twilio_text is not None else None + ), + "twilio_media": ( + self.twilio_media.to_dict() + if self.twilio_media is not None + else None + ), + "twilio_location": ( + self.twilio_location.to_dict() + if self.twilio_location is not None + else None + ), + "twilio_list_picker": ( + self.twilio_list_picker.to_dict() + if self.twilio_list_picker is not None + else None + ), + "twilio_call_to_action": ( + self.twilio_call_to_action.to_dict() + if self.twilio_call_to_action is not None + else None + ), + "twilio_quick_reply": ( + self.twilio_quick_reply.to_dict() + if self.twilio_quick_reply is not None + else None + ), + "twilio_card": ( + self.twilio_card.to_dict() if self.twilio_card is not None else None + ), + "twilio_catalog": ( + self.twilio_catalog.to_dict() + if self.twilio_catalog is not None + else None + ), + "twilio_carousel": ( + self.twilio_carousel.to_dict() + if self.twilio_carousel is not None + else None + ), + "twilio_flows": ( + self.twilio_flows.to_dict() + if self.twilio_flows is not None + else None + ), + "whatsapp_card": ( + self.whatsapp_card.to_dict() + if self.whatsapp_card is not None + else None + ), + "whatsapp_authentication": ( + self.whatsapp_authentication.to_dict() + if self.whatsapp_authentication is not None + else None + ), + } + + class WhatsappAuthentication(object): + """ + :ivar add_security_recommendation: + :ivar code_expiration_minutes: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.add_security_recommendation: Optional[bool] = payload.get( + "add_security_recommendation" + ) + self.code_expiration_minutes: Optional[float] = payload.get( + "code_expiration_minutes" + ) + self.actions: Optional[List[ContentList.AuthenticationAction]] = ( + payload.get("actions") + ) + + def to_dict(self): + return { + "add_security_recommendation": self.add_security_recommendation, + "code_expiration_minutes": self.code_expiration_minutes, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + + class WhatsappCard(object): + """ + :ivar body: + :ivar footer: + :ivar media: + :ivar header_text: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.footer: Optional[str] = payload.get("footer") + self.media: Optional[List[str]] = payload.get("media") + self.header_text: Optional[str] = payload.get("header_text") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "footer": self.footer, + "media": self.media, + "header_text": self.header_text, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + class AuthenticationActionType(object): COPY_CODE = "COPY_CODE" - class CallToActionActionType(object): - URL = "URL" - PHONE_NUMBER = "PHONE_NUMBER" - COPY_CODE = "COPY_CODE" - VOICE_CALL = "VOICE_CALL" - VOICE_CALL_REQUEST = "VOICE_CALL_REQUEST" + class CallToActionActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + COPY_CODE = "COPY_CODE" + VOICE_CALL = "VOICE_CALL" + VOICE_CALL_REQUEST = "VOICE_CALL_REQUEST" + + class CardActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + QUICK_REPLY = "QUICK_REPLY" + COPY_CODE = "COPY_CODE" + VOICE_CALL = "VOICE_CALL" + + class CarouselActionType(object): + URL = "URL" + PHONE_NUMBER = "PHONE_NUMBER" + QUICK_REPLY = "QUICK_REPLY" + + class QuickReplyActionType(object): + QUICK_REPLY = "QUICK_REPLY" + + """ + :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. + :ivar sid: The unique string that that we created to identify the Content resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. + :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. + :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. + :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. + :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. + :ivar url: The URL of the resource, relative to `https://content.twilio.com`. + :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.language: Optional[str] = payload.get("language") + self.variables: Optional[Dict[str, object]] = payload.get("variables") + self.types: Optional[Dict[str, object]] = payload.get("types") + self.url: Optional[str] = payload.get("url") + self.links: Optional[Dict[str, object]] = payload.get("links") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[ContentContext] = None + + @property + def _proxy(self) -> "ContentContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: ContentContext for this ContentInstance + """ + if self._context is None: + self._context = ContentContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the ContentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the ContentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "ContentInstance": + """ + Fetch the ContentInstance + + + :returns: The fetched ContentInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "ContentInstance": + """ + Asynchronous coroutine to fetch the ContentInstance + + + :returns: The fetched ContentInstance + """ + return await self._proxy.fetch_async() + + @property + def approval_create(self) -> ApprovalCreateList: + """ + Access the approval_create + """ + return self._proxy.approval_create + + @property + def approval_fetch(self) -> ApprovalFetchList: + """ + Access the approval_fetch + """ + return self._proxy.approval_fetch + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ContentContext(InstanceContext): + + class AuthenticationAction(object): + """ + :ivar type: + :ivar copy_code_text: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.AuthenticationActionType"] = ( + payload.get("type") + ) + self.copy_code_text: Optional[str] = payload.get("copy_code_text") + + def to_dict(self): + return { + "type": self.type, + "copy_code_text": self.copy_code_text, + } + + class CallToActionAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar code: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.CallToActionActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.code: Optional[str] = payload.get("code") + + def to_dict(self): + return { + "type": self.type, + "title": self.title, + "url": self.url, + "phone": self.phone, + "code": self.code, + } + + class CardAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + :ivar code: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.CardActionType"] = payload.get("type") + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + self.code: Optional[str] = payload.get("code") + + def to_dict(self): + return { + "type": self.type, + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + "code": self.code, + } + + class CarouselAction(object): + """ + :ivar type: + :ivar title: + :ivar url: + :ivar phone: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.CarouselActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.url: Optional[str] = payload.get("url") + self.phone: Optional[str] = payload.get("phone") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type, + "title": self.title, + "url": self.url, + "phone": self.phone, + "id": self.id, + } + + class CarouselCard(object): + """ + :ivar title: + :ivar body: + :ivar media: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.title: Optional[str] = payload.get("title") + self.body: Optional[str] = payload.get("body") + self.media: Optional[str] = payload.get("media") + self.actions: Optional[List[ContentList.CarouselAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "title": self.title, + "body": self.body, + "media": self.media, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + + class CatalogItem(object): + """ + :ivar id: + :ivar section_title: + :ivar name: + :ivar media_url: + :ivar price: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.section_title: Optional[str] = payload.get("section_title") + self.name: Optional[str] = payload.get("name") + self.media_url: Optional[str] = payload.get("media_url") + self.price: Optional[float] = payload.get("price") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "section_title": self.section_title, + "name": self.name, + "media_url": self.media_url, + "price": self.price, + "description": self.description, + } + + class ContentCreateRequest(object): + """ + :ivar friendly_name: User defined name of the content + :ivar variables: Key value pairs of variable name to value + :ivar language: Language code for the content + :ivar types: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.variables: Optional[dict[str, str]] = payload.get("variables") + self.language: Optional[str] = payload.get("language") + self.types: Optional[ContentList.Types] = payload.get("types") + + def to_dict(self): + return { + "friendly_name": self.friendly_name, + "variables": self.variables, + "language": self.language, + "types": self.types.to_dict() if self.types is not None else None, + } + + class FlowsPage(object): + """ + :ivar id: + :ivar next_page_id: + :ivar title: + :ivar subtitle: + :ivar layout: + """ - class CardActionType(object): - URL = "URL" - PHONE_NUMBER = "PHONE_NUMBER" - QUICK_REPLY = "QUICK_REPLY" - COPY_CODE = "COPY_CODE" - VOICE_CALL = "VOICE_CALL" + def __init__(self, payload: Dict[str, Any]): - class CarouselActionType(object): - URL = "URL" - PHONE_NUMBER = "PHONE_NUMBER" - QUICK_REPLY = "QUICK_REPLY" + self.id: Optional[str] = payload.get("id") + self.next_page_id: Optional[str] = payload.get("next_page_id") + self.title: Optional[str] = payload.get("title") + self.subtitle: Optional[str] = payload.get("subtitle") + self.layout: Optional[List[ContentList.FlowsPageComponent]] = payload.get( + "layout" + ) - class QuickReplyActionType(object): - QUICK_REPLY = "QUICK_REPLY" + def to_dict(self): + return { + "id": self.id, + "next_page_id": self.next_page_id, + "title": self.title, + "subtitle": self.subtitle, + "layout": ( + [layout.to_dict() for layout in self.layout] + if self.layout is not None + else None + ), + } - """ - :ivar date_created: The date and time in GMT that the resource was created specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar date_updated: The date and time in GMT that the resource was last updated specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. - :ivar sid: The unique string that that we created to identify the Content resource. - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/usage/api/account) that created Content resource. - :ivar friendly_name: A string name used to describe the Content resource. Not visible to the end recipient. - :ivar language: Two-letter (ISO 639-1) language code (e.g., en) identifying the language the Content resource is in. - :ivar variables: Defines the default placeholder values for variables included in the Content resource. e.g. {\"1\": \"Customer_Name\"}. - :ivar types: The [Content types](https://www.twilio.com/docs/content-api/content-types-overview) (e.g. twilio/text) for this Content resource. - :ivar url: The URL of the resource, relative to `https://content.twilio.com`. - :ivar links: A list of links related to the Content resource, such as approval_fetch and approval_create - """ + class FlowsPageComponent(object): + """ + :ivar label: + :ivar type: + :ivar text: + :ivar options: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.label: Optional[str] = payload.get("label") + self.type: Optional[str] = payload.get("type") + self.text: Optional[str] = payload.get("text") + self.options: Optional[List[ContentList.FlowsPageComponentSelectItem]] = ( + payload.get("options") + ) + + def to_dict(self): + return { + "label": self.label, + "type": self.type, + "text": self.text, + "options": ( + [options.to_dict() for options in self.options] + if self.options is not None + else None + ), + } + + class FlowsPageComponentSelectItem(object): + """ + :ivar id: + :ivar title: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.title: Optional[str] = payload.get("title") + + def to_dict(self): + return { + "id": self.id, + "title": self.title, + } + + class ListItem(object): + """ + :ivar id: + :ivar item: + :ivar description: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.item: Optional[str] = payload.get("item") + self.description: Optional[str] = payload.get("description") + + def to_dict(self): + return { + "id": self.id, + "item": self.item, + "description": self.description, + } + + class QuickReplyAction(object): + """ + :ivar type: + :ivar title: + :ivar id: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.type: Optional["ContentInstance.QuickReplyActionType"] = payload.get( + "type" + ) + self.title: Optional[str] = payload.get("title") + self.id: Optional[str] = payload.get("id") + + def to_dict(self): + return { + "type": self.type, + "title": self.title, + "id": self.id, + } + + class TwilioCallToAction(object): + """ + :ivar body: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.CallToActionAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + + class TwilioCard(object): + """ + :ivar title: + :ivar subtitle: + :ivar media: + :ivar actions: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.title: Optional[str] = payload.get("title") + self.subtitle: Optional[str] = payload.get("subtitle") + self.media: Optional[List[str]] = payload.get("media") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "title": self.title, + "subtitle": self.subtitle, + "media": self.media, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + + class TwilioCarousel(object): + """ + :ivar body: + :ivar cards: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.cards: Optional[List[ContentList.CarouselCard]] = payload.get("cards") + + def to_dict(self): + return { + "body": self.body, + "cards": ( + [cards.to_dict() for cards in self.cards] + if self.cards is not None + else None + ), + } + + class TwilioCatalog(object): + """ + :ivar title: + :ivar body: + :ivar subtitle: + :ivar id: + :ivar items: + :ivar dynamic_items: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.title: Optional[str] = payload.get("title") + self.body: Optional[str] = payload.get("body") + self.subtitle: Optional[str] = payload.get("subtitle") + self.id: Optional[str] = payload.get("id") + self.items: Optional[List[ContentList.CatalogItem]] = payload.get("items") + self.dynamic_items: Optional[str] = payload.get("dynamic_items") + + def to_dict(self): + return { + "title": self.title, + "body": self.body, + "subtitle": self.subtitle, + "id": self.id, + "items": ( + [items.to_dict() for items in self.items] + if self.items is not None + else None + ), + "dynamic_items": self.dynamic_items, + } + + class TwilioFlows(object): + """ + :ivar body: + :ivar button_text: + :ivar subtitle: + :ivar media_url: + :ivar pages: + :ivar type: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.body: Optional[str] = payload.get("body") + self.button_text: Optional[str] = payload.get("button_text") + self.subtitle: Optional[str] = payload.get("subtitle") + self.media_url: Optional[str] = payload.get("media_url") + self.pages: Optional[List[ContentList.FlowsPage]] = payload.get("pages") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "body": self.body, + "button_text": self.button_text, + "subtitle": self.subtitle, + "media_url": self.media_url, + "pages": ( + [pages.to_dict() for pages in self.pages] + if self.pages is not None + else None + ), + "type": self.type, + } + + class TwilioListPicker(object): + """ + :ivar body: + :ivar button: + :ivar items: + """ - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) + def __init__(self, payload: Dict[str, Any]): - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.sid: Optional[str] = payload.get("sid") - self.account_sid: Optional[str] = payload.get("account_sid") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.language: Optional[str] = payload.get("language") - self.variables: Optional[Dict[str, object]] = payload.get("variables") - self.types: Optional[Dict[str, object]] = payload.get("types") - self.url: Optional[str] = payload.get("url") - self.links: Optional[Dict[str, object]] = payload.get("links") + self.body: Optional[str] = payload.get("body") + self.button: Optional[str] = payload.get("button") + self.items: Optional[List[ContentList.ListItem]] = payload.get("items") - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[ContentContext] = None + def to_dict(self): + return { + "body": self.body, + "button": self.button, + "items": ( + [items.to_dict() for items in self.items] + if self.items is not None + else None + ), + } - @property - def _proxy(self) -> "ContentContext": + class TwilioLocation(object): """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: ContentContext for this ContentInstance + :ivar latitude: + :ivar longitude: + :ivar label: """ - if self._context is None: - self._context = ContentContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - def delete(self) -> bool: - """ - Deletes the ContentInstance + def __init__(self, payload: Dict[str, Any]): + self.latitude: Optional[float] = payload.get("latitude") + self.longitude: Optional[float] = payload.get("longitude") + self.label: Optional[str] = payload.get("label") - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() + def to_dict(self): + return { + "latitude": self.latitude, + "longitude": self.longitude, + "label": self.label, + } - async def delete_async(self) -> bool: + class TwilioMedia(object): + """ + :ivar body: + :ivar media: """ - Asynchronous coroutine that deletes the ContentInstance + def __init__(self, payload: Dict[str, Any]): - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() + self.body: Optional[str] = payload.get("body") + self.media: Optional[List[str]] = payload.get("media") - def fetch(self) -> "ContentInstance": + def to_dict(self): + return { + "body": self.body, + "media": self.media, + } + + class TwilioQuickReply(object): + """ + :ivar body: + :ivar actions: """ - Fetch the ContentInstance + def __init__(self, payload: Dict[str, Any]): - :returns: The fetched ContentInstance - """ - return self._proxy.fetch() + self.body: Optional[str] = payload.get("body") + self.actions: Optional[List[ContentList.QuickReplyAction]] = payload.get( + "actions" + ) - async def fetch_async(self) -> "ContentInstance": + def to_dict(self): + return { + "body": self.body, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + + class TwilioText(object): + """ + :ivar body: """ - Asynchronous coroutine to fetch the ContentInstance + def __init__(self, payload: Dict[str, Any]): - :returns: The fetched ContentInstance - """ - return await self._proxy.fetch_async() + self.body: Optional[str] = payload.get("body") - @property - def approval_create(self) -> ApprovalCreateList: + def to_dict(self): + return { + "body": self.body, + } + + class Types(object): """ - Access the approval_create + :ivar twilio_text: + :ivar twilio_media: + :ivar twilio_location: + :ivar twilio_list_picker: + :ivar twilio_call_to_action: + :ivar twilio_quick_reply: + :ivar twilio_card: + :ivar twilio_catalog: + :ivar twilio_carousel: + :ivar twilio_flows: + :ivar whatsapp_card: + :ivar whatsapp_authentication: """ - return self._proxy.approval_create - @property - def approval_fetch(self) -> ApprovalFetchList: + def __init__(self, payload: Dict[str, Any]): + + self.twilio_text: Optional[ContentList.TwilioText] = payload.get( + "twilio_text" + ) + self.twilio_media: Optional[ContentList.TwilioMedia] = payload.get( + "twilio_media" + ) + self.twilio_location: Optional[ContentList.TwilioLocation] = payload.get( + "twilio_location" + ) + self.twilio_list_picker: Optional[ContentList.TwilioListPicker] = ( + payload.get("twilio_list_picker") + ) + self.twilio_call_to_action: Optional[ContentList.TwilioCallToAction] = ( + payload.get("twilio_call_to_action") + ) + self.twilio_quick_reply: Optional[ContentList.TwilioQuickReply] = ( + payload.get("twilio_quick_reply") + ) + self.twilio_card: Optional[ContentList.TwilioCard] = payload.get( + "twilio_card" + ) + self.twilio_catalog: Optional[ContentList.TwilioCatalog] = payload.get( + "twilio_catalog" + ) + self.twilio_carousel: Optional[ContentList.TwilioCarousel] = payload.get( + "twilio_carousel" + ) + self.twilio_flows: Optional[ContentList.TwilioFlows] = payload.get( + "twilio_flows" + ) + self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( + "whatsapp_card" + ) + self.whatsapp_authentication: Optional[ + ContentList.WhatsappAuthentication + ] = payload.get("whatsapp_authentication") + + def to_dict(self): + return { + "twilio_text": ( + self.twilio_text.to_dict() if self.twilio_text is not None else None + ), + "twilio_media": ( + self.twilio_media.to_dict() + if self.twilio_media is not None + else None + ), + "twilio_location": ( + self.twilio_location.to_dict() + if self.twilio_location is not None + else None + ), + "twilio_list_picker": ( + self.twilio_list_picker.to_dict() + if self.twilio_list_picker is not None + else None + ), + "twilio_call_to_action": ( + self.twilio_call_to_action.to_dict() + if self.twilio_call_to_action is not None + else None + ), + "twilio_quick_reply": ( + self.twilio_quick_reply.to_dict() + if self.twilio_quick_reply is not None + else None + ), + "twilio_card": ( + self.twilio_card.to_dict() if self.twilio_card is not None else None + ), + "twilio_catalog": ( + self.twilio_catalog.to_dict() + if self.twilio_catalog is not None + else None + ), + "twilio_carousel": ( + self.twilio_carousel.to_dict() + if self.twilio_carousel is not None + else None + ), + "twilio_flows": ( + self.twilio_flows.to_dict() + if self.twilio_flows is not None + else None + ), + "whatsapp_card": ( + self.whatsapp_card.to_dict() + if self.whatsapp_card is not None + else None + ), + "whatsapp_authentication": ( + self.whatsapp_authentication.to_dict() + if self.whatsapp_authentication is not None + else None + ), + } + + class WhatsappAuthentication(object): """ - Access the approval_fetch + :ivar add_security_recommendation: + :ivar code_expiration_minutes: + :ivar actions: """ - return self._proxy.approval_fetch - def __repr__(self) -> str: - """ - Provide a friendly representation + def __init__(self, payload: Dict[str, Any]): - :returns: Machine friendly representation + self.add_security_recommendation: Optional[bool] = payload.get( + "add_security_recommendation" + ) + self.code_expiration_minutes: Optional[float] = payload.get( + "code_expiration_minutes" + ) + self.actions: Optional[List[ContentList.AuthenticationAction]] = ( + payload.get("actions") + ) + + def to_dict(self): + return { + "add_security_recommendation": self.add_security_recommendation, + "code_expiration_minutes": self.code_expiration_minutes, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } + + class WhatsappCard(object): + """ + :ivar body: + :ivar footer: + :ivar media: + :ivar header_text: + :ivar actions: """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) + def __init__(self, payload: Dict[str, Any]): -class ContentContext(InstanceContext): + self.body: Optional[str] = payload.get("body") + self.footer: Optional[str] = payload.get("footer") + self.media: Optional[List[str]] = payload.get("media") + self.header_text: Optional[str] = payload.get("header_text") + self.actions: Optional[List[ContentList.CardAction]] = payload.get( + "actions" + ) + + def to_dict(self): + return { + "body": self.body, + "footer": self.footer, + "media": self.media, + "header_text": self.header_text, + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), + } def __init__(self, version: Version, sid: str): """ @@ -191,10 +1629,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -203,9 +1641,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ContentInstance: @@ -216,10 +1656,11 @@ def fetch(self) -> ContentInstance: :returns: The fetched ContentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ContentInstance( self._version, @@ -235,9 +1676,12 @@ async def fetch_async(self) -> ContentInstance: :returns: The fetched ContentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ContentInstance( @@ -427,7 +1871,11 @@ def to_dict(self): "title": self.title, "body": self.body, "media": self.media, - "actions": [actions.to_dict() for actions in self.actions], + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), } class CatalogItem(object): @@ -479,7 +1927,7 @@ def to_dict(self): "friendly_name": self.friendly_name, "variables": self.variables, "language": self.language, - "types": self.types.to_dict(), + "types": self.types.to_dict() if self.types is not None else None, } class FlowsPage(object): @@ -507,7 +1955,11 @@ def to_dict(self): "next_page_id": self.next_page_id, "title": self.title, "subtitle": self.subtitle, - "layout": [layout.to_dict() for layout in self.layout], + "layout": ( + [layout.to_dict() for layout in self.layout] + if self.layout is not None + else None + ), } class FlowsPageComponent(object): @@ -532,7 +1984,11 @@ def to_dict(self): "label": self.label, "type": self.type, "text": self.text, - "options": [options.to_dict() for options in self.options], + "options": ( + [options.to_dict() for options in self.options] + if self.options is not None + else None + ), } class FlowsPageComponentSelectItem(object): @@ -610,7 +2066,11 @@ def __init__(self, payload: Dict[str, Any]): def to_dict(self): return { "body": self.body, - "actions": [actions.to_dict() for actions in self.actions], + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), } class TwilioCard(object): @@ -635,7 +2095,11 @@ def to_dict(self): "title": self.title, "subtitle": self.subtitle, "media": self.media, - "actions": [actions.to_dict() for actions in self.actions], + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), } class TwilioCarousel(object): @@ -652,7 +2116,11 @@ def __init__(self, payload: Dict[str, Any]): def to_dict(self): return { "body": self.body, - "cards": [cards.to_dict() for cards in self.cards], + "cards": ( + [cards.to_dict() for cards in self.cards] + if self.cards is not None + else None + ), } class TwilioCatalog(object): @@ -680,7 +2148,11 @@ def to_dict(self): "body": self.body, "subtitle": self.subtitle, "id": self.id, - "items": [items.to_dict() for items in self.items], + "items": ( + [items.to_dict() for items in self.items] + if self.items is not None + else None + ), "dynamic_items": self.dynamic_items, } @@ -709,7 +2181,11 @@ def to_dict(self): "button_text": self.button_text, "subtitle": self.subtitle, "media_url": self.media_url, - "pages": [pages.to_dict() for pages in self.pages], + "pages": ( + [pages.to_dict() for pages in self.pages] + if self.pages is not None + else None + ), "type": self.type, } @@ -730,7 +2206,11 @@ def to_dict(self): return { "body": self.body, "button": self.button, - "items": [items.to_dict() for items in self.items], + "items": ( + [items.to_dict() for items in self.items] + if self.items is not None + else None + ), } class TwilioLocation(object): @@ -786,7 +2266,11 @@ def __init__(self, payload: Dict[str, Any]): def to_dict(self): return { "body": self.body, - "actions": [actions.to_dict() for actions in self.actions], + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), } class TwilioText(object): @@ -860,18 +2344,62 @@ def __init__(self, payload: Dict[str, Any]): def to_dict(self): return { - "twilio_text": self.twilio_text.to_dict(), - "twilio_media": self.twilio_media.to_dict(), - "twilio_location": self.twilio_location.to_dict(), - "twilio_list_picker": self.twilio_list_picker.to_dict(), - "twilio_call_to_action": self.twilio_call_to_action.to_dict(), - "twilio_quick_reply": self.twilio_quick_reply.to_dict(), - "twilio_card": self.twilio_card.to_dict(), - "twilio_catalog": self.twilio_catalog.to_dict(), - "twilio_carousel": self.twilio_carousel.to_dict(), - "twilio_flows": self.twilio_flows.to_dict(), - "whatsapp_card": self.whatsapp_card.to_dict(), - "whatsapp_authentication": self.whatsapp_authentication.to_dict(), + "twilio_text": ( + self.twilio_text.to_dict() if self.twilio_text is not None else None + ), + "twilio_media": ( + self.twilio_media.to_dict() + if self.twilio_media is not None + else None + ), + "twilio_location": ( + self.twilio_location.to_dict() + if self.twilio_location is not None + else None + ), + "twilio_list_picker": ( + self.twilio_list_picker.to_dict() + if self.twilio_list_picker is not None + else None + ), + "twilio_call_to_action": ( + self.twilio_call_to_action.to_dict() + if self.twilio_call_to_action is not None + else None + ), + "twilio_quick_reply": ( + self.twilio_quick_reply.to_dict() + if self.twilio_quick_reply is not None + else None + ), + "twilio_card": ( + self.twilio_card.to_dict() if self.twilio_card is not None else None + ), + "twilio_catalog": ( + self.twilio_catalog.to_dict() + if self.twilio_catalog is not None + else None + ), + "twilio_carousel": ( + self.twilio_carousel.to_dict() + if self.twilio_carousel is not None + else None + ), + "twilio_flows": ( + self.twilio_flows.to_dict() + if self.twilio_flows is not None + else None + ), + "whatsapp_card": ( + self.whatsapp_card.to_dict() + if self.whatsapp_card is not None + else None + ), + "whatsapp_authentication": ( + self.whatsapp_authentication.to_dict() + if self.whatsapp_authentication is not None + else None + ), } class WhatsappAuthentication(object): @@ -897,7 +2425,11 @@ def to_dict(self): return { "add_security_recommendation": self.add_security_recommendation, "code_expiration_minutes": self.code_expiration_minutes, - "actions": [actions.to_dict() for actions in self.actions], + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), } class WhatsappCard(object): @@ -925,7 +2457,11 @@ def to_dict(self): "footer": self.footer, "media": self.media, "header_text": self.header_text, - "actions": [actions.to_dict() for actions in self.actions], + "actions": ( + [actions.to_dict() for actions in self.actions] + if self.actions is not None + else None + ), } def __init__(self, version: Version): @@ -950,8 +2486,11 @@ def create(self, content_create_request: ContentCreateRequest) -> ContentInstanc data = content_create_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -971,8 +2510,11 @@ async def create_async( data = content_create_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1106,7 +2648,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ContentPage(self._version, response) async def page_async( @@ -1133,8 +2681,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ContentPage(self._version, response) diff --git a/twilio/rest/content/v1/content/approval_create.py b/twilio/rest/content/v1/content/approval_create.py index 4f22f2df14..9f34064e35 100644 --- a/twilio/rest/content/v1/content/approval_create.py +++ b/twilio/rest/content/v1/content/approval_create.py @@ -21,13 +21,31 @@ class ApprovalCreateInstance(InstanceResource): + + class ContentApprovalRequest(object): + """ + :ivar name: Name of the template. + :ivar category: A WhatsApp recognized template category. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.name: Optional[str] = payload.get("name") + self.category: Optional[str] = payload.get("category") + + def to_dict(self): + return { + "name": self.name, + "category": self.category, + } + """ - :ivar name: - :ivar category: - :ivar content_type: - :ivar status: - :ivar rejection_reason: - :ivar allow_category_change: + :ivar name: + :ivar category: + :ivar content_type: + :ivar status: + :ivar rejection_reason: + :ivar allow_category_change: """ def __init__(self, version: Version, payload: Dict[str, Any], content_sid: str): @@ -106,8 +124,11 @@ def create( data = content_approval_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -129,8 +150,11 @@ async def create_async( data = content_approval_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/content/v1/content/approval_fetch.py b/twilio/rest/content/v1/content/approval_fetch.py index f35ef6a48f..d3d00e5058 100644 --- a/twilio/rest/content/v1/content/approval_fetch.py +++ b/twilio/rest/content/v1/content/approval_fetch.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -108,10 +109,11 @@ def fetch(self) -> ApprovalFetchInstance: :returns: The fetched ApprovalFetchInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ApprovalFetchInstance( self._version, @@ -127,9 +129,12 @@ async def fetch_async(self) -> ApprovalFetchInstance: :returns: The fetched ApprovalFetchInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ApprovalFetchInstance( diff --git a/twilio/rest/content/v1/content_and_approvals.py b/twilio/rest/content/v1/content_and_approvals.py index de40cfc172..c2a210665d 100644 --- a/twilio/rest/content/v1/content_and_approvals.py +++ b/twilio/rest/content/v1/content_and_approvals.py @@ -223,7 +223,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ContentAndApprovalsPage(self._version, response) async def page_async( @@ -250,8 +256,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ContentAndApprovalsPage(self._version, response) diff --git a/twilio/rest/content/v1/legacy_content.py b/twilio/rest/content/v1/legacy_content.py index cfb4ac698d..d32778e748 100644 --- a/twilio/rest/content/v1/legacy_content.py +++ b/twilio/rest/content/v1/legacy_content.py @@ -225,7 +225,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return LegacyContentPage(self._version, response) async def page_async( @@ -252,8 +258,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return LegacyContentPage(self._version, response) diff --git a/twilio/rest/content/v2/content.py b/twilio/rest/content/v2/content.py index c8abf4dcda..c2e2db7d8c 100644 --- a/twilio/rest/content/v2/content.py +++ b/twilio/rest/content/v2/content.py @@ -362,7 +362,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ContentPage(self._version, response) async def page_async( @@ -416,8 +422,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ContentPage(self._version, response) diff --git a/twilio/rest/content/v2/content_and_approvals.py b/twilio/rest/content/v2/content_and_approvals.py index 4c081b9e22..823bcfe083 100644 --- a/twilio/rest/content/v2/content_and_approvals.py +++ b/twilio/rest/content/v2/content_and_approvals.py @@ -362,7 +362,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ContentAndApprovalsPage(self._version, response) async def page_async( @@ -416,8 +422,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ContentAndApprovalsPage(self._version, response) diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index 58bd74be49..096f023889 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -251,10 +251,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -263,9 +263,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AddressConfigurationInstance: @@ -276,10 +278,11 @@ def fetch(self) -> AddressConfigurationInstance: :returns: The fetched AddressConfigurationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AddressConfigurationInstance( self._version, @@ -295,9 +298,12 @@ async def fetch_async(self) -> AddressConfigurationInstance: :returns: The fetched AddressConfigurationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AddressConfigurationInstance( @@ -337,6 +343,7 @@ def update( :returns: The updated AddressConfigurationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -354,11 +361,14 @@ def update( "AutoCreation.StudioRetryCount": auto_creation_studio_retry_count, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressConfigurationInstance( @@ -396,6 +406,7 @@ async def update_async( :returns: The updated AddressConfigurationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -413,11 +424,14 @@ async def update_async( "AutoCreation.StudioRetryCount": auto_creation_studio_retry_count, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AddressConfigurationInstance( @@ -528,6 +542,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -594,6 +612,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -740,7 +762,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AddressConfigurationPage(self._version, response) async def page_async( @@ -770,8 +798,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AddressConfigurationPage(self._version, response) diff --git a/twilio/rest/conversations/v1/configuration/__init__.py b/twilio/rest/conversations/v1/configuration/__init__.py index 46f511aa1e..584082353f 100644 --- a/twilio/rest/conversations/v1/configuration/__init__.py +++ b/twilio/rest/conversations/v1/configuration/__init__.py @@ -162,10 +162,11 @@ def fetch(self) -> ConfigurationInstance: :returns: The fetched ConfigurationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ConfigurationInstance( self._version, @@ -180,9 +181,12 @@ async def fetch_async(self) -> ConfigurationInstance: :returns: The fetched ConfigurationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ConfigurationInstance( @@ -207,6 +211,7 @@ def update( :returns: The updated ConfigurationInstance """ + data = values.of( { "DefaultChatServiceSid": default_chat_service_sid, @@ -215,11 +220,14 @@ def update( "DefaultClosedTimer": default_closed_timer, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConfigurationInstance(self._version, payload) @@ -241,6 +249,7 @@ async def update_async( :returns: The updated ConfigurationInstance """ + data = values.of( { "DefaultChatServiceSid": default_chat_service_sid, @@ -249,11 +258,14 @@ async def update_async( "DefaultClosedTimer": default_closed_timer, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConfigurationInstance(self._version, payload) diff --git a/twilio/rest/conversations/v1/configuration/webhook.py b/twilio/rest/conversations/v1/configuration/webhook.py index 4ece54232c..183930708e 100644 --- a/twilio/rest/conversations/v1/configuration/webhook.py +++ b/twilio/rest/conversations/v1/configuration/webhook.py @@ -169,10 +169,11 @@ def fetch(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WebhookInstance( self._version, @@ -187,9 +188,12 @@ async def fetch_async(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WebhookInstance( @@ -216,6 +220,7 @@ def update( :returns: The updated WebhookInstance """ + data = values.of( { "Method": method, @@ -225,11 +230,14 @@ def update( "Target": target, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance(self._version, payload) @@ -253,6 +261,7 @@ async def update_async( :returns: The updated WebhookInstance """ + data = values.of( { "Method": method, @@ -262,11 +271,14 @@ async def update_async( "Target": target, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance(self._version, payload) diff --git a/twilio/rest/conversations/v1/conversation/__init__.py b/twilio/rest/conversations/v1/conversation/__init__.py index 4eb14b769c..d1f08cc2d8 100644 --- a/twilio/rest/conversations/v1/conversation/__init__.py +++ b/twilio/rest/conversations/v1/conversation/__init__.py @@ -320,6 +320,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -341,6 +343,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -353,10 +357,11 @@ def fetch(self) -> ConversationInstance: :returns: The fetched ConversationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ConversationInstance( self._version, @@ -372,9 +377,12 @@ async def fetch_async(self) -> ConversationInstance: :returns: The fetched ConversationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ConversationInstance( @@ -418,6 +426,7 @@ def update( :returns: The updated ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -433,11 +442,20 @@ def update( "Bindings.Email.Name": bindings_email_name, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -480,6 +498,7 @@ async def update_async( :returns: The updated ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -495,11 +514,20 @@ async def update_async( "Bindings.Email.Name": bindings_email_name, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -643,6 +671,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -707,6 +739,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -889,7 +925,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConversationPage(self._version, response) async def page_async( @@ -925,8 +967,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConversationPage(self._version, response) diff --git a/twilio/rest/conversations/v1/conversation/message/__init__.py b/twilio/rest/conversations/v1/conversation/message/__init__.py index 8488bee004..04e7fdf252 100644 --- a/twilio/rest/conversations/v1/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/conversation/message/__init__.py @@ -285,6 +285,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -306,6 +308,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -318,10 +322,11 @@ def fetch(self) -> MessageInstance: :returns: The fetched MessageInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MessageInstance( self._version, @@ -338,9 +343,12 @@ async def fetch_async(self) -> MessageInstance: :returns: The fetched MessageInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MessageInstance( @@ -375,6 +383,7 @@ def update( :returns: The updated MessageInstance """ + data = values.of( { "Author": author, @@ -385,11 +394,20 @@ def update( "Subject": subject, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -427,6 +445,7 @@ async def update_async( :returns: The updated MessageInstance """ + data = values.of( { "Author": author, @@ -437,11 +456,20 @@ async def update_async( "Subject": subject, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -570,6 +598,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -630,6 +662,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -778,7 +814,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MessagePage(self._version, response, self._solution) async def page_async( @@ -808,8 +850,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MessagePage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py b/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py index 16af7892e9..2ed297e059 100644 --- a/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py +++ b/twilio/rest/conversations/v1/conversation/message/delivery_receipt.py @@ -158,10 +158,11 @@ def fetch(self) -> DeliveryReceiptInstance: :returns: The fetched DeliveryReceiptInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DeliveryReceiptInstance( self._version, @@ -179,9 +180,12 @@ async def fetch_async(self) -> DeliveryReceiptInstance: :returns: The fetched DeliveryReceiptInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DeliveryReceiptInstance( @@ -377,7 +381,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DeliveryReceiptPage(self._version, response, self._solution) async def page_async( @@ -404,8 +414,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DeliveryReceiptPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/conversation/participant.py b/twilio/rest/conversations/v1/conversation/participant.py index 92f8e5de40..deb652641a 100644 --- a/twilio/rest/conversations/v1/conversation/participant.py +++ b/twilio/rest/conversations/v1/conversation/participant.py @@ -285,6 +285,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -306,6 +308,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -318,10 +322,11 @@ def fetch(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ParticipantInstance( self._version, @@ -338,9 +343,12 @@ async def fetch_async(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ParticipantInstance( @@ -381,6 +389,7 @@ def update( :returns: The updated ParticipantInstance """ + data = values.of( { "DateCreated": serialize.iso8601_datetime(date_created), @@ -394,11 +403,20 @@ def update( "LastReadTimestamp": last_read_timestamp, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -442,6 +460,7 @@ async def update_async( :returns: The updated ParticipantInstance """ + data = values.of( { "DateCreated": serialize.iso8601_datetime(date_created), @@ -455,11 +474,20 @@ async def update_async( "LastReadTimestamp": last_read_timestamp, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -572,6 +600,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -629,6 +661,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -764,7 +800,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ParticipantPage(self._version, response, self._solution) async def page_async( @@ -791,8 +833,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ParticipantPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/conversation/webhook.py b/twilio/rest/conversations/v1/conversation/webhook.py index b961b832a5..837f88c26f 100644 --- a/twilio/rest/conversations/v1/conversation/webhook.py +++ b/twilio/rest/conversations/v1/conversation/webhook.py @@ -216,10 +216,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -228,9 +228,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> WebhookInstance: @@ -241,10 +243,11 @@ def fetch(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WebhookInstance( self._version, @@ -261,9 +264,12 @@ async def fetch_async(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WebhookInstance( @@ -292,6 +298,7 @@ def update( :returns: The updated WebhookInstance """ + data = values.of( { "Configuration.Url": configuration_url, @@ -305,11 +312,14 @@ def update( "Configuration.FlowSid": configuration_flow_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -338,6 +348,7 @@ async def update_async( :returns: The updated WebhookInstance """ + data = values.of( { "Configuration.Url": configuration_url, @@ -351,11 +362,14 @@ async def update_async( "Configuration.FlowSid": configuration_flow_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -457,6 +471,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -506,6 +524,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -641,7 +663,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return WebhookPage(self._version, response, self._solution) async def page_async( @@ -668,8 +696,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WebhookPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/conversation_with_participants.py b/twilio/rest/conversations/v1/conversation_with_participants.py index b50c2da1a7..a818a29ca4 100644 --- a/twilio/rest/conversations/v1/conversation_with_participants.py +++ b/twilio/rest/conversations/v1/conversation_with_participants.py @@ -159,6 +159,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -228,6 +232,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/conversations/v1/credential.py b/twilio/rest/conversations/v1/credential.py index c8cd78ab05..f382458ba7 100644 --- a/twilio/rest/conversations/v1/credential.py +++ b/twilio/rest/conversations/v1/credential.py @@ -214,10 +214,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -226,9 +226,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CredentialInstance: @@ -239,10 +241,11 @@ def fetch(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CredentialInstance( self._version, @@ -258,9 +261,12 @@ async def fetch_async(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CredentialInstance( @@ -292,6 +298,7 @@ def update( :returns: The updated CredentialInstance """ + data = values.of( { "Type": type, @@ -303,11 +310,14 @@ def update( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -335,6 +345,7 @@ async def update_async( :returns: The updated CredentialInstance """ + data = values.of( { "Type": type, @@ -346,11 +357,14 @@ async def update_async( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -434,6 +448,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -477,6 +495,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -610,7 +632,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CredentialPage(self._version, response) async def page_async( @@ -637,8 +665,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CredentialPage(self._version, response) diff --git a/twilio/rest/conversations/v1/participant_conversation.py b/twilio/rest/conversations/v1/participant_conversation.py index 7413047152..0938bd5421 100644 --- a/twilio/rest/conversations/v1/participant_conversation.py +++ b/twilio/rest/conversations/v1/participant_conversation.py @@ -285,7 +285,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ParticipantConversationPage(self._version, response) async def page_async( @@ -318,8 +324,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ParticipantConversationPage(self._version, response) diff --git a/twilio/rest/conversations/v1/role.py b/twilio/rest/conversations/v1/role.py index 301063800a..229e9b7dd4 100644 --- a/twilio/rest/conversations/v1/role.py +++ b/twilio/rest/conversations/v1/role.py @@ -173,10 +173,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -185,9 +185,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RoleInstance: @@ -198,10 +200,11 @@ def fetch(self) -> RoleInstance: :returns: The fetched RoleInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RoleInstance( self._version, @@ -217,9 +220,12 @@ async def fetch_async(self) -> RoleInstance: :returns: The fetched RoleInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RoleInstance( @@ -236,16 +242,20 @@ def update(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance(self._version, payload, sid=self._solution["sid"]) @@ -258,16 +268,20 @@ async def update_async(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance(self._version, payload, sid=self._solution["sid"]) @@ -336,6 +350,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -364,6 +382,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -497,7 +519,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RolePage(self._version, response) async def page_async( @@ -524,8 +552,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RolePage(self._version, response) diff --git a/twilio/rest/conversations/v1/service/__init__.py b/twilio/rest/conversations/v1/service/__init__.py index 415c252290..3b92c87934 100644 --- a/twilio/rest/conversations/v1/service/__init__.py +++ b/twilio/rest/conversations/v1/service/__init__.py @@ -210,10 +210,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -222,9 +222,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -235,10 +237,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -254,9 +257,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -407,6 +413,10 @@ def create(self, friendly_name: str) -> ServiceInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -429,6 +439,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -562,7 +576,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -589,8 +609,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/conversations/v1/service/binding.py b/twilio/rest/conversations/v1/service/binding.py index 6e66844490..363dab91d0 100644 --- a/twilio/rest/conversations/v1/service/binding.py +++ b/twilio/rest/conversations/v1/service/binding.py @@ -166,10 +166,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -178,9 +178,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> BindingInstance: @@ -191,10 +193,11 @@ def fetch(self) -> BindingInstance: :returns: The fetched BindingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BindingInstance( self._version, @@ -211,9 +214,12 @@ async def fetch_async(self) -> BindingInstance: :returns: The fetched BindingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return BindingInstance( @@ -429,7 +435,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return BindingPage(self._version, response, self._solution) async def page_async( @@ -462,8 +474,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BindingPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/service/configuration/__init__.py b/twilio/rest/conversations/v1/service/configuration/__init__.py index 9ca23a435f..e37c8888c8 100644 --- a/twilio/rest/conversations/v1/service/configuration/__init__.py +++ b/twilio/rest/conversations/v1/service/configuration/__init__.py @@ -178,10 +178,11 @@ def fetch(self) -> ConfigurationInstance: :returns: The fetched ConfigurationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ConfigurationInstance( self._version, @@ -197,9 +198,12 @@ async def fetch_async(self) -> ConfigurationInstance: :returns: The fetched ConfigurationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ConfigurationInstance( @@ -225,6 +229,7 @@ def update( :returns: The updated ConfigurationInstance """ + data = values.of( { "DefaultConversationCreatorRoleSid": default_conversation_creator_role_sid, @@ -235,11 +240,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConfigurationInstance( @@ -263,6 +271,7 @@ async def update_async( :returns: The updated ConfigurationInstance """ + data = values.of( { "DefaultConversationCreatorRoleSid": default_conversation_creator_role_sid, @@ -273,11 +282,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConfigurationInstance( diff --git a/twilio/rest/conversations/v1/service/configuration/notification.py b/twilio/rest/conversations/v1/service/configuration/notification.py index 2dee2d4d29..6aced28115 100644 --- a/twilio/rest/conversations/v1/service/configuration/notification.py +++ b/twilio/rest/conversations/v1/service/configuration/notification.py @@ -225,10 +225,11 @@ def fetch(self) -> NotificationInstance: :returns: The fetched NotificationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return NotificationInstance( self._version, @@ -244,9 +245,12 @@ async def fetch_async(self) -> NotificationInstance: :returns: The fetched NotificationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return NotificationInstance( @@ -290,6 +294,7 @@ def update( :returns: The updated NotificationInstance """ + data = values.of( { "LogEnabled": serialize.boolean_to_string(log_enabled), @@ -315,11 +320,14 @@ def update( "NewMessage.WithMedia.Template": new_message_with_media_template, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NotificationInstance( @@ -361,6 +369,7 @@ async def update_async( :returns: The updated NotificationInstance """ + data = values.of( { "LogEnabled": serialize.boolean_to_string(log_enabled), @@ -386,11 +395,14 @@ async def update_async( "NewMessage.WithMedia.Template": new_message_with_media_template, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NotificationInstance( diff --git a/twilio/rest/conversations/v1/service/configuration/webhook.py b/twilio/rest/conversations/v1/service/configuration/webhook.py index aa4015361f..706f410550 100644 --- a/twilio/rest/conversations/v1/service/configuration/webhook.py +++ b/twilio/rest/conversations/v1/service/configuration/webhook.py @@ -172,10 +172,11 @@ def fetch(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WebhookInstance( self._version, @@ -191,9 +192,12 @@ async def fetch_async(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WebhookInstance( @@ -219,6 +223,7 @@ def update( :returns: The updated WebhookInstance """ + data = values.of( { "PreWebhookUrl": pre_webhook_url, @@ -227,11 +232,14 @@ def update( "Method": method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -255,6 +263,7 @@ async def update_async( :returns: The updated WebhookInstance """ + data = values.of( { "PreWebhookUrl": pre_webhook_url, @@ -263,11 +272,14 @@ async def update_async( "Method": method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( diff --git a/twilio/rest/conversations/v1/service/conversation/__init__.py b/twilio/rest/conversations/v1/service/conversation/__init__.py index 139bdcb5ca..0f28c4dfe2 100644 --- a/twilio/rest/conversations/v1/service/conversation/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/__init__.py @@ -332,6 +332,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -353,6 +355,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -365,10 +369,11 @@ def fetch(self) -> ConversationInstance: :returns: The fetched ConversationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ConversationInstance( self._version, @@ -385,9 +390,12 @@ async def fetch_async(self) -> ConversationInstance: :returns: The fetched ConversationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ConversationInstance( @@ -432,6 +440,7 @@ def update( :returns: The updated ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -447,11 +456,20 @@ def update( "Bindings.Email.Name": bindings_email_name, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -499,6 +517,7 @@ async def update_async( :returns: The updated ConversationInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -514,11 +533,20 @@ async def update_async( "Bindings.Email.Name": bindings_email_name, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -679,6 +707,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -745,6 +777,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -929,7 +965,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConversationPage(self._version, response, self._solution) async def page_async( @@ -965,8 +1007,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConversationPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/service/conversation/message/__init__.py b/twilio/rest/conversations/v1/service/conversation/message/__init__.py index 32f480bc59..c4123afd34 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/__init__.py +++ b/twilio/rest/conversations/v1/service/conversation/message/__init__.py @@ -294,6 +294,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -315,6 +317,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -327,10 +331,11 @@ def fetch(self) -> MessageInstance: :returns: The fetched MessageInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MessageInstance( self._version, @@ -348,9 +353,12 @@ async def fetch_async(self) -> MessageInstance: :returns: The fetched MessageInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MessageInstance( @@ -386,6 +394,7 @@ def update( :returns: The updated MessageInstance """ + data = values.of( { "Author": author, @@ -396,11 +405,20 @@ def update( "Subject": subject, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -439,6 +457,7 @@ async def update_async( :returns: The updated MessageInstance """ + data = values.of( { "Author": author, @@ -449,11 +468,20 @@ async def update_async( "Subject": subject, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -589,6 +617,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -652,6 +684,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -803,7 +839,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MessagePage(self._version, response, self._solution) async def page_async( @@ -833,8 +875,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MessagePage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py b/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py index b9bf8a70c8..939b631271 100644 --- a/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py +++ b/twilio/rest/conversations/v1/service/conversation/message/delivery_receipt.py @@ -170,10 +170,11 @@ def fetch(self) -> DeliveryReceiptInstance: :returns: The fetched DeliveryReceiptInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DeliveryReceiptInstance( self._version, @@ -192,9 +193,12 @@ async def fetch_async(self) -> DeliveryReceiptInstance: :returns: The fetched DeliveryReceiptInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DeliveryReceiptInstance( @@ -398,7 +402,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DeliveryReceiptPage(self._version, response, self._solution) async def page_async( @@ -425,8 +435,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DeliveryReceiptPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/service/conversation/participant.py b/twilio/rest/conversations/v1/service/conversation/participant.py index 530bce26fc..03a3cead7e 100644 --- a/twilio/rest/conversations/v1/service/conversation/participant.py +++ b/twilio/rest/conversations/v1/service/conversation/participant.py @@ -294,6 +294,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -315,6 +317,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -327,10 +331,11 @@ def fetch(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ParticipantInstance( self._version, @@ -348,9 +353,12 @@ async def fetch_async(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ParticipantInstance( @@ -392,6 +400,7 @@ def update( :returns: The updated ParticipantInstance """ + data = values.of( { "DateCreated": serialize.iso8601_datetime(date_created), @@ -405,11 +414,20 @@ def update( "LastReadTimestamp": last_read_timestamp, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -454,6 +472,7 @@ async def update_async( :returns: The updated ParticipantInstance """ + data = values.of( { "DateCreated": serialize.iso8601_datetime(date_created), @@ -467,11 +486,20 @@ async def update_async( "LastReadTimestamp": last_read_timestamp, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -590,6 +618,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -650,6 +682,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -788,7 +824,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ParticipantPage(self._version, response, self._solution) async def page_async( @@ -815,8 +857,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ParticipantPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/service/conversation/webhook.py b/twilio/rest/conversations/v1/service/conversation/webhook.py index 327dc9f024..08ec93ce4e 100644 --- a/twilio/rest/conversations/v1/service/conversation/webhook.py +++ b/twilio/rest/conversations/v1/service/conversation/webhook.py @@ -225,10 +225,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -237,9 +237,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> WebhookInstance: @@ -250,10 +252,11 @@ def fetch(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WebhookInstance( self._version, @@ -271,9 +274,12 @@ async def fetch_async(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WebhookInstance( @@ -303,6 +309,7 @@ def update( :returns: The updated WebhookInstance """ + data = values.of( { "Configuration.Url": configuration_url, @@ -316,11 +323,14 @@ def update( "Configuration.FlowSid": configuration_flow_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -350,6 +360,7 @@ async def update_async( :returns: The updated WebhookInstance """ + data = values.of( { "Configuration.Url": configuration_url, @@ -363,11 +374,14 @@ async def update_async( "Configuration.FlowSid": configuration_flow_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -475,6 +489,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -527,6 +545,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -665,7 +687,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return WebhookPage(self._version, response, self._solution) async def page_async( @@ -692,8 +720,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WebhookPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/service/conversation_with_participants.py b/twilio/rest/conversations/v1/service/conversation_with_participants.py index ef1495debb..ff82a8ce35 100644 --- a/twilio/rest/conversations/v1/service/conversation_with_participants.py +++ b/twilio/rest/conversations/v1/service/conversation_with_participants.py @@ -176,6 +176,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -247,6 +251,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/conversations/v1/service/participant_conversation.py b/twilio/rest/conversations/v1/service/participant_conversation.py index 2c3bebcc1e..8ec561a7d9 100644 --- a/twilio/rest/conversations/v1/service/participant_conversation.py +++ b/twilio/rest/conversations/v1/service/participant_conversation.py @@ -302,7 +302,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ParticipantConversationPage(self._version, response, self._solution) async def page_async( @@ -335,8 +341,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ParticipantConversationPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/service/role.py b/twilio/rest/conversations/v1/service/role.py index 170512a2b2..0884fb008b 100644 --- a/twilio/rest/conversations/v1/service/role.py +++ b/twilio/rest/conversations/v1/service/role.py @@ -181,10 +181,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -193,9 +193,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RoleInstance: @@ -206,10 +208,11 @@ def fetch(self) -> RoleInstance: :returns: The fetched RoleInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RoleInstance( self._version, @@ -226,9 +229,12 @@ async def fetch_async(self) -> RoleInstance: :returns: The fetched RoleInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RoleInstance( @@ -246,16 +252,20 @@ def update(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -273,16 +283,20 @@ async def update_async(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -363,6 +377,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -393,6 +411,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -528,7 +550,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RolePage(self._version, response, self._solution) async def page_async( @@ -555,8 +583,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RolePage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/service/user/__init__.py b/twilio/rest/conversations/v1/service/user/__init__.py index 4d4df0398d..b8cda74c8c 100644 --- a/twilio/rest/conversations/v1/service/user/__init__.py +++ b/twilio/rest/conversations/v1/service/user/__init__.py @@ -257,6 +257,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -278,6 +280,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -290,10 +294,11 @@ def fetch(self) -> UserInstance: :returns: The fetched UserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserInstance( self._version, @@ -310,9 +315,12 @@ async def fetch_async(self) -> UserInstance: :returns: The fetched UserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserInstance( @@ -341,6 +349,7 @@ def update( :returns: The updated UserInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -348,11 +357,20 @@ def update( "RoleSid": role_sid, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -384,6 +402,7 @@ async def update_async( :returns: The updated UserInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -391,11 +410,20 @@ async def update_async( "RoleSid": role_sid, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -507,6 +535,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -552,6 +584,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -687,7 +723,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserPage(self._version, response, self._solution) async def page_async( @@ -714,8 +756,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/service/user/user_conversation.py b/twilio/rest/conversations/v1/service/user/user_conversation.py index 7a836505b9..4f1727f8e8 100644 --- a/twilio/rest/conversations/v1/service/user/user_conversation.py +++ b/twilio/rest/conversations/v1/service/user/user_conversation.py @@ -247,10 +247,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -259,9 +259,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> UserConversationInstance: @@ -272,10 +274,11 @@ def fetch(self) -> UserConversationInstance: :returns: The fetched UserConversationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserConversationInstance( self._version, @@ -293,9 +296,12 @@ async def fetch_async(self) -> UserConversationInstance: :returns: The fetched UserConversationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserConversationInstance( @@ -323,6 +329,7 @@ def update( :returns: The updated UserConversationInstance """ + data = values.of( { "NotificationLevel": notification_level, @@ -330,11 +337,14 @@ def update( "LastReadMessageIndex": last_read_message_index, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserConversationInstance( @@ -362,6 +372,7 @@ async def update_async( :returns: The updated UserConversationInstance """ + data = values.of( { "NotificationLevel": notification_level, @@ -369,11 +380,14 @@ async def update_async( "LastReadMessageIndex": last_read_message_index, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserConversationInstance( @@ -569,7 +583,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserConversationPage(self._version, response, self._solution) async def page_async( @@ -596,8 +616,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserConversationPage(self._version, response, self._solution) diff --git a/twilio/rest/conversations/v1/user/__init__.py b/twilio/rest/conversations/v1/user/__init__.py index a05deeda43..fe5d12f095 100644 --- a/twilio/rest/conversations/v1/user/__init__.py +++ b/twilio/rest/conversations/v1/user/__init__.py @@ -247,6 +247,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -268,6 +270,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -280,10 +284,11 @@ def fetch(self) -> UserInstance: :returns: The fetched UserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserInstance( self._version, @@ -299,9 +304,12 @@ async def fetch_async(self) -> UserInstance: :returns: The fetched UserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserInstance( @@ -329,6 +337,7 @@ def update( :returns: The updated UserInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -336,11 +345,20 @@ def update( "RoleSid": role_sid, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -367,6 +385,7 @@ async def update_async( :returns: The updated UserInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -374,11 +393,20 @@ async def update_async( "RoleSid": role_sid, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -477,6 +505,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -520,6 +552,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -653,7 +689,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserPage(self._version, response) async def page_async( @@ -680,8 +722,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserPage(self._version, response) diff --git a/twilio/rest/conversations/v1/user/user_conversation.py b/twilio/rest/conversations/v1/user/user_conversation.py index e162441151..16ce2c2418 100644 --- a/twilio/rest/conversations/v1/user/user_conversation.py +++ b/twilio/rest/conversations/v1/user/user_conversation.py @@ -236,10 +236,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -248,9 +248,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> UserConversationInstance: @@ -261,10 +263,11 @@ def fetch(self) -> UserConversationInstance: :returns: The fetched UserConversationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserConversationInstance( self._version, @@ -281,9 +284,12 @@ async def fetch_async(self) -> UserConversationInstance: :returns: The fetched UserConversationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserConversationInstance( @@ -310,6 +316,7 @@ def update( :returns: The updated UserConversationInstance """ + data = values.of( { "NotificationLevel": notification_level, @@ -317,11 +324,14 @@ def update( "LastReadMessageIndex": last_read_message_index, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserConversationInstance( @@ -348,6 +358,7 @@ async def update_async( :returns: The updated UserConversationInstance """ + data = values.of( { "NotificationLevel": notification_level, @@ -355,11 +366,14 @@ async def update_async( "LastReadMessageIndex": last_read_message_index, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserConversationInstance( @@ -545,7 +559,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserConversationPage(self._version, response, self._solution) async def page_async( @@ -572,8 +592,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserConversationPage(self._version, response, self._solution) diff --git a/twilio/rest/events/v1/event_type.py b/twilio/rest/events/v1/event_type.py index a019a82a9e..7eaaeb03ba 100644 --- a/twilio/rest/events/v1/event_type.py +++ b/twilio/rest/events/v1/event_type.py @@ -127,10 +127,11 @@ def fetch(self) -> EventTypeInstance: :returns: The fetched EventTypeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EventTypeInstance( self._version, @@ -146,9 +147,12 @@ async def fetch_async(self) -> EventTypeInstance: :returns: The fetched EventTypeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EventTypeInstance( @@ -339,7 +343,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EventTypePage(self._version, response) async def page_async( @@ -369,8 +379,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EventTypePage(self._version, response) diff --git a/twilio/rest/events/v1/schema/__init__.py b/twilio/rest/events/v1/schema/__init__.py index c3b6593c03..2c7ffa6b28 100644 --- a/twilio/rest/events/v1/schema/__init__.py +++ b/twilio/rest/events/v1/schema/__init__.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, Optional -from twilio.base import deserialize +from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -129,10 +129,11 @@ def fetch(self) -> SchemaInstance: :returns: The fetched SchemaInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SchemaInstance( self._version, @@ -148,9 +149,12 @@ async def fetch_async(self) -> SchemaInstance: :returns: The fetched SchemaInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SchemaInstance( diff --git a/twilio/rest/events/v1/schema/schema_version.py b/twilio/rest/events/v1/schema/schema_version.py index 3557cb2935..be000b9c0b 100644 --- a/twilio/rest/events/v1/schema/schema_version.py +++ b/twilio/rest/events/v1/schema/schema_version.py @@ -127,10 +127,11 @@ def fetch(self) -> SchemaVersionInstance: :returns: The fetched SchemaVersionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SchemaVersionInstance( self._version, @@ -147,9 +148,12 @@ async def fetch_async(self) -> SchemaVersionInstance: :returns: The fetched SchemaVersionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SchemaVersionInstance( @@ -333,7 +337,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SchemaVersionPage(self._version, response, self._solution) async def page_async( @@ -360,8 +370,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SchemaVersionPage(self._version, response, self._solution) diff --git a/twilio/rest/events/v1/sink/__init__.py b/twilio/rest/events/v1/sink/__init__.py index 9098c51bd7..886c2947f5 100644 --- a/twilio/rest/events/v1/sink/__init__.py +++ b/twilio/rest/events/v1/sink/__init__.py @@ -201,10 +201,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -213,9 +213,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SinkInstance: @@ -226,10 +228,11 @@ def fetch(self) -> SinkInstance: :returns: The fetched SinkInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SinkInstance( self._version, @@ -245,9 +248,12 @@ async def fetch_async(self) -> SinkInstance: :returns: The fetched SinkInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SinkInstance( @@ -264,16 +270,20 @@ def update(self, description: str) -> SinkInstance: :returns: The updated SinkInstance """ + data = values.of( { "Description": description, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SinkInstance(self._version, payload, sid=self._solution["sid"]) @@ -286,16 +296,20 @@ async def update_async(self, description: str) -> SinkInstance: :returns: The updated SinkInstance """ + data = values.of( { "Description": description, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SinkInstance(self._version, payload, sid=self._solution["sid"]) @@ -391,6 +405,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -422,6 +440,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -583,7 +605,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SinkPage(self._version, response) async def page_async( @@ -616,8 +644,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SinkPage(self._version, response) diff --git a/twilio/rest/events/v1/sink/sink_test.py b/twilio/rest/events/v1/sink/sink_test.py index 150e7deabc..566106efca 100644 --- a/twilio/rest/events/v1/sink/sink_test.py +++ b/twilio/rest/events/v1/sink/sink_test.py @@ -72,6 +72,8 @@ def create(self) -> SinkTestInstance: headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = self._version.create(method="POST", uri=self._uri, headers=headers) return SinkTestInstance(self._version, payload, sid=self._solution["sid"]) @@ -86,6 +88,8 @@ async def create_async(self) -> SinkTestInstance: headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, headers=headers ) diff --git a/twilio/rest/events/v1/sink/sink_validate.py b/twilio/rest/events/v1/sink/sink_validate.py index 8c6565a007..53eef814c0 100644 --- a/twilio/rest/events/v1/sink/sink_validate.py +++ b/twilio/rest/events/v1/sink/sink_validate.py @@ -78,6 +78,10 @@ def create(self, test_id: str) -> SinkValidateInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -100,6 +104,10 @@ async def create_async(self, test_id: str) -> SinkValidateInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/events/v1/subscription/__init__.py b/twilio/rest/events/v1/subscription/__init__.py index 2f6d7e91a2..872c9ed7d0 100644 --- a/twilio/rest/events/v1/subscription/__init__.py +++ b/twilio/rest/events/v1/subscription/__init__.py @@ -188,10 +188,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -200,9 +200,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SubscriptionInstance: @@ -213,10 +215,11 @@ def fetch(self) -> SubscriptionInstance: :returns: The fetched SubscriptionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SubscriptionInstance( self._version, @@ -232,9 +235,12 @@ async def fetch_async(self) -> SubscriptionInstance: :returns: The fetched SubscriptionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SubscriptionInstance( @@ -256,17 +262,21 @@ def update( :returns: The updated SubscriptionInstance """ + data = values.of( { "Description": description, "SinkSid": sink_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscriptionInstance(self._version, payload, sid=self._solution["sid"]) @@ -284,17 +294,21 @@ async def update_async( :returns: The updated SubscriptionInstance """ + data = values.of( { "Description": description, "SinkSid": sink_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscriptionInstance(self._version, payload, sid=self._solution["sid"]) @@ -375,6 +389,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -403,6 +421,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -549,7 +571,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SubscriptionPage(self._version, response) async def page_async( @@ -579,8 +607,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SubscriptionPage(self._version, response) diff --git a/twilio/rest/events/v1/subscription/subscribed_event.py b/twilio/rest/events/v1/subscription/subscribed_event.py index 8547fd486b..dae60ac206 100644 --- a/twilio/rest/events/v1/subscription/subscribed_event.py +++ b/twilio/rest/events/v1/subscription/subscribed_event.py @@ -171,10 +171,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -183,9 +183,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SubscribedEventInstance: @@ -196,10 +198,11 @@ def fetch(self) -> SubscribedEventInstance: :returns: The fetched SubscribedEventInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SubscribedEventInstance( self._version, @@ -216,9 +219,12 @@ async def fetch_async(self) -> SubscribedEventInstance: :returns: The fetched SubscribedEventInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SubscribedEventInstance( @@ -238,16 +244,20 @@ def update( :returns: The updated SubscribedEventInstance """ + data = values.of( { "SchemaVersion": schema_version, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscribedEventInstance( @@ -267,16 +277,20 @@ async def update_async( :returns: The updated SubscribedEventInstance """ + data = values.of( { "SchemaVersion": schema_version, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SubscribedEventInstance( @@ -357,6 +371,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -385,6 +403,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -520,7 +542,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SubscribedEventPage(self._version, response, self._solution) async def page_async( @@ -547,8 +575,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SubscribedEventPage(self._version, response, self._solution) diff --git a/twilio/rest/flex_api/v1/assessments.py b/twilio/rest/flex_api/v1/assessments.py index b24d9113d4..130514b295 100644 --- a/twilio/rest/flex_api/v1/assessments.py +++ b/twilio/rest/flex_api/v1/assessments.py @@ -176,6 +176,7 @@ def update( :returns: The updated AssessmentsInstance """ + data = values.of( { "Offset": offset, @@ -183,11 +184,17 @@ def update( "AnswerId": answer_id, } ) - headers = values.of( - { - "Authorization": authorization, - } - ) + headers = values.of({}) + + if not ( + authorization is values.unset + or (isinstance(authorization, str) and not authorization) + ): + headers["Authorization"] = authorization + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -214,6 +221,7 @@ async def update_async( :returns: The updated AssessmentsInstance """ + data = values.of( { "Offset": offset, @@ -221,11 +229,17 @@ async def update_async( "AnswerId": answer_id, } ) - headers = values.of( - { - "Authorization": authorization, - } - ) + headers = values.of({}) + + if not ( + authorization is values.unset + or (isinstance(authorization, str) and not authorization) + ): + headers["Authorization"] = authorization + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -330,6 +344,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -389,6 +407,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -556,7 +578,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AssessmentsPage(self._version, response) async def page_async( @@ -589,8 +622,17 @@ async def page_async( } ) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AssessmentsPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/channel.py b/twilio/rest/flex_api/v1/channel.py index bf4feb99e1..aa98ff8d31 100644 --- a/twilio/rest/flex_api/v1/channel.py +++ b/twilio/rest/flex_api/v1/channel.py @@ -142,10 +142,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -154,9 +154,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ChannelInstance: @@ -167,10 +169,11 @@ def fetch(self) -> ChannelInstance: :returns: The fetched ChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ChannelInstance( self._version, @@ -186,9 +189,12 @@ async def fetch_async(self) -> ChannelInstance: :returns: The fetched ChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ChannelInstance( @@ -285,6 +291,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -337,6 +347,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -470,7 +484,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ChannelPage(self._version, response) async def page_async( @@ -497,8 +517,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ChannelPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/configuration.py b/twilio/rest/flex_api/v1/configuration.py index bec7034cfe..28a66be036 100644 --- a/twilio/rest/flex_api/v1/configuration.py +++ b/twilio/rest/flex_api/v1/configuration.py @@ -304,7 +304,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConfigurationInstance( self._version, @@ -328,8 +334,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConfigurationInstance( @@ -347,12 +357,13 @@ def update( :returns: The updated ConfigurationInstance """ - data = values.of({}) - headers = values.of( - { - "body": body, - } - ) + data = body.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -370,12 +381,13 @@ async def update_async( :returns: The updated ConfigurationInstance """ - data = values.of({}) - headers = values.of( - { - "body": body, - } - ) + data = body.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/flex_api/v1/flex_flow.py b/twilio/rest/flex_api/v1/flex_flow.py index 531dd470b2..0ae2634666 100644 --- a/twilio/rest/flex_api/v1/flex_flow.py +++ b/twilio/rest/flex_api/v1/flex_flow.py @@ -302,10 +302,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -314,9 +314,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> FlexFlowInstance: @@ -327,10 +329,11 @@ def fetch(self) -> FlexFlowInstance: :returns: The fetched FlexFlowInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FlexFlowInstance( self._version, @@ -346,9 +349,12 @@ async def fetch_async(self) -> FlexFlowInstance: :returns: The fetched FlexFlowInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FlexFlowInstance( @@ -402,6 +408,7 @@ def update( :returns: The updated FlexFlowInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -425,11 +432,14 @@ def update( "Integration.RetryCount": integration_retry_count, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlexFlowInstance(self._version, payload, sid=self._solution["sid"]) @@ -479,6 +489,7 @@ async def update_async( :returns: The updated FlexFlowInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -502,11 +513,14 @@ async def update_async( "Integration.RetryCount": integration_retry_count, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlexFlowInstance(self._version, payload, sid=self._solution["sid"]) @@ -624,6 +638,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -701,6 +719,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -849,7 +871,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return FlexFlowPage(self._version, response) async def page_async( @@ -879,8 +907,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return FlexFlowPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/insights_assessments_comment.py b/twilio/rest/flex_api/v1/insights_assessments_comment.py index faeb6ae62c..2b6c79343b 100644 --- a/twilio/rest/flex_api/v1/insights_assessments_comment.py +++ b/twilio/rest/flex_api/v1/insights_assessments_comment.py @@ -138,6 +138,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -185,6 +189,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -367,7 +375,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InsightsAssessmentsCommentPage(self._version, response) async def page_async( @@ -403,8 +422,17 @@ async def page_async( } ) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InsightsAssessmentsCommentPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/insights_conversations.py b/twilio/rest/flex_api/v1/insights_conversations.py index d08608c7e4..efdcea203e 100644 --- a/twilio/rest/flex_api/v1/insights_conversations.py +++ b/twilio/rest/flex_api/v1/insights_conversations.py @@ -242,7 +242,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InsightsConversationsPage(self._version, response) async def page_async( @@ -275,8 +286,17 @@ async def page_async( } ) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InsightsConversationsPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires.py b/twilio/rest/flex_api/v1/insights_questionnaires.py index 1724e2a253..d21aff8242 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires.py @@ -221,6 +221,8 @@ def delete(self, authorization: Union[str, object] = values.unset) -> bool: } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -239,6 +241,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -260,7 +264,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return InsightsQuestionnairesInstance( self._version, @@ -285,8 +295,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InsightsQuestionnairesInstance( @@ -314,6 +328,7 @@ def update( :returns: The updated InsightsQuestionnairesInstance """ + data = values.of( { "Active": serialize.boolean_to_string(active), @@ -322,11 +337,17 @@ def update( "QuestionSids": serialize.map(question_sids, lambda e: e), } ) - headers = values.of( - { - "Authorization": authorization, - } - ) + headers = values.of({}) + + if not ( + authorization is values.unset + or (isinstance(authorization, str) and not authorization) + ): + headers["Authorization"] = authorization + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -357,6 +378,7 @@ async def update_async( :returns: The updated InsightsQuestionnairesInstance """ + data = values.of( { "Active": serialize.boolean_to_string(active), @@ -365,11 +387,17 @@ async def update_async( "QuestionSids": serialize.map(question_sids, lambda e: e), } ) - headers = values.of( - { - "Authorization": authorization, - } - ) + headers = values.of({}) + + if not ( + authorization is values.unset + or (isinstance(authorization, str) and not authorization) + ): + headers["Authorization"] = authorization + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -458,6 +486,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -499,6 +531,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -666,7 +702,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InsightsQuestionnairesPage(self._version, response) async def page_async( @@ -699,8 +746,17 @@ async def page_async( } ) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InsightsQuestionnairesPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_category.py b/twilio/rest/flex_api/v1/insights_questionnaires_category.py index aba8eb8bdd..817a4753f9 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_category.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_category.py @@ -165,6 +165,8 @@ def delete(self, authorization: Union[str, object] = values.unset) -> bool: } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -183,6 +185,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -198,16 +202,23 @@ def update( :returns: The updated InsightsQuestionnairesCategoryInstance """ + data = values.of( { "Name": name, } ) - headers = values.of( - { - "Authorization": authorization, - } - ) + headers = values.of({}) + + if not ( + authorization is values.unset + or (isinstance(authorization, str) and not authorization) + ): + headers["Authorization"] = authorization + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -228,16 +239,23 @@ async def update_async( :returns: The updated InsightsQuestionnairesCategoryInstance """ + data = values.of( { "Name": name, } ) - headers = values.of( - { - "Authorization": authorization, - } - ) + headers = values.of({}) + + if not ( + authorization is values.unset + or (isinstance(authorization, str) and not authorization) + ): + headers["Authorization"] = authorization + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -317,6 +335,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -347,6 +369,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -495,7 +521,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InsightsQuestionnairesCategoryPage(self._version, response) async def page_async( @@ -525,8 +562,17 @@ async def page_async( } ) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InsightsQuestionnairesCategoryPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/insights_questionnaires_question.py b/twilio/rest/flex_api/v1/insights_questionnaires_question.py index 363d5c07b1..33e2304599 100644 --- a/twilio/rest/flex_api/v1/insights_questionnaires_question.py +++ b/twilio/rest/flex_api/v1/insights_questionnaires_question.py @@ -205,6 +205,8 @@ def delete(self, authorization: Union[str, object] = values.unset) -> bool: } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -223,6 +225,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -248,6 +252,7 @@ def update( :returns: The updated InsightsQuestionnairesQuestionInstance """ + data = values.of( { "AllowNa": serialize.boolean_to_string(allow_na), @@ -257,11 +262,17 @@ def update( "AnswerSetId": answer_set_id, } ) - headers = values.of( - { - "Authorization": authorization, - } - ) + headers = values.of({}) + + if not ( + authorization is values.unset + or (isinstance(authorization, str) and not authorization) + ): + headers["Authorization"] = authorization + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -292,6 +303,7 @@ async def update_async( :returns: The updated InsightsQuestionnairesQuestionInstance """ + data = values.of( { "AllowNa": serialize.boolean_to_string(allow_na), @@ -301,11 +313,17 @@ async def update_async( "AnswerSetId": answer_set_id, } ) - headers = values.of( - { - "Authorization": authorization, - } - ) + headers = values.of({}) + + if not ( + authorization is values.unset + or (isinstance(authorization, str) and not authorization) + ): + headers["Authorization"] = authorization + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -399,6 +417,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -443,6 +465,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -610,7 +636,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InsightsQuestionnairesQuestionPage(self._version, response) async def page_async( @@ -643,8 +680,17 @@ async def page_async( } ) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InsightsQuestionnairesQuestionPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/insights_segments.py b/twilio/rest/flex_api/v1/insights_segments.py index 2d509802a9..7c98e81cff 100644 --- a/twilio/rest/flex_api/v1/insights_segments.py +++ b/twilio/rest/flex_api/v1/insights_segments.py @@ -301,7 +301,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InsightsSegmentsPage(self._version, response) async def page_async( @@ -337,8 +348,17 @@ async def page_async( } ) + headers = values.of( + { + "Authorization": authorization, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InsightsSegmentsPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py index d426e215a9..9b0e89e938 100644 --- a/twilio/rest/flex_api/v1/insights_settings_answer_sets.py +++ b/twilio/rest/flex_api/v1/insights_settings_answer_sets.py @@ -79,6 +79,8 @@ def fetch( } ) + headers["Accept"] = "application/json" + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InsightsSettingsAnswerSetsInstance(self._version, payload) @@ -99,6 +101,8 @@ async def fetch_async( } ) + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( method="GET", uri=self._uri, headers=headers ) diff --git a/twilio/rest/flex_api/v1/insights_settings_comment.py b/twilio/rest/flex_api/v1/insights_settings_comment.py index 548b279181..18733a4957 100644 --- a/twilio/rest/flex_api/v1/insights_settings_comment.py +++ b/twilio/rest/flex_api/v1/insights_settings_comment.py @@ -73,6 +73,8 @@ def fetch( } ) + headers["Accept"] = "application/json" + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InsightsSettingsCommentInstance(self._version, payload) @@ -93,6 +95,8 @@ async def fetch_async( } ) + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( method="GET", uri=self._uri, headers=headers ) diff --git a/twilio/rest/flex_api/v1/insights_user_roles.py b/twilio/rest/flex_api/v1/insights_user_roles.py index 9dbea5fa3b..19cb10b8e4 100644 --- a/twilio/rest/flex_api/v1/insights_user_roles.py +++ b/twilio/rest/flex_api/v1/insights_user_roles.py @@ -115,7 +115,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return InsightsUserRolesInstance( self._version, @@ -139,8 +145,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InsightsUserRolesInstance( diff --git a/twilio/rest/flex_api/v1/interaction/__init__.py b/twilio/rest/flex_api/v1/interaction/__init__.py index 468b3134eb..c67d9c026e 100644 --- a/twilio/rest/flex_api/v1/interaction/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/__init__.py @@ -130,10 +130,11 @@ def fetch(self) -> InteractionInstance: :returns: The fetched InteractionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InteractionInstance( self._version, @@ -149,9 +150,12 @@ async def fetch_async(self) -> InteractionInstance: :returns: The fetched InteractionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InteractionInstance( @@ -220,6 +224,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -251,6 +259,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py index a26dc0425e..781adb9797 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py @@ -213,10 +213,11 @@ def fetch(self) -> InteractionChannelInstance: :returns: The fetched InteractionChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InteractionChannelInstance( self._version, @@ -233,9 +234,12 @@ async def fetch_async(self) -> InteractionChannelInstance: :returns: The fetched InteractionChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InteractionChannelInstance( @@ -258,17 +262,21 @@ def update( :returns: The updated InteractionChannelInstance """ + data = values.of( { "Status": status, "Routing": serialize.object(routing), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelInstance( @@ -291,17 +299,21 @@ async def update_async( :returns: The updated InteractionChannelInstance """ + data = values.of( { "Status": status, "Routing": serialize.object(routing), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelInstance( @@ -513,7 +525,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InteractionChannelPage(self._version, response, self._solution) async def page_async( @@ -540,8 +558,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InteractionChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py index 2ffa14b1df..a81acd4fc4 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_invite.py @@ -124,6 +124,10 @@ def create(self, routing: object) -> InteractionChannelInviteInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -151,6 +155,10 @@ async def create_async(self, routing: object) -> InteractionChannelInviteInstanc ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -289,7 +297,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InteractionChannelInvitePage(self._version, response, self._solution) async def page_async( @@ -316,8 +330,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InteractionChannelInvitePage(self._version, response, self._solution) diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py index 225ca3efaf..53d2d40dbf 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_channel_participant.py @@ -163,16 +163,20 @@ def update( :returns: The updated InteractionChannelParticipantInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelParticipantInstance( @@ -193,16 +197,20 @@ async def update_async( :returns: The updated InteractionChannelParticipantInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InteractionChannelParticipantInstance( @@ -298,6 +306,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -334,6 +346,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -472,7 +488,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InteractionChannelParticipantPage( self._version, response, self._solution ) @@ -501,8 +523,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InteractionChannelParticipantPage( self._version, response, self._solution diff --git a/twilio/rest/flex_api/v1/plugin/__init__.py b/twilio/rest/flex_api/v1/plugin/__init__.py index b6baf8f935..2415c42710 100644 --- a/twilio/rest/flex_api/v1/plugin/__init__.py +++ b/twilio/rest/flex_api/v1/plugin/__init__.py @@ -198,7 +198,13 @@ def fetch(self, flex_metadata: Union[str, object] = values.unset) -> PluginInsta } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return PluginInstance( self._version, @@ -223,8 +229,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PluginInstance( @@ -248,17 +258,24 @@ def update( :returns: The updated PluginInstance """ + data = values.of( { "FriendlyName": friendly_name, "Description": description, } ) - headers = values.of( - { - "Flex-Metadata": flex_metadata, - } - ) + headers = values.of({}) + + if not ( + flex_metadata is values.unset + or (isinstance(flex_metadata, str) and not flex_metadata) + ): + headers["Flex-Metadata"] = flex_metadata + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -281,17 +298,24 @@ async def update_async( :returns: The updated PluginInstance """ + data = values.of( { "FriendlyName": friendly_name, "Description": description, } ) - headers = values.of( - { - "Flex-Metadata": flex_metadata, - } - ) + headers = values.of({}) + + if not ( + flex_metadata is values.unset + or (isinstance(flex_metadata, str) and not flex_metadata) + ): + headers["Flex-Metadata"] = flex_metadata + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -385,6 +409,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -423,6 +451,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -571,7 +603,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PluginPage(self._version, response) async def page_async( @@ -601,8 +644,17 @@ async def page_async( } ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PluginPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/plugin/plugin_versions.py b/twilio/rest/flex_api/v1/plugin/plugin_versions.py index 3da4de3ac7..4d66ef572b 100644 --- a/twilio/rest/flex_api/v1/plugin/plugin_versions.py +++ b/twilio/rest/flex_api/v1/plugin/plugin_versions.py @@ -158,7 +158,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return PluginVersionsInstance( self._version, @@ -184,8 +190,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PluginVersionsInstance( @@ -287,6 +297,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -336,6 +350,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -486,7 +504,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PluginVersionsPage(self._version, response, self._solution) async def page_async( @@ -516,8 +545,17 @@ async def page_async( } ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PluginVersionsPage(self._version, response, self._solution) diff --git a/twilio/rest/flex_api/v1/plugin_archive.py b/twilio/rest/flex_api/v1/plugin_archive.py index 68f9bce384..e7f526a919 100644 --- a/twilio/rest/flex_api/v1/plugin_archive.py +++ b/twilio/rest/flex_api/v1/plugin_archive.py @@ -138,12 +138,17 @@ def update( :returns: The updated PluginArchiveInstance """ + data = values.of({}) - headers = values.of( - { - "Flex-Metadata": flex_metadata, - } - ) + headers = values.of({}) + + if not ( + flex_metadata is values.unset + or (isinstance(flex_metadata, str) and not flex_metadata) + ): + headers["Flex-Metadata"] = flex_metadata + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -161,12 +166,17 @@ async def update_async( :returns: The updated PluginArchiveInstance """ + data = values.of({}) - headers = values.of( - { - "Flex-Metadata": flex_metadata, - } - ) + headers = values.of({}) + + if not ( + flex_metadata is values.unset + or (isinstance(flex_metadata, str) and not flex_metadata) + ): + headers["Flex-Metadata"] = flex_metadata + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/flex_api/v1/plugin_configuration/__init__.py b/twilio/rest/flex_api/v1/plugin_configuration/__init__.py index 9b76695243..b17d697e3b 100644 --- a/twilio/rest/flex_api/v1/plugin_configuration/__init__.py +++ b/twilio/rest/flex_api/v1/plugin_configuration/__init__.py @@ -154,7 +154,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return PluginConfigurationInstance( self._version, @@ -179,8 +185,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PluginConfigurationInstance( @@ -275,6 +285,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -313,6 +327,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -461,7 +479,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PluginConfigurationPage(self._version, response) async def page_async( @@ -491,8 +520,17 @@ async def page_async( } ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PluginConfigurationPage(self._version, response) diff --git a/twilio/rest/flex_api/v1/plugin_configuration/configured_plugin.py b/twilio/rest/flex_api/v1/plugin_configuration/configured_plugin.py index 6e54012eb0..062a7db7b4 100644 --- a/twilio/rest/flex_api/v1/plugin_configuration/configured_plugin.py +++ b/twilio/rest/flex_api/v1/plugin_configuration/configured_plugin.py @@ -170,7 +170,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConfiguredPluginInstance( self._version, @@ -196,8 +202,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConfiguredPluginInstance( @@ -402,7 +412,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConfiguredPluginPage(self._version, response, self._solution) async def page_async( @@ -432,8 +453,17 @@ async def page_async( } ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConfiguredPluginPage(self._version, response, self._solution) diff --git a/twilio/rest/flex_api/v1/plugin_configuration_archive.py b/twilio/rest/flex_api/v1/plugin_configuration_archive.py index 97d2f8120d..3fec073333 100644 --- a/twilio/rest/flex_api/v1/plugin_configuration_archive.py +++ b/twilio/rest/flex_api/v1/plugin_configuration_archive.py @@ -136,12 +136,17 @@ def update( :returns: The updated PluginConfigurationArchiveInstance """ + data = values.of({}) - headers = values.of( - { - "Flex-Metadata": flex_metadata, - } - ) + headers = values.of({}) + + if not ( + flex_metadata is values.unset + or (isinstance(flex_metadata, str) and not flex_metadata) + ): + headers["Flex-Metadata"] = flex_metadata + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -161,12 +166,17 @@ async def update_async( :returns: The updated PluginConfigurationArchiveInstance """ + data = values.of({}) - headers = values.of( - { - "Flex-Metadata": flex_metadata, - } - ) + headers = values.of({}) + + if not ( + flex_metadata is values.unset + or (isinstance(flex_metadata, str) and not flex_metadata) + ): + headers["Flex-Metadata"] = flex_metadata + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/flex_api/v1/plugin_release.py b/twilio/rest/flex_api/v1/plugin_release.py index e339183297..0694b05f8b 100644 --- a/twilio/rest/flex_api/v1/plugin_release.py +++ b/twilio/rest/flex_api/v1/plugin_release.py @@ -136,7 +136,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return PluginReleaseInstance( self._version, @@ -161,8 +167,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PluginReleaseInstance( @@ -237,6 +247,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -267,6 +281,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -415,7 +433,18 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PluginReleasePage(self._version, response) async def page_async( @@ -445,8 +474,17 @@ async def page_async( } ) + headers = values.of( + { + "Flex-Metadata": flex_metadata, + "Content-Type": "application/x-www-form-urlencoded", + } + ) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PluginReleasePage(self._version, response) diff --git a/twilio/rest/flex_api/v1/plugin_version_archive.py b/twilio/rest/flex_api/v1/plugin_version_archive.py index ae8d2f3dff..be169d4d64 100644 --- a/twilio/rest/flex_api/v1/plugin_version_archive.py +++ b/twilio/rest/flex_api/v1/plugin_version_archive.py @@ -148,12 +148,17 @@ def update( :returns: The updated PluginVersionArchiveInstance """ + data = values.of({}) - headers = values.of( - { - "Flex-Metadata": flex_metadata, - } - ) + headers = values.of({}) + + if not ( + flex_metadata is values.unset + or (isinstance(flex_metadata, str) and not flex_metadata) + ): + headers["Flex-Metadata"] = flex_metadata + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -176,12 +181,17 @@ async def update_async( :returns: The updated PluginVersionArchiveInstance """ + data = values.of({}) - headers = values.of( - { - "Flex-Metadata": flex_metadata, - } - ) + headers = values.of({}) + + if not ( + flex_metadata is values.unset + or (isinstance(flex_metadata, str) and not flex_metadata) + ): + headers["Flex-Metadata"] = flex_metadata + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers diff --git a/twilio/rest/flex_api/v1/provisioning_status.py b/twilio/rest/flex_api/v1/provisioning_status.py index 9cc9144dcc..2a7bc5b465 100644 --- a/twilio/rest/flex_api/v1/provisioning_status.py +++ b/twilio/rest/flex_api/v1/provisioning_status.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -104,10 +105,11 @@ def fetch(self) -> ProvisioningStatusInstance: :returns: The fetched ProvisioningStatusInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ProvisioningStatusInstance( self._version, @@ -122,9 +124,12 @@ async def fetch_async(self) -> ProvisioningStatusInstance: :returns: The fetched ProvisioningStatusInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ProvisioningStatusInstance( diff --git a/twilio/rest/flex_api/v1/web_channel.py b/twilio/rest/flex_api/v1/web_channel.py index a96698f8cb..46e44fcecd 100644 --- a/twilio/rest/flex_api/v1/web_channel.py +++ b/twilio/rest/flex_api/v1/web_channel.py @@ -178,10 +178,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -190,9 +190,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> WebChannelInstance: @@ -203,10 +205,11 @@ def fetch(self) -> WebChannelInstance: :returns: The fetched WebChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WebChannelInstance( self._version, @@ -222,9 +225,12 @@ async def fetch_async(self) -> WebChannelInstance: :returns: The fetched WebChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WebChannelInstance( @@ -246,17 +252,21 @@ def update( :returns: The updated WebChannelInstance """ + data = values.of( { "ChatStatus": chat_status, "PostEngagementData": post_engagement_data, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebChannelInstance(self._version, payload, sid=self._solution["sid"]) @@ -274,17 +284,21 @@ async def update_async( :returns: The updated WebChannelInstance """ + data = values.of( { "ChatStatus": chat_status, "PostEngagementData": post_engagement_data, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebChannelInstance(self._version, payload, sid=self._solution["sid"]) @@ -365,6 +379,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -405,6 +423,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -538,7 +560,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return WebChannelPage(self._version, response) async def page_async( @@ -565,8 +593,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WebChannelPage(self._version, response) diff --git a/twilio/rest/flex_api/v2/flex_user.py b/twilio/rest/flex_api/v2/flex_user.py index 0f5b1571f2..480a439b85 100644 --- a/twilio/rest/flex_api/v2/flex_user.py +++ b/twilio/rest/flex_api/v2/flex_user.py @@ -214,10 +214,11 @@ def fetch(self) -> FlexUserInstance: :returns: The fetched FlexUserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FlexUserInstance( self._version, @@ -234,9 +235,12 @@ async def fetch_async(self) -> FlexUserInstance: :returns: The fetched FlexUserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FlexUserInstance( @@ -267,6 +271,7 @@ def update( :returns: The updated FlexUserInstance """ + data = values.of( { "FirstName": first_name, @@ -277,11 +282,14 @@ def update( "Locale": locale, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlexUserInstance( @@ -312,6 +320,7 @@ async def update_async( :returns: The updated FlexUserInstance """ + data = values.of( { "FirstName": first_name, @@ -322,11 +331,14 @@ async def update_async( "Locale": locale, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlexUserInstance( diff --git a/twilio/rest/flex_api/v2/web_channels.py b/twilio/rest/flex_api/v2/web_channels.py index 153f59cae9..8e5aff8226 100644 --- a/twilio/rest/flex_api/v2/web_channels.py +++ b/twilio/rest/flex_api/v2/web_channels.py @@ -90,6 +90,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -131,6 +135,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/frontline_api/v1/user.py b/twilio/rest/frontline_api/v1/user.py index 8c9dd93853..a45ed2ffee 100644 --- a/twilio/rest/frontline_api/v1/user.py +++ b/twilio/rest/frontline_api/v1/user.py @@ -170,10 +170,11 @@ def fetch(self) -> UserInstance: :returns: The fetched UserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserInstance( self._version, @@ -189,9 +190,12 @@ async def fetch_async(self) -> UserInstance: :returns: The fetched UserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserInstance( @@ -217,6 +221,7 @@ def update( :returns: The updated UserInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -225,11 +230,14 @@ def update( "IsAvailable": serialize.boolean_to_string(is_available), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance(self._version, payload, sid=self._solution["sid"]) @@ -251,6 +259,7 @@ async def update_async( :returns: The updated UserInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -259,11 +268,14 @@ async def update_async( "IsAvailable": serialize.boolean_to_string(is_available), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance(self._version, payload, sid=self._solution["sid"]) diff --git a/twilio/rest/iam/v1/__init__.py b/twilio/rest/iam/v1/__init__.py index 408de11acb..0c46947341 100644 --- a/twilio/rest/iam/v1/__init__.py +++ b/twilio/rest/iam/v1/__init__.py @@ -17,7 +17,7 @@ from twilio.base.domain import Domain from twilio.rest.iam.v1.api_key import ApiKeyList from twilio.rest.iam.v1.get_api_keys import GetApiKeysList -from twilio.rest.iam.v1.key import KeyList +from twilio.rest.iam.v1.new_api_key import NewApiKeyList class V1(Version): @@ -31,7 +31,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._api_key: Optional[ApiKeyList] = None self._get_api_keys: Optional[GetApiKeysList] = None - self._keys: Optional[KeyList] = None + self._new_api_key: Optional[NewApiKeyList] = None @property def api_key(self) -> ApiKeyList: @@ -46,10 +46,10 @@ def get_api_keys(self) -> GetApiKeysList: return self._get_api_keys @property - def keys(self) -> KeyList: - if self._keys is None: - self._keys = KeyList(self) - return self._keys + def new_api_key(self) -> NewApiKeyList: + if self._new_api_key is None: + self._new_api_key = NewApiKeyList(self) + return self._new_api_key def __repr__(self) -> str: """ diff --git a/twilio/rest/iam/v1/api_key.py b/twilio/rest/iam/v1/api_key.py index b94889fcca..f07512c09b 100644 --- a/twilio/rest/iam/v1/api_key.py +++ b/twilio/rest/iam/v1/api_key.py @@ -171,10 +171,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -183,9 +183,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ApiKeyInstance: @@ -196,10 +198,11 @@ def fetch(self) -> ApiKeyInstance: :returns: The fetched ApiKeyInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ApiKeyInstance( self._version, @@ -215,9 +218,12 @@ async def fetch_async(self) -> ApiKeyInstance: :returns: The fetched ApiKeyInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ApiKeyInstance( @@ -239,17 +245,21 @@ def update( :returns: The updated ApiKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, "Policy": serialize.object(policy), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ApiKeyInstance(self._version, payload, sid=self._solution["sid"]) @@ -267,17 +277,21 @@ async def update_async( :returns: The updated ApiKeyInstance """ + data = values.of( { "FriendlyName": friendly_name, "Policy": serialize.object(policy), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ApiKeyInstance(self._version, payload, sid=self._solution["sid"]) diff --git a/twilio/rest/iam/v1/get_api_keys.py b/twilio/rest/iam/v1/get_api_keys.py index 3a3e9bda76..03b29cdb38 100644 --- a/twilio/rest/iam/v1/get_api_keys.py +++ b/twilio/rest/iam/v1/get_api_keys.py @@ -226,7 +226,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return GetApiKeysPage(self._version, response) async def page_async( @@ -256,8 +262,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return GetApiKeysPage(self._version, response) diff --git a/twilio/rest/iam/v1/key.py b/twilio/rest/iam/v1/new_api_key.py similarity index 84% rename from twilio/rest/iam/v1/key.py rename to twilio/rest/iam/v1/new_api_key.py index 5adcbc6939..760ce79ca3 100644 --- a/twilio/rest/iam/v1/key.py +++ b/twilio/rest/iam/v1/new_api_key.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class KeyInstance(InstanceResource): +class NewApiKeyInstance(InstanceResource): class Keytype(object): RESTRICTED = "restricted" @@ -56,14 +56,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class KeyList(ListResource): +class NewApiKeyList(ListResource): def __init__(self, version: Version): """ - Initialize the KeyList + Initialize the NewApiKeyList :param version: Version that contains the resource @@ -76,18 +76,18 @@ def create( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["KeyInstance.Keytype", object] = values.unset, + key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> KeyInstance: + ) -> NewApiKeyInstance: """ - Create the KeyInstance + Create the NewApiKeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created KeyInstance + :returns: The created NewApiKeyInstance """ data = values.of( @@ -100,28 +100,32 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) - return KeyInstance(self._version, payload) + return NewApiKeyInstance(self._version, payload) async def create_async( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["KeyInstance.Keytype", object] = values.unset, + key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> KeyInstance: + ) -> NewApiKeyInstance: """ - Asynchronously create the KeyInstance + Asynchronously create the NewApiKeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created KeyInstance + :returns: The created NewApiKeyInstance """ data = values.of( @@ -134,11 +138,15 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) - return KeyInstance(self._version, payload) + return NewApiKeyInstance(self._version, payload) def __repr__(self) -> str: """ @@ -146,4 +154,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/insights/v1/call/__init__.py b/twilio/rest/insights/v1/call/__init__.py index ff628b7d06..cb08aa58aa 100644 --- a/twilio/rest/insights/v1/call/__init__.py +++ b/twilio/rest/insights/v1/call/__init__.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -146,10 +147,11 @@ def fetch(self) -> CallInstance: :returns: The fetched CallInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CallInstance( self._version, @@ -165,9 +167,12 @@ async def fetch_async(self) -> CallInstance: :returns: The fetched CallInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CallInstance( diff --git a/twilio/rest/insights/v1/call/annotation.py b/twilio/rest/insights/v1/call/annotation.py index d560003c0a..6e705d3916 100644 --- a/twilio/rest/insights/v1/call/annotation.py +++ b/twilio/rest/insights/v1/call/annotation.py @@ -209,10 +209,11 @@ def fetch(self) -> AnnotationInstance: :returns: The fetched AnnotationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AnnotationInstance( self._version, @@ -228,9 +229,12 @@ async def fetch_async(self) -> AnnotationInstance: :returns: The fetched AnnotationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AnnotationInstance( @@ -264,6 +268,7 @@ def update( :returns: The updated AnnotationInstance """ + data = values.of( { "AnsweredBy": answered_by, @@ -275,11 +280,14 @@ def update( "Incident": incident, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AnnotationInstance( @@ -311,6 +319,7 @@ async def update_async( :returns: The updated AnnotationInstance """ + data = values.of( { "AnsweredBy": answered_by, @@ -322,11 +331,14 @@ async def update_async( "Incident": incident, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AnnotationInstance( diff --git a/twilio/rest/insights/v1/call/call_summary.py b/twilio/rest/insights/v1/call/call_summary.py index 0e256b36c8..f11aa912ed 100644 --- a/twilio/rest/insights/v1/call/call_summary.py +++ b/twilio/rest/insights/v1/call/call_summary.py @@ -222,7 +222,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return CallSummaryInstance( self._version, @@ -250,8 +256,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CallSummaryInstance( diff --git a/twilio/rest/insights/v1/call/event.py b/twilio/rest/insights/v1/call/event.py index 89734f110a..98dce5eb71 100644 --- a/twilio/rest/insights/v1/call/event.py +++ b/twilio/rest/insights/v1/call/event.py @@ -259,7 +259,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EventPage(self._version, response, self._solution) async def page_async( @@ -289,8 +295,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EventPage(self._version, response, self._solution) diff --git a/twilio/rest/insights/v1/call/metric.py b/twilio/rest/insights/v1/call/metric.py index 3cf9decc53..77f770ae7c 100644 --- a/twilio/rest/insights/v1/call/metric.py +++ b/twilio/rest/insights/v1/call/metric.py @@ -271,7 +271,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MetricPage(self._version, response, self._solution) async def page_async( @@ -304,8 +310,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MetricPage(self._version, response, self._solution) diff --git a/twilio/rest/insights/v1/call_summaries.py b/twilio/rest/insights/v1/call_summaries.py index 35cf41aa49..45fcce98c1 100644 --- a/twilio/rest/insights/v1/call_summaries.py +++ b/twilio/rest/insights/v1/call_summaries.py @@ -797,7 +797,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CallSummariesPage(self._version, response) async def page_async( @@ -924,8 +930,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CallSummariesPage(self._version, response) diff --git a/twilio/rest/insights/v1/conference/__init__.py b/twilio/rest/insights/v1/conference/__init__.py index 63b8abbf9a..0f9bb118b5 100644 --- a/twilio/rest/insights/v1/conference/__init__.py +++ b/twilio/rest/insights/v1/conference/__init__.py @@ -240,10 +240,11 @@ def fetch(self) -> ConferenceInstance: :returns: The fetched ConferenceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ConferenceInstance( self._version, @@ -259,9 +260,12 @@ async def fetch_async(self) -> ConferenceInstance: :returns: The fetched ConferenceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ConferenceInstance( @@ -605,7 +609,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConferencePage(self._version, response) async def page_async( @@ -662,8 +672,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConferencePage(self._version, response) diff --git a/twilio/rest/insights/v1/conference/conference_participant.py b/twilio/rest/insights/v1/conference/conference_participant.py index 68faa690b3..203f950699 100644 --- a/twilio/rest/insights/v1/conference/conference_participant.py +++ b/twilio/rest/insights/v1/conference/conference_participant.py @@ -268,7 +268,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConferenceParticipantInstance( self._version, @@ -298,8 +304,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConferenceParticipantInstance( @@ -536,7 +546,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConferenceParticipantPage(self._version, response, self._solution) async def page_async( @@ -572,8 +588,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConferenceParticipantPage(self._version, response, self._solution) diff --git a/twilio/rest/insights/v1/room/__init__.py b/twilio/rest/insights/v1/room/__init__.py index abcc9f8c5b..0b987c020a 100644 --- a/twilio/rest/insights/v1/room/__init__.py +++ b/twilio/rest/insights/v1/room/__init__.py @@ -252,10 +252,11 @@ def fetch(self) -> RoomInstance: :returns: The fetched RoomInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RoomInstance( self._version, @@ -271,9 +272,12 @@ async def fetch_async(self) -> RoomInstance: :returns: The fetched RoomInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RoomInstance( @@ -542,7 +546,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RoomPage(self._version, response) async def page_async( @@ -584,8 +594,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RoomPage(self._version, response) diff --git a/twilio/rest/insights/v1/room/participant.py b/twilio/rest/insights/v1/room/participant.py index 6c2b8448cf..0791ec287c 100644 --- a/twilio/rest/insights/v1/room/participant.py +++ b/twilio/rest/insights/v1/room/participant.py @@ -193,10 +193,11 @@ def fetch(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ParticipantInstance( self._version, @@ -213,9 +214,12 @@ async def fetch_async(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ParticipantInstance( @@ -401,7 +405,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ParticipantPage(self._version, response, self._solution) async def page_async( @@ -428,8 +438,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ParticipantPage(self._version, response, self._solution) diff --git a/twilio/rest/insights/v1/setting.py b/twilio/rest/insights/v1/setting.py index c385fc424e..3c6b746f07 100644 --- a/twilio/rest/insights/v1/setting.py +++ b/twilio/rest/insights/v1/setting.py @@ -161,7 +161,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return SettingInstance( self._version, @@ -185,8 +191,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SettingInstance( @@ -209,6 +219,7 @@ def update( :returns: The updated SettingInstance """ + data = values.of( { "AdvancedFeatures": serialize.boolean_to_string(advanced_features), @@ -216,11 +227,14 @@ def update( "SubaccountSid": subaccount_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SettingInstance(self._version, payload) @@ -240,6 +254,7 @@ async def update_async( :returns: The updated SettingInstance """ + data = values.of( { "AdvancedFeatures": serialize.boolean_to_string(advanced_features), @@ -247,11 +262,14 @@ async def update_async( "SubaccountSid": subaccount_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SettingInstance(self._version, payload) diff --git a/twilio/rest/intelligence/v2/custom_operator.py b/twilio/rest/intelligence/v2/custom_operator.py index af5239b124..3dd73d47bb 100644 --- a/twilio/rest/intelligence/v2/custom_operator.py +++ b/twilio/rest/intelligence/v2/custom_operator.py @@ -201,10 +201,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -213,9 +213,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CustomOperatorInstance: @@ -226,10 +228,11 @@ def fetch(self) -> CustomOperatorInstance: :returns: The fetched CustomOperatorInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CustomOperatorInstance( self._version, @@ -245,9 +248,12 @@ async def fetch_async(self) -> CustomOperatorInstance: :returns: The fetched CustomOperatorInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CustomOperatorInstance( @@ -271,17 +277,23 @@ def update( :returns: The updated CustomOperatorInstance """ + data = values.of( { "FriendlyName": friendly_name, "Config": serialize.object(config), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -304,17 +316,23 @@ async def update_async( :returns: The updated CustomOperatorInstance """ + data = values.of( { "FriendlyName": friendly_name, "Config": serialize.object(config), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -386,6 +404,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -414,6 +436,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -591,7 +617,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CustomOperatorPage(self._version, response) async def page_async( @@ -626,8 +658,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CustomOperatorPage(self._version, response) diff --git a/twilio/rest/intelligence/v2/operator.py b/twilio/rest/intelligence/v2/operator.py index 6618c4a6c0..984c46d724 100644 --- a/twilio/rest/intelligence/v2/operator.py +++ b/twilio/rest/intelligence/v2/operator.py @@ -142,10 +142,11 @@ def fetch(self) -> OperatorInstance: :returns: The fetched OperatorInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return OperatorInstance( self._version, @@ -161,9 +162,12 @@ async def fetch_async(self) -> OperatorInstance: :returns: The fetched OperatorInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return OperatorInstance( @@ -375,7 +379,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return OperatorPage(self._version, response) async def page_async( @@ -408,8 +418,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return OperatorPage(self._version, response) diff --git a/twilio/rest/intelligence/v2/operator_attachment.py b/twilio/rest/intelligence/v2/operator_attachment.py index 4ab8b48c10..6080bc5ebf 100644 --- a/twilio/rest/intelligence/v2/operator_attachment.py +++ b/twilio/rest/intelligence/v2/operator_attachment.py @@ -174,10 +174,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -186,9 +186,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def __repr__(self) -> str: diff --git a/twilio/rest/intelligence/v2/operator_attachments.py b/twilio/rest/intelligence/v2/operator_attachments.py index 2500ef7224..19a875f76b 100644 --- a/twilio/rest/intelligence/v2/operator_attachments.py +++ b/twilio/rest/intelligence/v2/operator_attachments.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, List, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -111,10 +112,11 @@ def fetch(self) -> OperatorAttachmentsInstance: :returns: The fetched OperatorAttachmentsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return OperatorAttachmentsInstance( self._version, @@ -130,9 +132,12 @@ async def fetch_async(self) -> OperatorAttachmentsInstance: :returns: The fetched OperatorAttachmentsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return OperatorAttachmentsInstance( diff --git a/twilio/rest/intelligence/v2/operator_type.py b/twilio/rest/intelligence/v2/operator_type.py index f1f839fe79..b14e677ad2 100644 --- a/twilio/rest/intelligence/v2/operator_type.py +++ b/twilio/rest/intelligence/v2/operator_type.py @@ -164,10 +164,11 @@ def fetch(self) -> OperatorTypeInstance: :returns: The fetched OperatorTypeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return OperatorTypeInstance( self._version, @@ -183,9 +184,12 @@ async def fetch_async(self) -> OperatorTypeInstance: :returns: The fetched OperatorTypeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return OperatorTypeInstance( @@ -363,7 +367,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return OperatorTypePage(self._version, response) async def page_async( @@ -390,8 +400,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return OperatorTypePage(self._version, response) diff --git a/twilio/rest/intelligence/v2/prebuilt_operator.py b/twilio/rest/intelligence/v2/prebuilt_operator.py index e00ceecac5..50693f29c2 100644 --- a/twilio/rest/intelligence/v2/prebuilt_operator.py +++ b/twilio/rest/intelligence/v2/prebuilt_operator.py @@ -142,10 +142,11 @@ def fetch(self) -> PrebuiltOperatorInstance: :returns: The fetched PrebuiltOperatorInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PrebuiltOperatorInstance( self._version, @@ -161,9 +162,12 @@ async def fetch_async(self) -> PrebuiltOperatorInstance: :returns: The fetched PrebuiltOperatorInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PrebuiltOperatorInstance( @@ -385,7 +389,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PrebuiltOperatorPage(self._version, response) async def page_async( @@ -420,8 +430,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PrebuiltOperatorPage(self._version, response) diff --git a/twilio/rest/intelligence/v2/service.py b/twilio/rest/intelligence/v2/service.py index 8f5633d0fe..fac3eb8473 100644 --- a/twilio/rest/intelligence/v2/service.py +++ b/twilio/rest/intelligence/v2/service.py @@ -246,10 +246,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -258,9 +258,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -271,10 +273,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -290,9 +293,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -328,6 +334,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), @@ -340,11 +347,16 @@ def update( "WebhookHttpMethod": webhook_http_method, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -379,6 +391,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "AutoTranscribe": serialize.boolean_to_string(auto_transcribe), @@ -391,11 +404,16 @@ async def update_async( "WebhookHttpMethod": webhook_http_method, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -488,6 +506,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -537,6 +559,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -670,7 +696,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -697,8 +729,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/intelligence/v2/transcript/__init__.py b/twilio/rest/intelligence/v2/transcript/__init__.py index bc71542bc0..c2141bb5da 100644 --- a/twilio/rest/intelligence/v2/transcript/__init__.py +++ b/twilio/rest/intelligence/v2/transcript/__init__.py @@ -194,10 +194,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -206,9 +206,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TranscriptInstance: @@ -219,10 +221,11 @@ def fetch(self) -> TranscriptInstance: :returns: The fetched TranscriptInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TranscriptInstance( self._version, @@ -238,9 +241,12 @@ async def fetch_async(self) -> TranscriptInstance: :returns: The fetched TranscriptInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TranscriptInstance( @@ -355,6 +361,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -389,6 +399,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -646,7 +660,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TranscriptPage(self._version, response) async def page_async( @@ -697,8 +717,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TranscriptPage(self._version, response) diff --git a/twilio/rest/intelligence/v2/transcript/media.py b/twilio/rest/intelligence/v2/transcript/media.py index 74d3ab9959..76bc448e9b 100644 --- a/twilio/rest/intelligence/v2/transcript/media.py +++ b/twilio/rest/intelligence/v2/transcript/media.py @@ -126,7 +126,13 @@ def fetch(self, redacted: Union[bool, object] = values.unset) -> MediaInstance: } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return MediaInstance( self._version, @@ -151,8 +157,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MediaInstance( diff --git a/twilio/rest/intelligence/v2/transcript/operator_result.py b/twilio/rest/intelligence/v2/transcript/operator_result.py index 9d1d614f4d..4b607b39e8 100644 --- a/twilio/rest/intelligence/v2/transcript/operator_result.py +++ b/twilio/rest/intelligence/v2/transcript/operator_result.py @@ -187,7 +187,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return OperatorResultInstance( self._version, @@ -213,8 +219,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return OperatorResultInstance( @@ -415,7 +425,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return OperatorResultPage(self._version, response, self._solution) async def page_async( @@ -445,8 +461,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return OperatorResultPage(self._version, response, self._solution) diff --git a/twilio/rest/intelligence/v2/transcript/sentence.py b/twilio/rest/intelligence/v2/transcript/sentence.py index 4a2229b8a4..f4fb0b3b92 100644 --- a/twilio/rest/intelligence/v2/transcript/sentence.py +++ b/twilio/rest/intelligence/v2/transcript/sentence.py @@ -267,7 +267,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SentencePage(self._version, response, self._solution) async def page_async( @@ -300,8 +306,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SentencePage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v1/credential.py b/twilio/rest/ip_messaging/v1/credential.py index 279aef7860..4aa6d3fc63 100644 --- a/twilio/rest/ip_messaging/v1/credential.py +++ b/twilio/rest/ip_messaging/v1/credential.py @@ -208,10 +208,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -220,9 +220,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CredentialInstance: @@ -233,10 +235,11 @@ def fetch(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CredentialInstance( self._version, @@ -252,9 +255,12 @@ async def fetch_async(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CredentialInstance( @@ -284,6 +290,7 @@ def update( :returns: The updated CredentialInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -294,11 +301,14 @@ def update( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -324,6 +334,7 @@ async def update_async( :returns: The updated CredentialInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -334,11 +345,14 @@ async def update_async( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -422,6 +436,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -465,6 +483,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -598,7 +620,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CredentialPage(self._version, response) async def page_async( @@ -625,8 +653,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CredentialPage(self._version, response) diff --git a/twilio/rest/ip_messaging/v1/service/__init__.py b/twilio/rest/ip_messaging/v1/service/__init__.py index e0b52e2738..3a77cf765e 100644 --- a/twilio/rest/ip_messaging/v1/service/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/__init__.py @@ -554,10 +554,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -566,9 +566,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -579,10 +581,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -598,9 +601,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -726,6 +732,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -794,11 +801,14 @@ def update( "Limits.UserChannels": limits_user_channels, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -920,6 +930,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -988,11 +999,14 @@ async def update_async( "Limits.UserChannels": limits_user_channels, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -1091,6 +1105,10 @@ def create(self, friendly_name: str) -> ServiceInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1113,6 +1131,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1246,7 +1268,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -1273,8 +1301,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/ip_messaging/v1/service/channel/__init__.py b/twilio/rest/ip_messaging/v1/service/channel/__init__.py index 57d2d245ec..14423c9e38 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/channel/__init__.py @@ -241,10 +241,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -253,9 +253,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ChannelInstance: @@ -266,10 +268,11 @@ def fetch(self) -> ChannelInstance: :returns: The fetched ChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ChannelInstance( self._version, @@ -286,9 +289,12 @@ async def fetch_async(self) -> ChannelInstance: :returns: The fetched ChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ChannelInstance( @@ -313,6 +319,7 @@ def update( :returns: The updated ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -320,11 +327,14 @@ def update( "Attributes": attributes, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( @@ -349,6 +359,7 @@ async def update_async( :returns: The updated ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -356,11 +367,14 @@ async def update_async( "Attributes": attributes, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChannelInstance( @@ -486,6 +500,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -522,6 +540,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -670,7 +692,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ChannelPage(self._version, response, self._solution) async def page_async( @@ -700,8 +728,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v1/service/channel/invite.py b/twilio/rest/ip_messaging/v1/service/channel/invite.py index f4c3476edb..d348540346 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v1/service/channel/invite.py @@ -163,10 +163,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -175,9 +175,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> InviteInstance: @@ -188,10 +190,11 @@ def fetch(self) -> InviteInstance: :returns: The fetched InviteInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InviteInstance( self._version, @@ -209,9 +212,12 @@ async def fetch_async(self) -> InviteInstance: :returns: The fetched InviteInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InviteInstance( @@ -298,6 +304,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -329,6 +339,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -480,7 +494,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InvitePage(self._version, response, self._solution) async def page_async( @@ -510,8 +530,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InvitePage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v1/service/channel/member.py b/twilio/rest/ip_messaging/v1/service/channel/member.py index 4452699ceb..26a68650ef 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/member.py +++ b/twilio/rest/ip_messaging/v1/service/channel/member.py @@ -205,10 +205,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -217,9 +217,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> MemberInstance: @@ -230,10 +232,11 @@ def fetch(self) -> MemberInstance: :returns: The fetched MemberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MemberInstance( self._version, @@ -251,9 +254,12 @@ async def fetch_async(self) -> MemberInstance: :returns: The fetched MemberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MemberInstance( @@ -277,17 +283,21 @@ def update( :returns: The updated MemberInstance """ + data = values.of( { "RoleSid": role_sid, "LastConsumedMessageIndex": last_consumed_message_index, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( @@ -311,17 +321,21 @@ async def update_async( :returns: The updated MemberInstance """ + data = values.of( { "RoleSid": role_sid, "LastConsumedMessageIndex": last_consumed_message_index, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MemberInstance( @@ -408,6 +422,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -439,6 +457,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -590,7 +612,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MemberPage(self._version, response, self._solution) async def page_async( @@ -620,8 +648,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MemberPage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v1/service/channel/message.py b/twilio/rest/ip_messaging/v1/service/channel/message.py index 5d3f2eb577..ad7c05d8a1 100644 --- a/twilio/rest/ip_messaging/v1/service/channel/message.py +++ b/twilio/rest/ip_messaging/v1/service/channel/message.py @@ -210,10 +210,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -222,9 +222,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> MessageInstance: @@ -235,10 +237,11 @@ def fetch(self) -> MessageInstance: :returns: The fetched MessageInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MessageInstance( self._version, @@ -256,9 +259,12 @@ async def fetch_async(self) -> MessageInstance: :returns: The fetched MessageInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MessageInstance( @@ -282,17 +288,21 @@ def update( :returns: The updated MessageInstance """ + data = values.of( { "Body": body, "Attributes": attributes, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -316,17 +326,21 @@ async def update_async( :returns: The updated MessageInstance """ + data = values.of( { "Body": body, "Attributes": attributes, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessageInstance( @@ -418,6 +432,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -454,6 +472,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -605,7 +627,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MessagePage(self._version, response, self._solution) async def page_async( @@ -635,8 +663,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MessagePage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v1/service/role.py b/twilio/rest/ip_messaging/v1/service/role.py index 5f5b19cfe9..d5d0628032 100644 --- a/twilio/rest/ip_messaging/v1/service/role.py +++ b/twilio/rest/ip_messaging/v1/service/role.py @@ -181,10 +181,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -193,9 +193,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RoleInstance: @@ -206,10 +208,11 @@ def fetch(self) -> RoleInstance: :returns: The fetched RoleInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RoleInstance( self._version, @@ -226,9 +229,12 @@ async def fetch_async(self) -> RoleInstance: :returns: The fetched RoleInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RoleInstance( @@ -246,16 +252,20 @@ def update(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -273,16 +283,20 @@ async def update_async(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -363,6 +377,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -393,6 +411,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -528,7 +550,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RolePage(self._version, response, self._solution) async def page_async( @@ -555,8 +583,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RolePage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v1/service/user/__init__.py b/twilio/rest/ip_messaging/v1/service/user/__init__.py index 91364d8f96..5f37f2d3aa 100644 --- a/twilio/rest/ip_messaging/v1/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v1/service/user/__init__.py @@ -216,10 +216,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -228,9 +228,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> UserInstance: @@ -241,10 +243,11 @@ def fetch(self) -> UserInstance: :returns: The fetched UserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserInstance( self._version, @@ -261,9 +264,12 @@ async def fetch_async(self) -> UserInstance: :returns: The fetched UserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserInstance( @@ -288,6 +294,7 @@ def update( :returns: The updated UserInstance """ + data = values.of( { "RoleSid": role_sid, @@ -295,11 +302,14 @@ def update( "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( @@ -324,6 +334,7 @@ async def update_async( :returns: The updated UserInstance """ + data = values.of( { "RoleSid": role_sid, @@ -331,11 +342,14 @@ async def update_async( "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserInstance( @@ -435,6 +449,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -471,6 +489,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -606,7 +628,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserPage(self._version, response, self._solution) async def page_async( @@ -633,8 +661,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserPage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v1/service/user/user_channel.py b/twilio/rest/ip_messaging/v1/service/user/user_channel.py index 192aafb380..4245449869 100644 --- a/twilio/rest/ip_messaging/v1/service/user/user_channel.py +++ b/twilio/rest/ip_messaging/v1/service/user/user_channel.py @@ -247,7 +247,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserChannelPage(self._version, response, self._solution) async def page_async( @@ -274,8 +280,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v2/credential.py b/twilio/rest/ip_messaging/v2/credential.py index 5d4e14f983..065c5048e9 100644 --- a/twilio/rest/ip_messaging/v2/credential.py +++ b/twilio/rest/ip_messaging/v2/credential.py @@ -208,10 +208,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -220,9 +220,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CredentialInstance: @@ -233,10 +235,11 @@ def fetch(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CredentialInstance( self._version, @@ -252,9 +255,12 @@ async def fetch_async(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CredentialInstance( @@ -284,6 +290,7 @@ def update( :returns: The updated CredentialInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -294,11 +301,14 @@ def update( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -324,6 +334,7 @@ async def update_async( :returns: The updated CredentialInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -334,11 +345,14 @@ async def update_async( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -422,6 +436,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -465,6 +483,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -598,7 +620,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CredentialPage(self._version, response) async def page_async( @@ -625,8 +653,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CredentialPage(self._version, response) diff --git a/twilio/rest/ip_messaging/v2/service/__init__.py b/twilio/rest/ip_messaging/v2/service/__init__.py index 3475811625..a303f10f33 100644 --- a/twilio/rest/ip_messaging/v2/service/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/__init__.py @@ -437,10 +437,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -449,9 +449,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -462,10 +464,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -481,9 +484,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -565,6 +571,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -614,11 +621,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -696,6 +706,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -745,11 +756,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -860,6 +874,10 @@ def create(self, friendly_name: str) -> ServiceInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -882,6 +900,10 @@ async def create_async(self, friendly_name: str) -> ServiceInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1015,7 +1037,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -1042,8 +1070,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/ip_messaging/v2/service/binding.py b/twilio/rest/ip_messaging/v2/service/binding.py index 24c4f65a4b..af9018af9f 100644 --- a/twilio/rest/ip_messaging/v2/service/binding.py +++ b/twilio/rest/ip_messaging/v2/service/binding.py @@ -166,10 +166,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -178,9 +178,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> BindingInstance: @@ -191,10 +193,11 @@ def fetch(self) -> BindingInstance: :returns: The fetched BindingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BindingInstance( self._version, @@ -211,9 +214,12 @@ async def fetch_async(self) -> BindingInstance: :returns: The fetched BindingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return BindingInstance( @@ -429,7 +435,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return BindingPage(self._version, response, self._solution) async def page_async( @@ -462,8 +474,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BindingPage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v2/service/channel/__init__.py b/twilio/rest/ip_messaging/v2/service/channel/__init__.py index 29ee9ddd64..8220a4be9c 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/channel/__init__.py @@ -310,6 +310,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -331,6 +333,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -343,10 +347,11 @@ def fetch(self) -> ChannelInstance: :returns: The fetched ChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ChannelInstance( self._version, @@ -363,9 +368,12 @@ async def fetch_async(self) -> ChannelInstance: :returns: The fetched ChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ChannelInstance( @@ -400,6 +408,7 @@ def update( :returns: The updated ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -410,11 +419,20 @@ def update( "CreatedBy": created_by, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -452,6 +470,7 @@ async def update_async( :returns: The updated ChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -462,11 +481,20 @@ async def update_async( "CreatedBy": created_by, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -626,6 +654,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -680,6 +712,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -828,7 +864,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ChannelPage(self._version, response, self._solution) async def page_async( @@ -858,8 +900,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v2/service/channel/invite.py b/twilio/rest/ip_messaging/v2/service/channel/invite.py index a40c47a125..4fa3c187fc 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/invite.py +++ b/twilio/rest/ip_messaging/v2/service/channel/invite.py @@ -163,10 +163,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -175,9 +175,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> InviteInstance: @@ -188,10 +190,11 @@ def fetch(self) -> InviteInstance: :returns: The fetched InviteInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InviteInstance( self._version, @@ -209,9 +212,12 @@ async def fetch_async(self) -> InviteInstance: :returns: The fetched InviteInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InviteInstance( @@ -298,6 +304,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -329,6 +339,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -480,7 +494,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InvitePage(self._version, response, self._solution) async def page_async( @@ -510,8 +530,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InvitePage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v2/service/channel/member.py b/twilio/rest/ip_messaging/v2/service/channel/member.py index 9511a2bf6b..6456d3be20 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/member.py +++ b/twilio/rest/ip_messaging/v2/service/channel/member.py @@ -274,6 +274,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -295,6 +297,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -307,10 +311,11 @@ def fetch(self) -> MemberInstance: :returns: The fetched MemberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MemberInstance( self._version, @@ -328,9 +333,12 @@ async def fetch_async(self) -> MemberInstance: :returns: The fetched MemberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MemberInstance( @@ -366,6 +374,7 @@ def update( :returns: The updated MemberInstance """ + data = values.of( { "RoleSid": role_sid, @@ -378,11 +387,20 @@ def update( "Attributes": attributes, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -421,6 +439,7 @@ async def update_async( :returns: The updated MemberInstance """ + data = values.of( { "RoleSid": role_sid, @@ -433,11 +452,20 @@ async def update_async( "Attributes": attributes, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -555,6 +583,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -614,6 +646,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -765,7 +801,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MemberPage(self._version, response, self._solution) async def page_async( @@ -795,8 +837,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MemberPage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v2/service/channel/message.py b/twilio/rest/ip_messaging/v2/service/channel/message.py index 7420117113..838b3c7271 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/message.py +++ b/twilio/rest/ip_messaging/v2/service/channel/message.py @@ -282,6 +282,8 @@ def delete( } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async( @@ -303,6 +305,8 @@ async def delete_async( } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -315,10 +319,11 @@ def fetch(self) -> MessageInstance: :returns: The fetched MessageInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MessageInstance( self._version, @@ -336,9 +341,12 @@ async def fetch_async(self) -> MessageInstance: :returns: The fetched MessageInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MessageInstance( @@ -374,6 +382,7 @@ def update( :returns: The updated MessageInstance """ + data = values.of( { "Body": body, @@ -384,11 +393,20 @@ def update( "From": from_, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -427,6 +445,7 @@ async def update_async( :returns: The updated MessageInstance """ + data = values.of( { "Body": body, @@ -437,11 +456,20 @@ async def update_async( "From": from_, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -557,6 +585,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -614,6 +646,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -765,7 +801,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MessagePage(self._version, response, self._solution) async def page_async( @@ -795,8 +837,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MessagePage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v2/service/channel/webhook.py b/twilio/rest/ip_messaging/v2/service/channel/webhook.py index db23dd66af..3c7570fd0e 100644 --- a/twilio/rest/ip_messaging/v2/service/channel/webhook.py +++ b/twilio/rest/ip_messaging/v2/service/channel/webhook.py @@ -231,10 +231,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -243,9 +243,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> WebhookInstance: @@ -256,10 +258,11 @@ def fetch(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WebhookInstance( self._version, @@ -277,9 +280,12 @@ async def fetch_async(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WebhookInstance( @@ -311,6 +317,7 @@ def update( :returns: The updated WebhookInstance """ + data = values.of( { "Configuration.Url": configuration_url, @@ -325,11 +332,14 @@ def update( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -361,6 +371,7 @@ async def update_async( :returns: The updated WebhookInstance """ + data = values.of( { "Configuration.Url": configuration_url, @@ -375,11 +386,14 @@ async def update_async( "Configuration.RetryCount": configuration_retry_count, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -487,6 +501,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -539,6 +557,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -677,7 +699,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return WebhookPage(self._version, response, self._solution) async def page_async( @@ -704,8 +732,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WebhookPage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v2/service/role.py b/twilio/rest/ip_messaging/v2/service/role.py index 0acf77983b..32f70c2272 100644 --- a/twilio/rest/ip_messaging/v2/service/role.py +++ b/twilio/rest/ip_messaging/v2/service/role.py @@ -181,10 +181,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -193,9 +193,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RoleInstance: @@ -206,10 +208,11 @@ def fetch(self) -> RoleInstance: :returns: The fetched RoleInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RoleInstance( self._version, @@ -226,9 +229,12 @@ async def fetch_async(self) -> RoleInstance: :returns: The fetched RoleInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RoleInstance( @@ -246,16 +252,20 @@ def update(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -273,16 +283,20 @@ async def update_async(self, permission: List[str]) -> RoleInstance: :returns: The updated RoleInstance """ + data = values.of( { "Permission": serialize.map(permission, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoleInstance( @@ -363,6 +377,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -393,6 +411,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -528,7 +550,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RolePage(self._version, response, self._solution) async def page_async( @@ -555,8 +583,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RolePage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v2/service/user/__init__.py b/twilio/rest/ip_messaging/v2/service/user/__init__.py index 3af3121fab..f5f1454c72 100644 --- a/twilio/rest/ip_messaging/v2/service/user/__init__.py +++ b/twilio/rest/ip_messaging/v2/service/user/__init__.py @@ -240,10 +240,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -252,9 +252,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> UserInstance: @@ -265,10 +267,11 @@ def fetch(self) -> UserInstance: :returns: The fetched UserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserInstance( self._version, @@ -285,9 +288,12 @@ async def fetch_async(self) -> UserInstance: :returns: The fetched UserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserInstance( @@ -316,6 +322,7 @@ def update( :returns: The updated UserInstance """ + data = values.of( { "RoleSid": role_sid, @@ -323,11 +330,20 @@ def update( "FriendlyName": friendly_name, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -359,6 +375,7 @@ async def update_async( :returns: The updated UserInstance """ + data = values.of( { "RoleSid": role_sid, @@ -366,11 +383,20 @@ async def update_async( "FriendlyName": friendly_name, } ) - headers = values.of( - { - "X-Twilio-Webhook-Enabled": x_twilio_webhook_enabled, - } - ) + headers = values.of({}) + + if not ( + x_twilio_webhook_enabled is values.unset + or ( + isinstance(x_twilio_webhook_enabled, str) + and not x_twilio_webhook_enabled + ) + ): + headers["X-Twilio-Webhook-Enabled"] = x_twilio_webhook_enabled + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -495,6 +521,10 @@ def create( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -540,6 +570,10 @@ async def create_async( } ) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -675,7 +709,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserPage(self._version, response, self._solution) async def page_async( @@ -702,8 +742,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserPage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v2/service/user/user_binding.py b/twilio/rest/ip_messaging/v2/service/user/user_binding.py index 575a295cbb..4f1d9f10a7 100644 --- a/twilio/rest/ip_messaging/v2/service/user/user_binding.py +++ b/twilio/rest/ip_messaging/v2/service/user/user_binding.py @@ -173,10 +173,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -185,9 +185,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> UserBindingInstance: @@ -198,10 +200,11 @@ def fetch(self) -> UserBindingInstance: :returns: The fetched UserBindingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserBindingInstance( self._version, @@ -219,9 +222,12 @@ async def fetch_async(self) -> UserBindingInstance: :returns: The fetched UserBindingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserBindingInstance( @@ -440,7 +446,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserBindingPage(self._version, response, self._solution) async def page_async( @@ -472,8 +484,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserBindingPage(self._version, response, self._solution) diff --git a/twilio/rest/ip_messaging/v2/service/user/user_channel.py b/twilio/rest/ip_messaging/v2/service/user/user_channel.py index d89e6cb80d..5cb544fc3f 100644 --- a/twilio/rest/ip_messaging/v2/service/user/user_channel.py +++ b/twilio/rest/ip_messaging/v2/service/user/user_channel.py @@ -227,10 +227,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -239,9 +239,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> UserChannelInstance: @@ -252,10 +254,11 @@ def fetch(self) -> UserChannelInstance: :returns: The fetched UserChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UserChannelInstance( self._version, @@ -273,9 +276,12 @@ async def fetch_async(self) -> UserChannelInstance: :returns: The fetched UserChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UserChannelInstance( @@ -303,6 +309,7 @@ def update( :returns: The updated UserChannelInstance """ + data = values.of( { "NotificationLevel": notification_level, @@ -312,11 +319,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserChannelInstance( @@ -344,6 +354,7 @@ async def update_async( :returns: The updated UserChannelInstance """ + data = values.of( { "NotificationLevel": notification_level, @@ -353,11 +364,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UserChannelInstance( @@ -551,7 +565,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UserChannelPage(self._version, response, self._solution) async def page_async( @@ -578,8 +598,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UserChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/lookups/v1/phone_number.py b/twilio/rest/lookups/v1/phone_number.py index fe521c73e9..ace46b67bd 100644 --- a/twilio/rest/lookups/v1/phone_number.py +++ b/twilio/rest/lookups/v1/phone_number.py @@ -167,9 +167,16 @@ def fetch( "AddOns": serialize.map(add_ons, lambda e: e), } ) + data.update(serialize.prefixed_collapsible_map(add_ons_data, "AddOns")) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return PhoneNumberInstance( self._version, @@ -202,10 +209,15 @@ async def fetch_async( "AddOns": serialize.map(add_ons, lambda e: e), } ) + data.update(serialize.prefixed_collapsible_map(add_ons_data, "AddOns")) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PhoneNumberInstance( diff --git a/twilio/rest/lookups/v2/phone_number.py b/twilio/rest/lookups/v2/phone_number.py index d9c73c22d8..ac1b3257ef 100644 --- a/twilio/rest/lookups/v2/phone_number.py +++ b/twilio/rest/lookups/v2/phone_number.py @@ -300,7 +300,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return PhoneNumberInstance( self._version, @@ -365,8 +371,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PhoneNumberInstance( diff --git a/twilio/rest/marketplace/v1/available_add_on/__init__.py b/twilio/rest/marketplace/v1/available_add_on/__init__.py index 6f6713ee17..297d5dd6f3 100644 --- a/twilio/rest/marketplace/v1/available_add_on/__init__.py +++ b/twilio/rest/marketplace/v1/available_add_on/__init__.py @@ -132,10 +132,11 @@ def fetch(self) -> AvailableAddOnInstance: :returns: The fetched AvailableAddOnInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AvailableAddOnInstance( self._version, @@ -151,9 +152,12 @@ async def fetch_async(self) -> AvailableAddOnInstance: :returns: The fetched AvailableAddOnInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AvailableAddOnInstance( @@ -343,7 +347,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AvailableAddOnPage(self._version, response) async def page_async( @@ -370,8 +380,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AvailableAddOnPage(self._version, response) diff --git a/twilio/rest/marketplace/v1/available_add_on/available_add_on_extension.py b/twilio/rest/marketplace/v1/available_add_on/available_add_on_extension.py index 1113d9313c..a8973a08b0 100644 --- a/twilio/rest/marketplace/v1/available_add_on/available_add_on_extension.py +++ b/twilio/rest/marketplace/v1/available_add_on/available_add_on_extension.py @@ -128,10 +128,11 @@ def fetch(self) -> AvailableAddOnExtensionInstance: :returns: The fetched AvailableAddOnExtensionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AvailableAddOnExtensionInstance( self._version, @@ -148,9 +149,12 @@ async def fetch_async(self) -> AvailableAddOnExtensionInstance: :returns: The fetched AvailableAddOnExtensionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AvailableAddOnExtensionInstance( @@ -342,7 +346,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AvailableAddOnExtensionPage(self._version, response, self._solution) async def page_async( @@ -369,8 +379,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AvailableAddOnExtensionPage(self._version, response, self._solution) diff --git a/twilio/rest/marketplace/v1/installed_add_on/__init__.py b/twilio/rest/marketplace/v1/installed_add_on/__init__.py index df67c01d8c..8fedfb9b41 100644 --- a/twilio/rest/marketplace/v1/installed_add_on/__init__.py +++ b/twilio/rest/marketplace/v1/installed_add_on/__init__.py @@ -205,10 +205,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -217,9 +217,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> InstalledAddOnInstance: @@ -230,10 +232,11 @@ def fetch(self) -> InstalledAddOnInstance: :returns: The fetched InstalledAddOnInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InstalledAddOnInstance( self._version, @@ -249,9 +252,12 @@ async def fetch_async(self) -> InstalledAddOnInstance: :returns: The fetched InstalledAddOnInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InstalledAddOnInstance( @@ -273,17 +279,21 @@ def update( :returns: The updated InstalledAddOnInstance """ + data = values.of( { "Configuration": serialize.object(configuration), "UniqueName": unique_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload, sid=self._solution["sid"]) @@ -301,17 +311,21 @@ async def update_async( :returns: The updated InstalledAddOnInstance """ + data = values.of( { "Configuration": serialize.object(configuration), "UniqueName": unique_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload, sid=self._solution["sid"]) @@ -412,6 +426,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -448,6 +466,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -581,7 +603,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InstalledAddOnPage(self._version, response) async def page_async( @@ -608,8 +636,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InstalledAddOnPage(self._version, response) diff --git a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_extension.py b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_extension.py index c53a6ca510..88f160ed29 100644 --- a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_extension.py +++ b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_extension.py @@ -154,10 +154,11 @@ def fetch(self) -> InstalledAddOnExtensionInstance: :returns: The fetched InstalledAddOnExtensionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InstalledAddOnExtensionInstance( self._version, @@ -174,9 +175,12 @@ async def fetch_async(self) -> InstalledAddOnExtensionInstance: :returns: The fetched InstalledAddOnExtensionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InstalledAddOnExtensionInstance( @@ -194,16 +198,20 @@ def update(self, enabled: bool) -> InstalledAddOnExtensionInstance: :returns: The updated InstalledAddOnExtensionInstance """ + data = values.of( { "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnExtensionInstance( @@ -221,16 +229,20 @@ async def update_async(self, enabled: bool) -> InstalledAddOnExtensionInstance: :returns: The updated InstalledAddOnExtensionInstance """ + data = values.of( { "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnExtensionInstance( @@ -422,7 +434,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InstalledAddOnExtensionPage(self._version, response, self._solution) async def page_async( @@ -449,8 +467,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InstalledAddOnExtensionPage(self._version, response, self._solution) diff --git a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py index 47a9a7c13b..1a54756496 100644 --- a/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py +++ b/twilio/rest/marketplace/v1/installed_add_on/installed_add_on_usage.py @@ -21,9 +21,57 @@ class InstalledAddOnUsageInstance(InstanceResource): + + class MarketplaceV1InstalledAddOnInstalledAddOnUsage(object): + """ + :ivar total_submitted: Total amount in local currency that was billed in this request. Aggregates all billable_items that were successfully submitted. + :ivar billable_items: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.total_submitted: Optional[float] = deserialize.decimal( + payload.get("total_submitted") + ) + self.billable_items: Optional[ + List[ + InstalledAddOnUsageList.MarketplaceV1InstalledAddOnInstalledAddOnUsageBillableItems + ] + ] = payload.get("billable_items") + + def to_dict(self): + return { + "total_submitted": self.total_submitted, + "billable_items": ( + [billable_items.to_dict() for billable_items in self.billable_items] + if self.billable_items is not None + else None + ), + } + + class MarketplaceV1InstalledAddOnInstalledAddOnUsageBillableItems(object): + """ + :ivar quantity: Total amount in local currency that was billed for this Billing Item. Can be any floating number greater than 0. + :ivar sid: BillingSid to use for billing. + :ivar submitted: Whether the billing event was successfully generated for this Billable Item. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.quantity: Optional[float] = payload.get("quantity") + self.sid: Optional[str] = payload.get("sid") + self.submitted: Optional[bool] = payload.get("submitted") + + def to_dict(self): + return { + "quantity": self.quantity, + "sid": self.sid, + "submitted": self.submitted, + } + """ :ivar total_submitted: Total amount in local currency that was billed in this request. Aggregates all billable_items that were successfully submitted. - :ivar billable_items: + :ivar billable_items: """ def __init__( @@ -74,9 +122,31 @@ def __init__(self, payload: Dict[str, Any]): def to_dict(self): return { "total_submitted": self.total_submitted, - "billable_items": [ - billable_items.to_dict() for billable_items in self.billable_items - ], + "billable_items": ( + [billable_items.to_dict() for billable_items in self.billable_items] + if self.billable_items is not None + else None + ), + } + + class MarketplaceV1InstalledAddOnInstalledAddOnUsageBillableItems(object): + """ + :ivar quantity: Total amount in local currency that was billed for this Billing Item. Can be any floating number greater than 0. + :ivar sid: BillingSid to use for billing. + :ivar submitted: Whether the billing event was successfully generated for this Billable Item. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.quantity: Optional[float] = payload.get("quantity") + self.sid: Optional[str] = payload.get("sid") + self.submitted: Optional[bool] = payload.get("submitted") + + def to_dict(self): + return { + "quantity": self.quantity, + "sid": self.sid, + "submitted": self.submitted, } def __init__(self, version: Version, installed_add_on_sid: str): @@ -111,8 +181,11 @@ def create( data = marketplace_v1_installed_add_on_installed_add_on_usage.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -137,8 +210,11 @@ async def create_async( data = marketplace_v1_installed_add_on_installed_add_on_usage.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/marketplace/v1/module_data_management.py b/twilio/rest/marketplace/v1/module_data_management.py index 8ef224cec1..2dbdfe055f 100644 --- a/twilio/rest/marketplace/v1/module_data_management.py +++ b/twilio/rest/marketplace/v1/module_data_management.py @@ -187,10 +187,11 @@ def fetch(self) -> ModuleDataManagementInstance: :returns: The fetched ModuleDataManagementInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ModuleDataManagementInstance( self._version, @@ -206,9 +207,12 @@ async def fetch_async(self) -> ModuleDataManagementInstance: :returns: The fetched ModuleDataManagementInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ModuleDataManagementInstance( @@ -240,6 +244,7 @@ def update( :returns: The updated ModuleDataManagementInstance """ + data = values.of( { "ModuleInfo": module_info, @@ -251,11 +256,14 @@ def update( "Pricing": pricing, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ModuleDataManagementInstance( @@ -285,6 +293,7 @@ async def update_async( :returns: The updated ModuleDataManagementInstance """ + data = values.of( { "ModuleInfo": module_info, @@ -296,11 +305,14 @@ async def update_async( "Pricing": pricing, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ModuleDataManagementInstance( diff --git a/twilio/rest/marketplace/v1/referral_conversion.py b/twilio/rest/marketplace/v1/referral_conversion.py index 47bb191ed7..9d9f3c2fa9 100644 --- a/twilio/rest/marketplace/v1/referral_conversion.py +++ b/twilio/rest/marketplace/v1/referral_conversion.py @@ -21,8 +21,25 @@ class ReferralConversionInstance(InstanceResource): + + class CreateReferralConversionRequest(object): + """ + :ivar referral_account_sid: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.referral_account_sid: Optional[str] = payload.get( + "referral_account_sid" + ) + + def to_dict(self): + return { + "referral_account_sid": self.referral_account_sid, + } + """ - :ivar converted_account_sid: + :ivar converted_account_sid: """ def __init__(self, version: Version, payload: Dict[str, Any]): @@ -82,8 +99,11 @@ def create( data = create_referral_conversion_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -103,8 +123,11 @@ async def create_async( data = create_referral_conversion_request.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index b6ac290064..e8c2ac40d5 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -225,10 +225,11 @@ def fetch(self) -> BrandRegistrationInstance: :returns: The fetched BrandRegistrationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BrandRegistrationInstance( self._version, @@ -244,9 +245,12 @@ async def fetch_async(self) -> BrandRegistrationInstance: :returns: The fetched BrandRegistrationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return BrandRegistrationInstance( @@ -262,12 +266,14 @@ def update(self) -> BrandRegistrationInstance: :returns: The updated BrandRegistrationInstance """ + data = values.of({}) + headers = values.of({}) + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BrandRegistrationInstance( @@ -281,12 +287,14 @@ async def update_async(self) -> BrandRegistrationInstance: :returns: The updated BrandRegistrationInstance """ + data = values.of({}) + headers = values.of({}) + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BrandRegistrationInstance( @@ -392,6 +400,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -431,6 +443,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -564,7 +580,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return BrandRegistrationPage(self._version, response) async def page_async( @@ -591,8 +613,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BrandRegistrationPage(self._version, response) diff --git a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py index 74631cea78..415dec9589 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_registration_otp.py @@ -80,6 +80,8 @@ def create(self) -> BrandRegistrationOtpInstance: headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = self._version.create(method="POST", uri=self._uri, headers=headers) return BrandRegistrationOtpInstance( @@ -98,6 +100,8 @@ async def create_async(self) -> BrandRegistrationOtpInstance: headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, headers=headers ) diff --git a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py index 37fe4ed8d4..680be65037 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py @@ -147,10 +147,11 @@ def fetch(self) -> BrandVettingInstance: :returns: The fetched BrandVettingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BrandVettingInstance( self._version, @@ -167,9 +168,12 @@ async def fetch_async(self) -> BrandVettingInstance: :returns: The fetched BrandVettingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return BrandVettingInstance( @@ -252,6 +256,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -282,6 +290,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -444,7 +456,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return BrandVettingPage(self._version, response, self._solution) async def page_async( @@ -476,8 +494,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BrandVettingPage(self._version, response, self._solution) diff --git a/twilio/rest/messaging/v1/deactivations.py b/twilio/rest/messaging/v1/deactivations.py index 6616d87df5..e2cbf17a94 100644 --- a/twilio/rest/messaging/v1/deactivations.py +++ b/twilio/rest/messaging/v1/deactivations.py @@ -112,7 +112,13 @@ def fetch(self, date: Union[date, object] = values.unset) -> DeactivationsInstan } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return DeactivationsInstance( self._version, @@ -136,8 +142,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DeactivationsInstance( diff --git a/twilio/rest/messaging/v1/domain_certs.py b/twilio/rest/messaging/v1/domain_certs.py index 3acc8a18ff..6da256cdb0 100644 --- a/twilio/rest/messaging/v1/domain_certs.py +++ b/twilio/rest/messaging/v1/domain_certs.py @@ -174,10 +174,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -186,9 +186,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> DomainCertsInstance: @@ -199,10 +201,11 @@ def fetch(self) -> DomainCertsInstance: :returns: The fetched DomainCertsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DomainCertsInstance( self._version, @@ -218,9 +221,12 @@ async def fetch_async(self) -> DomainCertsInstance: :returns: The fetched DomainCertsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DomainCertsInstance( @@ -237,16 +243,20 @@ def update(self, tls_cert: str) -> DomainCertsInstance: :returns: The updated DomainCertsInstance """ + data = values.of( { "TlsCert": tls_cert, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DomainCertsInstance( @@ -261,16 +271,20 @@ async def update_async(self, tls_cert: str) -> DomainCertsInstance: :returns: The updated DomainCertsInstance """ + data = values.of( { "TlsCert": tls_cert, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DomainCertsInstance( diff --git a/twilio/rest/messaging/v1/domain_config.py b/twilio/rest/messaging/v1/domain_config.py index 25d69342d0..ed70351077 100644 --- a/twilio/rest/messaging/v1/domain_config.py +++ b/twilio/rest/messaging/v1/domain_config.py @@ -179,10 +179,11 @@ def fetch(self) -> DomainConfigInstance: :returns: The fetched DomainConfigInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DomainConfigInstance( self._version, @@ -198,9 +199,12 @@ async def fetch_async(self) -> DomainConfigInstance: :returns: The fetched DomainConfigInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DomainConfigInstance( @@ -226,6 +230,7 @@ def update( :returns: The updated DomainConfigInstance """ + data = values.of( { "FallbackUrl": fallback_url, @@ -234,11 +239,14 @@ def update( "DisableHttps": serialize.boolean_to_string(disable_https), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DomainConfigInstance( @@ -262,6 +270,7 @@ async def update_async( :returns: The updated DomainConfigInstance """ + data = values.of( { "FallbackUrl": fallback_url, @@ -270,11 +279,14 @@ async def update_async( "DisableHttps": serialize.boolean_to_string(disable_https), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DomainConfigInstance( diff --git a/twilio/rest/messaging/v1/domain_config_messaging_service.py b/twilio/rest/messaging/v1/domain_config_messaging_service.py index 178ebd544e..2bcd4aa88c 100644 --- a/twilio/rest/messaging/v1/domain_config_messaging_service.py +++ b/twilio/rest/messaging/v1/domain_config_messaging_service.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, Optional -from twilio.base import deserialize +from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -134,10 +134,11 @@ def fetch(self) -> DomainConfigMessagingServiceInstance: :returns: The fetched DomainConfigMessagingServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DomainConfigMessagingServiceInstance( self._version, @@ -153,9 +154,12 @@ async def fetch_async(self) -> DomainConfigMessagingServiceInstance: :returns: The fetched DomainConfigMessagingServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DomainConfigMessagingServiceInstance( diff --git a/twilio/rest/messaging/v1/external_campaign.py b/twilio/rest/messaging/v1/external_campaign.py index ebc115ee74..eed039a6cc 100644 --- a/twilio/rest/messaging/v1/external_campaign.py +++ b/twilio/rest/messaging/v1/external_campaign.py @@ -89,6 +89,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -120,6 +124,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/messaging/v1/linkshortening_messaging_service.py b/twilio/rest/messaging/v1/linkshortening_messaging_service.py index 94ebfa6173..ac69842a0c 100644 --- a/twilio/rest/messaging/v1/linkshortening_messaging_service.py +++ b/twilio/rest/messaging/v1/linkshortening_messaging_service.py @@ -177,10 +177,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -189,9 +189,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def __repr__(self) -> str: diff --git a/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py b/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py index a1252d2b35..4c0b52bddf 100644 --- a/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py +++ b/twilio/rest/messaging/v1/linkshortening_messaging_service_domain_association.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -122,10 +123,11 @@ def fetch(self) -> LinkshorteningMessagingServiceDomainAssociationInstance: :returns: The fetched LinkshorteningMessagingServiceDomainAssociationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return LinkshorteningMessagingServiceDomainAssociationInstance( self._version, @@ -143,9 +145,12 @@ async def fetch_async( :returns: The fetched LinkshorteningMessagingServiceDomainAssociationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return LinkshorteningMessagingServiceDomainAssociationInstance( diff --git a/twilio/rest/messaging/v1/request_managed_cert.py b/twilio/rest/messaging/v1/request_managed_cert.py index fd79b5a686..81ccf9486c 100644 --- a/twilio/rest/messaging/v1/request_managed_cert.py +++ b/twilio/rest/messaging/v1/request_managed_cert.py @@ -132,12 +132,14 @@ def update(self) -> RequestManagedCertInstance: :returns: The updated RequestManagedCertInstance """ + data = values.of({}) + headers = values.of({}) + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RequestManagedCertInstance( @@ -151,12 +153,14 @@ async def update_async(self) -> RequestManagedCertInstance: :returns: The updated RequestManagedCertInstance """ + data = values.of({}) + headers = values.of({}) + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RequestManagedCertInstance( diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 0fbb3dd10b..197bdf65f9 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -371,10 +371,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -383,9 +383,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -396,10 +398,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -415,9 +418,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -469,6 +475,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -495,11 +502,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -547,6 +557,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -573,11 +584,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -768,6 +782,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -846,6 +864,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -979,7 +1001,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -1006,8 +1034,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/messaging/v1/service/alpha_sender.py b/twilio/rest/messaging/v1/service/alpha_sender.py index 0173c98099..2ba4c2a45c 100644 --- a/twilio/rest/messaging/v1/service/alpha_sender.py +++ b/twilio/rest/messaging/v1/service/alpha_sender.py @@ -152,10 +152,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -164,9 +164,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AlphaSenderInstance: @@ -177,10 +179,11 @@ def fetch(self) -> AlphaSenderInstance: :returns: The fetched AlphaSenderInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AlphaSenderInstance( self._version, @@ -197,9 +200,12 @@ async def fetch_async(self) -> AlphaSenderInstance: :returns: The fetched AlphaSenderInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AlphaSenderInstance( @@ -274,6 +280,10 @@ def create(self, alpha_sender: str) -> AlphaSenderInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -298,6 +308,10 @@ async def create_async(self, alpha_sender: str) -> AlphaSenderInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -433,7 +447,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AlphaSenderPage(self._version, response, self._solution) async def page_async( @@ -460,8 +480,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AlphaSenderPage(self._version, response, self._solution) diff --git a/twilio/rest/messaging/v1/service/channel_sender.py b/twilio/rest/messaging/v1/service/channel_sender.py index 0a0d5c98de..9d708a2fba 100644 --- a/twilio/rest/messaging/v1/service/channel_sender.py +++ b/twilio/rest/messaging/v1/service/channel_sender.py @@ -154,10 +154,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -166,9 +166,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ChannelSenderInstance: @@ -179,10 +181,11 @@ def fetch(self) -> ChannelSenderInstance: :returns: The fetched ChannelSenderInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ChannelSenderInstance( self._version, @@ -199,9 +202,12 @@ async def fetch_async(self) -> ChannelSenderInstance: :returns: The fetched ChannelSenderInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ChannelSenderInstance( @@ -280,6 +286,10 @@ def create(self, sid: str) -> ChannelSenderInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -306,6 +316,10 @@ async def create_async(self, sid: str) -> ChannelSenderInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -443,7 +457,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ChannelSenderPage(self._version, response, self._solution) async def page_async( @@ -470,8 +490,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ChannelSenderPage(self._version, response, self._solution) diff --git a/twilio/rest/messaging/v1/service/phone_number.py b/twilio/rest/messaging/v1/service/phone_number.py index 10d30ab7fa..11b806583e 100644 --- a/twilio/rest/messaging/v1/service/phone_number.py +++ b/twilio/rest/messaging/v1/service/phone_number.py @@ -154,10 +154,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -166,9 +166,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> PhoneNumberInstance: @@ -179,10 +181,11 @@ def fetch(self) -> PhoneNumberInstance: :returns: The fetched PhoneNumberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PhoneNumberInstance( self._version, @@ -199,9 +202,12 @@ async def fetch_async(self) -> PhoneNumberInstance: :returns: The fetched PhoneNumberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PhoneNumberInstance( @@ -276,6 +282,10 @@ def create(self, phone_number_sid: str) -> PhoneNumberInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -300,6 +310,10 @@ async def create_async(self, phone_number_sid: str) -> PhoneNumberInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -435,7 +449,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PhoneNumberPage(self._version, response, self._solution) async def page_async( @@ -462,8 +482,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PhoneNumberPage(self._version, response, self._solution) diff --git a/twilio/rest/messaging/v1/service/short_code.py b/twilio/rest/messaging/v1/service/short_code.py index c8f1b3e3c8..172c78dbb9 100644 --- a/twilio/rest/messaging/v1/service/short_code.py +++ b/twilio/rest/messaging/v1/service/short_code.py @@ -152,10 +152,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -164,9 +164,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ShortCodeInstance: @@ -177,10 +179,11 @@ def fetch(self) -> ShortCodeInstance: :returns: The fetched ShortCodeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ShortCodeInstance( self._version, @@ -197,9 +200,12 @@ async def fetch_async(self) -> ShortCodeInstance: :returns: The fetched ShortCodeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ShortCodeInstance( @@ -274,6 +280,10 @@ def create(self, short_code_sid: str) -> ShortCodeInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -298,6 +308,10 @@ async def create_async(self, short_code_sid: str) -> ShortCodeInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -433,7 +447,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ShortCodePage(self._version, response, self._solution) async def page_async( @@ -460,8 +480,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ShortCodePage(self._version, response, self._solution) diff --git a/twilio/rest/messaging/v1/service/us_app_to_person.py b/twilio/rest/messaging/v1/service/us_app_to_person.py index ad31c6a4b7..dd451f5c59 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person.py @@ -264,10 +264,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -276,9 +276,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> UsAppToPersonInstance: @@ -289,10 +291,11 @@ def fetch(self) -> UsAppToPersonInstance: :returns: The fetched UsAppToPersonInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UsAppToPersonInstance( self._version, @@ -309,9 +312,12 @@ async def fetch_async(self) -> UsAppToPersonInstance: :returns: The fetched UsAppToPersonInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return UsAppToPersonInstance( @@ -344,6 +350,7 @@ def update( :returns: The updated UsAppToPersonInstance """ + data = values.of( { "HasEmbeddedLinks": serialize.boolean_to_string(has_embedded_links), @@ -355,11 +362,14 @@ def update( "DirectLending": serialize.boolean_to_string(direct_lending), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UsAppToPersonInstance( @@ -392,6 +402,7 @@ async def update_async( :returns: The updated UsAppToPersonInstance """ + data = values.of( { "HasEmbeddedLinks": serialize.boolean_to_string(has_embedded_links), @@ -403,11 +414,14 @@ async def update_async( "DirectLending": serialize.boolean_to_string(direct_lending), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return UsAppToPersonInstance( @@ -534,6 +548,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -608,6 +626,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -745,7 +767,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UsAppToPersonPage(self._version, response, self._solution) async def page_async( @@ -772,8 +800,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UsAppToPersonPage(self._version, response, self._solution) diff --git a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py index 1f0d857047..bf9e48e626 100644 --- a/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py +++ b/twilio/rest/messaging/v1/service/us_app_to_person_usecase.py @@ -81,6 +81,8 @@ def fetch( """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + params = values.of( { "BrandRegistrationSid": brand_registration_sid, @@ -108,6 +110,8 @@ async def fetch_async( """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + params = values.of( { "BrandRegistrationSid": brand_registration_sid, diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index 98887c7663..d052bd4cde 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -399,10 +399,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -411,9 +411,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TollfreeVerificationInstance: @@ -424,10 +426,11 @@ def fetch(self) -> TollfreeVerificationInstance: :returns: The fetched TollfreeVerificationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TollfreeVerificationInstance( self._version, @@ -443,9 +446,12 @@ async def fetch_async(self) -> TollfreeVerificationInstance: :returns: The fetched TollfreeVerificationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TollfreeVerificationInstance( @@ -507,6 +513,7 @@ def update( :returns: The updated TollfreeVerificationInstance """ + data = values.of( { "BusinessName": business_name, @@ -532,11 +539,14 @@ def update( "EditReason": edit_reason, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TollfreeVerificationInstance( @@ -596,6 +606,7 @@ async def update_async( :returns: The updated TollfreeVerificationInstance """ + data = values.of( { "BusinessName": business_name, @@ -621,11 +632,14 @@ async def update_async( "EditReason": edit_reason, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TollfreeVerificationInstance( @@ -759,6 +773,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -850,6 +868,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1047,7 +1069,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TollfreeVerificationPage(self._version, response) async def page_async( @@ -1086,8 +1114,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TollfreeVerificationPage(self._version, response) diff --git a/twilio/rest/messaging/v1/usecase.py b/twilio/rest/messaging/v1/usecase.py index 118c9c895e..fe811e0c84 100644 --- a/twilio/rest/messaging/v1/usecase.py +++ b/twilio/rest/messaging/v1/usecase.py @@ -62,6 +62,8 @@ def fetch(self) -> UsecaseInstance: """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return UsecaseInstance(self._version, payload) @@ -75,6 +77,8 @@ async def fetch_async(self) -> UsecaseInstance: """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( method="GET", uri=self._uri, headers=headers ) diff --git a/twilio/rest/microvisor/v1/account_config.py b/twilio/rest/microvisor/v1/account_config.py index 0abe5f9288..7faba8acb1 100644 --- a/twilio/rest/microvisor/v1/account_config.py +++ b/twilio/rest/microvisor/v1/account_config.py @@ -156,10 +156,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -168,9 +168,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AccountConfigInstance: @@ -181,10 +183,11 @@ def fetch(self) -> AccountConfigInstance: :returns: The fetched AccountConfigInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AccountConfigInstance( self._version, @@ -200,9 +203,12 @@ async def fetch_async(self) -> AccountConfigInstance: :returns: The fetched AccountConfigInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AccountConfigInstance( @@ -219,16 +225,20 @@ def update(self, value: str) -> AccountConfigInstance: :returns: The updated AccountConfigInstance """ + data = values.of( { "Value": value, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountConfigInstance(self._version, payload, key=self._solution["key"]) @@ -241,16 +251,20 @@ async def update_async(self, value: str) -> AccountConfigInstance: :returns: The updated AccountConfigInstance """ + data = values.of( { "Value": value, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountConfigInstance(self._version, payload, key=self._solution["key"]) @@ -315,6 +329,10 @@ def create(self, key: str, value: str) -> AccountConfigInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -339,6 +357,10 @@ async def create_async(self, key: str, value: str) -> AccountConfigInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -472,7 +494,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AccountConfigPage(self._version, response) async def page_async( @@ -499,8 +527,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AccountConfigPage(self._version, response) diff --git a/twilio/rest/microvisor/v1/account_secret.py b/twilio/rest/microvisor/v1/account_secret.py index e85a78bc58..13ca961e61 100644 --- a/twilio/rest/microvisor/v1/account_secret.py +++ b/twilio/rest/microvisor/v1/account_secret.py @@ -154,10 +154,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -166,9 +166,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AccountSecretInstance: @@ -179,10 +181,11 @@ def fetch(self) -> AccountSecretInstance: :returns: The fetched AccountSecretInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AccountSecretInstance( self._version, @@ -198,9 +201,12 @@ async def fetch_async(self) -> AccountSecretInstance: :returns: The fetched AccountSecretInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AccountSecretInstance( @@ -217,16 +223,20 @@ def update(self, value: str) -> AccountSecretInstance: :returns: The updated AccountSecretInstance """ + data = values.of( { "Value": value, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountSecretInstance(self._version, payload, key=self._solution["key"]) @@ -239,16 +249,20 @@ async def update_async(self, value: str) -> AccountSecretInstance: :returns: The updated AccountSecretInstance """ + data = values.of( { "Value": value, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AccountSecretInstance(self._version, payload, key=self._solution["key"]) @@ -313,6 +327,10 @@ def create(self, key: str, value: str) -> AccountSecretInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -337,6 +355,10 @@ async def create_async(self, key: str, value: str) -> AccountSecretInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -470,7 +492,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AccountSecretPage(self._version, response) async def page_async( @@ -497,8 +525,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AccountSecretPage(self._version, response) diff --git a/twilio/rest/microvisor/v1/app/__init__.py b/twilio/rest/microvisor/v1/app/__init__.py index 0c91fe3c50..8cfbbe68df 100644 --- a/twilio/rest/microvisor/v1/app/__init__.py +++ b/twilio/rest/microvisor/v1/app/__init__.py @@ -152,10 +152,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -164,9 +164,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AppInstance: @@ -177,10 +179,11 @@ def fetch(self) -> AppInstance: :returns: The fetched AppInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AppInstance( self._version, @@ -196,9 +199,12 @@ async def fetch_async(self) -> AppInstance: :returns: The fetched AppInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AppInstance( @@ -388,7 +394,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AppPage(self._version, response) async def page_async( @@ -415,8 +427,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AppPage(self._version, response) diff --git a/twilio/rest/microvisor/v1/app/app_manifest.py b/twilio/rest/microvisor/v1/app/app_manifest.py index 4f9eab075e..0412cadcc1 100644 --- a/twilio/rest/microvisor/v1/app/app_manifest.py +++ b/twilio/rest/microvisor/v1/app/app_manifest.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -108,10 +109,11 @@ def fetch(self) -> AppManifestInstance: :returns: The fetched AppManifestInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AppManifestInstance( self._version, @@ -127,9 +129,12 @@ async def fetch_async(self) -> AppManifestInstance: :returns: The fetched AppManifestInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AppManifestInstance( diff --git a/twilio/rest/microvisor/v1/device/__init__.py b/twilio/rest/microvisor/v1/device/__init__.py index 42a17340f6..a3b3089162 100644 --- a/twilio/rest/microvisor/v1/device/__init__.py +++ b/twilio/rest/microvisor/v1/device/__init__.py @@ -194,10 +194,11 @@ def fetch(self) -> DeviceInstance: :returns: The fetched DeviceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DeviceInstance( self._version, @@ -213,9 +214,12 @@ async def fetch_async(self) -> DeviceInstance: :returns: The fetched DeviceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DeviceInstance( @@ -241,6 +245,7 @@ def update( :returns: The updated DeviceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -249,11 +254,14 @@ def update( "RestartApp": serialize.boolean_to_string(restart_app), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceInstance(self._version, payload, sid=self._solution["sid"]) @@ -275,6 +283,7 @@ async def update_async( :returns: The updated DeviceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -283,11 +292,14 @@ async def update_async( "RestartApp": serialize.boolean_to_string(restart_app), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceInstance(self._version, payload, sid=self._solution["sid"]) @@ -485,7 +497,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DevicePage(self._version, response) async def page_async( @@ -512,8 +530,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DevicePage(self._version, response) diff --git a/twilio/rest/microvisor/v1/device/device_config.py b/twilio/rest/microvisor/v1/device/device_config.py index b4759e90b0..b87063f53f 100644 --- a/twilio/rest/microvisor/v1/device/device_config.py +++ b/twilio/rest/microvisor/v1/device/device_config.py @@ -166,10 +166,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -178,9 +178,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> DeviceConfigInstance: @@ -191,10 +193,11 @@ def fetch(self) -> DeviceConfigInstance: :returns: The fetched DeviceConfigInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DeviceConfigInstance( self._version, @@ -211,9 +214,12 @@ async def fetch_async(self) -> DeviceConfigInstance: :returns: The fetched DeviceConfigInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DeviceConfigInstance( @@ -231,16 +237,20 @@ def update(self, value: str) -> DeviceConfigInstance: :returns: The updated DeviceConfigInstance """ + data = values.of( { "Value": value, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceConfigInstance( @@ -258,16 +268,20 @@ async def update_async(self, value: str) -> DeviceConfigInstance: :returns: The updated DeviceConfigInstance """ + data = values.of( { "Value": value, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceConfigInstance( @@ -344,6 +358,10 @@ def create(self, key: str, value: str) -> DeviceConfigInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -370,6 +388,10 @@ async def create_async(self, key: str, value: str) -> DeviceConfigInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -505,7 +527,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DeviceConfigPage(self._version, response, self._solution) async def page_async( @@ -532,8 +560,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DeviceConfigPage(self._version, response, self._solution) diff --git a/twilio/rest/microvisor/v1/device/device_secret.py b/twilio/rest/microvisor/v1/device/device_secret.py index f89a6c0e96..30b805ea6b 100644 --- a/twilio/rest/microvisor/v1/device/device_secret.py +++ b/twilio/rest/microvisor/v1/device/device_secret.py @@ -164,10 +164,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -176,9 +176,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> DeviceSecretInstance: @@ -189,10 +191,11 @@ def fetch(self) -> DeviceSecretInstance: :returns: The fetched DeviceSecretInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DeviceSecretInstance( self._version, @@ -209,9 +212,12 @@ async def fetch_async(self) -> DeviceSecretInstance: :returns: The fetched DeviceSecretInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DeviceSecretInstance( @@ -229,16 +235,20 @@ def update(self, value: str) -> DeviceSecretInstance: :returns: The updated DeviceSecretInstance """ + data = values.of( { "Value": value, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceSecretInstance( @@ -256,16 +266,20 @@ async def update_async(self, value: str) -> DeviceSecretInstance: :returns: The updated DeviceSecretInstance """ + data = values.of( { "Value": value, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DeviceSecretInstance( @@ -342,6 +356,10 @@ def create(self, key: str, value: str) -> DeviceSecretInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -368,6 +386,10 @@ async def create_async(self, key: str, value: str) -> DeviceSecretInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -503,7 +525,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DeviceSecretPage(self._version, response, self._solution) async def page_async( @@ -530,8 +558,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DeviceSecretPage(self._version, response, self._solution) diff --git a/twilio/rest/monitor/v1/alert.py b/twilio/rest/monitor/v1/alert.py index ef8cf39dda..829e633643 100644 --- a/twilio/rest/monitor/v1/alert.py +++ b/twilio/rest/monitor/v1/alert.py @@ -149,10 +149,11 @@ def fetch(self) -> AlertInstance: :returns: The fetched AlertInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AlertInstance( self._version, @@ -168,9 +169,12 @@ async def fetch_async(self) -> AlertInstance: :returns: The fetched AlertInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AlertInstance( @@ -397,7 +401,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AlertPage(self._version, response) async def page_async( @@ -433,8 +443,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AlertPage(self._version, response) diff --git a/twilio/rest/monitor/v1/event.py b/twilio/rest/monitor/v1/event.py index 6b67a9c029..31716b8813 100644 --- a/twilio/rest/monitor/v1/event.py +++ b/twilio/rest/monitor/v1/event.py @@ -135,10 +135,11 @@ def fetch(self) -> EventInstance: :returns: The fetched EventInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EventInstance( self._version, @@ -154,9 +155,12 @@ async def fetch_async(self) -> EventInstance: :returns: The fetched EventInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EventInstance( @@ -428,7 +432,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EventPage(self._version, response) async def page_async( @@ -473,8 +483,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EventPage(self._version, response) diff --git a/twilio/rest/notify/v1/credential.py b/twilio/rest/notify/v1/credential.py index d894a9a702..9ca59927cb 100644 --- a/twilio/rest/notify/v1/credential.py +++ b/twilio/rest/notify/v1/credential.py @@ -208,10 +208,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -220,9 +220,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CredentialInstance: @@ -233,10 +235,11 @@ def fetch(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CredentialInstance( self._version, @@ -252,9 +255,12 @@ async def fetch_async(self) -> CredentialInstance: :returns: The fetched CredentialInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CredentialInstance( @@ -284,6 +290,7 @@ def update( :returns: The updated CredentialInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -294,11 +301,14 @@ def update( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -324,6 +334,7 @@ async def update_async( :returns: The updated CredentialInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -334,11 +345,14 @@ async def update_async( "Secret": secret, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CredentialInstance(self._version, payload, sid=self._solution["sid"]) @@ -422,6 +436,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -465,6 +483,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -598,7 +620,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CredentialPage(self._version, response) async def page_async( @@ -625,8 +653,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CredentialPage(self._version, response) diff --git a/twilio/rest/notify/v1/service/__init__.py b/twilio/rest/notify/v1/service/__init__.py index 2654c97c14..e097e69a67 100644 --- a/twilio/rest/notify/v1/service/__init__.py +++ b/twilio/rest/notify/v1/service/__init__.py @@ -305,10 +305,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -317,9 +317,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -330,10 +332,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -349,9 +352,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -397,6 +403,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -417,11 +424,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -463,6 +473,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -483,11 +494,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -618,6 +632,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -684,6 +702,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -832,7 +854,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -862,8 +890,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/notify/v1/service/binding.py b/twilio/rest/notify/v1/service/binding.py index 845f720dc2..33b1a4aac0 100644 --- a/twilio/rest/notify/v1/service/binding.py +++ b/twilio/rest/notify/v1/service/binding.py @@ -173,10 +173,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -185,9 +185,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> BindingInstance: @@ -198,10 +200,11 @@ def fetch(self) -> BindingInstance: :returns: The fetched BindingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BindingInstance( self._version, @@ -218,9 +221,12 @@ async def fetch_async(self) -> BindingInstance: :returns: The fetched BindingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return BindingInstance( @@ -316,6 +322,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -361,6 +371,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -560,7 +574,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return BindingPage(self._version, response, self._solution) async def page_async( @@ -599,8 +619,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BindingPage(self._version, response, self._solution) diff --git a/twilio/rest/notify/v1/service/notification.py b/twilio/rest/notify/v1/service/notification.py index ec31b423a1..4d228e864f 100644 --- a/twilio/rest/notify/v1/service/notification.py +++ b/twilio/rest/notify/v1/service/notification.py @@ -182,6 +182,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -260,6 +264,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 043364c3d5..68f078a88d 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,12 +28,10 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) -from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( - PortingWebhookConfigurationFetchList, -) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) +from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -58,12 +56,10 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None - self._porting_webhook_configuration_fetch: Optional[ - PortingWebhookConfigurationFetchList - ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None + self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -111,22 +107,18 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete - @property - def porting_webhook_configuration_fetch( - self, - ) -> PortingWebhookConfigurationFetchList: - if self._porting_webhook_configuration_fetch is None: - self._porting_webhook_configuration_fetch = ( - PortingWebhookConfigurationFetchList(self) - ) - return self._porting_webhook_configuration_fetch - @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations + @property + def webhook(self) -> WebhookList: + if self._webhook is None: + self._webhook = WebhookList(self) + return self._webhook + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/bulk_eligibility.py b/twilio/rest/numbers/v1/bulk_eligibility.py index 97b358b71e..766032f7c4 100644 --- a/twilio/rest/numbers/v1/bulk_eligibility.py +++ b/twilio/rest/numbers/v1/bulk_eligibility.py @@ -127,10 +127,11 @@ def fetch(self) -> BulkEligibilityInstance: :returns: The fetched BulkEligibilityInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BulkEligibilityInstance( self._version, @@ -146,9 +147,12 @@ async def fetch_async(self) -> BulkEligibilityInstance: :returns: The fetched BulkEligibilityInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return BulkEligibilityInstance( @@ -193,8 +197,11 @@ def create( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -214,8 +221,11 @@ async def create_async( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/numbers/v1/eligibility.py b/twilio/rest/numbers/v1/eligibility.py index 007a019f5b..8c5af0ac64 100644 --- a/twilio/rest/numbers/v1/eligibility.py +++ b/twilio/rest/numbers/v1/eligibility.py @@ -64,8 +64,11 @@ def create(self, body: Union[object, object] = values.unset) -> EligibilityInsta data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -85,8 +88,11 @@ async def create_async( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index 02844a09b4..bfca5762e0 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -164,10 +164,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -176,9 +176,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> PortingPortInInstance: @@ -189,10 +191,11 @@ def fetch(self) -> PortingPortInInstance: :returns: The fetched PortingPortInInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PortingPortInInstance( self._version, @@ -208,9 +211,12 @@ async def fetch_async(self) -> PortingPortInInstance: :returns: The fetched PortingPortInInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PortingPortInInstance( @@ -255,8 +261,11 @@ def create( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -276,8 +285,11 @@ async def create_async( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/numbers/v1/porting_port_in_phone_number.py b/twilio/rest/numbers/v1/porting_port_in_phone_number.py index c494961ef6..cc8120f78f 100644 --- a/twilio/rest/numbers/v1/porting_port_in_phone_number.py +++ b/twilio/rest/numbers/v1/porting_port_in_phone_number.py @@ -14,7 +14,7 @@ from datetime import datetime from typing import Any, Dict, Optional -from twilio.base import deserialize +from twilio.base import deserialize, values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -187,10 +187,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -199,9 +199,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> PortingPortInPhoneNumberInstance: @@ -212,10 +214,11 @@ def fetch(self) -> PortingPortInPhoneNumberInstance: :returns: The fetched PortingPortInPhoneNumberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PortingPortInPhoneNumberInstance( self._version, @@ -232,9 +235,12 @@ async def fetch_async(self) -> PortingPortInPhoneNumberInstance: :returns: The fetched PortingPortInPhoneNumberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PortingPortInPhoneNumberInstance( diff --git a/twilio/rest/numbers/v1/porting_portability.py b/twilio/rest/numbers/v1/porting_portability.py index 826a69a243..351cd541af 100644 --- a/twilio/rest/numbers/v1/porting_portability.py +++ b/twilio/rest/numbers/v1/porting_portability.py @@ -170,7 +170,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return PortingPortabilityInstance( self._version, @@ -199,8 +205,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PortingPortabilityInstance( diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration.py b/twilio/rest/numbers/v1/porting_webhook_configuration.py index ec36777a61..cfd9e1d0a8 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration.py @@ -72,8 +72,11 @@ def create( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -93,8 +96,11 @@ async def create_async( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py b/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py index 73d3477972..11572f1846 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_delete.py @@ -12,6 +12,7 @@ Do not edit the class manually. """ +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.list_resource import ListResource @@ -48,10 +49,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -60,9 +61,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def __repr__(self) -> str: diff --git a/twilio/rest/numbers/v1/signing_request_configuration.py b/twilio/rest/numbers/v1/signing_request_configuration.py index a144a09fe6..fcfcd7777b 100644 --- a/twilio/rest/numbers/v1/signing_request_configuration.py +++ b/twilio/rest/numbers/v1/signing_request_configuration.py @@ -102,8 +102,11 @@ def create( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -123,8 +126,11 @@ async def create_async( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -288,7 +294,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SigningRequestConfigurationPage(self._version, response) async def page_async( @@ -321,8 +333,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SigningRequestConfigurationPage(self._version, response) diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/webhook.py similarity index 77% rename from twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py rename to twilio/rest/numbers/v1/webhook.py index 89b8064bdb..69bd556326 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py +++ b/twilio/rest/numbers/v1/webhook.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class PortingWebhookConfigurationFetchInstance(InstanceResource): +class WebhookInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class PortingWebhookConfigurationFetchList(ListResource): +class WebhookList(ListResource): def __init__(self, version: Version): """ - Initialize the PortingWebhookConfigurationFetchList + Initialize the WebhookList :param version: Version that contains the resource @@ -68,33 +68,37 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> PortingWebhookConfigurationFetchInstance: + def fetch(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) - async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: + async def fetch_async(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( method="GET", uri=self._uri, headers=headers ) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) def __repr__(self) -> str: """ @@ -102,4 +106,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/numbers/v2/authorization_document/__init__.py b/twilio/rest/numbers/v2/authorization_document/__init__.py index f56071878e..033a32cfd7 100644 --- a/twilio/rest/numbers/v2/authorization_document/__init__.py +++ b/twilio/rest/numbers/v2/authorization_document/__init__.py @@ -170,10 +170,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -182,9 +182,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AuthorizationDocumentInstance: @@ -195,10 +197,11 @@ def fetch(self) -> AuthorizationDocumentInstance: :returns: The fetched AuthorizationDocumentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AuthorizationDocumentInstance( self._version, @@ -214,9 +217,12 @@ async def fetch_async(self) -> AuthorizationDocumentInstance: :returns: The fetched AuthorizationDocumentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AuthorizationDocumentInstance( @@ -315,6 +321,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -357,6 +367,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -518,7 +532,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AuthorizationDocumentPage(self._version, response) async def page_async( @@ -551,8 +571,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AuthorizationDocumentPage(self._version, response) diff --git a/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py b/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py index 7fc558fee2..36f961f5ef 100644 --- a/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py +++ b/twilio/rest/numbers/v2/authorization_document/dependent_hosted_number_order.py @@ -350,7 +350,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DependentHostedNumberOrderPage(self._version, response, self._solution) async def page_async( @@ -391,8 +397,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DependentHostedNumberOrderPage(self._version, response, self._solution) diff --git a/twilio/rest/numbers/v2/bulk_hosted_number_order.py b/twilio/rest/numbers/v2/bulk_hosted_number_order.py index 325ffe8e73..7259c801d2 100644 --- a/twilio/rest/numbers/v2/bulk_hosted_number_order.py +++ b/twilio/rest/numbers/v2/bulk_hosted_number_order.py @@ -160,7 +160,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return BulkHostedNumberOrderInstance( self._version, @@ -185,8 +191,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BulkHostedNumberOrderInstance( @@ -231,8 +241,11 @@ def create( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -252,8 +265,11 @@ async def create_async( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index 0fab0fe34a..5ad2b6d920 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -248,10 +248,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -260,9 +260,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> HostedNumberOrderInstance: @@ -273,10 +275,11 @@ def fetch(self) -> HostedNumberOrderInstance: :returns: The fetched HostedNumberOrderInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return HostedNumberOrderInstance( self._version, @@ -292,9 +295,12 @@ async def fetch_async(self) -> HostedNumberOrderInstance: :returns: The fetched HostedNumberOrderInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return HostedNumberOrderInstance( @@ -318,6 +324,7 @@ def update( :returns: The updated HostedNumberOrderInstance """ + data = values.of( { "Status": status, @@ -325,11 +332,14 @@ def update( "VerificationCallExtension": verification_call_extension, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance( @@ -351,6 +361,7 @@ async def update_async( :returns: The updated HostedNumberOrderInstance """ + data = values.of( { "Status": status, @@ -358,11 +369,14 @@ async def update_async( "VerificationCallExtension": verification_call_extension, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance( @@ -475,6 +489,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -545,6 +563,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -757,7 +779,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return HostedNumberOrderPage(self._version, response) async def page_async( @@ -799,8 +827,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return HostedNumberOrderPage(self._version, response) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py index 8ad16f21ce..079540d87b 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/__init__.py @@ -266,10 +266,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -278,9 +278,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> BundleInstance: @@ -291,10 +293,11 @@ def fetch(self) -> BundleInstance: :returns: The fetched BundleInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BundleInstance( self._version, @@ -310,9 +313,12 @@ async def fetch_async(self) -> BundleInstance: :returns: The fetched BundleInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return BundleInstance( @@ -338,6 +344,7 @@ def update( :returns: The updated BundleInstance """ + data = values.of( { "Status": status, @@ -346,11 +353,14 @@ def update( "Email": email, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BundleInstance(self._version, payload, sid=self._solution["sid"]) @@ -372,6 +382,7 @@ async def update_async( :returns: The updated BundleInstance """ + data = values.of( { "Status": status, @@ -380,11 +391,14 @@ async def update_async( "Email": email, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BundleInstance(self._version, payload, sid=self._solution["sid"]) @@ -519,6 +533,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -565,6 +583,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -867,7 +889,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return BundlePage(self._version, response) async def page_async( @@ -927,8 +955,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BundlePage(self._version, response) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py index 860a6f186e..d20a569690 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/bundle_copy.py @@ -138,6 +138,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -164,6 +168,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -299,7 +307,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return BundleCopyPage(self._version, response, self._solution) async def page_async( @@ -326,8 +340,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BundleCopyPage(self._version, response, self._solution) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py index 83d061cda7..fd45064808 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/evaluation.py @@ -140,10 +140,11 @@ def fetch(self) -> EvaluationInstance: :returns: The fetched EvaluationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EvaluationInstance( self._version, @@ -160,9 +161,12 @@ async def fetch_async(self) -> EvaluationInstance: :returns: The fetched EvaluationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EvaluationInstance( @@ -233,6 +237,8 @@ def create(self) -> EvaluationInstance: headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = self._version.create(method="POST", uri=self._uri, headers=headers) return EvaluationInstance( @@ -249,6 +255,8 @@ async def create_async(self) -> EvaluationInstance: headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, headers=headers ) @@ -384,7 +392,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EvaluationPage(self._version, response, self._solution) async def page_async( @@ -411,8 +425,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EvaluationPage(self._version, response, self._solution) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py index 5fa77e7f95..4eb1fe2b33 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/item_assignment.py @@ -148,10 +148,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -160,9 +160,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ItemAssignmentInstance: @@ -173,10 +175,11 @@ def fetch(self) -> ItemAssignmentInstance: :returns: The fetched ItemAssignmentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ItemAssignmentInstance( self._version, @@ -193,9 +196,12 @@ async def fetch_async(self) -> ItemAssignmentInstance: :returns: The fetched ItemAssignmentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ItemAssignmentInstance( @@ -272,6 +278,10 @@ def create(self, object_sid: str) -> ItemAssignmentInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -296,6 +306,10 @@ async def create_async(self, object_sid: str) -> ItemAssignmentInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -431,7 +445,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ItemAssignmentPage(self._version, response, self._solution) async def page_async( @@ -458,8 +478,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ItemAssignmentPage(self._version, response, self._solution) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py index 2e2bc6c293..a6a1de024d 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/bundle/replace_items.py @@ -114,6 +114,10 @@ def create(self, from_bundle_sid: str) -> ReplaceItemsInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -138,6 +142,10 @@ async def create_async(self, from_bundle_sid: str) -> ReplaceItemsInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py index 7886494d54..ab1803372a 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user.py @@ -183,10 +183,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -195,9 +195,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> EndUserInstance: @@ -208,10 +210,11 @@ def fetch(self) -> EndUserInstance: :returns: The fetched EndUserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EndUserInstance( self._version, @@ -227,9 +230,12 @@ async def fetch_async(self) -> EndUserInstance: :returns: The fetched EndUserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EndUserInstance( @@ -251,17 +257,21 @@ def update( :returns: The updated EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, "Attributes": serialize.object(attributes), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload, sid=self._solution["sid"]) @@ -279,17 +289,21 @@ async def update_async( :returns: The updated EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, "Attributes": serialize.object(attributes), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload, sid=self._solution["sid"]) @@ -361,6 +375,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -392,6 +410,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -525,7 +547,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EndUserPage(self._version, response) async def page_async( @@ -552,8 +580,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EndUserPage(self._version, response) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py b/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py index ba155575ac..f14c8905c7 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/end_user_type.py @@ -114,10 +114,11 @@ def fetch(self) -> EndUserTypeInstance: :returns: The fetched EndUserTypeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EndUserTypeInstance( self._version, @@ -133,9 +134,12 @@ async def fetch_async(self) -> EndUserTypeInstance: :returns: The fetched EndUserTypeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EndUserTypeInstance( @@ -313,7 +317,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EndUserTypePage(self._version, response) async def page_async( @@ -340,8 +350,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EndUserTypePage(self._version, response) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py index 706853bcee..9c1227905e 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/regulation.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/regulation.py @@ -144,7 +144,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return RegulationInstance( self._version, @@ -169,8 +175,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RegulationInstance( @@ -412,7 +422,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RegulationPage(self._version, response) async def page_async( @@ -451,8 +467,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RegulationPage(self._version, response) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py index c343e91ed5..b72f993858 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document.py @@ -199,10 +199,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -211,9 +211,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SupportingDocumentInstance: @@ -224,10 +226,11 @@ def fetch(self) -> SupportingDocumentInstance: :returns: The fetched SupportingDocumentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SupportingDocumentInstance( self._version, @@ -243,9 +246,12 @@ async def fetch_async(self) -> SupportingDocumentInstance: :returns: The fetched SupportingDocumentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SupportingDocumentInstance( @@ -267,17 +273,21 @@ def update( :returns: The updated SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, "Attributes": serialize.object(attributes), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance( @@ -297,17 +307,21 @@ async def update_async( :returns: The updated SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, "Attributes": serialize.object(attributes), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance( @@ -381,6 +395,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -412,6 +430,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -545,7 +567,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SupportingDocumentPage(self._version, response) async def page_async( @@ -572,8 +600,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SupportingDocumentPage(self._version, response) diff --git a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py index 0c7dc7b302..692248cb45 100644 --- a/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py +++ b/twilio/rest/numbers/v2/regulatory_compliance/supporting_document_type.py @@ -116,10 +116,11 @@ def fetch(self) -> SupportingDocumentTypeInstance: :returns: The fetched SupportingDocumentTypeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SupportingDocumentTypeInstance( self._version, @@ -135,9 +136,12 @@ async def fetch_async(self) -> SupportingDocumentTypeInstance: :returns: The fetched SupportingDocumentTypeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SupportingDocumentTypeInstance( @@ -315,7 +319,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SupportingDocumentTypePage(self._version, response) async def page_async( @@ -342,8 +352,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SupportingDocumentTypePage(self._version, response) diff --git a/twilio/rest/oauth/v1/authorize.py b/twilio/rest/oauth/v1/authorize.py index 19341db74e..a353c4b8e0 100644 --- a/twilio/rest/oauth/v1/authorize.py +++ b/twilio/rest/oauth/v1/authorize.py @@ -69,6 +69,8 @@ def fetch( """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + params = values.of( { "ResponseType": response_type, @@ -101,6 +103,8 @@ async def fetch_async( """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + params = values.of( { "ResponseType": response_type, diff --git a/twilio/rest/oauth/v1/token.py b/twilio/rest/oauth/v1/token.py index 0d5377a9f9..18de1008cb 100644 --- a/twilio/rest/oauth/v1/token.py +++ b/twilio/rest/oauth/v1/token.py @@ -101,6 +101,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -147,6 +151,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py index 79fe4beddd..49d3d40da5 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/__init__.py @@ -219,10 +219,11 @@ def fetch(self) -> AuthorizationDocumentInstance: :returns: The fetched AuthorizationDocumentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AuthorizationDocumentInstance( self._version, @@ -238,9 +239,12 @@ async def fetch_async(self) -> AuthorizationDocumentInstance: :returns: The fetched AuthorizationDocumentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AuthorizationDocumentInstance( @@ -272,6 +276,7 @@ def update( :returns: The updated AuthorizationDocumentInstance """ + data = values.of( { "HostedNumberOrderSids": serialize.map( @@ -285,11 +290,14 @@ def update( "ContactPhoneNumber": contact_phone_number, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthorizationDocumentInstance( @@ -319,6 +327,7 @@ async def update_async( :returns: The updated AuthorizationDocumentInstance """ + data = values.of( { "HostedNumberOrderSids": serialize.map( @@ -332,11 +341,14 @@ async def update_async( "ContactPhoneNumber": contact_phone_number, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AuthorizationDocumentInstance( @@ -435,6 +447,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -477,6 +493,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -638,7 +658,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AuthorizationDocumentPage(self._version, response) async def page_async( @@ -671,8 +697,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AuthorizationDocumentPage(self._version, response) diff --git a/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py b/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py index 35b67d71c7..0ec58f8792 100644 --- a/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/authorization_document/dependent_hosted_number_order.py @@ -385,7 +385,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DependentHostedNumberOrderPage(self._version, response, self._solution) async def page_async( @@ -429,8 +435,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DependentHostedNumberOrderPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/hosted_numbers/hosted_number_order.py b/twilio/rest/preview/hosted_numbers/hosted_number_order.py index 7010b1b3eb..0c20af8791 100644 --- a/twilio/rest/preview/hosted_numbers/hosted_number_order.py +++ b/twilio/rest/preview/hosted_numbers/hosted_number_order.py @@ -290,10 +290,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -302,9 +302,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> HostedNumberOrderInstance: @@ -315,10 +317,11 @@ def fetch(self) -> HostedNumberOrderInstance: :returns: The fetched HostedNumberOrderInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return HostedNumberOrderInstance( self._version, @@ -334,9 +337,12 @@ async def fetch_async(self) -> HostedNumberOrderInstance: :returns: The fetched HostedNumberOrderInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return HostedNumberOrderInstance( @@ -376,6 +382,7 @@ def update( :returns: The updated HostedNumberOrderInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -390,11 +397,14 @@ def update( "CallDelay": call_delay, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance( @@ -432,6 +442,7 @@ async def update_async( :returns: The updated HostedNumberOrderInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -446,11 +457,14 @@ async def update_async( "CallDelay": call_delay, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return HostedNumberOrderInstance( @@ -570,6 +584,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -645,6 +663,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -857,7 +879,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return HostedNumberOrderPage(self._version, response) async def page_async( @@ -899,8 +927,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return HostedNumberOrderPage(self._version, response) diff --git a/twilio/rest/preview/marketplace/available_add_on/__init__.py b/twilio/rest/preview/marketplace/available_add_on/__init__.py index 7743d8a8c3..e81ec649de 100644 --- a/twilio/rest/preview/marketplace/available_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/available_add_on/__init__.py @@ -132,10 +132,11 @@ def fetch(self) -> AvailableAddOnInstance: :returns: The fetched AvailableAddOnInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AvailableAddOnInstance( self._version, @@ -151,9 +152,12 @@ async def fetch_async(self) -> AvailableAddOnInstance: :returns: The fetched AvailableAddOnInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AvailableAddOnInstance( @@ -343,7 +347,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AvailableAddOnPage(self._version, response) async def page_async( @@ -370,8 +380,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AvailableAddOnPage(self._version, response) diff --git a/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py b/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py index d27b74cbfc..4c05f4244d 100644 --- a/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py +++ b/twilio/rest/preview/marketplace/available_add_on/available_add_on_extension.py @@ -128,10 +128,11 @@ def fetch(self) -> AvailableAddOnExtensionInstance: :returns: The fetched AvailableAddOnExtensionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AvailableAddOnExtensionInstance( self._version, @@ -148,9 +149,12 @@ async def fetch_async(self) -> AvailableAddOnExtensionInstance: :returns: The fetched AvailableAddOnExtensionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AvailableAddOnExtensionInstance( @@ -342,7 +346,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AvailableAddOnExtensionPage(self._version, response, self._solution) async def page_async( @@ -369,8 +379,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AvailableAddOnExtensionPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/marketplace/installed_add_on/__init__.py b/twilio/rest/preview/marketplace/installed_add_on/__init__.py index 731e84c80c..7f1fadc510 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/__init__.py +++ b/twilio/rest/preview/marketplace/installed_add_on/__init__.py @@ -194,10 +194,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -206,9 +206,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> InstalledAddOnInstance: @@ -219,10 +221,11 @@ def fetch(self) -> InstalledAddOnInstance: :returns: The fetched InstalledAddOnInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InstalledAddOnInstance( self._version, @@ -238,9 +241,12 @@ async def fetch_async(self) -> InstalledAddOnInstance: :returns: The fetched InstalledAddOnInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InstalledAddOnInstance( @@ -262,17 +268,21 @@ def update( :returns: The updated InstalledAddOnInstance """ + data = values.of( { "Configuration": serialize.object(configuration), "UniqueName": unique_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload, sid=self._solution["sid"]) @@ -290,17 +300,21 @@ async def update_async( :returns: The updated InstalledAddOnInstance """ + data = values.of( { "Configuration": serialize.object(configuration), "UniqueName": unique_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnInstance(self._version, payload, sid=self._solution["sid"]) @@ -389,6 +403,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -425,6 +443,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -558,7 +580,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InstalledAddOnPage(self._version, response) async def page_async( @@ -585,8 +613,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InstalledAddOnPage(self._version, response) diff --git a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py index f8e65d12c1..e0574ee2fd 100644 --- a/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py +++ b/twilio/rest/preview/marketplace/installed_add_on/installed_add_on_extension.py @@ -154,10 +154,11 @@ def fetch(self) -> InstalledAddOnExtensionInstance: :returns: The fetched InstalledAddOnExtensionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InstalledAddOnExtensionInstance( self._version, @@ -174,9 +175,12 @@ async def fetch_async(self) -> InstalledAddOnExtensionInstance: :returns: The fetched InstalledAddOnExtensionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InstalledAddOnExtensionInstance( @@ -194,16 +198,20 @@ def update(self, enabled: bool) -> InstalledAddOnExtensionInstance: :returns: The updated InstalledAddOnExtensionInstance """ + data = values.of( { "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnExtensionInstance( @@ -221,16 +229,20 @@ async def update_async(self, enabled: bool) -> InstalledAddOnExtensionInstance: :returns: The updated InstalledAddOnExtensionInstance """ + data = values.of( { "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return InstalledAddOnExtensionInstance( @@ -422,7 +434,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InstalledAddOnExtensionPage(self._version, response, self._solution) async def page_async( @@ -449,8 +467,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InstalledAddOnExtensionPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py index 23f805a875..7b09429375 100644 --- a/twilio/rest/preview/sync/service/__init__.py +++ b/twilio/rest/preview/sync/service/__init__.py @@ -224,10 +224,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -236,9 +236,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -249,10 +251,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -268,9 +271,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -296,6 +302,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "WebhookUrl": webhook_url, @@ -306,11 +313,14 @@ def update( "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -332,6 +342,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "WebhookUrl": webhook_url, @@ -342,11 +353,14 @@ async def update_async( "AclEnabled": serialize.boolean_to_string(acl_enabled), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -459,6 +473,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -495,6 +513,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -628,7 +650,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -655,8 +683,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/preview/sync/service/document/__init__.py b/twilio/rest/preview/sync/service/document/__init__.py index c7033e2fd2..ee55186ca4 100644 --- a/twilio/rest/preview/sync/service/document/__init__.py +++ b/twilio/rest/preview/sync/service/document/__init__.py @@ -200,10 +200,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -212,9 +212,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> DocumentInstance: @@ -225,10 +227,11 @@ def fetch(self) -> DocumentInstance: :returns: The fetched DocumentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DocumentInstance( self._version, @@ -245,9 +248,12 @@ async def fetch_async(self) -> DocumentInstance: :returns: The fetched DocumentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DocumentInstance( @@ -268,16 +274,22 @@ def update( :returns: The updated DocumentInstance """ + data = values.of( { "Data": serialize.object(data), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -301,16 +313,22 @@ async def update_async( :returns: The updated DocumentInstance """ + data = values.of( { "Data": serialize.object(data), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -407,6 +425,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -437,6 +459,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -572,7 +598,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DocumentPage(self._version, response, self._solution) async def page_async( @@ -599,8 +631,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DocumentPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/sync/service/document/document_permission.py b/twilio/rest/preview/sync/service/document/document_permission.py index 48addbb163..676efb569f 100644 --- a/twilio/rest/preview/sync/service/document/document_permission.py +++ b/twilio/rest/preview/sync/service/document/document_permission.py @@ -190,10 +190,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -202,9 +202,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> DocumentPermissionInstance: @@ -215,10 +217,11 @@ def fetch(self) -> DocumentPermissionInstance: :returns: The fetched DocumentPermissionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DocumentPermissionInstance( self._version, @@ -236,9 +239,12 @@ async def fetch_async(self) -> DocumentPermissionInstance: :returns: The fetched DocumentPermissionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DocumentPermissionInstance( @@ -261,6 +267,7 @@ def update( :returns: The updated DocumentPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -268,11 +275,14 @@ def update( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentPermissionInstance( @@ -295,6 +305,7 @@ async def update_async( :returns: The updated DocumentPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -302,11 +313,14 @@ async def update_async( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentPermissionInstance( @@ -502,7 +516,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DocumentPermissionPage(self._version, response, self._solution) async def page_async( @@ -529,8 +549,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DocumentPermissionPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/sync/service/sync_list/__init__.py b/twilio/rest/preview/sync/service/sync_list/__init__.py index 4b920e0194..0461f22430 100644 --- a/twilio/rest/preview/sync/service/sync_list/__init__.py +++ b/twilio/rest/preview/sync/service/sync_list/__init__.py @@ -175,10 +175,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -187,9 +187,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SyncListInstance: @@ -200,10 +202,11 @@ def fetch(self) -> SyncListInstance: :returns: The fetched SyncListInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncListInstance( self._version, @@ -220,9 +223,12 @@ async def fetch_async(self) -> SyncListInstance: :returns: The fetched SyncListInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncListInstance( @@ -325,6 +331,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -351,6 +361,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -486,7 +500,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncListPage(self._version, response, self._solution) async def page_async( @@ -513,8 +533,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncListPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py index b84411e8a8..5220aec215 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py @@ -215,6 +215,8 @@ def delete(self, if_match: Union[str, object] = values.unset) -> bool: } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self, if_match: Union[str, object] = values.unset) -> bool: @@ -231,6 +233,8 @@ async def delete_async(self, if_match: Union[str, object] = values.unset) -> boo } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -243,10 +247,11 @@ def fetch(self) -> SyncListItemInstance: :returns: The fetched SyncListItemInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncListItemInstance( self._version, @@ -264,9 +269,12 @@ async def fetch_async(self) -> SyncListItemInstance: :returns: The fetched SyncListItemInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncListItemInstance( @@ -288,16 +296,22 @@ def update( :returns: The updated SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -322,16 +336,22 @@ async def update_async( :returns: The updated SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -417,6 +437,10 @@ def create(self, data: object) -> SyncListItemInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -444,6 +468,10 @@ async def create_async(self, data: object) -> SyncListItemInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -625,7 +653,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncListItemPage(self._version, response, self._solution) async def page_async( @@ -661,8 +695,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncListItemPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py index 2fcaca5b26..334b62dd18 100644 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py +++ b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py @@ -192,10 +192,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -204,9 +204,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SyncListPermissionInstance: @@ -217,10 +219,11 @@ def fetch(self) -> SyncListPermissionInstance: :returns: The fetched SyncListPermissionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncListPermissionInstance( self._version, @@ -238,9 +241,12 @@ async def fetch_async(self) -> SyncListPermissionInstance: :returns: The fetched SyncListPermissionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncListPermissionInstance( @@ -263,6 +269,7 @@ def update( :returns: The updated SyncListPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -270,11 +277,14 @@ def update( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListPermissionInstance( @@ -297,6 +307,7 @@ async def update_async( :returns: The updated SyncListPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -304,11 +315,14 @@ async def update_async( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListPermissionInstance( @@ -502,7 +516,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncListPermissionPage(self._version, response, self._solution) async def page_async( @@ -529,8 +549,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncListPermissionPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/sync/service/sync_map/__init__.py b/twilio/rest/preview/sync/service/sync_map/__init__.py index 19c29f3267..0ecbb6132f 100644 --- a/twilio/rest/preview/sync/service/sync_map/__init__.py +++ b/twilio/rest/preview/sync/service/sync_map/__init__.py @@ -175,10 +175,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -187,9 +187,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SyncMapInstance: @@ -200,10 +202,11 @@ def fetch(self) -> SyncMapInstance: :returns: The fetched SyncMapInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncMapInstance( self._version, @@ -220,9 +223,12 @@ async def fetch_async(self) -> SyncMapInstance: :returns: The fetched SyncMapInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncMapInstance( @@ -323,6 +329,10 @@ def create(self, unique_name: Union[str, object] = values.unset) -> SyncMapInsta ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -349,6 +359,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -484,7 +498,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncMapPage(self._version, response, self._solution) async def page_async( @@ -511,8 +531,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncMapPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py index 78682fe588..9ddd1d5afe 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py @@ -215,6 +215,8 @@ def delete(self, if_match: Union[str, object] = values.unset) -> bool: } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self, if_match: Union[str, object] = values.unset) -> bool: @@ -231,6 +233,8 @@ async def delete_async(self, if_match: Union[str, object] = values.unset) -> boo } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -243,10 +247,11 @@ def fetch(self) -> SyncMapItemInstance: :returns: The fetched SyncMapItemInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncMapItemInstance( self._version, @@ -264,9 +269,12 @@ async def fetch_async(self) -> SyncMapItemInstance: :returns: The fetched SyncMapItemInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncMapItemInstance( @@ -288,16 +296,22 @@ def update( :returns: The updated SyncMapItemInstance """ + data = values.of( { "Data": serialize.object(data), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -322,16 +336,22 @@ async def update_async( :returns: The updated SyncMapItemInstance """ + data = values.of( { "Data": serialize.object(data), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -419,6 +439,10 @@ def create(self, key: str, data: object) -> SyncMapItemInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -448,6 +472,10 @@ async def create_async(self, key: str, data: object) -> SyncMapItemInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -629,7 +657,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncMapItemPage(self._version, response, self._solution) async def page_async( @@ -665,8 +699,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncMapItemPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py index b626f07bdc..9e19d56a91 100644 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py +++ b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py @@ -190,10 +190,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -202,9 +202,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SyncMapPermissionInstance: @@ -215,10 +217,11 @@ def fetch(self) -> SyncMapPermissionInstance: :returns: The fetched SyncMapPermissionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncMapPermissionInstance( self._version, @@ -236,9 +239,12 @@ async def fetch_async(self) -> SyncMapPermissionInstance: :returns: The fetched SyncMapPermissionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncMapPermissionInstance( @@ -261,6 +267,7 @@ def update( :returns: The updated SyncMapPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -268,11 +275,14 @@ def update( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapPermissionInstance( @@ -295,6 +305,7 @@ async def update_async( :returns: The updated SyncMapPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -302,11 +313,14 @@ async def update_async( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapPermissionInstance( @@ -500,7 +514,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncMapPermissionPage(self._version, response, self._solution) async def page_async( @@ -527,8 +547,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncMapPermissionPage(self._version, response, self._solution) diff --git a/twilio/rest/preview/wireless/command.py b/twilio/rest/preview/wireless/command.py index b91d1969e8..8e715e09ef 100644 --- a/twilio/rest/preview/wireless/command.py +++ b/twilio/rest/preview/wireless/command.py @@ -131,10 +131,11 @@ def fetch(self) -> CommandInstance: :returns: The fetched CommandInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CommandInstance( self._version, @@ -150,9 +151,12 @@ async def fetch_async(self) -> CommandInstance: :returns: The fetched CommandInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CommandInstance( @@ -240,6 +244,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -283,6 +291,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -480,7 +492,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CommandPage(self._version, response) async def page_async( @@ -519,8 +537,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CommandPage(self._version, response) diff --git a/twilio/rest/preview/wireless/rate_plan.py b/twilio/rest/preview/wireless/rate_plan.py index b9ca020da6..95e45f1ef2 100644 --- a/twilio/rest/preview/wireless/rate_plan.py +++ b/twilio/rest/preview/wireless/rate_plan.py @@ -194,10 +194,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -206,9 +206,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RatePlanInstance: @@ -219,10 +221,11 @@ def fetch(self) -> RatePlanInstance: :returns: The fetched RatePlanInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RatePlanInstance( self._version, @@ -238,9 +241,12 @@ async def fetch_async(self) -> RatePlanInstance: :returns: The fetched RatePlanInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RatePlanInstance( @@ -262,17 +268,21 @@ def update( :returns: The updated RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload, sid=self._solution["sid"]) @@ -290,17 +300,21 @@ async def update_async( :returns: The updated RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload, sid=self._solution["sid"]) @@ -397,6 +411,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -453,6 +471,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -586,7 +608,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RatePlanPage(self._version, response) async def page_async( @@ -613,8 +641,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RatePlanPage(self._version, response) diff --git a/twilio/rest/preview/wireless/sim/__init__.py b/twilio/rest/preview/wireless/sim/__init__.py index 8620c03ba2..07a9e74da0 100644 --- a/twilio/rest/preview/wireless/sim/__init__.py +++ b/twilio/rest/preview/wireless/sim/__init__.py @@ -285,10 +285,11 @@ def fetch(self) -> SimInstance: :returns: The fetched SimInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SimInstance( self._version, @@ -304,9 +305,12 @@ async def fetch_async(self) -> SimInstance: :returns: The fetched SimInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SimInstance( @@ -356,6 +360,7 @@ def update( :returns: The updated SimInstance """ + data = values.of( { "UniqueName": unique_name, @@ -376,11 +381,14 @@ def update( "VoiceUrl": voice_url, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SimInstance(self._version, payload, sid=self._solution["sid"]) @@ -426,6 +434,7 @@ async def update_async( :returns: The updated SimInstance """ + data = values.of( { "UniqueName": unique_name, @@ -446,11 +455,14 @@ async def update_async( "VoiceUrl": voice_url, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SimInstance(self._version, payload, sid=self._solution["sid"]) @@ -715,7 +727,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SimPage(self._version, response) async def page_async( @@ -757,8 +775,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SimPage(self._version, response) diff --git a/twilio/rest/preview/wireless/sim/usage.py b/twilio/rest/preview/wireless/sim/usage.py index d90b5f9e84..aff3731b51 100644 --- a/twilio/rest/preview/wireless/sim/usage.py +++ b/twilio/rest/preview/wireless/sim/usage.py @@ -150,7 +150,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return UsageInstance( self._version, @@ -179,8 +185,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UsageInstance( diff --git a/twilio/rest/preview_iam/PreviewIamBase.py b/twilio/rest/preview_iam/PreviewIamBase.py index d8735295d7..bdf047ecd2 100644 --- a/twilio/rest/preview_iam/PreviewIamBase.py +++ b/twilio/rest/preview_iam/PreviewIamBase.py @@ -9,15 +9,16 @@ Do not edit the class manually. """ -from twilio.base.domain import Domain from typing import Optional -from twilio.rest import Client +from twilio.base.domain import Domain +from twilio.rest import Client +from twilio.rest.preview_iam.organizations import Organizations from twilio.rest.preview_iam.v1 import V1 -from twilio.rest.preview_iam.versionless import Versionless class PreviewIamBase(Domain): + def __init__(self, twilio: Client): """ Initialize the PreviewIam Domain @@ -25,23 +26,30 @@ def __init__(self, twilio: Client): :returns: Domain for PreviewIam """ super().__init__(twilio, "https://preview-iam.twilio.com") - self._versionless: Optional[Versionless] = None + self._organizations: Optional[Organizations] = None self._v1: Optional[V1] = None @property - def versionless(self) -> Versionless: + def organizations(self) -> Organizations: """ - :returns: Versionless of PreviewIam + :returns: Versions organizations of PreviewIam """ - if self._versionless is None: - self._versionless = Versionless(self) - return self._versionless + if self._organizations is None: + self._organizations = Organizations(self) + return self._organizations @property def v1(self) -> V1: """ - :returns: V1 of PreviewIam + :returns: Versions v1 of PreviewIam """ if self._v1 is None: self._v1 = V1(self) return self._v1 + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/__init__.py b/twilio/rest/preview_iam/__init__.py index 9103436220..dd51b97489 100644 --- a/twilio/rest/preview_iam/__init__.py +++ b/twilio/rest/preview_iam/__init__.py @@ -1,25 +1,59 @@ -from twilio.rest.preview_iam.PreviewIamBase import PreviewIamBase +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ -from twilio.rest.preview_iam.v1.authorize import ( - AuthorizeList, -) -from twilio.rest.preview_iam.v1.token import ( - TokenList, -) -from twilio.rest.preview_iam.versionless.organization import ( - OrganizationList, -) + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.preview_iam.organizations.account import AccountList +from twilio.rest.preview_iam.organizations.role_assignment import RoleAssignmentList +from twilio.rest.preview_iam.organizations.user import UserList + + +class Organizations(Version): + + def __init__(self, domain: Domain): + """ + Initialize the Organizations version of PreviewIam + + :param domain: The Twilio.preview_iam domain + """ + super().__init__(domain, "Organizations") + self._accounts: Optional[AccountList] = None + self._role_assignments: Optional[RoleAssignmentList] = None + self._users: Optional[UserList] = None -class PreviewIam(PreviewIamBase): @property - def organization(self) -> OrganizationList: - return self.versionless.organization + def accounts(self) -> AccountList: + if self._accounts is None: + self._accounts = AccountList(self) + return self._accounts @property - def authorize(self) -> AuthorizeList: - return self.v1.authorize + def role_assignments(self) -> RoleAssignmentList: + if self._role_assignments is None: + self._role_assignments = RoleAssignmentList(self) + return self._role_assignments @property - def token(self) -> TokenList: - return self.v1.token + def users(self) -> UserList: + if self._users is None: + self._users = UserList(self) + return self._users + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/organizations/__init__.py b/twilio/rest/preview_iam/organizations/__init__.py new file mode 100644 index 0000000000..dd51b97489 --- /dev/null +++ b/twilio/rest/preview_iam/organizations/__init__.py @@ -0,0 +1,59 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.preview_iam.organizations.account import AccountList +from twilio.rest.preview_iam.organizations.role_assignment import RoleAssignmentList +from twilio.rest.preview_iam.organizations.user import UserList + + +class Organizations(Version): + + def __init__(self, domain: Domain): + """ + Initialize the Organizations version of PreviewIam + + :param domain: The Twilio.preview_iam domain + """ + super().__init__(domain, "Organizations") + self._accounts: Optional[AccountList] = None + self._role_assignments: Optional[RoleAssignmentList] = None + self._users: Optional[UserList] = None + + @property + def accounts(self) -> AccountList: + if self._accounts is None: + self._accounts = AccountList(self) + return self._accounts + + @property + def role_assignments(self) -> RoleAssignmentList: + if self._role_assignments is None: + self._role_assignments = RoleAssignmentList(self) + return self._role_assignments + + @property + def users(self) -> UserList: + if self._users is None: + self._users = UserList(self) + return self._users + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/organizations/account.py b/twilio/rest/preview_iam/organizations/account.py new file mode 100644 index 0000000000..bc5f49e28f --- /dev/null +++ b/twilio/rest/preview_iam/organizations/account.py @@ -0,0 +1,436 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class AccountInstance(InstanceResource): + """ + :ivar account_sid: Twilio account sid + :ivar friendly_name: Account friendly name + :ivar status: Account status + :ivar owner_sid: Twilio account sid + :ivar date_created: The date and time when the account was created in the system + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + organization_sid: Optional[str] = None, + account_sid: Optional[str] = None, + ): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.friendly_name: Optional[str] = payload.get("friendly_name") + self.status: Optional[str] = payload.get("status") + self.owner_sid: Optional[str] = payload.get("owner_sid") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + + self._solution = { + "organization_sid": organization_sid or self.organization_sid, + "account_sid": account_sid or self.account_sid, + } + self._context: Optional[AccountContext] = None + + @property + def _proxy(self) -> "AccountContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: AccountContext for this AccountInstance + """ + if self._context is None: + self._context = AccountContext( + self._version, + organization_sid=self._solution["organization_sid"], + account_sid=self._solution["account_sid"], + ) + return self._context + + def fetch(self) -> "AccountInstance": + """ + Fetch the AccountInstance + + + :returns: The fetched AccountInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "AccountInstance": + """ + Asynchronous coroutine to fetch the AccountInstance + + + :returns: The fetched AccountInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AccountContext(InstanceContext): + + def __init__(self, version: Version, organization_sid: str, account_sid: str): + """ + Initialize the AccountContext + + :param version: Version that contains the resource + :param organization_sid: + :param account_sid: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + "account_sid": account_sid, + } + self._uri = "/{organization_sid}/Accounts/{account_sid}".format( + **self._solution + ) + + def fetch(self) -> AccountInstance: + """ + Fetch the AccountInstance + + + :returns: The fetched AccountInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return AccountInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + account_sid=self._solution["account_sid"], + ) + + async def fetch_async(self) -> AccountInstance: + """ + Asynchronous coroutine to fetch the AccountInstance + + + :returns: The fetched AccountInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return AccountInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + account_sid=self._solution["account_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class AccountPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> AccountInstance: + """ + Build an instance of AccountInstance + + :param payload: Payload response from the API + """ + return AccountInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class AccountList(ListResource): + + def __init__(self, version: Version, organization_sid: str): + """ + Initialize the AccountList + + :param version: Version that contains the resource + :param organization_sid: + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + } + self._uri = "/{organization_sid}/Accounts".format(**self._solution) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[AccountInstance]: + """ + Streams AccountInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[AccountInstance]: + """ + Asynchronously streams AccountInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AccountInstance]: + """ + Lists AccountInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[AccountInstance]: + """ + Asynchronously lists AccountInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AccountPage: + """ + Retrieve a single page of AccountInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AccountInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return AccountPage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> AccountPage: + """ + Asynchronously retrieve a single page of AccountInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of AccountInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return AccountPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> AccountPage: + """ + Retrieve a specific page of AccountInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AccountInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return AccountPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> AccountPage: + """ + Asynchronously retrieve a specific page of AccountInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of AccountInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return AccountPage(self._version, response, self._solution) + + def get(self, organization_sid: str, account_sid: str) -> AccountContext: + """ + Constructs a AccountContext + + :param organization_sid: + :param account_sid: + """ + return AccountContext( + self._version, organization_sid=organization_sid, account_sid=account_sid + ) + + def __call__(self, organization_sid: str, account_sid: str) -> AccountContext: + """ + Constructs a AccountContext + + :param organization_sid: + :param account_sid: + """ + return AccountContext( + self._version, organization_sid=organization_sid, account_sid=account_sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/organizations/role_assignment.py b/twilio/rest/preview_iam/organizations/role_assignment.py new file mode 100644 index 0000000000..9608e2b806 --- /dev/null +++ b/twilio/rest/preview_iam/organizations/role_assignment.py @@ -0,0 +1,588 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class RoleAssignmentInstance(InstanceResource): + + class PublicApiCreateRoleAssignmentRequest(object): + """ + :ivar role_sid: Twilio Role Sid representing assigned role + :ivar scope: Twilio Sid representing scope of this assignment + :ivar identity: Twilio Sid representing identity of this assignment + """ + + def __init__(self, payload: Dict[str, Any]): + + self.role_sid: Optional[str] = payload.get("role_sid") + self.scope: Optional[str] = payload.get("scope") + self.identity: Optional[str] = payload.get("identity") + + def to_dict(self): + return { + "role_sid": self.role_sid, + "scope": self.scope, + "identity": self.identity, + } + + """ + :ivar sid: Twilio Role Assignment Sid representing this role assignment + :ivar role_sid: Twilio Role Sid representing assigned role + :ivar scope: Twilio Sid representing identity of this assignment + :ivar identity: Twilio Sid representing scope of this assignment + :ivar code: Twilio-specific error code + :ivar message: Error message + :ivar more_info: Link to Error Code References + :ivar status: HTTP response status code + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + organization_sid: Optional[str] = None, + role_assignment_sid: Optional[str] = None, + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.role_sid: Optional[str] = payload.get("role_sid") + self.scope: Optional[str] = payload.get("scope") + self.identity: Optional[str] = payload.get("identity") + self.code: Optional[int] = payload.get("code") + self.message: Optional[str] = payload.get("message") + self.more_info: Optional[str] = payload.get("moreInfo") + self.status: Optional[int] = payload.get("status") + + self._solution = { + "organization_sid": organization_sid or self.organization_sid, + "role_assignment_sid": role_assignment_sid or self.role_assignment_sid, + } + self._context: Optional[RoleAssignmentContext] = None + + @property + def _proxy(self) -> "RoleAssignmentContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: RoleAssignmentContext for this RoleAssignmentInstance + """ + if self._context is None: + self._context = RoleAssignmentContext( + self._version, + organization_sid=self._solution["organization_sid"], + role_assignment_sid=self._solution["role_assignment_sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the RoleAssignmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the RoleAssignmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class RoleAssignmentContext(InstanceContext): + + class PublicApiCreateRoleAssignmentRequest(object): + """ + :ivar role_sid: Twilio Role Sid representing assigned role + :ivar scope: Twilio Sid representing scope of this assignment + :ivar identity: Twilio Sid representing identity of this assignment + """ + + def __init__(self, payload: Dict[str, Any]): + + self.role_sid: Optional[str] = payload.get("role_sid") + self.scope: Optional[str] = payload.get("scope") + self.identity: Optional[str] = payload.get("identity") + + def to_dict(self): + return { + "role_sid": self.role_sid, + "scope": self.scope, + "identity": self.identity, + } + + def __init__( + self, version: Version, organization_sid: str, role_assignment_sid: str + ): + """ + Initialize the RoleAssignmentContext + + :param version: Version that contains the resource + :param organization_sid: + :param role_assignment_sid: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + "role_assignment_sid": role_assignment_sid, + } + self._uri = "/{organization_sid}/RoleAssignments/{role_assignment_sid}".format( + **self._solution + ) + + def delete(self) -> bool: + """ + Deletes the RoleAssignmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the RoleAssignmentInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + return await self._version.delete_async( + method="DELETE", uri=self._uri, headers=headers + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format( + context + ) + + +class RoleAssignmentPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> RoleAssignmentInstance: + """ + Build an instance of RoleAssignmentInstance + + :param payload: Payload response from the API + """ + return RoleAssignmentInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class RoleAssignmentList(ListResource): + + class PublicApiCreateRoleAssignmentRequest(object): + """ + :ivar role_sid: Twilio Role Sid representing assigned role + :ivar scope: Twilio Sid representing scope of this assignment + :ivar identity: Twilio Sid representing identity of this assignment + """ + + def __init__(self, payload: Dict[str, Any]): + + self.role_sid: Optional[str] = payload.get("role_sid") + self.scope: Optional[str] = payload.get("scope") + self.identity: Optional[str] = payload.get("identity") + + def to_dict(self): + return { + "role_sid": self.role_sid, + "scope": self.scope, + "identity": self.identity, + } + + def __init__(self, version: Version, organization_sid: str): + """ + Initialize the RoleAssignmentList + + :param version: Version that contains the resource + :param organization_sid: + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + } + self._uri = "/{organization_sid}/RoleAssignments".format(**self._solution) + + def create( + self, + public_api_create_role_assignment_request: PublicApiCreateRoleAssignmentRequest, + ) -> RoleAssignmentInstance: + """ + Create the RoleAssignmentInstance + + :param public_api_create_role_assignment_request: + + :returns: The created RoleAssignmentInstance + """ + data = public_api_create_role_assignment_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return RoleAssignmentInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + async def create_async( + self, + public_api_create_role_assignment_request: PublicApiCreateRoleAssignmentRequest, + ) -> RoleAssignmentInstance: + """ + Asynchronously create the RoleAssignmentInstance + + :param public_api_create_role_assignment_request: + + :returns: The created RoleAssignmentInstance + """ + data = public_api_create_role_assignment_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return RoleAssignmentInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + def stream( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[RoleAssignmentInstance]: + """ + Streams RoleAssignmentInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str identity: + :param str scope: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(identity=identity, scope=scope, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[RoleAssignmentInstance]: + """ + Asynchronously streams RoleAssignmentInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str identity: + :param str scope: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async( + identity=identity, scope=scope, page_size=limits["page_size"] + ) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[RoleAssignmentInstance]: + """ + Lists RoleAssignmentInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str identity: + :param str scope: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + identity=identity, + scope=scope, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[RoleAssignmentInstance]: + """ + Asynchronously lists RoleAssignmentInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str identity: + :param str scope: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + identity=identity, + scope=scope, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> RoleAssignmentPage: + """ + Retrieve a single page of RoleAssignmentInstance records from the API. + Request is executed immediately + + :param identity: + :param scope: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of RoleAssignmentInstance + """ + data = values.of( + { + "Identity": identity, + "Scope": scope, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return RoleAssignmentPage(self._version, response, self._solution) + + async def page_async( + self, + identity: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> RoleAssignmentPage: + """ + Asynchronously retrieve a single page of RoleAssignmentInstance records from the API. + Request is executed immediately + + :param identity: + :param scope: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of RoleAssignmentInstance + """ + data = values.of( + { + "Identity": identity, + "Scope": scope, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return RoleAssignmentPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> RoleAssignmentPage: + """ + Retrieve a specific page of RoleAssignmentInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of RoleAssignmentInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return RoleAssignmentPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> RoleAssignmentPage: + """ + Asynchronously retrieve a specific page of RoleAssignmentInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of RoleAssignmentInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return RoleAssignmentPage(self._version, response, self._solution) + + def get( + self, organization_sid: str, role_assignment_sid: str + ) -> RoleAssignmentContext: + """ + Constructs a RoleAssignmentContext + + :param organization_sid: + :param role_assignment_sid: + """ + return RoleAssignmentContext( + self._version, + organization_sid=organization_sid, + role_assignment_sid=role_assignment_sid, + ) + + def __call__( + self, organization_sid: str, role_assignment_sid: str + ) -> RoleAssignmentContext: + """ + Constructs a RoleAssignmentContext + + :param organization_sid: + :param role_assignment_sid: + """ + return RoleAssignmentContext( + self._version, + organization_sid=organization_sid, + role_assignment_sid=role_assignment_sid, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/organizations/user.py b/twilio/rest/preview_iam/organizations/user.py new file mode 100644 index 0000000000..31ee699422 --- /dev/null +++ b/twilio/rest/preview_iam/organizations/user.py @@ -0,0 +1,1052 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Organization Public API + No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class UserInstance(InstanceResource): + + class ScimEmailAddress(object): + """ + :ivar primary: Indicates if this email address is the primary one + :ivar value: The actual email address value + :ivar type: The type of email address (e.g., work, home, etc.) + """ + + def __init__(self, payload: Dict[str, Any]): + + self.primary: Optional[bool] = payload.get("primary") + self.value: Optional[str] = payload.get("value") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "primary": self.primary, + "value": self.value, + "type": self.type, + } + + class ScimMeta(object): + """ + :ivar resource_type: Indicates the type of the resource + :ivar created: The date and time when the resource was created in the system + :ivar last_modified: The date and time when the resource was last modified + :ivar version: A version identifier for the resource. This can be used to manage resource versioning and concurrency control. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.resource_type: Optional[str] = payload.get("resource_type") + self.created: Optional[datetime] = payload.get("created") + self.last_modified: Optional[datetime] = payload.get("last_modified") + self.version: Optional[str] = payload.get("version") + + def to_dict(self): + return { + "resource_type": self.resource_type, + "created": self.created, + "last_modified": self.last_modified, + "version": self.version, + } + + class ScimName(object): + """ + :ivar given_name: The user's first or given name + :ivar family_name: The user's last or family name + """ + + def __init__(self, payload: Dict[str, Any]): + + self.given_name: Optional[str] = payload.get("given_name") + self.family_name: Optional[str] = payload.get("family_name") + + def to_dict(self): + return { + "given_name": self.given_name, + "family_name": self.family_name, + } + + class ScimUser(object): + """ + :ivar id: Unique Twilio user sid + :ivar external_id: External unique resource id defined by provisioning client + :ivar user_name: Unique username, MUST be same as primary email address + :ivar display_name: User friendly display name + :ivar name: + :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. + :ivar active: Indicates whether the user is active + :ivar locale: User's locale + :ivar timezone: User's time zone + :ivar schemas: An array of URIs that indicate the schemas supported for this user resource + :ivar meta: + :ivar detail: A human-readable description of the error + :ivar scim_type: A scimType error code as defined in RFC7644 + :ivar status: Http status code + :ivar code: Twilio-specific error code + :ivar more_info: Link to Error Code References + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.external_id: Optional[str] = payload.get("external_id") + self.user_name: Optional[str] = payload.get("user_name") + self.display_name: Optional[str] = payload.get("display_name") + self.name: Optional[UserList.ScimName] = payload.get("name") + self.emails: Optional[List[UserList.ScimEmailAddress]] = payload.get( + "emails" + ) + self.active: Optional[bool] = payload.get("active") + self.locale: Optional[str] = payload.get("locale") + self.timezone: Optional[str] = payload.get("timezone") + self.schemas: Optional[List[str]] = payload.get("schemas") + self.meta: Optional[UserList.ScimMeta] = payload.get("meta") + self.detail: Optional[str] = payload.get("detail") + self.scim_type: Optional[str] = payload.get("scim_type") + self.status: Optional[str] = payload.get("status") + self.code: Optional[int] = payload.get("code") + self.more_info: Optional[str] = payload.get("more_info") + + def to_dict(self): + return { + "id": self.id, + "externalId": self.external_id, + "userName": self.user_name, + "displayName": self.display_name, + "name": self.name.to_dict() if self.name is not None else None, + "emails": ( + [emails.to_dict() for emails in self.emails] + if self.emails is not None + else None + ), + "active": self.active, + "locale": self.locale, + "timezone": self.timezone, + "schemas": self.schemas, + "meta": self.meta.to_dict() if self.meta is not None else None, + "detail": self.detail, + "scimType": self.scim_type, + "status": self.status, + "code": self.code, + "moreInfo": self.more_info, + } + + """ + :ivar id: Unique Twilio user sid + :ivar external_id: External unique resource id defined by provisioning client + :ivar user_name: Unique username, MUST be same as primary email address + :ivar display_name: User friendly display name + :ivar name: + :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. + :ivar active: Indicates whether the user is active + :ivar locale: User's locale + :ivar timezone: User's time zone + :ivar schemas: An array of URIs that indicate the schemas supported for this user resource + :ivar meta: + :ivar detail: A human-readable description of the error + :ivar scim_type: A scimType error code as defined in RFC7644 + :ivar status: Http status code + :ivar code: Twilio-specific error code + :ivar more_info: Link to Error Code References + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + organization_sid: Optional[str] = None, + user_sid: Optional[str] = None, + ): + super().__init__(version) + + self.id: Optional[str] = payload.get("id") + self.external_id: Optional[str] = payload.get("externalId") + self.user_name: Optional[str] = payload.get("userName") + self.display_name: Optional[str] = payload.get("displayName") + self.name: Optional[UserList.str] = payload.get("name") + self.emails: Optional[List[UserList.str]] = payload.get("emails") + self.active: Optional[bool] = payload.get("active") + self.locale: Optional[str] = payload.get("locale") + self.timezone: Optional[str] = payload.get("timezone") + self.schemas: Optional[List[str]] = payload.get("schemas") + self.meta: Optional[UserList.str] = payload.get("meta") + self.detail: Optional[str] = payload.get("detail") + self.scim_type: Optional[str] = payload.get("scimType") + self.status: Optional[str] = payload.get("status") + self.code: Optional[int] = payload.get("code") + self.more_info: Optional[str] = payload.get("moreInfo") + + self._solution = { + "organization_sid": organization_sid or self.organization_sid, + "user_sid": user_sid or self.user_sid, + } + self._context: Optional[UserContext] = None + + @property + def _proxy(self) -> "UserContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: UserContext for this UserInstance + """ + if self._context is None: + self._context = UserContext( + self._version, + organization_sid=self._solution["organization_sid"], + user_sid=self._solution["user_sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the UserInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the UserInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "UserInstance": + """ + Fetch the UserInstance + + + :returns: The fetched UserInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "UserInstance": + """ + Asynchronous coroutine to fetch the UserInstance + + + :returns: The fetched UserInstance + """ + return await self._proxy.fetch_async() + + def update( + self, scim_user: ScimUser, if_match: Union[str, object] = values.unset + ) -> "UserInstance": + """ + Update the UserInstance + + :param scim_user: + :param if_match: + + :returns: The updated UserInstance + """ + return self._proxy.update( + scim_user=scim_user, + if_match=if_match, + ) + + async def update_async( + self, scim_user: ScimUser, if_match: Union[str, object] = values.unset + ) -> "UserInstance": + """ + Asynchronous coroutine to update the UserInstance + + :param scim_user: + :param if_match: + + :returns: The updated UserInstance + """ + return await self._proxy.update_async( + scim_user=scim_user, + if_match=if_match, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class UserContext(InstanceContext): + + class ScimEmailAddress(object): + """ + :ivar primary: Indicates if this email address is the primary one + :ivar value: The actual email address value + :ivar type: The type of email address (e.g., work, home, etc.) + """ + + def __init__(self, payload: Dict[str, Any]): + + self.primary: Optional[bool] = payload.get("primary") + self.value: Optional[str] = payload.get("value") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "primary": self.primary, + "value": self.value, + "type": self.type, + } + + class ScimMeta(object): + """ + :ivar resource_type: Indicates the type of the resource + :ivar created: The date and time when the resource was created in the system + :ivar last_modified: The date and time when the resource was last modified + :ivar version: A version identifier for the resource. This can be used to manage resource versioning and concurrency control. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.resource_type: Optional[str] = payload.get("resource_type") + self.created: Optional[datetime] = payload.get("created") + self.last_modified: Optional[datetime] = payload.get("last_modified") + self.version: Optional[str] = payload.get("version") + + def to_dict(self): + return { + "resource_type": self.resource_type, + "created": self.created, + "last_modified": self.last_modified, + "version": self.version, + } + + class ScimName(object): + """ + :ivar given_name: The user's first or given name + :ivar family_name: The user's last or family name + """ + + def __init__(self, payload: Dict[str, Any]): + + self.given_name: Optional[str] = payload.get("given_name") + self.family_name: Optional[str] = payload.get("family_name") + + def to_dict(self): + return { + "given_name": self.given_name, + "family_name": self.family_name, + } + + class ScimUser(object): + """ + :ivar id: Unique Twilio user sid + :ivar external_id: External unique resource id defined by provisioning client + :ivar user_name: Unique username, MUST be same as primary email address + :ivar display_name: User friendly display name + :ivar name: + :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. + :ivar active: Indicates whether the user is active + :ivar locale: User's locale + :ivar timezone: User's time zone + :ivar schemas: An array of URIs that indicate the schemas supported for this user resource + :ivar meta: + :ivar detail: A human-readable description of the error + :ivar scim_type: A scimType error code as defined in RFC7644 + :ivar status: Http status code + :ivar code: Twilio-specific error code + :ivar more_info: Link to Error Code References + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.external_id: Optional[str] = payload.get("external_id") + self.user_name: Optional[str] = payload.get("user_name") + self.display_name: Optional[str] = payload.get("display_name") + self.name: Optional[UserList.ScimName] = payload.get("name") + self.emails: Optional[List[UserList.ScimEmailAddress]] = payload.get( + "emails" + ) + self.active: Optional[bool] = payload.get("active") + self.locale: Optional[str] = payload.get("locale") + self.timezone: Optional[str] = payload.get("timezone") + self.schemas: Optional[List[str]] = payload.get("schemas") + self.meta: Optional[UserList.ScimMeta] = payload.get("meta") + self.detail: Optional[str] = payload.get("detail") + self.scim_type: Optional[str] = payload.get("scim_type") + self.status: Optional[str] = payload.get("status") + self.code: Optional[int] = payload.get("code") + self.more_info: Optional[str] = payload.get("more_info") + + def to_dict(self): + return { + "id": self.id, + "externalId": self.external_id, + "userName": self.user_name, + "displayName": self.display_name, + "name": self.name.to_dict() if self.name is not None else None, + "emails": ( + [emails.to_dict() for emails in self.emails] + if self.emails is not None + else None + ), + "active": self.active, + "locale": self.locale, + "timezone": self.timezone, + "schemas": self.schemas, + "meta": self.meta.to_dict() if self.meta is not None else None, + "detail": self.detail, + "scimType": self.scim_type, + "status": self.status, + "code": self.code, + "moreInfo": self.more_info, + } + + def __init__(self, version: Version, organization_sid: str, user_sid: str): + """ + Initialize the UserContext + + :param version: Version that contains the resource + :param organization_sid: + :param user_sid: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + "user_sid": user_sid, + } + self._uri = "/{organization_sid}/scim/Users/{user_sid}".format(**self._solution) + + def delete(self) -> bool: + """ + Deletes the UserInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the UserInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + return await self._version.delete_async( + method="DELETE", uri=self._uri, headers=headers + ) + + def fetch(self) -> UserInstance: + """ + Fetch the UserInstance + + + :returns: The fetched UserInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return UserInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + user_sid=self._solution["user_sid"], + ) + + async def fetch_async(self) -> UserInstance: + """ + Asynchronous coroutine to fetch the UserInstance + + + :returns: The fetched UserInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/scim+json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return UserInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + user_sid=self._solution["user_sid"], + ) + + def update( + self, scim_user: ScimUser, if_match: Union[str, object] = values.unset + ) -> UserInstance: + """ + Update the UserInstance + + :param scim_user: + :param if_match: + + :returns: The updated UserInstance + """ + data = scim_user.to_dict() + + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/json" + + headers["Content-Type"] = "application/scim+json" + + headers["Accept"] = "application/scim+json" + + payload = self._version.update( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return UserInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + user_sid=self._solution["user_sid"], + ) + + async def update_async( + self, scim_user: ScimUser, if_match: Union[str, object] = values.unset + ) -> UserInstance: + """ + Asynchronous coroutine to update the UserInstance + + :param scim_user: + :param if_match: + + :returns: The updated UserInstance + """ + data = scim_user.to_dict() + + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/json" + + headers["Content-Type"] = "application/scim+json" + + headers["Accept"] = "application/scim+json" + + payload = await self._version.update_async( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return UserInstance( + self._version, + payload, + organization_sid=self._solution["organization_sid"], + user_sid=self._solution["user_sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class UserPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> UserInstance: + """ + Build an instance of UserInstance + + :param payload: Payload response from the API + """ + return UserInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class UserList(ListResource): + + class ScimEmailAddress(object): + """ + :ivar primary: Indicates if this email address is the primary one + :ivar value: The actual email address value + :ivar type: The type of email address (e.g., work, home, etc.) + """ + + def __init__(self, payload: Dict[str, Any]): + + self.primary: Optional[bool] = payload.get("primary") + self.value: Optional[str] = payload.get("value") + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "primary": self.primary, + "value": self.value, + "type": self.type, + } + + class ScimMeta(object): + """ + :ivar resource_type: Indicates the type of the resource + :ivar created: The date and time when the resource was created in the system + :ivar last_modified: The date and time when the resource was last modified + :ivar version: A version identifier for the resource. This can be used to manage resource versioning and concurrency control. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.resource_type: Optional[str] = payload.get("resource_type") + self.created: Optional[datetime] = payload.get("created") + self.last_modified: Optional[datetime] = payload.get("last_modified") + self.version: Optional[str] = payload.get("version") + + def to_dict(self): + return { + "resource_type": self.resource_type, + "created": self.created, + "last_modified": self.last_modified, + "version": self.version, + } + + class ScimName(object): + """ + :ivar given_name: The user's first or given name + :ivar family_name: The user's last or family name + """ + + def __init__(self, payload: Dict[str, Any]): + + self.given_name: Optional[str] = payload.get("given_name") + self.family_name: Optional[str] = payload.get("family_name") + + def to_dict(self): + return { + "given_name": self.given_name, + "family_name": self.family_name, + } + + class ScimUser(object): + """ + :ivar id: Unique Twilio user sid + :ivar external_id: External unique resource id defined by provisioning client + :ivar user_name: Unique username, MUST be same as primary email address + :ivar display_name: User friendly display name + :ivar name: + :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. + :ivar active: Indicates whether the user is active + :ivar locale: User's locale + :ivar timezone: User's time zone + :ivar schemas: An array of URIs that indicate the schemas supported for this user resource + :ivar meta: + :ivar detail: A human-readable description of the error + :ivar scim_type: A scimType error code as defined in RFC7644 + :ivar status: Http status code + :ivar code: Twilio-specific error code + :ivar more_info: Link to Error Code References + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.external_id: Optional[str] = payload.get("external_id") + self.user_name: Optional[str] = payload.get("user_name") + self.display_name: Optional[str] = payload.get("display_name") + self.name: Optional[UserList.ScimName] = payload.get("name") + self.emails: Optional[List[UserList.ScimEmailAddress]] = payload.get( + "emails" + ) + self.active: Optional[bool] = payload.get("active") + self.locale: Optional[str] = payload.get("locale") + self.timezone: Optional[str] = payload.get("timezone") + self.schemas: Optional[List[str]] = payload.get("schemas") + self.meta: Optional[UserList.ScimMeta] = payload.get("meta") + self.detail: Optional[str] = payload.get("detail") + self.scim_type: Optional[str] = payload.get("scim_type") + self.status: Optional[str] = payload.get("status") + self.code: Optional[int] = payload.get("code") + self.more_info: Optional[str] = payload.get("more_info") + + def to_dict(self): + return { + "id": self.id, + "externalId": self.external_id, + "userName": self.user_name, + "displayName": self.display_name, + "name": self.name.to_dict() if self.name is not None else None, + "emails": ( + [emails.to_dict() for emails in self.emails] + if self.emails is not None + else None + ), + "active": self.active, + "locale": self.locale, + "timezone": self.timezone, + "schemas": self.schemas, + "meta": self.meta.to_dict() if self.meta is not None else None, + "detail": self.detail, + "scimType": self.scim_type, + "status": self.status, + "code": self.code, + "moreInfo": self.more_info, + } + + def __init__(self, version: Version, organization_sid: str): + """ + Initialize the UserList + + :param version: Version that contains the resource + :param organization_sid: + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "organization_sid": organization_sid, + } + self._uri = "/{organization_sid}/scim/Users".format(**self._solution) + + def create(self, scim_user: ScimUser) -> UserInstance: + """ + Create the UserInstance + + :param scim_user: + + :returns: The created UserInstance + """ + data = scim_user.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Content-Type"] = "application/scim+json" + + headers["Accept"] = "application/scim+json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return UserInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + async def create_async(self, scim_user: ScimUser) -> UserInstance: + """ + Asynchronously create the UserInstance + + :param scim_user: + + :returns: The created UserInstance + """ + data = scim_user.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Content-Type"] = "application/scim+json" + + headers["Accept"] = "application/scim+json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return UserInstance( + self._version, payload, organization_sid=self._solution["organization_sid"] + ) + + def stream( + self, + filter: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[UserInstance]: + """ + Streams UserInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str filter: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(filter=filter, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + filter: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[UserInstance]: + """ + Asynchronously streams UserInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str filter: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(filter=filter, page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + filter: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[UserInstance]: + """ + Lists UserInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str filter: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + filter=filter, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + filter: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[UserInstance]: + """ + Asynchronously lists UserInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str filter: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + filter=filter, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + filter: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> UserPage: + """ + Retrieve a single page of UserInstance records from the API. + Request is executed immediately + + :param filter: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of UserInstance + """ + data = values.of( + { + "filter": filter, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/scim+json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return UserPage(self._version, response, self._solution) + + async def page_async( + self, + filter: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> UserPage: + """ + Asynchronously retrieve a single page of UserInstance records from the API. + Request is executed immediately + + :param filter: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of UserInstance + """ + data = values.of( + { + "filter": filter, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/scim+json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return UserPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> UserPage: + """ + Retrieve a specific page of UserInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of UserInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return UserPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> UserPage: + """ + Asynchronously retrieve a specific page of UserInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of UserInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return UserPage(self._version, response, self._solution) + + def get(self, organization_sid: str, user_sid: str) -> UserContext: + """ + Constructs a UserContext + + :param organization_sid: + :param user_sid: + """ + return UserContext( + self._version, organization_sid=organization_sid, user_sid=user_sid + ) + + def __call__(self, organization_sid: str, user_sid: str) -> UserContext: + """ + Constructs a UserContext + + :param organization_sid: + :param user_sid: + """ + return UserContext( + self._version, organization_sid=organization_sid, user_sid=user_sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/preview_iam/v1/authorize.py b/twilio/rest/preview_iam/v1/authorize.py index 051f13a8e6..4166b4aea2 100644 --- a/twilio/rest/preview_iam/v1/authorize.py +++ b/twilio/rest/preview_iam/v1/authorize.py @@ -69,6 +69,8 @@ def fetch( """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + params = values.of( { "response_type": response_type, @@ -101,6 +103,8 @@ async def fetch_async( """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + params = values.of( { "response_type": response_type, diff --git a/twilio/rest/preview_iam/v1/token.py b/twilio/rest/preview_iam/v1/token.py index 81eed237f7..34d9f30080 100644 --- a/twilio/rest/preview_iam/v1/token.py +++ b/twilio/rest/preview_iam/v1/token.py @@ -101,6 +101,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -147,6 +151,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/pricing/v1/messaging/country.py b/twilio/rest/pricing/v1/messaging/country.py index 47f5707ce8..49360cd85c 100644 --- a/twilio/rest/pricing/v1/messaging/country.py +++ b/twilio/rest/pricing/v1/messaging/country.py @@ -121,10 +121,11 @@ def fetch(self) -> CountryInstance: :returns: The fetched CountryInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CountryInstance( self._version, @@ -140,9 +141,12 @@ async def fetch_async(self) -> CountryInstance: :returns: The fetched CountryInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CountryInstance( @@ -320,7 +324,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CountryPage(self._version, response) async def page_async( @@ -347,8 +357,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CountryPage(self._version, response) diff --git a/twilio/rest/pricing/v1/phone_number/country.py b/twilio/rest/pricing/v1/phone_number/country.py index b0822fff23..2d11cd1c3e 100644 --- a/twilio/rest/pricing/v1/phone_number/country.py +++ b/twilio/rest/pricing/v1/phone_number/country.py @@ -119,10 +119,11 @@ def fetch(self) -> CountryInstance: :returns: The fetched CountryInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CountryInstance( self._version, @@ -138,9 +139,12 @@ async def fetch_async(self) -> CountryInstance: :returns: The fetched CountryInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CountryInstance( @@ -318,7 +322,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CountryPage(self._version, response) async def page_async( @@ -345,8 +355,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CountryPage(self._version, response) diff --git a/twilio/rest/pricing/v1/voice/country.py b/twilio/rest/pricing/v1/voice/country.py index e3b1496de4..7fb0da883a 100644 --- a/twilio/rest/pricing/v1/voice/country.py +++ b/twilio/rest/pricing/v1/voice/country.py @@ -123,10 +123,11 @@ def fetch(self) -> CountryInstance: :returns: The fetched CountryInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CountryInstance( self._version, @@ -142,9 +143,12 @@ async def fetch_async(self) -> CountryInstance: :returns: The fetched CountryInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CountryInstance( @@ -322,7 +326,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CountryPage(self._version, response) async def page_async( @@ -349,8 +359,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CountryPage(self._version, response) diff --git a/twilio/rest/pricing/v1/voice/number.py b/twilio/rest/pricing/v1/voice/number.py index 910919707e..5bff8cd5d6 100644 --- a/twilio/rest/pricing/v1/voice/number.py +++ b/twilio/rest/pricing/v1/voice/number.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -116,10 +117,11 @@ def fetch(self) -> NumberInstance: :returns: The fetched NumberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return NumberInstance( self._version, @@ -135,9 +137,12 @@ async def fetch_async(self) -> NumberInstance: :returns: The fetched NumberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return NumberInstance( diff --git a/twilio/rest/pricing/v2/country.py b/twilio/rest/pricing/v2/country.py index a058c071b5..30672235a8 100644 --- a/twilio/rest/pricing/v2/country.py +++ b/twilio/rest/pricing/v2/country.py @@ -123,10 +123,11 @@ def fetch(self) -> CountryInstance: :returns: The fetched CountryInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CountryInstance( self._version, @@ -142,9 +143,12 @@ async def fetch_async(self) -> CountryInstance: :returns: The fetched CountryInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CountryInstance( @@ -322,7 +326,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CountryPage(self._version, response) async def page_async( @@ -349,8 +359,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CountryPage(self._version, response) diff --git a/twilio/rest/pricing/v2/number.py b/twilio/rest/pricing/v2/number.py index 6c4cd9fe9d..1dead39347 100644 --- a/twilio/rest/pricing/v2/number.py +++ b/twilio/rest/pricing/v2/number.py @@ -145,7 +145,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return NumberInstance( self._version, @@ -170,8 +176,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return NumberInstance( diff --git a/twilio/rest/pricing/v2/voice/country.py b/twilio/rest/pricing/v2/voice/country.py index 4a84bbd734..997f368462 100644 --- a/twilio/rest/pricing/v2/voice/country.py +++ b/twilio/rest/pricing/v2/voice/country.py @@ -123,10 +123,11 @@ def fetch(self) -> CountryInstance: :returns: The fetched CountryInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CountryInstance( self._version, @@ -142,9 +143,12 @@ async def fetch_async(self) -> CountryInstance: :returns: The fetched CountryInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CountryInstance( @@ -322,7 +326,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CountryPage(self._version, response) async def page_async( @@ -349,8 +359,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CountryPage(self._version, response) diff --git a/twilio/rest/pricing/v2/voice/number.py b/twilio/rest/pricing/v2/voice/number.py index 6dd8764821..97a3a526ff 100644 --- a/twilio/rest/pricing/v2/voice/number.py +++ b/twilio/rest/pricing/v2/voice/number.py @@ -143,7 +143,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return NumberInstance( self._version, @@ -168,8 +174,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return NumberInstance( diff --git a/twilio/rest/proxy/v1/service/__init__.py b/twilio/rest/proxy/v1/service/__init__.py index 7337294a6c..ff1e7ed7d7 100644 --- a/twilio/rest/proxy/v1/service/__init__.py +++ b/twilio/rest/proxy/v1/service/__init__.py @@ -279,10 +279,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -291,9 +291,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -304,10 +306,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -323,9 +326,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -361,6 +367,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -373,11 +380,14 @@ def update( "ChatInstanceSid": chat_instance_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -409,6 +419,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "UniqueName": unique_name, @@ -421,11 +432,14 @@ async def update_async( "ChatInstanceSid": chat_instance_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -550,6 +564,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -598,6 +616,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -731,7 +753,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -758,8 +786,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/proxy/v1/service/phone_number.py b/twilio/rest/proxy/v1/service/phone_number.py index 05b9033602..3c8517cedd 100644 --- a/twilio/rest/proxy/v1/service/phone_number.py +++ b/twilio/rest/proxy/v1/service/phone_number.py @@ -188,10 +188,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -200,9 +200,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> PhoneNumberInstance: @@ -213,10 +215,11 @@ def fetch(self) -> PhoneNumberInstance: :returns: The fetched PhoneNumberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PhoneNumberInstance( self._version, @@ -233,9 +236,12 @@ async def fetch_async(self) -> PhoneNumberInstance: :returns: The fetched PhoneNumberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PhoneNumberInstance( @@ -255,16 +261,20 @@ def update( :returns: The updated PhoneNumberInstance """ + data = values.of( { "IsReserved": serialize.boolean_to_string(is_reserved), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( @@ -284,16 +294,20 @@ async def update_async( :returns: The updated PhoneNumberInstance """ + data = values.of( { "IsReserved": serialize.boolean_to_string(is_reserved), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( @@ -377,6 +391,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -410,6 +428,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -545,7 +567,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PhoneNumberPage(self._version, response, self._solution) async def page_async( @@ -572,8 +600,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PhoneNumberPage(self._version, response, self._solution) diff --git a/twilio/rest/proxy/v1/service/session/__init__.py b/twilio/rest/proxy/v1/service/session/__init__.py index cfd547b1e7..839db075c3 100644 --- a/twilio/rest/proxy/v1/service/session/__init__.py +++ b/twilio/rest/proxy/v1/service/session/__init__.py @@ -248,10 +248,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -260,9 +260,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SessionInstance: @@ -273,10 +275,11 @@ def fetch(self) -> SessionInstance: :returns: The fetched SessionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SessionInstance( self._version, @@ -293,9 +296,12 @@ async def fetch_async(self) -> SessionInstance: :returns: The fetched SessionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SessionInstance( @@ -320,6 +326,7 @@ def update( :returns: The updated SessionInstance """ + data = values.of( { "DateExpiry": serialize.iso8601_datetime(date_expiry), @@ -327,11 +334,14 @@ def update( "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SessionInstance( @@ -356,6 +366,7 @@ async def update_async( :returns: The updated SessionInstance """ + data = values.of( { "DateExpiry": serialize.iso8601_datetime(date_expiry), @@ -363,11 +374,14 @@ async def update_async( "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SessionInstance( @@ -488,6 +502,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -532,6 +550,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -667,7 +689,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SessionPage(self._version, response, self._solution) async def page_async( @@ -694,8 +722,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SessionPage(self._version, response, self._solution) diff --git a/twilio/rest/proxy/v1/service/session/interaction.py b/twilio/rest/proxy/v1/service/session/interaction.py index 6e4cac7c14..7eeccda5bc 100644 --- a/twilio/rest/proxy/v1/service/session/interaction.py +++ b/twilio/rest/proxy/v1/service/session/interaction.py @@ -220,10 +220,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -232,9 +232,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> InteractionInstance: @@ -245,10 +247,11 @@ def fetch(self) -> InteractionInstance: :returns: The fetched InteractionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return InteractionInstance( self._version, @@ -266,9 +269,12 @@ async def fetch_async(self) -> InteractionInstance: :returns: The fetched InteractionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return InteractionInstance( @@ -464,7 +470,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return InteractionPage(self._version, response, self._solution) async def page_async( @@ -491,8 +503,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return InteractionPage(self._version, response, self._solution) diff --git a/twilio/rest/proxy/v1/service/session/participant/__init__.py b/twilio/rest/proxy/v1/service/session/participant/__init__.py index e2eb3eaae8..7ad20fcffb 100644 --- a/twilio/rest/proxy/v1/service/session/participant/__init__.py +++ b/twilio/rest/proxy/v1/service/session/participant/__init__.py @@ -183,10 +183,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -195,9 +195,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ParticipantInstance: @@ -208,10 +210,11 @@ def fetch(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ParticipantInstance( self._version, @@ -229,9 +232,12 @@ async def fetch_async(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ParticipantInstance( @@ -342,6 +348,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -381,6 +391,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -519,7 +533,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ParticipantPage(self._version, response, self._solution) async def page_async( @@ -546,8 +566,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ParticipantPage(self._version, response, self._solution) diff --git a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py index 55ff64074e..4ffe67965b 100644 --- a/twilio/rest/proxy/v1/service/session/participant/message_interaction.py +++ b/twilio/rest/proxy/v1/service/session/participant/message_interaction.py @@ -215,10 +215,11 @@ def fetch(self) -> MessageInteractionInstance: :returns: The fetched MessageInteractionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MessageInteractionInstance( self._version, @@ -237,9 +238,12 @@ async def fetch_async(self) -> MessageInteractionInstance: :returns: The fetched MessageInteractionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MessageInteractionInstance( @@ -334,6 +338,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -368,6 +376,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -507,7 +519,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MessageInteractionPage(self._version, response, self._solution) async def page_async( @@ -534,8 +552,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MessageInteractionPage(self._version, response, self._solution) diff --git a/twilio/rest/proxy/v1/service/short_code.py b/twilio/rest/proxy/v1/service/short_code.py index e26514bff2..df71d4bdd5 100644 --- a/twilio/rest/proxy/v1/service/short_code.py +++ b/twilio/rest/proxy/v1/service/short_code.py @@ -182,10 +182,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -194,9 +194,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ShortCodeInstance: @@ -207,10 +209,11 @@ def fetch(self) -> ShortCodeInstance: :returns: The fetched ShortCodeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ShortCodeInstance( self._version, @@ -227,9 +230,12 @@ async def fetch_async(self) -> ShortCodeInstance: :returns: The fetched ShortCodeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ShortCodeInstance( @@ -249,16 +255,20 @@ def update( :returns: The updated ShortCodeInstance """ + data = values.of( { "IsReserved": serialize.boolean_to_string(is_reserved), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( @@ -278,16 +288,20 @@ async def update_async( :returns: The updated ShortCodeInstance """ + data = values.of( { "IsReserved": serialize.boolean_to_string(is_reserved), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ShortCodeInstance( @@ -362,6 +376,10 @@ def create(self, sid: str) -> ShortCodeInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -386,6 +404,10 @@ async def create_async(self, sid: str) -> ShortCodeInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -521,7 +543,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ShortCodePage(self._version, response, self._solution) async def page_async( @@ -548,8 +576,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ShortCodePage(self._version, response, self._solution) diff --git a/twilio/rest/routes/v2/phone_number.py b/twilio/rest/routes/v2/phone_number.py index 4f452e3616..1b67509bb0 100644 --- a/twilio/rest/routes/v2/phone_number.py +++ b/twilio/rest/routes/v2/phone_number.py @@ -163,10 +163,11 @@ def fetch(self) -> PhoneNumberInstance: :returns: The fetched PhoneNumberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PhoneNumberInstance( self._version, @@ -182,9 +183,12 @@ async def fetch_async(self) -> PhoneNumberInstance: :returns: The fetched PhoneNumberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PhoneNumberInstance( @@ -206,17 +210,21 @@ def update( :returns: The updated PhoneNumberInstance """ + data = values.of( { "VoiceRegion": voice_region, "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( @@ -236,17 +244,21 @@ async def update_async( :returns: The updated PhoneNumberInstance """ + data = values.of( { "VoiceRegion": voice_region, "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return PhoneNumberInstance( diff --git a/twilio/rest/routes/v2/sip_domain.py b/twilio/rest/routes/v2/sip_domain.py index cad3a4922c..2326a5dbc1 100644 --- a/twilio/rest/routes/v2/sip_domain.py +++ b/twilio/rest/routes/v2/sip_domain.py @@ -163,10 +163,11 @@ def fetch(self) -> SipDomainInstance: :returns: The fetched SipDomainInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SipDomainInstance( self._version, @@ -182,9 +183,12 @@ async def fetch_async(self) -> SipDomainInstance: :returns: The fetched SipDomainInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SipDomainInstance( @@ -206,17 +210,21 @@ def update( :returns: The updated SipDomainInstance """ + data = values.of( { "VoiceRegion": voice_region, "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SipDomainInstance( @@ -236,17 +244,21 @@ async def update_async( :returns: The updated SipDomainInstance """ + data = values.of( { "VoiceRegion": voice_region, "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SipDomainInstance( diff --git a/twilio/rest/routes/v2/trunk.py b/twilio/rest/routes/v2/trunk.py index 2baf2788ae..f783ce92ca 100644 --- a/twilio/rest/routes/v2/trunk.py +++ b/twilio/rest/routes/v2/trunk.py @@ -163,10 +163,11 @@ def fetch(self) -> TrunkInstance: :returns: The fetched TrunkInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TrunkInstance( self._version, @@ -182,9 +183,12 @@ async def fetch_async(self) -> TrunkInstance: :returns: The fetched TrunkInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TrunkInstance( @@ -206,17 +210,21 @@ def update( :returns: The updated TrunkInstance """ + data = values.of( { "VoiceRegion": voice_region, "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrunkInstance( @@ -236,17 +244,21 @@ async def update_async( :returns: The updated TrunkInstance """ + data = values.of( { "VoiceRegion": voice_region, "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrunkInstance( diff --git a/twilio/rest/serverless/v1/service/__init__.py b/twilio/rest/serverless/v1/service/__init__.py index 1658e671f4..f6e4e5841e 100644 --- a/twilio/rest/serverless/v1/service/__init__.py +++ b/twilio/rest/serverless/v1/service/__init__.py @@ -227,10 +227,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -239,9 +239,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -252,10 +254,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -271,9 +274,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -297,6 +303,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "IncludeCredentials": serialize.boolean_to_string(include_credentials), @@ -304,11 +311,14 @@ def update( "UiEditable": serialize.boolean_to_string(ui_editable), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -328,6 +338,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "IncludeCredentials": serialize.boolean_to_string(include_credentials), @@ -335,11 +346,14 @@ async def update_async( "UiEditable": serialize.boolean_to_string(ui_editable), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -462,6 +476,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -496,6 +514,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -629,7 +651,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -656,8 +684,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/serverless/v1/service/asset/__init__.py b/twilio/rest/serverless/v1/service/asset/__init__.py index 4e413db1da..de68b969be 100644 --- a/twilio/rest/serverless/v1/service/asset/__init__.py +++ b/twilio/rest/serverless/v1/service/asset/__init__.py @@ -184,10 +184,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -196,9 +196,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> AssetInstance: @@ -209,10 +211,11 @@ def fetch(self) -> AssetInstance: :returns: The fetched AssetInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AssetInstance( self._version, @@ -229,9 +232,12 @@ async def fetch_async(self) -> AssetInstance: :returns: The fetched AssetInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AssetInstance( @@ -249,16 +255,20 @@ def update(self, friendly_name: str) -> AssetInstance: :returns: The updated AssetInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AssetInstance( @@ -276,16 +286,20 @@ async def update_async(self, friendly_name: str) -> AssetInstance: :returns: The updated AssetInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AssetInstance( @@ -373,6 +387,10 @@ def create(self, friendly_name: str) -> AssetInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -397,6 +415,10 @@ async def create_async(self, friendly_name: str) -> AssetInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -532,7 +554,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AssetPage(self._version, response, self._solution) async def page_async( @@ -559,8 +587,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AssetPage(self._version, response, self._solution) diff --git a/twilio/rest/serverless/v1/service/asset/asset_version.py b/twilio/rest/serverless/v1/service/asset/asset_version.py index fbe7b30800..31f85d4c29 100644 --- a/twilio/rest/serverless/v1/service/asset/asset_version.py +++ b/twilio/rest/serverless/v1/service/asset/asset_version.py @@ -146,10 +146,11 @@ def fetch(self) -> AssetVersionInstance: :returns: The fetched AssetVersionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AssetVersionInstance( self._version, @@ -167,9 +168,12 @@ async def fetch_async(self) -> AssetVersionInstance: :returns: The fetched AssetVersionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AssetVersionInstance( @@ -363,7 +367,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return AssetVersionPage(self._version, response, self._solution) async def page_async( @@ -390,8 +400,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return AssetVersionPage(self._version, response, self._solution) diff --git a/twilio/rest/serverless/v1/service/build/__init__.py b/twilio/rest/serverless/v1/service/build/__init__.py index 90e5ccec41..ddd59918b4 100644 --- a/twilio/rest/serverless/v1/service/build/__init__.py +++ b/twilio/rest/serverless/v1/service/build/__init__.py @@ -26,6 +26,7 @@ class BuildInstance(InstanceResource): + class Runtime(object): NODE8 = "node8" NODE10 = "node10" @@ -173,7 +174,13 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete(method='DELETE', uri=self._uri,) + + + headers = values.of({}) + + + + return self._version.delete(method='DELETE', uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -182,7 +189,12 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return await self._version.delete_async(method='DELETE', uri=self._uri,) + + headers = values.of({}) + + + + return await self._version.delete_async(method='DELETE', uri=self._uri, headers=headers) def fetch(self) -> BuildInstance: @@ -193,7 +205,13 @@ def fetch(self) -> BuildInstance: :returns: The fetched BuildInstance """ - payload = self._version.fetch(method='GET', uri=self._uri, ) + + headers = values.of({}) + + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method='GET', uri=self._uri , headers=headers) return BuildInstance( self._version, @@ -211,7 +229,13 @@ async def fetch_async(self) -> BuildInstance: :returns: The fetched BuildInstance """ - payload = await self._version.fetch_async(method='GET', uri=self._uri, ) + + headers = values.of({}) + + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async(method='GET', uri=self._uri , headers=headers) return BuildInstance( self._version, @@ -317,6 +341,11 @@ def create(self, asset_versions: Union[List[str], object]=values.unset, function 'Content-Type': 'application/x-www-form-urlencoded' }) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + + headers["Accept"] = "application/json" + payload = self._version.create(method='POST', uri=self._uri, data=data, headers=headers) @@ -344,6 +373,11 @@ async def create_async(self, asset_versions: Union[List[str], object]=values.uns 'Content-Type': 'application/x-www-form-urlencoded' }) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + + headers["Accept"] = "application/json" + payload = await self._version.create_async(method='POST', uri=self._uri, data=data, headers=headers) @@ -474,7 +508,15 @@ def page(self, 'PageSize': page_size, }) - response = self._version.page(method='GET', uri=self._uri, params=data) + headers = values.of({ + 'Content-Type': 'application/x-www-form-urlencoded' + }) + + + headers["Accept"] = "application/json" + + + response = self._version.page(method='GET', uri=self._uri, params=data, headers=headers) return BuildPage(self._version, response, self._solution) async def page_async(self, @@ -499,7 +541,15 @@ async def page_async(self, 'PageSize': page_size, }) - response = await self._version.page_async(method='GET', uri=self._uri, params=data) + headers = values.of({ + 'Content-Type': 'application/x-www-form-urlencoded' + }) + + + headers["Accept"] = "application/json" + + + response = await self._version.page_async(method='GET', uri=self._uri, params=data, headers=headers) return BuildPage(self._version, response, self._solution) def get_page(self, target_url: str) -> BuildPage: diff --git a/twilio/rest/serverless/v1/service/build/build_status.py b/twilio/rest/serverless/v1/service/build/build_status.py index 2613ae3cb6..e67c00e00e 100644 --- a/twilio/rest/serverless/v1/service/build/build_status.py +++ b/twilio/rest/serverless/v1/service/build/build_status.py @@ -14,6 +14,7 @@ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -23,6 +24,7 @@ class BuildStatusInstance(InstanceResource): + class Status(object): BUILDING = "building" COMPLETED = "completed" @@ -123,7 +125,13 @@ def fetch(self) -> BuildStatusInstance: :returns: The fetched BuildStatusInstance """ - payload = self._version.fetch(method='GET', uri=self._uri, ) + + headers = values.of({}) + + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method='GET', uri=self._uri , headers=headers) return BuildStatusInstance( self._version, @@ -141,7 +149,13 @@ async def fetch_async(self) -> BuildStatusInstance: :returns: The fetched BuildStatusInstance """ - payload = await self._version.fetch_async(method='GET', uri=self._uri, ) + + headers = values.of({}) + + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async(method='GET', uri=self._uri , headers=headers) return BuildStatusInstance( self._version, diff --git a/twilio/rest/serverless/v1/service/environment/__init__.py b/twilio/rest/serverless/v1/service/environment/__init__.py index e9df6ecb2a..cdad0504a7 100644 --- a/twilio/rest/serverless/v1/service/environment/__init__.py +++ b/twilio/rest/serverless/v1/service/environment/__init__.py @@ -186,10 +186,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -198,9 +198,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> EnvironmentInstance: @@ -211,10 +213,11 @@ def fetch(self) -> EnvironmentInstance: :returns: The fetched EnvironmentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EnvironmentInstance( self._version, @@ -231,9 +234,12 @@ async def fetch_async(self) -> EnvironmentInstance: :returns: The fetched EnvironmentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EnvironmentInstance( @@ -351,6 +357,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -379,6 +389,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -514,7 +528,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EnvironmentPage(self._version, response, self._solution) async def page_async( @@ -541,8 +561,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EnvironmentPage(self._version, response, self._solution) diff --git a/twilio/rest/serverless/v1/service/environment/deployment.py b/twilio/rest/serverless/v1/service/environment/deployment.py index e9d86d0c37..d28a4b8db1 100644 --- a/twilio/rest/serverless/v1/service/environment/deployment.py +++ b/twilio/rest/serverless/v1/service/environment/deployment.py @@ -142,10 +142,11 @@ def fetch(self) -> DeploymentInstance: :returns: The fetched DeploymentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DeploymentInstance( self._version, @@ -163,9 +164,12 @@ async def fetch_async(self) -> DeploymentInstance: :returns: The fetched DeploymentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DeploymentInstance( @@ -256,6 +260,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -289,6 +297,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -427,7 +439,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DeploymentPage(self._version, response, self._solution) async def page_async( @@ -454,8 +472,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DeploymentPage(self._version, response, self._solution) diff --git a/twilio/rest/serverless/v1/service/environment/log.py b/twilio/rest/serverless/v1/service/environment/log.py index e1aff5214f..a3c9a6c2da 100644 --- a/twilio/rest/serverless/v1/service/environment/log.py +++ b/twilio/rest/serverless/v1/service/environment/log.py @@ -156,10 +156,11 @@ def fetch(self) -> LogInstance: :returns: The fetched LogInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return LogInstance( self._version, @@ -177,9 +178,12 @@ async def fetch_async(self) -> LogInstance: :returns: The fetched LogInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return LogInstance( @@ -424,7 +428,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return LogPage(self._version, response, self._solution) async def page_async( @@ -460,8 +470,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return LogPage(self._version, response, self._solution) diff --git a/twilio/rest/serverless/v1/service/environment/variable.py b/twilio/rest/serverless/v1/service/environment/variable.py index 99027536f3..fbc6b48ac8 100644 --- a/twilio/rest/serverless/v1/service/environment/variable.py +++ b/twilio/rest/serverless/v1/service/environment/variable.py @@ -197,10 +197,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -209,9 +209,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> VariableInstance: @@ -222,10 +224,11 @@ def fetch(self) -> VariableInstance: :returns: The fetched VariableInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return VariableInstance( self._version, @@ -243,9 +246,12 @@ async def fetch_async(self) -> VariableInstance: :returns: The fetched VariableInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return VariableInstance( @@ -269,17 +275,21 @@ def update( :returns: The updated VariableInstance """ + data = values.of( { "Key": key, "Value": value, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VariableInstance( @@ -303,17 +313,21 @@ async def update_async( :returns: The updated VariableInstance """ + data = values.of( { "Key": key, "Value": value, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VariableInstance( @@ -400,6 +414,10 @@ def create(self, key: str, value: str) -> VariableInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -429,6 +447,10 @@ async def create_async(self, key: str, value: str) -> VariableInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -567,7 +589,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return VariablePage(self._version, response, self._solution) async def page_async( @@ -594,8 +622,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return VariablePage(self._version, response, self._solution) diff --git a/twilio/rest/serverless/v1/service/function/__init__.py b/twilio/rest/serverless/v1/service/function/__init__.py index 25a3ef935f..7697587e60 100644 --- a/twilio/rest/serverless/v1/service/function/__init__.py +++ b/twilio/rest/serverless/v1/service/function/__init__.py @@ -186,10 +186,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -198,9 +198,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> FunctionInstance: @@ -211,10 +213,11 @@ def fetch(self) -> FunctionInstance: :returns: The fetched FunctionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FunctionInstance( self._version, @@ -231,9 +234,12 @@ async def fetch_async(self) -> FunctionInstance: :returns: The fetched FunctionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FunctionInstance( @@ -251,16 +257,20 @@ def update(self, friendly_name: str) -> FunctionInstance: :returns: The updated FunctionInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FunctionInstance( @@ -278,16 +288,20 @@ async def update_async(self, friendly_name: str) -> FunctionInstance: :returns: The updated FunctionInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FunctionInstance( @@ -375,6 +389,10 @@ def create(self, friendly_name: str) -> FunctionInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -399,6 +417,10 @@ async def create_async(self, friendly_name: str) -> FunctionInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -534,7 +556,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return FunctionPage(self._version, response, self._solution) async def page_async( @@ -561,8 +589,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return FunctionPage(self._version, response, self._solution) diff --git a/twilio/rest/serverless/v1/service/function/function_version/__init__.py b/twilio/rest/serverless/v1/service/function/function_version/__init__.py index e915894f11..88b666208c 100644 --- a/twilio/rest/serverless/v1/service/function/function_version/__init__.py +++ b/twilio/rest/serverless/v1/service/function/function_version/__init__.py @@ -162,10 +162,11 @@ def fetch(self) -> FunctionVersionInstance: :returns: The fetched FunctionVersionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FunctionVersionInstance( self._version, @@ -183,9 +184,12 @@ async def fetch_async(self) -> FunctionVersionInstance: :returns: The fetched FunctionVersionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FunctionVersionInstance( @@ -393,7 +397,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return FunctionVersionPage(self._version, response, self._solution) async def page_async( @@ -420,8 +430,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return FunctionVersionPage(self._version, response, self._solution) diff --git a/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py b/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py index c58fa574e7..f16833da2a 100644 --- a/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py +++ b/twilio/rest/serverless/v1/service/function/function_version/function_version_content.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -131,10 +132,11 @@ def fetch(self) -> FunctionVersionContentInstance: :returns: The fetched FunctionVersionContentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FunctionVersionContentInstance( self._version, @@ -152,9 +154,12 @@ async def fetch_async(self) -> FunctionVersionContentInstance: :returns: The fetched FunctionVersionContentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FunctionVersionContentInstance( diff --git a/twilio/rest/studio/v1/flow/__init__.py b/twilio/rest/studio/v1/flow/__init__.py index bb0f78658b..533c1a45f5 100644 --- a/twilio/rest/studio/v1/flow/__init__.py +++ b/twilio/rest/studio/v1/flow/__init__.py @@ -168,10 +168,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -180,9 +180,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> FlowInstance: @@ -193,10 +195,11 @@ def fetch(self) -> FlowInstance: :returns: The fetched FlowInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FlowInstance( self._version, @@ -212,9 +215,12 @@ async def fetch_async(self) -> FlowInstance: :returns: The fetched FlowInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FlowInstance( @@ -416,7 +422,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return FlowPage(self._version, response) async def page_async( @@ -443,8 +455,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return FlowPage(self._version, response) diff --git a/twilio/rest/studio/v1/flow/engagement/__init__.py b/twilio/rest/studio/v1/flow/engagement/__init__.py index db0c846e5c..759d92506c 100644 --- a/twilio/rest/studio/v1/flow/engagement/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/__init__.py @@ -184,10 +184,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -196,9 +196,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> EngagementInstance: @@ -209,10 +211,11 @@ def fetch(self) -> EngagementInstance: :returns: The fetched EngagementInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EngagementInstance( self._version, @@ -229,9 +232,12 @@ async def fetch_async(self) -> EngagementInstance: :returns: The fetched EngagementInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EngagementInstance( @@ -338,6 +344,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -368,6 +378,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -503,7 +517,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EngagementPage(self._version, response, self._solution) async def page_async( @@ -530,8 +550,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EngagementPage(self._version, response, self._solution) diff --git a/twilio/rest/studio/v1/flow/engagement/engagement_context.py b/twilio/rest/studio/v1/flow/engagement/engagement_context.py index f534db6922..73161011eb 100644 --- a/twilio/rest/studio/v1/flow/engagement/engagement_context.py +++ b/twilio/rest/studio/v1/flow/engagement/engagement_context.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -122,10 +123,11 @@ def fetch(self) -> EngagementContextInstance: :returns: The fetched EngagementContextInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EngagementContextInstance( self._version, @@ -142,9 +144,12 @@ async def fetch_async(self) -> EngagementContextInstance: :returns: The fetched EngagementContextInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EngagementContextInstance( diff --git a/twilio/rest/studio/v1/flow/engagement/step/__init__.py b/twilio/rest/studio/v1/flow/engagement/step/__init__.py index 1a2d8570c9..d88d0ad0f6 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/step/__init__.py @@ -158,10 +158,11 @@ def fetch(self) -> StepInstance: :returns: The fetched StepInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return StepInstance( self._version, @@ -179,9 +180,12 @@ async def fetch_async(self) -> StepInstance: :returns: The fetched StepInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return StepInstance( @@ -389,7 +393,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return StepPage(self._version, response, self._solution) async def page_async( @@ -416,8 +426,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return StepPage(self._version, response, self._solution) diff --git a/twilio/rest/studio/v1/flow/engagement/step/step_context.py b/twilio/rest/studio/v1/flow/engagement/step/step_context.py index 69c4c22465..6b299ebe5d 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/step_context.py +++ b/twilio/rest/studio/v1/flow/engagement/step/step_context.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -131,10 +132,11 @@ def fetch(self) -> StepContextInstance: :returns: The fetched StepContextInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return StepContextInstance( self._version, @@ -152,9 +154,12 @@ async def fetch_async(self) -> StepContextInstance: :returns: The fetched StepContextInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return StepContextInstance( diff --git a/twilio/rest/studio/v1/flow/execution/__init__.py b/twilio/rest/studio/v1/flow/execution/__init__.py index 6a32cb3020..624b381768 100644 --- a/twilio/rest/studio/v1/flow/execution/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/__init__.py @@ -208,10 +208,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -220,9 +220,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ExecutionInstance: @@ -233,10 +235,11 @@ def fetch(self) -> ExecutionInstance: :returns: The fetched ExecutionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ExecutionInstance( self._version, @@ -253,9 +256,12 @@ async def fetch_async(self) -> ExecutionInstance: :returns: The fetched ExecutionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ExecutionInstance( @@ -273,16 +279,20 @@ def update(self, status: "ExecutionInstance.Status") -> ExecutionInstance: :returns: The updated ExecutionInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( @@ -302,16 +312,20 @@ async def update_async( :returns: The updated ExecutionInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( @@ -418,6 +432,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -448,6 +466,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -617,7 +639,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ExecutionPage(self._version, response, self._solution) async def page_async( @@ -650,8 +678,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ExecutionPage(self._version, response, self._solution) diff --git a/twilio/rest/studio/v1/flow/execution/execution_context.py b/twilio/rest/studio/v1/flow/execution/execution_context.py index a2765bbc9b..0841a9ef24 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_context.py +++ b/twilio/rest/studio/v1/flow/execution/execution_context.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -122,10 +123,11 @@ def fetch(self) -> ExecutionContextInstance: :returns: The fetched ExecutionContextInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ExecutionContextInstance( self._version, @@ -142,9 +144,12 @@ async def fetch_async(self) -> ExecutionContextInstance: :returns: The fetched ExecutionContextInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ExecutionContextInstance( diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py index 6e19ca4453..888506e965 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py @@ -160,10 +160,11 @@ def fetch(self) -> ExecutionStepInstance: :returns: The fetched ExecutionStepInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ExecutionStepInstance( self._version, @@ -181,9 +182,12 @@ async def fetch_async(self) -> ExecutionStepInstance: :returns: The fetched ExecutionStepInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ExecutionStepInstance( @@ -391,7 +395,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ExecutionStepPage(self._version, response, self._solution) async def page_async( @@ -418,8 +428,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ExecutionStepPage(self._version, response, self._solution) diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py b/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py index 224f92d0f5..78249a9562 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/execution_step_context.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -131,10 +132,11 @@ def fetch(self) -> ExecutionStepContextInstance: :returns: The fetched ExecutionStepContextInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ExecutionStepContextInstance( self._version, @@ -152,9 +154,12 @@ async def fetch_async(self) -> ExecutionStepContextInstance: :returns: The fetched ExecutionStepContextInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ExecutionStepContextInstance( diff --git a/twilio/rest/studio/v2/flow/__init__.py b/twilio/rest/studio/v2/flow/__init__.py index 057c949696..b4c542fdc0 100644 --- a/twilio/rest/studio/v2/flow/__init__.py +++ b/twilio/rest/studio/v2/flow/__init__.py @@ -237,10 +237,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -249,9 +249,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> FlowInstance: @@ -262,10 +264,11 @@ def fetch(self) -> FlowInstance: :returns: The fetched FlowInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FlowInstance( self._version, @@ -281,9 +284,12 @@ async def fetch_async(self) -> FlowInstance: :returns: The fetched FlowInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FlowInstance( @@ -309,6 +315,7 @@ def update( :returns: The updated FlowInstance """ + data = values.of( { "Status": status, @@ -317,11 +324,14 @@ def update( "CommitMessage": commit_message, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowInstance(self._version, payload, sid=self._solution["sid"]) @@ -343,6 +353,7 @@ async def update_async( :returns: The updated FlowInstance """ + data = values.of( { "Status": status, @@ -351,11 +362,14 @@ async def update_async( "CommitMessage": commit_message, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowInstance(self._version, payload, sid=self._solution["sid"]) @@ -466,6 +480,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -500,6 +518,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -633,7 +655,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return FlowPage(self._version, response) async def page_async( @@ -660,8 +688,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return FlowPage(self._version, response) diff --git a/twilio/rest/studio/v2/flow/execution/__init__.py b/twilio/rest/studio/v2/flow/execution/__init__.py index 18dcbf0629..c47a3fbbc0 100644 --- a/twilio/rest/studio/v2/flow/execution/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/__init__.py @@ -206,10 +206,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -218,9 +218,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ExecutionInstance: @@ -231,10 +233,11 @@ def fetch(self) -> ExecutionInstance: :returns: The fetched ExecutionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ExecutionInstance( self._version, @@ -251,9 +254,12 @@ async def fetch_async(self) -> ExecutionInstance: :returns: The fetched ExecutionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ExecutionInstance( @@ -271,16 +277,20 @@ def update(self, status: "ExecutionInstance.Status") -> ExecutionInstance: :returns: The updated ExecutionInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( @@ -300,16 +310,20 @@ async def update_async( :returns: The updated ExecutionInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ExecutionInstance( @@ -416,6 +430,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -446,6 +464,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -615,7 +637,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ExecutionPage(self._version, response, self._solution) async def page_async( @@ -648,8 +676,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ExecutionPage(self._version, response, self._solution) diff --git a/twilio/rest/studio/v2/flow/execution/execution_context.py b/twilio/rest/studio/v2/flow/execution/execution_context.py index facb52eed7..4c18f81d11 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_context.py +++ b/twilio/rest/studio/v2/flow/execution/execution_context.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -122,10 +123,11 @@ def fetch(self) -> ExecutionContextInstance: :returns: The fetched ExecutionContextInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ExecutionContextInstance( self._version, @@ -142,9 +144,12 @@ async def fetch_async(self) -> ExecutionContextInstance: :returns: The fetched ExecutionContextInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ExecutionContextInstance( diff --git a/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py index 257e16b1df..b088aeab0e 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py @@ -160,10 +160,11 @@ def fetch(self) -> ExecutionStepInstance: :returns: The fetched ExecutionStepInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ExecutionStepInstance( self._version, @@ -181,9 +182,12 @@ async def fetch_async(self) -> ExecutionStepInstance: :returns: The fetched ExecutionStepInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ExecutionStepInstance( @@ -391,7 +395,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ExecutionStepPage(self._version, response, self._solution) async def page_async( @@ -418,8 +428,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ExecutionStepPage(self._version, response, self._solution) diff --git a/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py b/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py index 41661238b5..7f00e0d180 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py +++ b/twilio/rest/studio/v2/flow/execution/execution_step/execution_step_context.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -131,10 +132,11 @@ def fetch(self) -> ExecutionStepContextInstance: :returns: The fetched ExecutionStepContextInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ExecutionStepContextInstance( self._version, @@ -152,9 +154,12 @@ async def fetch_async(self) -> ExecutionStepContextInstance: :returns: The fetched ExecutionStepContextInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ExecutionStepContextInstance( diff --git a/twilio/rest/studio/v2/flow/flow_revision.py b/twilio/rest/studio/v2/flow/flow_revision.py index 0de91513ed..aa065074d1 100644 --- a/twilio/rest/studio/v2/flow/flow_revision.py +++ b/twilio/rest/studio/v2/flow/flow_revision.py @@ -146,10 +146,11 @@ def fetch(self) -> FlowRevisionInstance: :returns: The fetched FlowRevisionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FlowRevisionInstance( self._version, @@ -166,9 +167,12 @@ async def fetch_async(self) -> FlowRevisionInstance: :returns: The fetched FlowRevisionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FlowRevisionInstance( @@ -352,7 +356,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return FlowRevisionPage(self._version, response, self._solution) async def page_async( @@ -379,8 +389,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return FlowRevisionPage(self._version, response, self._solution) diff --git a/twilio/rest/studio/v2/flow/flow_test_user.py b/twilio/rest/studio/v2/flow/flow_test_user.py index 3465632353..cff41cd7e2 100644 --- a/twilio/rest/studio/v2/flow/flow_test_user.py +++ b/twilio/rest/studio/v2/flow/flow_test_user.py @@ -131,10 +131,11 @@ def fetch(self) -> FlowTestUserInstance: :returns: The fetched FlowTestUserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FlowTestUserInstance( self._version, @@ -150,9 +151,12 @@ async def fetch_async(self) -> FlowTestUserInstance: :returns: The fetched FlowTestUserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FlowTestUserInstance( @@ -169,16 +173,20 @@ def update(self, test_users: List[str]) -> FlowTestUserInstance: :returns: The updated FlowTestUserInstance """ + data = values.of( { "TestUsers": serialize.map(test_users, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowTestUserInstance(self._version, payload, sid=self._solution["sid"]) @@ -191,16 +199,20 @@ async def update_async(self, test_users: List[str]) -> FlowTestUserInstance: :returns: The updated FlowTestUserInstance """ + data = values.of( { "TestUsers": serialize.map(test_users, lambda e: e), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FlowTestUserInstance(self._version, payload, sid=self._solution["sid"]) diff --git a/twilio/rest/studio/v2/flow_validate.py b/twilio/rest/studio/v2/flow_validate.py index 34f37e152f..5f8b308547 100644 --- a/twilio/rest/studio/v2/flow_validate.py +++ b/twilio/rest/studio/v2/flow_validate.py @@ -86,6 +86,10 @@ def update( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers ) @@ -120,6 +124,10 @@ async def update_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/supersim/v1/esim_profile.py b/twilio/rest/supersim/v1/esim_profile.py index 7e176bba7f..d12bb9b73f 100644 --- a/twilio/rest/supersim/v1/esim_profile.py +++ b/twilio/rest/supersim/v1/esim_profile.py @@ -146,10 +146,11 @@ def fetch(self) -> EsimProfileInstance: :returns: The fetched EsimProfileInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EsimProfileInstance( self._version, @@ -165,9 +166,12 @@ async def fetch_async(self) -> EsimProfileInstance: :returns: The fetched EsimProfileInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EsimProfileInstance( @@ -246,6 +250,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -280,6 +288,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -456,7 +468,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EsimProfilePage(self._version, response) async def page_async( @@ -492,8 +510,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EsimProfilePage(self._version, response) diff --git a/twilio/rest/supersim/v1/fleet.py b/twilio/rest/supersim/v1/fleet.py index 2b9fbff44e..3ea067cff2 100644 --- a/twilio/rest/supersim/v1/fleet.py +++ b/twilio/rest/supersim/v1/fleet.py @@ -213,10 +213,11 @@ def fetch(self) -> FleetInstance: :returns: The fetched FleetInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FleetInstance( self._version, @@ -232,9 +233,12 @@ async def fetch_async(self) -> FleetInstance: :returns: The fetched FleetInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FleetInstance( @@ -266,6 +270,7 @@ def update( :returns: The updated FleetInstance """ + data = values.of( { "UniqueName": unique_name, @@ -277,11 +282,14 @@ def update( "DataLimit": data_limit, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FleetInstance(self._version, payload, sid=self._solution["sid"]) @@ -309,6 +317,7 @@ async def update_async( :returns: The updated FleetInstance """ + data = values.of( { "UniqueName": unique_name, @@ -320,11 +329,14 @@ async def update_async( "DataLimit": data_limit, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FleetInstance(self._version, payload, sid=self._solution["sid"]) @@ -414,6 +426,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -463,6 +479,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -613,7 +633,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return FleetPage(self._version, response) async def page_async( @@ -643,8 +669,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return FleetPage(self._version, response) diff --git a/twilio/rest/supersim/v1/ip_command.py b/twilio/rest/supersim/v1/ip_command.py index db6ac26432..72bf78297f 100644 --- a/twilio/rest/supersim/v1/ip_command.py +++ b/twilio/rest/supersim/v1/ip_command.py @@ -156,10 +156,11 @@ def fetch(self) -> IpCommandInstance: :returns: The fetched IpCommandInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return IpCommandInstance( self._version, @@ -175,9 +176,12 @@ async def fetch_async(self) -> IpCommandInstance: :returns: The fetched IpCommandInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return IpCommandInstance( @@ -262,6 +266,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -302,6 +310,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -499,7 +511,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return IpCommandPage(self._version, response) async def page_async( @@ -538,8 +556,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return IpCommandPage(self._version, response) diff --git a/twilio/rest/supersim/v1/network.py b/twilio/rest/supersim/v1/network.py index 0d4f6a94fd..211068d075 100644 --- a/twilio/rest/supersim/v1/network.py +++ b/twilio/rest/supersim/v1/network.py @@ -114,10 +114,11 @@ def fetch(self) -> NetworkInstance: :returns: The fetched NetworkInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return NetworkInstance( self._version, @@ -133,9 +134,12 @@ async def fetch_async(self) -> NetworkInstance: :returns: The fetched NetworkInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return NetworkInstance( @@ -356,7 +360,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return NetworkPage(self._version, response) async def page_async( @@ -392,8 +402,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return NetworkPage(self._version, response) diff --git a/twilio/rest/supersim/v1/network_access_profile/__init__.py b/twilio/rest/supersim/v1/network_access_profile/__init__.py index 4937ac50dd..15b0cc5695 100644 --- a/twilio/rest/supersim/v1/network_access_profile/__init__.py +++ b/twilio/rest/supersim/v1/network_access_profile/__init__.py @@ -163,10 +163,11 @@ def fetch(self) -> NetworkAccessProfileInstance: :returns: The fetched NetworkAccessProfileInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return NetworkAccessProfileInstance( self._version, @@ -182,9 +183,12 @@ async def fetch_async(self) -> NetworkAccessProfileInstance: :returns: The fetched NetworkAccessProfileInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return NetworkAccessProfileInstance( @@ -203,16 +207,20 @@ def update( :returns: The updated NetworkAccessProfileInstance """ + data = values.of( { "UniqueName": unique_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NetworkAccessProfileInstance( @@ -229,16 +237,20 @@ async def update_async( :returns: The updated NetworkAccessProfileInstance """ + data = values.of( { "UniqueName": unique_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return NetworkAccessProfileInstance( @@ -321,6 +333,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -349,6 +365,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -482,7 +502,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return NetworkAccessProfilePage(self._version, response) async def page_async( @@ -509,8 +535,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return NetworkAccessProfilePage(self._version, response) diff --git a/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py b/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py index cbe4d5c0ea..c7099b8a7a 100644 --- a/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py +++ b/twilio/rest/supersim/v1/network_access_profile/network_access_profile_network.py @@ -149,10 +149,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -161,9 +161,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> NetworkAccessProfileNetworkInstance: @@ -174,10 +176,11 @@ def fetch(self) -> NetworkAccessProfileNetworkInstance: :returns: The fetched NetworkAccessProfileNetworkInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return NetworkAccessProfileNetworkInstance( self._version, @@ -194,9 +197,12 @@ async def fetch_async(self) -> NetworkAccessProfileNetworkInstance: :returns: The fetched NetworkAccessProfileNetworkInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return NetworkAccessProfileNetworkInstance( @@ -281,6 +287,10 @@ def create(self, network: str) -> NetworkAccessProfileNetworkInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -307,6 +317,10 @@ async def create_async(self, network: str) -> NetworkAccessProfileNetworkInstanc ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -444,7 +458,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return NetworkAccessProfileNetworkPage(self._version, response, self._solution) async def page_async( @@ -471,8 +491,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return NetworkAccessProfileNetworkPage(self._version, response, self._solution) diff --git a/twilio/rest/supersim/v1/settings_update.py b/twilio/rest/supersim/v1/settings_update.py index f946150287..294e1102ce 100644 --- a/twilio/rest/supersim/v1/settings_update.py +++ b/twilio/rest/supersim/v1/settings_update.py @@ -256,7 +256,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SettingsUpdatePage(self._version, response) async def page_async( @@ -289,8 +295,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SettingsUpdatePage(self._version, response) diff --git a/twilio/rest/supersim/v1/sim/__init__.py b/twilio/rest/supersim/v1/sim/__init__.py index 1452f1eac5..fa878a16df 100644 --- a/twilio/rest/supersim/v1/sim/__init__.py +++ b/twilio/rest/supersim/v1/sim/__init__.py @@ -221,10 +221,11 @@ def fetch(self) -> SimInstance: :returns: The fetched SimInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SimInstance( self._version, @@ -240,9 +241,12 @@ async def fetch_async(self) -> SimInstance: :returns: The fetched SimInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SimInstance( @@ -272,6 +276,7 @@ def update( :returns: The updated SimInstance """ + data = values.of( { "UniqueName": unique_name, @@ -282,11 +287,14 @@ def update( "AccountSid": account_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SimInstance(self._version, payload, sid=self._solution["sid"]) @@ -312,6 +320,7 @@ async def update_async( :returns: The updated SimInstance """ + data = values.of( { "UniqueName": unique_name, @@ -322,11 +331,14 @@ async def update_async( "AccountSid": account_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SimInstance(self._version, payload, sid=self._solution["sid"]) @@ -415,6 +427,10 @@ def create(self, iccid: str, registration_code: str) -> SimInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -439,6 +455,10 @@ async def create_async(self, iccid: str, registration_code: str) -> SimInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -615,7 +635,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SimPage(self._version, response) async def page_async( @@ -651,8 +677,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SimPage(self._version, response) diff --git a/twilio/rest/supersim/v1/sim/billing_period.py b/twilio/rest/supersim/v1/sim/billing_period.py index e6fb961835..27cbe1222e 100644 --- a/twilio/rest/supersim/v1/sim/billing_period.py +++ b/twilio/rest/supersim/v1/sim/billing_period.py @@ -241,7 +241,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return BillingPeriodPage(self._version, response, self._solution) async def page_async( @@ -268,8 +274,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BillingPeriodPage(self._version, response, self._solution) diff --git a/twilio/rest/supersim/v1/sim/sim_ip_address.py b/twilio/rest/supersim/v1/sim/sim_ip_address.py index 7c2b70e50f..0c4c3163b6 100644 --- a/twilio/rest/supersim/v1/sim/sim_ip_address.py +++ b/twilio/rest/supersim/v1/sim/sim_ip_address.py @@ -220,7 +220,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SimIpAddressPage(self._version, response, self._solution) async def page_async( @@ -247,8 +253,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SimIpAddressPage(self._version, response, self._solution) diff --git a/twilio/rest/supersim/v1/sms_command.py b/twilio/rest/supersim/v1/sms_command.py index 26d39a0bf8..dd70d2425e 100644 --- a/twilio/rest/supersim/v1/sms_command.py +++ b/twilio/rest/supersim/v1/sms_command.py @@ -141,10 +141,11 @@ def fetch(self) -> SmsCommandInstance: :returns: The fetched SmsCommandInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SmsCommandInstance( self._version, @@ -160,9 +161,12 @@ async def fetch_async(self) -> SmsCommandInstance: :returns: The fetched SmsCommandInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SmsCommandInstance( @@ -241,6 +245,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -275,6 +283,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -451,7 +463,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SmsCommandPage(self._version, response) async def page_async( @@ -487,8 +505,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SmsCommandPage(self._version, response) diff --git a/twilio/rest/supersim/v1/usage_record.py b/twilio/rest/supersim/v1/usage_record.py index 86a335d0de..94072a51fb 100644 --- a/twilio/rest/supersim/v1/usage_record.py +++ b/twilio/rest/supersim/v1/usage_record.py @@ -359,7 +359,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UsageRecordPage(self._version, response) async def page_async( @@ -410,8 +416,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UsageRecordPage(self._version, response) diff --git a/twilio/rest/sync/v1/service/__init__.py b/twilio/rest/sync/v1/service/__init__.py index 02d4e8f7e0..d17491d3cb 100644 --- a/twilio/rest/sync/v1/service/__init__.py +++ b/twilio/rest/sync/v1/service/__init__.py @@ -265,10 +265,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -277,9 +277,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -290,10 +292,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -309,9 +312,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -343,6 +349,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "WebhookUrl": webhook_url, @@ -360,11 +367,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -392,6 +402,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "WebhookUrl": webhook_url, @@ -409,11 +420,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -551,6 +565,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -600,6 +618,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -733,7 +755,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -760,8 +788,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/sync/v1/service/document/__init__.py b/twilio/rest/sync/v1/service/document/__init__.py index 033f27cf42..fe64f629a8 100644 --- a/twilio/rest/sync/v1/service/document/__init__.py +++ b/twilio/rest/sync/v1/service/document/__init__.py @@ -214,10 +214,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -226,9 +226,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> DocumentInstance: @@ -239,10 +241,11 @@ def fetch(self) -> DocumentInstance: :returns: The fetched DocumentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DocumentInstance( self._version, @@ -259,9 +262,12 @@ async def fetch_async(self) -> DocumentInstance: :returns: The fetched DocumentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DocumentInstance( @@ -286,17 +292,23 @@ def update( :returns: The updated DocumentInstance """ + data = values.of( { "Data": serialize.object(data), "Ttl": ttl, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -324,17 +336,23 @@ async def update_async( :returns: The updated DocumentInstance """ + data = values.of( { "Data": serialize.object(data), "Ttl": ttl, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -434,6 +452,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -467,6 +489,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -602,7 +628,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DocumentPage(self._version, response, self._solution) async def page_async( @@ -629,8 +661,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DocumentPage(self._version, response, self._solution) diff --git a/twilio/rest/sync/v1/service/document/document_permission.py b/twilio/rest/sync/v1/service/document/document_permission.py index 40f524832c..75a27c969a 100644 --- a/twilio/rest/sync/v1/service/document/document_permission.py +++ b/twilio/rest/sync/v1/service/document/document_permission.py @@ -190,10 +190,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -202,9 +202,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> DocumentPermissionInstance: @@ -215,10 +217,11 @@ def fetch(self) -> DocumentPermissionInstance: :returns: The fetched DocumentPermissionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return DocumentPermissionInstance( self._version, @@ -236,9 +239,12 @@ async def fetch_async(self) -> DocumentPermissionInstance: :returns: The fetched DocumentPermissionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return DocumentPermissionInstance( @@ -261,6 +267,7 @@ def update( :returns: The updated DocumentPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -268,11 +275,14 @@ def update( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentPermissionInstance( @@ -295,6 +305,7 @@ async def update_async( :returns: The updated DocumentPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -302,11 +313,14 @@ async def update_async( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return DocumentPermissionInstance( @@ -502,7 +516,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DocumentPermissionPage(self._version, response, self._solution) async def page_async( @@ -529,8 +549,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DocumentPermissionPage(self._version, response, self._solution) diff --git a/twilio/rest/sync/v1/service/sync_list/__init__.py b/twilio/rest/sync/v1/service/sync_list/__init__.py index 235fcbd1b9..1b8e54aff8 100644 --- a/twilio/rest/sync/v1/service/sync_list/__init__.py +++ b/twilio/rest/sync/v1/service/sync_list/__init__.py @@ -215,10 +215,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -227,9 +227,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SyncListInstance: @@ -240,10 +242,11 @@ def fetch(self) -> SyncListInstance: :returns: The fetched SyncListInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncListInstance( self._version, @@ -260,9 +263,12 @@ async def fetch_async(self) -> SyncListInstance: :returns: The fetched SyncListInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncListInstance( @@ -285,17 +291,21 @@ def update( :returns: The updated SyncListInstance """ + data = values.of( { "Ttl": ttl, "CollectionTtl": collection_ttl, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListInstance( @@ -318,17 +328,21 @@ async def update_async( :returns: The updated SyncListInstance """ + data = values.of( { "Ttl": ttl, "CollectionTtl": collection_ttl, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListInstance( @@ -438,6 +452,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -471,6 +489,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -606,7 +628,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncListPage(self._version, response, self._solution) async def page_async( @@ -633,8 +661,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncListPage(self._version, response, self._solution) diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py index 0db046e1a8..61783aa525 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_item.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_item.py @@ -241,6 +241,8 @@ def delete(self, if_match: Union[str, object] = values.unset) -> bool: } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self, if_match: Union[str, object] = values.unset) -> bool: @@ -257,6 +259,8 @@ async def delete_async(self, if_match: Union[str, object] = values.unset) -> boo } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -269,10 +273,11 @@ def fetch(self) -> SyncListItemInstance: :returns: The fetched SyncListItemInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncListItemInstance( self._version, @@ -290,9 +295,12 @@ async def fetch_async(self) -> SyncListItemInstance: :returns: The fetched SyncListItemInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncListItemInstance( @@ -322,6 +330,7 @@ def update( :returns: The updated SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), @@ -330,11 +339,16 @@ def update( "CollectionTtl": collection_ttl, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -367,6 +381,7 @@ async def update_async( :returns: The updated SyncListItemInstance """ + data = values.of( { "Data": serialize.object(data), @@ -375,11 +390,16 @@ async def update_async( "CollectionTtl": collection_ttl, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -477,6 +497,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -516,6 +540,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -697,7 +725,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncListItemPage(self._version, response, self._solution) async def page_async( @@ -733,8 +767,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncListItemPage(self._version, response, self._solution) diff --git a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py index 07fce14b95..f1eb853468 100644 --- a/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py +++ b/twilio/rest/sync/v1/service/sync_list/sync_list_permission.py @@ -192,10 +192,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -204,9 +204,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SyncListPermissionInstance: @@ -217,10 +219,11 @@ def fetch(self) -> SyncListPermissionInstance: :returns: The fetched SyncListPermissionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncListPermissionInstance( self._version, @@ -238,9 +241,12 @@ async def fetch_async(self) -> SyncListPermissionInstance: :returns: The fetched SyncListPermissionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncListPermissionInstance( @@ -263,6 +269,7 @@ def update( :returns: The updated SyncListPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -270,11 +277,14 @@ def update( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListPermissionInstance( @@ -297,6 +307,7 @@ async def update_async( :returns: The updated SyncListPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -304,11 +315,14 @@ async def update_async( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncListPermissionInstance( @@ -502,7 +516,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncListPermissionPage(self._version, response, self._solution) async def page_async( @@ -529,8 +549,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncListPermissionPage(self._version, response, self._solution) diff --git a/twilio/rest/sync/v1/service/sync_map/__init__.py b/twilio/rest/sync/v1/service/sync_map/__init__.py index 1c6b5c9a00..c6bb1ce556 100644 --- a/twilio/rest/sync/v1/service/sync_map/__init__.py +++ b/twilio/rest/sync/v1/service/sync_map/__init__.py @@ -215,10 +215,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -227,9 +227,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SyncMapInstance: @@ -240,10 +242,11 @@ def fetch(self) -> SyncMapInstance: :returns: The fetched SyncMapInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncMapInstance( self._version, @@ -260,9 +263,12 @@ async def fetch_async(self) -> SyncMapInstance: :returns: The fetched SyncMapInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncMapInstance( @@ -285,17 +291,21 @@ def update( :returns: The updated SyncMapInstance """ + data = values.of( { "Ttl": ttl, "CollectionTtl": collection_ttl, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapInstance( @@ -318,17 +328,21 @@ async def update_async( :returns: The updated SyncMapInstance """ + data = values.of( { "Ttl": ttl, "CollectionTtl": collection_ttl, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapInstance( @@ -438,6 +452,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -471,6 +489,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -606,7 +628,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncMapPage(self._version, response, self._solution) async def page_async( @@ -633,8 +661,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncMapPage(self._version, response, self._solution) diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py index c5381fc592..4939694026 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_item.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_item.py @@ -241,6 +241,8 @@ def delete(self, if_match: Union[str, object] = values.unset) -> bool: } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self, if_match: Union[str, object] = values.unset) -> bool: @@ -257,6 +259,8 @@ async def delete_async(self, if_match: Union[str, object] = values.unset) -> boo } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -269,10 +273,11 @@ def fetch(self) -> SyncMapItemInstance: :returns: The fetched SyncMapItemInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncMapItemInstance( self._version, @@ -290,9 +295,12 @@ async def fetch_async(self) -> SyncMapItemInstance: :returns: The fetched SyncMapItemInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncMapItemInstance( @@ -322,6 +330,7 @@ def update( :returns: The updated SyncMapItemInstance """ + data = values.of( { "Data": serialize.object(data), @@ -330,11 +339,16 @@ def update( "CollectionTtl": collection_ttl, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -367,6 +381,7 @@ async def update_async( :returns: The updated SyncMapItemInstance """ + data = values.of( { "Data": serialize.object(data), @@ -375,11 +390,16 @@ async def update_async( "CollectionTtl": collection_ttl, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -480,6 +500,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -522,6 +546,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -703,7 +731,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncMapItemPage(self._version, response, self._solution) async def page_async( @@ -739,8 +773,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncMapItemPage(self._version, response, self._solution) diff --git a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py index ba056906c7..910560add0 100644 --- a/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py +++ b/twilio/rest/sync/v1/service/sync_map/sync_map_permission.py @@ -190,10 +190,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -202,9 +202,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SyncMapPermissionInstance: @@ -215,10 +217,11 @@ def fetch(self) -> SyncMapPermissionInstance: :returns: The fetched SyncMapPermissionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncMapPermissionInstance( self._version, @@ -236,9 +239,12 @@ async def fetch_async(self) -> SyncMapPermissionInstance: :returns: The fetched SyncMapPermissionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncMapPermissionInstance( @@ -261,6 +267,7 @@ def update( :returns: The updated SyncMapPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -268,11 +275,14 @@ def update( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapPermissionInstance( @@ -295,6 +305,7 @@ async def update_async( :returns: The updated SyncMapPermissionInstance """ + data = values.of( { "Read": serialize.boolean_to_string(read), @@ -302,11 +313,14 @@ async def update_async( "Manage": serialize.boolean_to_string(manage), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncMapPermissionInstance( @@ -500,7 +514,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncMapPermissionPage(self._version, response, self._solution) async def page_async( @@ -527,8 +547,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncMapPermissionPage(self._version, response, self._solution) diff --git a/twilio/rest/sync/v1/service/sync_stream/__init__.py b/twilio/rest/sync/v1/service/sync_stream/__init__.py index c9b98ab7d0..a7f4128e05 100644 --- a/twilio/rest/sync/v1/service/sync_stream/__init__.py +++ b/twilio/rest/sync/v1/service/sync_stream/__init__.py @@ -192,10 +192,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -204,9 +204,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SyncStreamInstance: @@ -217,10 +219,11 @@ def fetch(self) -> SyncStreamInstance: :returns: The fetched SyncStreamInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SyncStreamInstance( self._version, @@ -237,9 +240,12 @@ async def fetch_async(self) -> SyncStreamInstance: :returns: The fetched SyncStreamInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SyncStreamInstance( @@ -257,16 +263,20 @@ def update(self, ttl: Union[int, object] = values.unset) -> SyncStreamInstance: :returns: The updated SyncStreamInstance """ + data = values.of( { "Ttl": ttl, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncStreamInstance( @@ -286,16 +296,20 @@ async def update_async( :returns: The updated SyncStreamInstance """ + data = values.of( { "Ttl": ttl, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SyncStreamInstance( @@ -389,6 +403,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -419,6 +437,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -554,7 +576,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SyncStreamPage(self._version, response, self._solution) async def page_async( @@ -581,8 +609,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SyncStreamPage(self._version, response, self._solution) diff --git a/twilio/rest/sync/v1/service/sync_stream/stream_message.py b/twilio/rest/sync/v1/service/sync_stream/stream_message.py index baca803f95..bcce239975 100644 --- a/twilio/rest/sync/v1/service/sync_stream/stream_message.py +++ b/twilio/rest/sync/v1/service/sync_stream/stream_message.py @@ -91,6 +91,10 @@ def create(self, data: object) -> StreamMessageInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -118,6 +122,10 @@ async def create_async(self, data: object) -> StreamMessageInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/taskrouter/v1/workspace/__init__.py b/twilio/rest/taskrouter/v1/workspace/__init__.py index 60085c1186..086e3e1747 100644 --- a/twilio/rest/taskrouter/v1/workspace/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/__init__.py @@ -330,10 +330,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -342,9 +342,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> WorkspaceInstance: @@ -355,10 +357,11 @@ def fetch(self) -> WorkspaceInstance: :returns: The fetched WorkspaceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WorkspaceInstance( self._version, @@ -374,9 +377,12 @@ async def fetch_async(self) -> WorkspaceInstance: :returns: The fetched WorkspaceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WorkspaceInstance( @@ -410,6 +416,7 @@ def update( :returns: The updated WorkspaceInstance """ + data = values.of( { "DefaultActivitySid": default_activity_sid, @@ -421,11 +428,14 @@ def update( "PrioritizeQueueOrder": prioritize_queue_order, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkspaceInstance(self._version, payload, sid=self._solution["sid"]) @@ -455,6 +465,7 @@ async def update_async( :returns: The updated WorkspaceInstance """ + data = values.of( { "DefaultActivitySid": default_activity_sid, @@ -466,11 +477,14 @@ async def update_async( "PrioritizeQueueOrder": prioritize_queue_order, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkspaceInstance(self._version, payload, sid=self._solution["sid"]) @@ -673,6 +687,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -715,6 +733,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -863,7 +885,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkspacePage(self._version, response) async def page_async( @@ -893,8 +921,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkspacePage(self._version, response) diff --git a/twilio/rest/taskrouter/v1/workspace/activity.py b/twilio/rest/taskrouter/v1/workspace/activity.py index e211ef9f72..4e3e416af7 100644 --- a/twilio/rest/taskrouter/v1/workspace/activity.py +++ b/twilio/rest/taskrouter/v1/workspace/activity.py @@ -182,10 +182,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -194,9 +194,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ActivityInstance: @@ -207,10 +209,11 @@ def fetch(self) -> ActivityInstance: :returns: The fetched ActivityInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ActivityInstance( self._version, @@ -227,9 +230,12 @@ async def fetch_async(self) -> ActivityInstance: :returns: The fetched ActivityInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ActivityInstance( @@ -249,16 +255,20 @@ def update( :returns: The updated ActivityInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ActivityInstance( @@ -278,16 +288,20 @@ async def update_async( :returns: The updated ActivityInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ActivityInstance( @@ -366,6 +380,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -394,6 +412,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -563,7 +585,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ActivityPage(self._version, response, self._solution) async def page_async( @@ -596,8 +624,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ActivityPage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/event.py b/twilio/rest/taskrouter/v1/workspace/event.py index 534d9cd120..1b7f289e5e 100644 --- a/twilio/rest/taskrouter/v1/workspace/event.py +++ b/twilio/rest/taskrouter/v1/workspace/event.py @@ -149,10 +149,11 @@ def fetch(self) -> EventInstance: :returns: The fetched EventInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EventInstance( self._version, @@ -169,9 +170,12 @@ async def fetch_async(self) -> EventInstance: :returns: The fetched EventInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EventInstance( @@ -526,7 +530,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EventPage(self._version, response, self._solution) async def page_async( @@ -586,8 +596,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EventPage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/task/__init__.py b/twilio/rest/taskrouter/v1/workspace/task/__init__.py index ed25dc71d1..2c4516df77 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task/__init__.py @@ -292,6 +292,8 @@ def delete(self, if_match: Union[str, object] = values.unset) -> bool: } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self, if_match: Union[str, object] = values.unset) -> bool: @@ -308,6 +310,8 @@ async def delete_async(self, if_match: Union[str, object] = values.unset) -> boo } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -320,10 +324,11 @@ def fetch(self) -> TaskInstance: :returns: The fetched TaskInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TaskInstance( self._version, @@ -340,9 +345,12 @@ async def fetch_async(self) -> TaskInstance: :returns: The fetched TaskInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TaskInstance( @@ -375,6 +383,7 @@ def update( :returns: The updated TaskInstance """ + data = values.of( { "Attributes": attributes, @@ -385,11 +394,16 @@ def update( "VirtualStartTime": serialize.iso8601_datetime(virtual_start_time), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -425,6 +439,7 @@ async def update_async( :returns: The updated TaskInstance """ + data = values.of( { "Attributes": attributes, @@ -435,11 +450,16 @@ async def update_async( "VirtualStartTime": serialize.iso8601_datetime(virtual_start_time), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -557,6 +577,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -608,6 +632,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -897,7 +925,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TaskPage(self._version, response, self._solution) async def page_async( @@ -954,8 +988,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TaskPage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/task/reservation.py b/twilio/rest/taskrouter/v1/workspace/task/reservation.py index 50b1ed1273..5318543ea2 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/task/reservation.py @@ -547,10 +547,11 @@ def fetch(self) -> ReservationInstance: :returns: The fetched ReservationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ReservationInstance( self._version, @@ -568,9 +569,12 @@ async def fetch_async(self) -> ReservationInstance: :returns: The fetched ReservationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ReservationInstance( @@ -706,6 +710,7 @@ def update( :returns: The updated ReservationInstance """ + data = values.of( { "ReservationStatus": reservation_status, @@ -778,11 +783,16 @@ def update( "JitterBufferSize": jitter_buffer_size, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -921,6 +931,7 @@ async def update_async( :returns: The updated ReservationInstance """ + data = values.of( { "ReservationStatus": reservation_status, @@ -993,11 +1004,16 @@ async def update_async( "JitterBufferSize": jitter_buffer_size, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -1228,7 +1244,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ReservationPage(self._version, response, self._solution) async def page_async( @@ -1261,8 +1283,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ReservationPage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/task_channel.py b/twilio/rest/taskrouter/v1/workspace/task_channel.py index 95a7e5efaf..3a4b0a6b9e 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/task_channel.py @@ -194,10 +194,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -206,9 +206,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TaskChannelInstance: @@ -219,10 +221,11 @@ def fetch(self) -> TaskChannelInstance: :returns: The fetched TaskChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TaskChannelInstance( self._version, @@ -239,9 +242,12 @@ async def fetch_async(self) -> TaskChannelInstance: :returns: The fetched TaskChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TaskChannelInstance( @@ -264,6 +270,7 @@ def update( :returns: The updated TaskChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -272,11 +279,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskChannelInstance( @@ -299,6 +309,7 @@ async def update_async( :returns: The updated TaskChannelInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -307,11 +318,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskChannelInstance( @@ -397,6 +411,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -432,6 +450,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -567,7 +589,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TaskChannelPage(self._version, response, self._solution) async def page_async( @@ -594,8 +622,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TaskChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py index 027cf8dbfc..4511a55310 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/__init__.py @@ -283,10 +283,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -295,9 +295,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TaskQueueInstance: @@ -308,10 +310,11 @@ def fetch(self) -> TaskQueueInstance: :returns: The fetched TaskQueueInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TaskQueueInstance( self._version, @@ -328,9 +331,12 @@ async def fetch_async(self) -> TaskQueueInstance: :returns: The fetched TaskQueueInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TaskQueueInstance( @@ -361,6 +367,7 @@ def update( :returns: The updated TaskQueueInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -371,11 +378,14 @@ def update( "TaskOrder": task_order, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskQueueInstance( @@ -406,6 +416,7 @@ async def update_async( :returns: The updated TaskQueueInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -416,11 +427,14 @@ async def update_async( "TaskOrder": task_order, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TaskQueueInstance( @@ -557,6 +571,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -599,6 +617,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -798,7 +820,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TaskQueuePage(self._version, response, self._solution) async def page_async( @@ -837,8 +865,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TaskQueuePage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py index 9ccef45773..90400c7930 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.py @@ -93,8 +93,11 @@ def create( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -116,8 +119,11 @@ async def create_async( data = body.to_dict() headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/json" + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py index acb8b79a29..ef851c755a 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.py @@ -254,7 +254,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return TaskQueueCumulativeStatisticsInstance( self._version, @@ -293,8 +299,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TaskQueueCumulativeStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py index 4d4198ac89..c4eb30ddc0 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.py @@ -182,7 +182,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return TaskQueueRealTimeStatisticsInstance( self._version, @@ -208,8 +214,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TaskQueueRealTimeStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py index 2a09f62a68..2d5d631069 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.py @@ -186,7 +186,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return TaskQueueStatisticsInstance( self._version, @@ -225,8 +231,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TaskQueueStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py index bec2d81b40..036f6ad92b 100644 --- a/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.py @@ -316,7 +316,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TaskQueuesStatisticsPage(self._version, response, self._solution) async def page_async( @@ -361,8 +367,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TaskQueuesStatisticsPage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py index 8f6ff4c7e1..38aede84bb 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/__init__.py @@ -268,6 +268,8 @@ def delete(self, if_match: Union[str, object] = values.unset) -> bool: } ) + headers = values.of({}) + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self, if_match: Union[str, object] = values.unset) -> bool: @@ -284,6 +286,8 @@ async def delete_async(self, if_match: Union[str, object] = values.unset) -> boo } ) + headers = values.of({}) + return await self._version.delete_async( method="DELETE", uri=self._uri, headers=headers ) @@ -296,10 +300,11 @@ def fetch(self) -> WorkerInstance: :returns: The fetched WorkerInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WorkerInstance( self._version, @@ -316,9 +321,12 @@ async def fetch_async(self) -> WorkerInstance: :returns: The fetched WorkerInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WorkerInstance( @@ -347,6 +355,7 @@ def update( :returns: The updated WorkerInstance """ + data = values.of( { "ActivitySid": activity_sid, @@ -357,11 +366,16 @@ def update( ), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -393,6 +407,7 @@ async def update_async( :returns: The updated WorkerInstance """ + data = values.of( { "ActivitySid": activity_sid, @@ -403,11 +418,16 @@ async def update_async( ), } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -537,6 +557,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -570,6 +594,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -829,7 +857,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkerPage(self._version, response, self._solution) async def page_async( @@ -880,8 +914,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkerPage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py index b7dc4bca9e..11d1ea610d 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py @@ -524,10 +524,11 @@ def fetch(self) -> ReservationInstance: :returns: The fetched ReservationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ReservationInstance( self._version, @@ -545,9 +546,12 @@ async def fetch_async(self) -> ReservationInstance: :returns: The fetched ReservationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ReservationInstance( @@ -677,6 +681,7 @@ def update( :returns: The updated ReservationInstance """ + data = values.of( { "ReservationStatus": reservation_status, @@ -747,11 +752,16 @@ def update( "JitterBufferSize": jitter_buffer_size, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers @@ -884,6 +894,7 @@ async def update_async( :returns: The updated ReservationInstance """ + data = values.of( { "ReservationStatus": reservation_status, @@ -954,11 +965,16 @@ async def update_async( "JitterBufferSize": jitter_buffer_size, } ) - headers = values.of( - { - "If-Match": if_match, - } - ) + headers = values.of({}) + + if not ( + if_match is values.unset or (isinstance(if_match, str) and not if_match) + ): + headers["If-Match"] = if_match + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers @@ -1174,7 +1190,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ReservationPage(self._version, response, self._solution) async def page_async( @@ -1204,8 +1226,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ReservationPage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py index f48ebb3a62..6e3cc9c1dd 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_channel.py @@ -196,10 +196,11 @@ def fetch(self) -> WorkerChannelInstance: :returns: The fetched WorkerChannelInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WorkerChannelInstance( self._version, @@ -217,9 +218,12 @@ async def fetch_async(self) -> WorkerChannelInstance: :returns: The fetched WorkerChannelInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WorkerChannelInstance( @@ -243,17 +247,21 @@ def update( :returns: The updated WorkerChannelInstance """ + data = values.of( { "Capacity": capacity, "Available": serialize.boolean_to_string(available), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkerChannelInstance( @@ -277,17 +285,21 @@ async def update_async( :returns: The updated WorkerChannelInstance """ + data = values.of( { "Capacity": capacity, "Available": serialize.boolean_to_string(available), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkerChannelInstance( @@ -481,7 +493,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkerChannelPage(self._version, response, self._solution) async def page_async( @@ -508,8 +526,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkerChannelPage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py index 61618d2961..eea670aa7d 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/worker_statistics.py @@ -175,7 +175,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkerStatisticsInstance( self._version, @@ -211,8 +217,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkerStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py index b18e7f123b..48a78710e2 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.py @@ -197,7 +197,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkersCumulativeStatisticsInstance( self._version, @@ -232,8 +238,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkersCumulativeStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py index 277889ae7a..2e9970478e 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.py @@ -138,7 +138,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkersRealTimeStatisticsInstance( self._version, @@ -163,8 +169,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkersRealTimeStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py b/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py index 0cd09ec124..31c79ee6ba 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/workers_statistics.py @@ -190,7 +190,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkersStatisticsInstance( self._version, @@ -234,8 +240,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkersStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py index 96d7aabf0e..619ae1bce9 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/__init__.py @@ -262,10 +262,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -274,9 +274,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> WorkflowInstance: @@ -287,10 +289,11 @@ def fetch(self) -> WorkflowInstance: :returns: The fetched WorkflowInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WorkflowInstance( self._version, @@ -307,9 +310,12 @@ async def fetch_async(self) -> WorkflowInstance: :returns: The fetched WorkflowInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WorkflowInstance( @@ -340,6 +346,7 @@ def update( :returns: The updated WorkflowInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -350,11 +357,14 @@ def update( "ReEvaluateTasks": re_evaluate_tasks, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkflowInstance( @@ -385,6 +395,7 @@ async def update_async( :returns: The updated WorkflowInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -395,11 +406,14 @@ async def update_async( "ReEvaluateTasks": re_evaluate_tasks, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WorkflowInstance( @@ -528,6 +542,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -567,6 +585,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -717,7 +739,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkflowPage(self._version, response, self._solution) async def page_async( @@ -747,8 +775,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkflowPage(self._version, response, self._solution) diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py index e06cab0114..d6d7c094cc 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.py @@ -254,7 +254,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkflowCumulativeStatisticsInstance( self._version, @@ -293,8 +299,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkflowCumulativeStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py index 415d4223e4..9387622518 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.py @@ -162,7 +162,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkflowRealTimeStatisticsInstance( self._version, @@ -188,8 +194,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkflowRealTimeStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py index f86590e40f..e49bd32d6e 100644 --- a/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workflow/workflow_statistics.py @@ -186,7 +186,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkflowStatisticsInstance( self._version, @@ -225,8 +231,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkflowStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py index 2b223641ae..3747b395d2 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.py @@ -242,7 +242,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkspaceCumulativeStatisticsInstance( self._version, @@ -280,8 +286,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkspaceCumulativeStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py index 35b50c0b21..923a94bf3a 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_real_time_statistics.py @@ -158,7 +158,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkspaceRealTimeStatisticsInstance( self._version, @@ -183,8 +189,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkspaceRealTimeStatisticsInstance( diff --git a/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py b/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py index 19eb885675..b8414a5c6c 100644 --- a/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py +++ b/twilio/rest/taskrouter/v1/workspace/workspace_statistics.py @@ -170,7 +170,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return WorkspaceStatisticsInstance( self._version, @@ -208,8 +214,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WorkspaceStatisticsInstance( diff --git a/twilio/rest/trunking/v1/trunk/__init__.py b/twilio/rest/trunking/v1/trunk/__init__.py index b1bfdba117..6a93a83233 100644 --- a/twilio/rest/trunking/v1/trunk/__init__.py +++ b/twilio/rest/trunking/v1/trunk/__init__.py @@ -298,10 +298,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -310,9 +310,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TrunkInstance: @@ -323,10 +325,11 @@ def fetch(self) -> TrunkInstance: :returns: The fetched TrunkInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TrunkInstance( self._version, @@ -342,9 +345,12 @@ async def fetch_async(self) -> TrunkInstance: :returns: The fetched TrunkInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TrunkInstance( @@ -380,6 +386,7 @@ def update( :returns: The updated TrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -392,11 +399,14 @@ def update( "TransferCallerId": transfer_caller_id, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrunkInstance(self._version, payload, sid=self._solution["sid"]) @@ -428,6 +438,7 @@ async def update_async( :returns: The updated TrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -440,11 +451,14 @@ async def update_async( "TransferCallerId": transfer_caller_id, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrunkInstance(self._version, payload, sid=self._solution["sid"]) @@ -593,6 +607,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -641,6 +659,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -774,7 +796,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TrunkPage(self._version, response) async def page_async( @@ -801,8 +829,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TrunkPage(self._version, response) diff --git a/twilio/rest/trunking/v1/trunk/credential_list.py b/twilio/rest/trunking/v1/trunk/credential_list.py index e04bb30720..09ffc99260 100644 --- a/twilio/rest/trunking/v1/trunk/credential_list.py +++ b/twilio/rest/trunking/v1/trunk/credential_list.py @@ -148,10 +148,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -160,9 +160,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CredentialListInstance: @@ -173,10 +175,11 @@ def fetch(self) -> CredentialListInstance: :returns: The fetched CredentialListInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CredentialListInstance( self._version, @@ -193,9 +196,12 @@ async def fetch_async(self) -> CredentialListInstance: :returns: The fetched CredentialListInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CredentialListInstance( @@ -270,6 +276,10 @@ def create(self, credential_list_sid: str) -> CredentialListInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -294,6 +304,10 @@ async def create_async(self, credential_list_sid: str) -> CredentialListInstance ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -429,7 +443,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CredentialListPage(self._version, response, self._solution) async def page_async( @@ -456,8 +476,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CredentialListPage(self._version, response, self._solution) diff --git a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py index 957084cb62..ec5a59de69 100644 --- a/twilio/rest/trunking/v1/trunk/ip_access_control_list.py +++ b/twilio/rest/trunking/v1/trunk/ip_access_control_list.py @@ -150,10 +150,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -162,9 +162,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> IpAccessControlListInstance: @@ -175,10 +177,11 @@ def fetch(self) -> IpAccessControlListInstance: :returns: The fetched IpAccessControlListInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return IpAccessControlListInstance( self._version, @@ -195,9 +198,12 @@ async def fetch_async(self) -> IpAccessControlListInstance: :returns: The fetched IpAccessControlListInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return IpAccessControlListInstance( @@ -272,6 +278,10 @@ def create(self, ip_access_control_list_sid: str) -> IpAccessControlListInstance ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -298,6 +308,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -433,7 +447,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return IpAccessControlListPage(self._version, response, self._solution) async def page_async( @@ -460,8 +480,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return IpAccessControlListPage(self._version, response, self._solution) diff --git a/twilio/rest/trunking/v1/trunk/origination_url.py b/twilio/rest/trunking/v1/trunk/origination_url.py index e8e77180e8..082fa34beb 100644 --- a/twilio/rest/trunking/v1/trunk/origination_url.py +++ b/twilio/rest/trunking/v1/trunk/origination_url.py @@ -210,10 +210,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -222,9 +222,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> OriginationUrlInstance: @@ -235,10 +237,11 @@ def fetch(self) -> OriginationUrlInstance: :returns: The fetched OriginationUrlInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return OriginationUrlInstance( self._version, @@ -255,9 +258,12 @@ async def fetch_async(self) -> OriginationUrlInstance: :returns: The fetched OriginationUrlInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return OriginationUrlInstance( @@ -286,6 +292,7 @@ def update( :returns: The updated OriginationUrlInstance """ + data = values.of( { "Weight": weight, @@ -295,11 +302,14 @@ def update( "SipUrl": sip_url, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return OriginationUrlInstance( @@ -328,6 +338,7 @@ async def update_async( :returns: The updated OriginationUrlInstance """ + data = values.of( { "Weight": weight, @@ -337,11 +348,14 @@ async def update_async( "SipUrl": sip_url, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return OriginationUrlInstance( @@ -431,6 +445,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -470,6 +488,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -605,7 +627,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return OriginationUrlPage(self._version, response, self._solution) async def page_async( @@ -632,8 +660,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return OriginationUrlPage(self._version, response, self._solution) diff --git a/twilio/rest/trunking/v1/trunk/phone_number.py b/twilio/rest/trunking/v1/trunk/phone_number.py index 75cb5f6c64..a7c3dbe20d 100644 --- a/twilio/rest/trunking/v1/trunk/phone_number.py +++ b/twilio/rest/trunking/v1/trunk/phone_number.py @@ -199,10 +199,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -211,9 +211,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> PhoneNumberInstance: @@ -224,10 +226,11 @@ def fetch(self) -> PhoneNumberInstance: :returns: The fetched PhoneNumberInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PhoneNumberInstance( self._version, @@ -244,9 +247,12 @@ async def fetch_async(self) -> PhoneNumberInstance: :returns: The fetched PhoneNumberInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PhoneNumberInstance( @@ -321,6 +327,10 @@ def create(self, phone_number_sid: str) -> PhoneNumberInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -345,6 +355,10 @@ async def create_async(self, phone_number_sid: str) -> PhoneNumberInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -480,7 +494,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PhoneNumberPage(self._version, response, self._solution) async def page_async( @@ -507,8 +527,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PhoneNumberPage(self._version, response, self._solution) diff --git a/twilio/rest/trunking/v1/trunk/recording.py b/twilio/rest/trunking/v1/trunk/recording.py index 1a431b496b..0507662f24 100644 --- a/twilio/rest/trunking/v1/trunk/recording.py +++ b/twilio/rest/trunking/v1/trunk/recording.py @@ -153,10 +153,11 @@ def fetch(self) -> RecordingInstance: :returns: The fetched RecordingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RecordingInstance( self._version, @@ -172,9 +173,12 @@ async def fetch_async(self) -> RecordingInstance: :returns: The fetched RecordingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RecordingInstance( @@ -196,17 +200,21 @@ def update( :returns: The updated RecordingInstance """ + data = values.of( { "Mode": mode, "Trim": trim, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingInstance( @@ -226,17 +234,21 @@ async def update_async( :returns: The updated RecordingInstance """ + data = values.of( { "Mode": mode, "Trim": trim, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RecordingInstance( diff --git a/twilio/rest/trusthub/v1/compliance_inquiries.py b/twilio/rest/trusthub/v1/compliance_inquiries.py index fe83b8630a..3c1abd596a 100644 --- a/twilio/rest/trusthub/v1/compliance_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_inquiries.py @@ -133,17 +133,21 @@ def update( :returns: The updated ComplianceInquiriesInstance """ + data = values.of( { "PrimaryProfileSid": primary_profile_sid, "ThemeSetId": theme_set_id, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceInquiriesInstance( @@ -161,17 +165,21 @@ async def update_async( :returns: The updated ComplianceInquiriesInstance """ + data = values.of( { "PrimaryProfileSid": primary_profile_sid, "ThemeSetId": theme_set_id, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceInquiriesInstance( @@ -226,6 +234,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -257,6 +269,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py index 2f6c465341..eccd1ac8cf 100644 --- a/twilio/rest/trusthub/v1/compliance_registration_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_registration_inquiries.py @@ -164,17 +164,21 @@ def update( :returns: The updated ComplianceRegistrationInquiriesInstance """ + data = values.of( { "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), "ThemeSetId": theme_set_id, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceRegistrationInquiriesInstance( @@ -194,17 +198,21 @@ async def update_async( :returns: The updated ComplianceRegistrationInquiriesInstance """ + data = values.of( { "IsIsvEmbed": serialize.boolean_to_string(is_isv_embed), "ThemeSetId": theme_set_id, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ComplianceRegistrationInquiriesInstance( @@ -380,6 +388,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -528,6 +540,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py index 4d8988ab41..9cf259a318 100644 --- a/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py +++ b/twilio/rest/trusthub/v1/compliance_tollfree_inquiries.py @@ -156,6 +156,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -251,6 +255,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/trusthub/v1/customer_profiles/__init__.py b/twilio/rest/trusthub/v1/customer_profiles/__init__.py index 5079b89e6d..bf5264e31d 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/__init__.py +++ b/twilio/rest/trusthub/v1/customer_profiles/__init__.py @@ -254,10 +254,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -266,9 +266,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CustomerProfilesInstance: @@ -279,10 +281,11 @@ def fetch(self) -> CustomerProfilesInstance: :returns: The fetched CustomerProfilesInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CustomerProfilesInstance( self._version, @@ -298,9 +301,12 @@ async def fetch_async(self) -> CustomerProfilesInstance: :returns: The fetched CustomerProfilesInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CustomerProfilesInstance( @@ -326,6 +332,7 @@ def update( :returns: The updated CustomerProfilesInstance """ + data = values.of( { "Status": status, @@ -334,11 +341,14 @@ def update( "Email": email, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesInstance( @@ -362,6 +372,7 @@ async def update_async( :returns: The updated CustomerProfilesInstance """ + data = values.of( { "Status": status, @@ -370,11 +381,14 @@ async def update_async( "Email": email, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CustomerProfilesInstance( @@ -495,6 +509,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -529,6 +547,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -711,7 +733,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CustomerProfilesPage(self._version, response) async def page_async( @@ -747,8 +775,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CustomerProfilesPage(self._version, response) diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py index 0369e51d5c..1adca541a8 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_channel_endpoint_assignment.py @@ -150,10 +150,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -162,9 +162,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CustomerProfilesChannelEndpointAssignmentInstance: @@ -175,10 +177,11 @@ def fetch(self) -> CustomerProfilesChannelEndpointAssignmentInstance: :returns: The fetched CustomerProfilesChannelEndpointAssignmentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CustomerProfilesChannelEndpointAssignmentInstance( self._version, @@ -195,9 +198,12 @@ async def fetch_async(self) -> CustomerProfilesChannelEndpointAssignmentInstance :returns: The fetched CustomerProfilesChannelEndpointAssignmentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CustomerProfilesChannelEndpointAssignmentInstance( @@ -284,6 +290,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -314,6 +324,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -485,7 +499,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CustomerProfilesChannelEndpointAssignmentPage( self._version, response, self._solution ) @@ -520,8 +540,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CustomerProfilesChannelEndpointAssignmentPage( self._version, response, self._solution diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py index 8fbb523b8a..f8710b9cd8 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_entity_assignments.py @@ -152,10 +152,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -164,9 +164,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CustomerProfilesEntityAssignmentsInstance: @@ -177,10 +179,11 @@ def fetch(self) -> CustomerProfilesEntityAssignmentsInstance: :returns: The fetched CustomerProfilesEntityAssignmentsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CustomerProfilesEntityAssignmentsInstance( self._version, @@ -197,9 +200,12 @@ async def fetch_async(self) -> CustomerProfilesEntityAssignmentsInstance: :returns: The fetched CustomerProfilesEntityAssignmentsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CustomerProfilesEntityAssignmentsInstance( @@ -284,6 +290,10 @@ def create(self, object_sid: str) -> CustomerProfilesEntityAssignmentsInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -312,6 +322,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -464,7 +478,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CustomerProfilesEntityAssignmentsPage( self._version, response, self._solution ) @@ -496,8 +516,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CustomerProfilesEntityAssignmentsPage( self._version, response, self._solution diff --git a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py index b5c3ba746e..648467aac6 100644 --- a/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py +++ b/twilio/rest/trusthub/v1/customer_profiles/customer_profiles_evaluations.py @@ -142,10 +142,11 @@ def fetch(self) -> CustomerProfilesEvaluationsInstance: :returns: The fetched CustomerProfilesEvaluationsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CustomerProfilesEvaluationsInstance( self._version, @@ -162,9 +163,12 @@ async def fetch_async(self) -> CustomerProfilesEvaluationsInstance: :returns: The fetched CustomerProfilesEvaluationsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CustomerProfilesEvaluationsInstance( @@ -247,6 +251,10 @@ def create(self, policy_sid: str) -> CustomerProfilesEvaluationsInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -275,6 +283,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -412,7 +424,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CustomerProfilesEvaluationsPage(self._version, response, self._solution) async def page_async( @@ -439,8 +457,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CustomerProfilesEvaluationsPage(self._version, response, self._solution) diff --git a/twilio/rest/trusthub/v1/end_user.py b/twilio/rest/trusthub/v1/end_user.py index 42bdb155e0..5ce3b819d9 100644 --- a/twilio/rest/trusthub/v1/end_user.py +++ b/twilio/rest/trusthub/v1/end_user.py @@ -178,10 +178,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -190,9 +190,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> EndUserInstance: @@ -203,10 +205,11 @@ def fetch(self) -> EndUserInstance: :returns: The fetched EndUserInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EndUserInstance( self._version, @@ -222,9 +225,12 @@ async def fetch_async(self) -> EndUserInstance: :returns: The fetched EndUserInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EndUserInstance( @@ -246,17 +252,21 @@ def update( :returns: The updated EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, "Attributes": serialize.object(attributes), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload, sid=self._solution["sid"]) @@ -274,17 +284,21 @@ async def update_async( :returns: The updated EndUserInstance """ + data = values.of( { "FriendlyName": friendly_name, "Attributes": serialize.object(attributes), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return EndUserInstance(self._version, payload, sid=self._solution["sid"]) @@ -356,6 +370,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -387,6 +405,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -520,7 +542,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EndUserPage(self._version, response) async def page_async( @@ -547,8 +575,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EndUserPage(self._version, response) diff --git a/twilio/rest/trusthub/v1/end_user_type.py b/twilio/rest/trusthub/v1/end_user_type.py index d336385b25..0eb2957e0a 100644 --- a/twilio/rest/trusthub/v1/end_user_type.py +++ b/twilio/rest/trusthub/v1/end_user_type.py @@ -114,10 +114,11 @@ def fetch(self) -> EndUserTypeInstance: :returns: The fetched EndUserTypeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EndUserTypeInstance( self._version, @@ -133,9 +134,12 @@ async def fetch_async(self) -> EndUserTypeInstance: :returns: The fetched EndUserTypeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EndUserTypeInstance( @@ -313,7 +317,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EndUserTypePage(self._version, response) async def page_async( @@ -340,8 +350,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EndUserTypePage(self._version, response) diff --git a/twilio/rest/trusthub/v1/policies.py b/twilio/rest/trusthub/v1/policies.py index a39b1e0e65..36a0916c51 100644 --- a/twilio/rest/trusthub/v1/policies.py +++ b/twilio/rest/trusthub/v1/policies.py @@ -112,10 +112,11 @@ def fetch(self) -> PoliciesInstance: :returns: The fetched PoliciesInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PoliciesInstance( self._version, @@ -131,9 +132,12 @@ async def fetch_async(self) -> PoliciesInstance: :returns: The fetched PoliciesInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PoliciesInstance( @@ -311,7 +315,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PoliciesPage(self._version, response) async def page_async( @@ -338,8 +348,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PoliciesPage(self._version, response) diff --git a/twilio/rest/trusthub/v1/supporting_document.py b/twilio/rest/trusthub/v1/supporting_document.py index 2336e1fefa..b53d7d319c 100644 --- a/twilio/rest/trusthub/v1/supporting_document.py +++ b/twilio/rest/trusthub/v1/supporting_document.py @@ -193,10 +193,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -205,9 +205,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SupportingDocumentInstance: @@ -218,10 +220,11 @@ def fetch(self) -> SupportingDocumentInstance: :returns: The fetched SupportingDocumentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SupportingDocumentInstance( self._version, @@ -237,9 +240,12 @@ async def fetch_async(self) -> SupportingDocumentInstance: :returns: The fetched SupportingDocumentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SupportingDocumentInstance( @@ -261,17 +267,21 @@ def update( :returns: The updated SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, "Attributes": serialize.object(attributes), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance( @@ -291,17 +301,21 @@ async def update_async( :returns: The updated SupportingDocumentInstance """ + data = values.of( { "FriendlyName": friendly_name, "Attributes": serialize.object(attributes), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SupportingDocumentInstance( @@ -375,6 +389,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -406,6 +424,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -539,7 +561,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SupportingDocumentPage(self._version, response) async def page_async( @@ -566,8 +594,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SupportingDocumentPage(self._version, response) diff --git a/twilio/rest/trusthub/v1/supporting_document_type.py b/twilio/rest/trusthub/v1/supporting_document_type.py index f1a93c59b7..f107397a4c 100644 --- a/twilio/rest/trusthub/v1/supporting_document_type.py +++ b/twilio/rest/trusthub/v1/supporting_document_type.py @@ -114,10 +114,11 @@ def fetch(self) -> SupportingDocumentTypeInstance: :returns: The fetched SupportingDocumentTypeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SupportingDocumentTypeInstance( self._version, @@ -133,9 +134,12 @@ async def fetch_async(self) -> SupportingDocumentTypeInstance: :returns: The fetched SupportingDocumentTypeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SupportingDocumentTypeInstance( @@ -313,7 +317,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SupportingDocumentTypePage(self._version, response) async def page_async( @@ -340,8 +350,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SupportingDocumentTypePage(self._version, response) diff --git a/twilio/rest/trusthub/v1/trust_products/__init__.py b/twilio/rest/trusthub/v1/trust_products/__init__.py index c819eb0a07..6bb01d61dc 100644 --- a/twilio/rest/trusthub/v1/trust_products/__init__.py +++ b/twilio/rest/trusthub/v1/trust_products/__init__.py @@ -250,10 +250,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -262,9 +262,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TrustProductsInstance: @@ -275,10 +277,11 @@ def fetch(self) -> TrustProductsInstance: :returns: The fetched TrustProductsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TrustProductsInstance( self._version, @@ -294,9 +297,12 @@ async def fetch_async(self) -> TrustProductsInstance: :returns: The fetched TrustProductsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TrustProductsInstance( @@ -322,6 +328,7 @@ def update( :returns: The updated TrustProductsInstance """ + data = values.of( { "Status": status, @@ -330,11 +337,14 @@ def update( "Email": email, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsInstance(self._version, payload, sid=self._solution["sid"]) @@ -356,6 +366,7 @@ async def update_async( :returns: The updated TrustProductsInstance """ + data = values.of( { "Status": status, @@ -364,11 +375,14 @@ async def update_async( "Email": email, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return TrustProductsInstance(self._version, payload, sid=self._solution["sid"]) @@ -485,6 +499,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -519,6 +537,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -701,7 +723,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TrustProductsPage(self._version, response) async def page_async( @@ -737,8 +765,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TrustProductsPage(self._version, response) diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py b/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py index df69d31ddf..adf9c51f51 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_channel_endpoint_assignment.py @@ -150,10 +150,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -162,9 +162,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TrustProductsChannelEndpointAssignmentInstance: @@ -175,10 +177,11 @@ def fetch(self) -> TrustProductsChannelEndpointAssignmentInstance: :returns: The fetched TrustProductsChannelEndpointAssignmentInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TrustProductsChannelEndpointAssignmentInstance( self._version, @@ -195,9 +198,12 @@ async def fetch_async(self) -> TrustProductsChannelEndpointAssignmentInstance: :returns: The fetched TrustProductsChannelEndpointAssignmentInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TrustProductsChannelEndpointAssignmentInstance( @@ -286,6 +292,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -316,6 +326,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -487,7 +501,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TrustProductsChannelEndpointAssignmentPage( self._version, response, self._solution ) @@ -522,8 +542,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TrustProductsChannelEndpointAssignmentPage( self._version, response, self._solution diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py index 57e1b3119c..ebda7ee8c0 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_entity_assignments.py @@ -148,10 +148,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -160,9 +160,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> TrustProductsEntityAssignmentsInstance: @@ -173,10 +175,11 @@ def fetch(self) -> TrustProductsEntityAssignmentsInstance: :returns: The fetched TrustProductsEntityAssignmentsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TrustProductsEntityAssignmentsInstance( self._version, @@ -193,9 +196,12 @@ async def fetch_async(self) -> TrustProductsEntityAssignmentsInstance: :returns: The fetched TrustProductsEntityAssignmentsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TrustProductsEntityAssignmentsInstance( @@ -278,6 +284,10 @@ def create(self, object_sid: str) -> TrustProductsEntityAssignmentsInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -306,6 +316,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -458,7 +472,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TrustProductsEntityAssignmentsPage( self._version, response, self._solution ) @@ -490,8 +510,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TrustProductsEntityAssignmentsPage( self._version, response, self._solution diff --git a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py index 3088a2b1b4..3691aa017b 100644 --- a/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py +++ b/twilio/rest/trusthub/v1/trust_products/trust_products_evaluations.py @@ -142,10 +142,11 @@ def fetch(self) -> TrustProductsEvaluationsInstance: :returns: The fetched TrustProductsEvaluationsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return TrustProductsEvaluationsInstance( self._version, @@ -162,9 +163,12 @@ async def fetch_async(self) -> TrustProductsEvaluationsInstance: :returns: The fetched TrustProductsEvaluationsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return TrustProductsEvaluationsInstance( @@ -243,6 +247,10 @@ def create(self, policy_sid: str) -> TrustProductsEvaluationsInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -269,6 +277,10 @@ async def create_async(self, policy_sid: str) -> TrustProductsEvaluationsInstanc ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -406,7 +418,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TrustProductsEvaluationsPage(self._version, response, self._solution) async def page_async( @@ -433,8 +451,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TrustProductsEvaluationsPage(self._version, response, self._solution) diff --git a/twilio/rest/verify/v2/form.py b/twilio/rest/verify/v2/form.py index 6e3231fcda..454030208d 100644 --- a/twilio/rest/verify/v2/form.py +++ b/twilio/rest/verify/v2/form.py @@ -13,6 +13,7 @@ """ from typing import Any, Dict, Optional +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -117,10 +118,11 @@ def fetch(self) -> FormInstance: :returns: The fetched FormInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FormInstance( self._version, @@ -136,9 +138,12 @@ async def fetch_async(self) -> FormInstance: :returns: The fetched FormInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FormInstance( diff --git a/twilio/rest/verify/v2/safelist.py b/twilio/rest/verify/v2/safelist.py index 0ee946a342..00fc0976f7 100644 --- a/twilio/rest/verify/v2/safelist.py +++ b/twilio/rest/verify/v2/safelist.py @@ -129,10 +129,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -141,9 +141,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SafelistInstance: @@ -154,10 +156,11 @@ def fetch(self) -> SafelistInstance: :returns: The fetched SafelistInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SafelistInstance( self._version, @@ -173,9 +176,12 @@ async def fetch_async(self) -> SafelistInstance: :returns: The fetched SafelistInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SafelistInstance( @@ -223,6 +229,10 @@ def create(self, phone_number: str) -> SafelistInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -245,6 +255,10 @@ async def create_async(self, phone_number: str) -> SafelistInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 9b8b4b4da9..207e8e7b53 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -384,10 +384,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -396,9 +396,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ServiceInstance: @@ -409,10 +411,11 @@ def fetch(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ServiceInstance( self._version, @@ -428,9 +431,12 @@ async def fetch_async(self) -> ServiceInstance: :returns: The fetched ServiceInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ServiceInstance( @@ -488,6 +494,7 @@ def update( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -518,11 +525,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -576,6 +586,7 @@ async def update_async( :returns: The updated ServiceInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -606,11 +617,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ServiceInstance(self._version, payload, sid=self._solution["sid"]) @@ -823,6 +837,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -911,6 +929,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -1044,7 +1066,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ServicePage(self._version, response) async def page_async( @@ -1071,8 +1099,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ServicePage(self._version, response) diff --git a/twilio/rest/verify/v2/service/access_token.py b/twilio/rest/verify/v2/service/access_token.py index 917abbc965..45a0094e52 100644 --- a/twilio/rest/verify/v2/service/access_token.py +++ b/twilio/rest/verify/v2/service/access_token.py @@ -142,10 +142,11 @@ def fetch(self) -> AccessTokenInstance: :returns: The fetched AccessTokenInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return AccessTokenInstance( self._version, @@ -162,9 +163,12 @@ async def fetch_async(self) -> AccessTokenInstance: :returns: The fetched AccessTokenInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return AccessTokenInstance( @@ -230,6 +234,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -266,6 +274,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/verify/v2/service/entity/__init__.py b/twilio/rest/verify/v2/service/entity/__init__.py index 7371edc08f..fa4bc1df12 100644 --- a/twilio/rest/verify/v2/service/entity/__init__.py +++ b/twilio/rest/verify/v2/service/entity/__init__.py @@ -180,10 +180,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -192,9 +192,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> EntityInstance: @@ -205,10 +207,11 @@ def fetch(self) -> EntityInstance: :returns: The fetched EntityInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return EntityInstance( self._version, @@ -225,9 +228,12 @@ async def fetch_async(self) -> EntityInstance: :returns: The fetched EntityInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return EntityInstance( @@ -341,6 +347,10 @@ def create(self, identity: str) -> EntityInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -365,6 +375,10 @@ async def create_async(self, identity: str) -> EntityInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -500,7 +514,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return EntityPage(self._version, response, self._solution) async def page_async( @@ -527,8 +547,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return EntityPage(self._version, response, self._solution) diff --git a/twilio/rest/verify/v2/service/entity/challenge/__init__.py b/twilio/rest/verify/v2/service/entity/challenge/__init__.py index 9ca2e4089b..146a95d959 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/__init__.py +++ b/twilio/rest/verify/v2/service/entity/challenge/__init__.py @@ -238,10 +238,11 @@ def fetch(self) -> ChallengeInstance: :returns: The fetched ChallengeInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ChallengeInstance( self._version, @@ -259,9 +260,12 @@ async def fetch_async(self) -> ChallengeInstance: :returns: The fetched ChallengeInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ChallengeInstance( @@ -285,17 +289,21 @@ def update( :returns: The updated ChallengeInstance """ + data = values.of( { "AuthPayload": auth_payload, "Metadata": serialize.object(metadata), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChallengeInstance( @@ -319,17 +327,21 @@ async def update_async( :returns: The updated ChallengeInstance """ + data = values.of( { "AuthPayload": auth_payload, "Metadata": serialize.object(metadata), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ChallengeInstance( @@ -446,6 +458,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -493,6 +509,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -680,7 +700,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ChallengePage(self._version, response, self._solution) async def page_async( @@ -716,8 +742,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ChallengePage(self._version, response, self._solution) diff --git a/twilio/rest/verify/v2/service/entity/challenge/notification.py b/twilio/rest/verify/v2/service/entity/challenge/notification.py index eadf42b81d..3802cc1a08 100644 --- a/twilio/rest/verify/v2/service/entity/challenge/notification.py +++ b/twilio/rest/verify/v2/service/entity/challenge/notification.py @@ -114,6 +114,10 @@ def create(self, ttl: Union[int, object] = values.unset) -> NotificationInstance ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -144,6 +148,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/verify/v2/service/entity/factor.py b/twilio/rest/verify/v2/service/entity/factor.py index 8900fcbfc2..7bf91cd870 100644 --- a/twilio/rest/verify/v2/service/entity/factor.py +++ b/twilio/rest/verify/v2/service/entity/factor.py @@ -261,10 +261,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -273,9 +273,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> FactorInstance: @@ -286,10 +288,11 @@ def fetch(self) -> FactorInstance: :returns: The fetched FactorInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return FactorInstance( self._version, @@ -307,9 +310,12 @@ async def fetch_async(self) -> FactorInstance: :returns: The fetched FactorInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return FactorInstance( @@ -347,6 +353,7 @@ def update( :returns: The updated FactorInstance """ + data = values.of( { "AuthPayload": auth_payload, @@ -360,11 +367,14 @@ def update( "Config.NotificationPlatform": config_notification_platform, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FactorInstance( @@ -402,6 +412,7 @@ async def update_async( :returns: The updated FactorInstance """ + data = values.of( { "AuthPayload": auth_payload, @@ -415,11 +426,14 @@ async def update_async( "Config.NotificationPlatform": config_notification_platform, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return FactorInstance( @@ -613,7 +627,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return FactorPage(self._version, response, self._solution) async def page_async( @@ -640,8 +660,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return FactorPage(self._version, response, self._solution) diff --git a/twilio/rest/verify/v2/service/entity/new_factor.py b/twilio/rest/verify/v2/service/entity/new_factor.py index c88a945853..2a2d77d512 100644 --- a/twilio/rest/verify/v2/service/entity/new_factor.py +++ b/twilio/rest/verify/v2/service/entity/new_factor.py @@ -183,6 +183,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -254,6 +258,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/verify/v2/service/messaging_configuration.py b/twilio/rest/verify/v2/service/messaging_configuration.py index b841770331..03f494f6e9 100644 --- a/twilio/rest/verify/v2/service/messaging_configuration.py +++ b/twilio/rest/verify/v2/service/messaging_configuration.py @@ -176,10 +176,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -188,9 +188,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> MessagingConfigurationInstance: @@ -201,10 +203,11 @@ def fetch(self) -> MessagingConfigurationInstance: :returns: The fetched MessagingConfigurationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return MessagingConfigurationInstance( self._version, @@ -221,9 +224,12 @@ async def fetch_async(self) -> MessagingConfigurationInstance: :returns: The fetched MessagingConfigurationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return MessagingConfigurationInstance( @@ -241,16 +247,20 @@ def update(self, messaging_service_sid: str) -> MessagingConfigurationInstance: :returns: The updated MessagingConfigurationInstance """ + data = values.of( { "MessagingServiceSid": messaging_service_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessagingConfigurationInstance( @@ -270,16 +280,20 @@ async def update_async( :returns: The updated MessagingConfigurationInstance """ + data = values.of( { "MessagingServiceSid": messaging_service_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return MessagingConfigurationInstance( @@ -360,6 +374,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -388,6 +406,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -523,7 +545,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return MessagingConfigurationPage(self._version, response, self._solution) async def page_async( @@ -550,8 +578,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return MessagingConfigurationPage(self._version, response, self._solution) diff --git a/twilio/rest/verify/v2/service/rate_limit/__init__.py b/twilio/rest/verify/v2/service/rate_limit/__init__.py index bdd165858a..ced5ab6a64 100644 --- a/twilio/rest/verify/v2/service/rate_limit/__init__.py +++ b/twilio/rest/verify/v2/service/rate_limit/__init__.py @@ -190,10 +190,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -202,9 +202,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RateLimitInstance: @@ -215,10 +217,11 @@ def fetch(self) -> RateLimitInstance: :returns: The fetched RateLimitInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RateLimitInstance( self._version, @@ -235,9 +238,12 @@ async def fetch_async(self) -> RateLimitInstance: :returns: The fetched RateLimitInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RateLimitInstance( @@ -257,16 +263,20 @@ def update( :returns: The updated RateLimitInstance """ + data = values.of( { "Description": description, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RateLimitInstance( @@ -286,16 +296,20 @@ async def update_async( :returns: The updated RateLimitInstance """ + data = values.of( { "Description": description, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RateLimitInstance( @@ -387,6 +401,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -415,6 +433,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -550,7 +572,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RateLimitPage(self._version, response, self._solution) async def page_async( @@ -577,8 +605,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RateLimitPage(self._version, response, self._solution) diff --git a/twilio/rest/verify/v2/service/rate_limit/bucket.py b/twilio/rest/verify/v2/service/rate_limit/bucket.py index dee84901e5..4ac50cfc2f 100644 --- a/twilio/rest/verify/v2/service/rate_limit/bucket.py +++ b/twilio/rest/verify/v2/service/rate_limit/bucket.py @@ -199,10 +199,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -211,9 +211,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> BucketInstance: @@ -224,10 +226,11 @@ def fetch(self) -> BucketInstance: :returns: The fetched BucketInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return BucketInstance( self._version, @@ -245,9 +248,12 @@ async def fetch_async(self) -> BucketInstance: :returns: The fetched BucketInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return BucketInstance( @@ -271,17 +277,21 @@ def update( :returns: The updated BucketInstance """ + data = values.of( { "Max": max, "Interval": interval, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BucketInstance( @@ -305,17 +315,21 @@ async def update_async( :returns: The updated BucketInstance """ + data = values.of( { "Max": max, "Interval": interval, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return BucketInstance( @@ -402,6 +416,10 @@ def create(self, max: int, interval: int) -> BucketInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -431,6 +449,10 @@ async def create_async(self, max: int, interval: int) -> BucketInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -569,7 +591,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return BucketPage(self._version, response, self._solution) async def page_async( @@ -596,8 +624,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return BucketPage(self._version, response, self._solution) diff --git a/twilio/rest/verify/v2/service/verification.py b/twilio/rest/verify/v2/service/verification.py index 23a956b65f..64988a5983 100644 --- a/twilio/rest/verify/v2/service/verification.py +++ b/twilio/rest/verify/v2/service/verification.py @@ -192,10 +192,11 @@ def fetch(self) -> VerificationInstance: :returns: The fetched VerificationInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return VerificationInstance( self._version, @@ -212,9 +213,12 @@ async def fetch_async(self) -> VerificationInstance: :returns: The fetched VerificationInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return VerificationInstance( @@ -232,16 +236,20 @@ def update(self, status: "VerificationInstance.Status") -> VerificationInstance: :returns: The updated VerificationInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VerificationInstance( @@ -261,16 +269,20 @@ async def update_async( :returns: The updated VerificationInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return VerificationInstance( @@ -380,6 +392,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -460,6 +476,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/verify/v2/service/verification_check.py b/twilio/rest/verify/v2/service/verification_check.py index fd1b3f897c..c09057ebe1 100644 --- a/twilio/rest/verify/v2/service/verification_check.py +++ b/twilio/rest/verify/v2/service/verification_check.py @@ -135,6 +135,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -177,6 +181,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/verify/v2/service/webhook.py b/twilio/rest/verify/v2/service/webhook.py index 67ffced265..dd68cf301b 100644 --- a/twilio/rest/verify/v2/service/webhook.py +++ b/twilio/rest/verify/v2/service/webhook.py @@ -227,10 +227,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -239,9 +239,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> WebhookInstance: @@ -252,10 +254,11 @@ def fetch(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return WebhookInstance( self._version, @@ -272,9 +275,12 @@ async def fetch_async(self) -> WebhookInstance: :returns: The fetched WebhookInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return WebhookInstance( @@ -303,6 +309,7 @@ def update( :returns: The updated WebhookInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -312,11 +319,14 @@ def update( "Version": version, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -345,6 +355,7 @@ async def update_async( :returns: The updated WebhookInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -354,11 +365,14 @@ async def update_async( "Version": version, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return WebhookInstance( @@ -448,6 +462,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -487,6 +505,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -622,7 +644,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return WebhookPage(self._version, response, self._solution) async def page_async( @@ -649,8 +677,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return WebhookPage(self._version, response, self._solution) diff --git a/twilio/rest/verify/v2/template.py b/twilio/rest/verify/v2/template.py index b9968eec87..5a242c153e 100644 --- a/twilio/rest/verify/v2/template.py +++ b/twilio/rest/verify/v2/template.py @@ -223,7 +223,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return TemplatePage(self._version, response) async def page_async( @@ -253,8 +259,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return TemplatePage(self._version, response) diff --git a/twilio/rest/verify/v2/verification_attempt.py b/twilio/rest/verify/v2/verification_attempt.py index 2c1f914d32..5c6989348a 100644 --- a/twilio/rest/verify/v2/verification_attempt.py +++ b/twilio/rest/verify/v2/verification_attempt.py @@ -146,10 +146,11 @@ def fetch(self) -> VerificationAttemptInstance: :returns: The fetched VerificationAttemptInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return VerificationAttemptInstance( self._version, @@ -165,9 +166,12 @@ async def fetch_async(self) -> VerificationAttemptInstance: :returns: The fetched VerificationAttemptInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return VerificationAttemptInstance( @@ -479,7 +483,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return VerificationAttemptPage(self._version, response) async def page_async( @@ -532,8 +542,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return VerificationAttemptPage(self._version, response) diff --git a/twilio/rest/verify/v2/verification_attempts_summary.py b/twilio/rest/verify/v2/verification_attempts_summary.py index 1f2d3d3955..429e9f70bc 100644 --- a/twilio/rest/verify/v2/verification_attempts_summary.py +++ b/twilio/rest/verify/v2/verification_attempts_summary.py @@ -191,7 +191,13 @@ def fetch( } ) - payload = self._version.fetch(method="GET", uri=self._uri, params=data) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch( + method="GET", uri=self._uri, params=data, headers=headers + ) return VerificationAttemptsSummaryInstance( self._version, @@ -233,8 +239,12 @@ async def fetch_async( } ) + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return VerificationAttemptsSummaryInstance( diff --git a/twilio/rest/video/v1/composition.py b/twilio/rest/video/v1/composition.py index 8add1e74e5..06f4d05f5f 100644 --- a/twilio/rest/video/v1/composition.py +++ b/twilio/rest/video/v1/composition.py @@ -188,10 +188,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -200,9 +200,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CompositionInstance: @@ -213,10 +215,11 @@ def fetch(self) -> CompositionInstance: :returns: The fetched CompositionInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CompositionInstance( self._version, @@ -232,9 +235,12 @@ async def fetch_async(self) -> CompositionInstance: :returns: The fetched CompositionInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CompositionInstance( @@ -330,6 +336,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -381,6 +391,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -578,7 +592,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CompositionPage(self._version, response) async def page_async( @@ -617,8 +637,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CompositionPage(self._version, response) diff --git a/twilio/rest/video/v1/composition_hook.py b/twilio/rest/video/v1/composition_hook.py index 0f833f793f..30fead17b0 100644 --- a/twilio/rest/video/v1/composition_hook.py +++ b/twilio/rest/video/v1/composition_hook.py @@ -249,10 +249,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -261,9 +261,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CompositionHookInstance: @@ -274,10 +276,11 @@ def fetch(self) -> CompositionHookInstance: :returns: The fetched CompositionHookInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CompositionHookInstance( self._version, @@ -293,9 +296,12 @@ async def fetch_async(self) -> CompositionHookInstance: :returns: The fetched CompositionHookInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CompositionHookInstance( @@ -333,6 +339,7 @@ def update( :returns: The updated CompositionHookInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -349,11 +356,14 @@ def update( "StatusCallbackMethod": status_callback_method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CompositionHookInstance( @@ -389,6 +399,7 @@ async def update_async( :returns: The updated CompositionHookInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -405,11 +416,14 @@ async def update_async( "StatusCallbackMethod": status_callback_method, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return CompositionHookInstance( @@ -506,6 +520,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -560,6 +578,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -757,7 +779,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CompositionHookPage(self._version, response) async def page_async( @@ -796,8 +824,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CompositionHookPage(self._version, response) diff --git a/twilio/rest/video/v1/composition_settings.py b/twilio/rest/video/v1/composition_settings.py index 366ec727cf..384ae692e8 100644 --- a/twilio/rest/video/v1/composition_settings.py +++ b/twilio/rest/video/v1/composition_settings.py @@ -242,10 +242,11 @@ def fetch(self) -> CompositionSettingsInstance: :returns: The fetched CompositionSettingsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CompositionSettingsInstance( self._version, @@ -260,9 +261,12 @@ async def fetch_async(self) -> CompositionSettingsInstance: :returns: The fetched CompositionSettingsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CompositionSettingsInstance( diff --git a/twilio/rest/video/v1/recording.py b/twilio/rest/video/v1/recording.py index 20c836d2b0..f474345fe0 100644 --- a/twilio/rest/video/v1/recording.py +++ b/twilio/rest/video/v1/recording.py @@ -188,10 +188,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -200,9 +200,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RecordingInstance: @@ -213,10 +215,11 @@ def fetch(self) -> RecordingInstance: :returns: The fetched RecordingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RecordingInstance( self._version, @@ -232,9 +235,12 @@ async def fetch_async(self) -> RecordingInstance: :returns: The fetched RecordingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RecordingInstance( @@ -506,7 +512,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RecordingPage(self._version, response) async def page_async( @@ -551,8 +563,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RecordingPage(self._version, response) diff --git a/twilio/rest/video/v1/recording_settings.py b/twilio/rest/video/v1/recording_settings.py index 3895b9d4ba..46259b6cf8 100644 --- a/twilio/rest/video/v1/recording_settings.py +++ b/twilio/rest/video/v1/recording_settings.py @@ -242,10 +242,11 @@ def fetch(self) -> RecordingSettingsInstance: :returns: The fetched RecordingSettingsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RecordingSettingsInstance( self._version, @@ -260,9 +261,12 @@ async def fetch_async(self) -> RecordingSettingsInstance: :returns: The fetched RecordingSettingsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RecordingSettingsInstance( diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index 4a6822c94b..0fb7a7b0dd 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -243,10 +243,11 @@ def fetch(self) -> RoomInstance: :returns: The fetched RoomInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RoomInstance( self._version, @@ -262,9 +263,12 @@ async def fetch_async(self) -> RoomInstance: :returns: The fetched RoomInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RoomInstance( @@ -281,16 +285,20 @@ def update(self, status: "RoomInstance.RoomStatus") -> RoomInstance: :returns: The updated RoomInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoomInstance(self._version, payload, sid=self._solution["sid"]) @@ -303,16 +311,20 @@ async def update_async(self, status: "RoomInstance.RoomStatus") -> RoomInstance: :returns: The updated RoomInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RoomInstance(self._version, payload, sid=self._solution["sid"]) @@ -458,6 +470,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -527,6 +543,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -724,7 +744,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RoomPage(self._version, response) async def page_async( @@ -763,8 +789,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RoomPage(self._version, response) diff --git a/twilio/rest/video/v1/room/participant/__init__.py b/twilio/rest/video/v1/room/participant/__init__.py index 145d95429a..756a166eae 100644 --- a/twilio/rest/video/v1/room/participant/__init__.py +++ b/twilio/rest/video/v1/room/participant/__init__.py @@ -215,10 +215,11 @@ def fetch(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ParticipantInstance( self._version, @@ -235,9 +236,12 @@ async def fetch_async(self) -> ParticipantInstance: :returns: The fetched ParticipantInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ParticipantInstance( @@ -257,16 +261,20 @@ def update( :returns: The updated ParticipantInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( @@ -286,16 +294,20 @@ async def update_async( :returns: The updated ParticipantInstance """ + data = values.of( { "Status": status, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ParticipantInstance( @@ -597,7 +609,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ParticipantPage(self._version, response, self._solution) async def page_async( @@ -636,8 +654,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ParticipantPage(self._version, response, self._solution) diff --git a/twilio/rest/video/v1/room/participant/anonymize.py b/twilio/rest/video/v1/room/participant/anonymize.py index e9a7f1383e..0560d3eff4 100644 --- a/twilio/rest/video/v1/room/participant/anonymize.py +++ b/twilio/rest/video/v1/room/participant/anonymize.py @@ -144,12 +144,14 @@ def update(self) -> AnonymizeInstance: :returns: The updated AnonymizeInstance """ + data = values.of({}) + headers = values.of({}) + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AnonymizeInstance( @@ -166,12 +168,14 @@ async def update_async(self) -> AnonymizeInstance: :returns: The updated AnonymizeInstance """ + data = values.of({}) + headers = values.of({}) + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return AnonymizeInstance( diff --git a/twilio/rest/video/v1/room/participant/published_track.py b/twilio/rest/video/v1/room/participant/published_track.py index 1fa84827b6..a766b276ab 100644 --- a/twilio/rest/video/v1/room/participant/published_track.py +++ b/twilio/rest/video/v1/room/participant/published_track.py @@ -148,10 +148,11 @@ def fetch(self) -> PublishedTrackInstance: :returns: The fetched PublishedTrackInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return PublishedTrackInstance( self._version, @@ -169,9 +170,12 @@ async def fetch_async(self) -> PublishedTrackInstance: :returns: The fetched PublishedTrackInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return PublishedTrackInstance( @@ -367,7 +371,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return PublishedTrackPage(self._version, response, self._solution) async def page_async( @@ -394,8 +404,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return PublishedTrackPage(self._version, response, self._solution) diff --git a/twilio/rest/video/v1/room/participant/subscribe_rules.py b/twilio/rest/video/v1/room/participant/subscribe_rules.py index a155038493..992f8a374b 100644 --- a/twilio/rest/video/v1/room/participant/subscribe_rules.py +++ b/twilio/rest/video/v1/room/participant/subscribe_rules.py @@ -97,6 +97,8 @@ def fetch(self) -> SubscribeRulesInstance: """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SubscribeRulesInstance( @@ -115,6 +117,8 @@ async def fetch_async(self) -> SubscribeRulesInstance: """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( method="GET", uri=self._uri, headers=headers ) @@ -144,6 +148,10 @@ def update( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers ) @@ -173,6 +181,10 @@ async def update_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/video/v1/room/participant/subscribed_track.py b/twilio/rest/video/v1/room/participant/subscribed_track.py index 7c915095ec..8baea148dc 100644 --- a/twilio/rest/video/v1/room/participant/subscribed_track.py +++ b/twilio/rest/video/v1/room/participant/subscribed_track.py @@ -150,10 +150,11 @@ def fetch(self) -> SubscribedTrackInstance: :returns: The fetched SubscribedTrackInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SubscribedTrackInstance( self._version, @@ -171,9 +172,12 @@ async def fetch_async(self) -> SubscribedTrackInstance: :returns: The fetched SubscribedTrackInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SubscribedTrackInstance( @@ -369,7 +373,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SubscribedTrackPage(self._version, response, self._solution) async def page_async( @@ -396,8 +406,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SubscribedTrackPage(self._version, response, self._solution) diff --git a/twilio/rest/video/v1/room/recording_rules.py b/twilio/rest/video/v1/room/recording_rules.py index f85ebe896e..d79d465c28 100644 --- a/twilio/rest/video/v1/room/recording_rules.py +++ b/twilio/rest/video/v1/room/recording_rules.py @@ -82,6 +82,8 @@ def fetch(self) -> RecordingRulesInstance: """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RecordingRulesInstance( @@ -97,6 +99,8 @@ async def fetch_async(self) -> RecordingRulesInstance: """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( method="GET", uri=self._uri, headers=headers ) @@ -123,6 +127,10 @@ def update( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.update( method="POST", uri=self._uri, data=data, headers=headers ) @@ -149,6 +157,10 @@ async def update_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.update_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/video/v1/room/room_recording.py b/twilio/rest/video/v1/room/room_recording.py index db67f29947..21d433ce38 100644 --- a/twilio/rest/video/v1/room/room_recording.py +++ b/twilio/rest/video/v1/room/room_recording.py @@ -192,10 +192,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -204,9 +204,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RoomRecordingInstance: @@ -217,10 +219,11 @@ def fetch(self) -> RoomRecordingInstance: :returns: The fetched RoomRecordingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RoomRecordingInstance( self._version, @@ -237,9 +240,12 @@ async def fetch_async(self) -> RoomRecordingInstance: :returns: The fetched RoomRecordingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RoomRecordingInstance( @@ -489,7 +495,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RoomRecordingPage(self._version, response, self._solution) async def page_async( @@ -528,8 +540,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RoomRecordingPage(self._version, response, self._solution) diff --git a/twilio/rest/voice/v1/archived_call.py b/twilio/rest/voice/v1/archived_call.py index ec8a5bb68e..939f1a03e2 100644 --- a/twilio/rest/voice/v1/archived_call.py +++ b/twilio/rest/voice/v1/archived_call.py @@ -13,6 +13,7 @@ """ from datetime import date +from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.list_resource import ListResource @@ -45,10 +46,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -57,9 +58,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def __repr__(self) -> str: diff --git a/twilio/rest/voice/v1/byoc_trunk.py b/twilio/rest/voice/v1/byoc_trunk.py index 1c3e301d7a..304bdd78a5 100644 --- a/twilio/rest/voice/v1/byoc_trunk.py +++ b/twilio/rest/voice/v1/byoc_trunk.py @@ -242,10 +242,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -254,9 +254,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ByocTrunkInstance: @@ -267,10 +269,11 @@ def fetch(self) -> ByocTrunkInstance: :returns: The fetched ByocTrunkInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ByocTrunkInstance( self._version, @@ -286,9 +289,12 @@ async def fetch_async(self) -> ByocTrunkInstance: :returns: The fetched ByocTrunkInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ByocTrunkInstance( @@ -326,6 +332,7 @@ def update( :returns: The updated ByocTrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -340,11 +347,14 @@ def update( "FromDomainSid": from_domain_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ByocTrunkInstance(self._version, payload, sid=self._solution["sid"]) @@ -378,6 +388,7 @@ async def update_async( :returns: The updated ByocTrunkInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -392,11 +403,14 @@ async def update_async( "FromDomainSid": from_domain_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ByocTrunkInstance(self._version, payload, sid=self._solution["sid"]) @@ -489,6 +503,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -541,6 +559,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -674,7 +696,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ByocTrunkPage(self._version, response) async def page_async( @@ -701,8 +729,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ByocTrunkPage(self._version, response) diff --git a/twilio/rest/voice/v1/connection_policy/__init__.py b/twilio/rest/voice/v1/connection_policy/__init__.py index 4e65be6519..e2a56929c7 100644 --- a/twilio/rest/voice/v1/connection_policy/__init__.py +++ b/twilio/rest/voice/v1/connection_policy/__init__.py @@ -180,10 +180,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -192,9 +192,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ConnectionPolicyInstance: @@ -205,10 +207,11 @@ def fetch(self) -> ConnectionPolicyInstance: :returns: The fetched ConnectionPolicyInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ConnectionPolicyInstance( self._version, @@ -224,9 +227,12 @@ async def fetch_async(self) -> ConnectionPolicyInstance: :returns: The fetched ConnectionPolicyInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ConnectionPolicyInstance( @@ -245,16 +251,20 @@ def update( :returns: The updated ConnectionPolicyInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyInstance( @@ -271,16 +281,20 @@ async def update_async( :returns: The updated ConnectionPolicyInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyInstance( @@ -359,6 +373,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -383,6 +401,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -516,7 +538,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConnectionPolicyPage(self._version, response) async def page_async( @@ -543,8 +571,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConnectionPolicyPage(self._version, response) diff --git a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py index 05daee6c79..03f4fd607d 100644 --- a/twilio/rest/voice/v1/connection_policy/connection_policy_target.py +++ b/twilio/rest/voice/v1/connection_policy/connection_policy_target.py @@ -212,10 +212,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -224,9 +224,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> ConnectionPolicyTargetInstance: @@ -237,10 +239,11 @@ def fetch(self) -> ConnectionPolicyTargetInstance: :returns: The fetched ConnectionPolicyTargetInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return ConnectionPolicyTargetInstance( self._version, @@ -257,9 +260,12 @@ async def fetch_async(self) -> ConnectionPolicyTargetInstance: :returns: The fetched ConnectionPolicyTargetInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return ConnectionPolicyTargetInstance( @@ -288,6 +294,7 @@ def update( :returns: The updated ConnectionPolicyTargetInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -297,11 +304,14 @@ def update( "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyTargetInstance( @@ -330,6 +340,7 @@ async def update_async( :returns: The updated ConnectionPolicyTargetInstance """ + data = values.of( { "FriendlyName": friendly_name, @@ -339,11 +350,14 @@ async def update_async( "Enabled": serialize.boolean_to_string(enabled), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return ConnectionPolicyTargetInstance( @@ -437,6 +451,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -478,6 +496,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -615,7 +637,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return ConnectionPolicyTargetPage(self._version, response, self._solution) async def page_async( @@ -642,8 +670,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return ConnectionPolicyTargetPage(self._version, response, self._solution) diff --git a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py index 5b0d35d3d2..4059be8dd7 100644 --- a/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py +++ b/twilio/rest/voice/v1/dialing_permissions/bulk_country_update.py @@ -73,6 +73,10 @@ def create(self, update_request: str) -> BulkCountryUpdateInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -95,6 +99,10 @@ async def create_async(self, update_request: str) -> BulkCountryUpdateInstance: ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) diff --git a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py index 2b9285c112..6a60c23a2f 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/__init__.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/__init__.py @@ -140,10 +140,11 @@ def fetch(self) -> CountryInstance: :returns: The fetched CountryInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CountryInstance( self._version, @@ -159,9 +160,12 @@ async def fetch_async(self) -> CountryInstance: :returns: The fetched CountryInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CountryInstance( @@ -451,7 +455,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CountryPage(self._version, response) async def page_async( @@ -502,8 +512,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CountryPage(self._version, response) diff --git a/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py b/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py index 9303f2c9ae..75300e928c 100644 --- a/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py +++ b/twilio/rest/voice/v1/dialing_permissions/country/highrisk_special_prefix.py @@ -215,7 +215,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return HighriskSpecialPrefixPage(self._version, response, self._solution) async def page_async( @@ -242,8 +248,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return HighriskSpecialPrefixPage(self._version, response, self._solution) diff --git a/twilio/rest/voice/v1/dialing_permissions/settings.py b/twilio/rest/voice/v1/dialing_permissions/settings.py index 20d845673a..9e7aa0babb 100644 --- a/twilio/rest/voice/v1/dialing_permissions/settings.py +++ b/twilio/rest/voice/v1/dialing_permissions/settings.py @@ -126,10 +126,11 @@ def fetch(self) -> SettingsInstance: :returns: The fetched SettingsInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SettingsInstance( self._version, @@ -144,9 +145,12 @@ async def fetch_async(self) -> SettingsInstance: :returns: The fetched SettingsInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SettingsInstance( @@ -164,6 +168,7 @@ def update( :returns: The updated SettingsInstance """ + data = values.of( { "DialingPermissionsInheritance": serialize.boolean_to_string( @@ -171,11 +176,14 @@ def update( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SettingsInstance(self._version, payload) @@ -190,6 +198,7 @@ async def update_async( :returns: The updated SettingsInstance """ + data = values.of( { "DialingPermissionsInheritance": serialize.boolean_to_string( @@ -197,11 +206,14 @@ async def update_async( ), } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SettingsInstance(self._version, payload) diff --git a/twilio/rest/voice/v1/ip_record.py b/twilio/rest/voice/v1/ip_record.py index 5c103bf98e..05e9741fa5 100644 --- a/twilio/rest/voice/v1/ip_record.py +++ b/twilio/rest/voice/v1/ip_record.py @@ -172,10 +172,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -184,9 +184,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> IpRecordInstance: @@ -197,10 +199,11 @@ def fetch(self) -> IpRecordInstance: :returns: The fetched IpRecordInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return IpRecordInstance( self._version, @@ -216,9 +219,12 @@ async def fetch_async(self) -> IpRecordInstance: :returns: The fetched IpRecordInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return IpRecordInstance( @@ -237,16 +243,20 @@ def update( :returns: The updated IpRecordInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpRecordInstance(self._version, payload, sid=self._solution["sid"]) @@ -261,16 +271,20 @@ async def update_async( :returns: The updated IpRecordInstance """ + data = values.of( { "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return IpRecordInstance(self._version, payload, sid=self._solution["sid"]) @@ -342,6 +356,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -373,6 +391,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -506,7 +528,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return IpRecordPage(self._version, response) async def page_async( @@ -533,8 +561,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return IpRecordPage(self._version, response) diff --git a/twilio/rest/voice/v1/source_ip_mapping.py b/twilio/rest/voice/v1/source_ip_mapping.py index 50e2bbe361..749d2b0034 100644 --- a/twilio/rest/voice/v1/source_ip_mapping.py +++ b/twilio/rest/voice/v1/source_ip_mapping.py @@ -162,10 +162,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -174,9 +174,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SourceIpMappingInstance: @@ -187,10 +189,11 @@ def fetch(self) -> SourceIpMappingInstance: :returns: The fetched SourceIpMappingInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SourceIpMappingInstance( self._version, @@ -206,9 +209,12 @@ async def fetch_async(self) -> SourceIpMappingInstance: :returns: The fetched SourceIpMappingInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SourceIpMappingInstance( @@ -225,16 +231,20 @@ def update(self, sip_domain_sid: str) -> SourceIpMappingInstance: :returns: The updated SourceIpMappingInstance """ + data = values.of( { "SipDomainSid": sip_domain_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SourceIpMappingInstance( @@ -249,16 +259,20 @@ async def update_async(self, sip_domain_sid: str) -> SourceIpMappingInstance: :returns: The updated SourceIpMappingInstance """ + data = values.of( { "SipDomainSid": sip_domain_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SourceIpMappingInstance( @@ -327,6 +341,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -353,6 +371,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -486,7 +508,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SourceIpMappingPage(self._version, response) async def page_async( @@ -513,8 +541,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SourceIpMappingPage(self._version, response) diff --git a/twilio/rest/wireless/v1/command.py b/twilio/rest/wireless/v1/command.py index 3dc78e9b8f..a6e8f0b39d 100644 --- a/twilio/rest/wireless/v1/command.py +++ b/twilio/rest/wireless/v1/command.py @@ -174,10 +174,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -186,9 +186,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> CommandInstance: @@ -199,10 +201,11 @@ def fetch(self) -> CommandInstance: :returns: The fetched CommandInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return CommandInstance( self._version, @@ -218,9 +221,12 @@ async def fetch_async(self) -> CommandInstance: :returns: The fetched CommandInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return CommandInstance( @@ -310,6 +316,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -355,6 +365,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -552,7 +566,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return CommandPage(self._version, response) async def page_async( @@ -591,8 +611,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return CommandPage(self._version, response) diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index 5370ef2ae3..458ade0ad5 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -202,10 +202,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -214,9 +214,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> RatePlanInstance: @@ -227,10 +229,11 @@ def fetch(self) -> RatePlanInstance: :returns: The fetched RatePlanInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return RatePlanInstance( self._version, @@ -246,9 +249,12 @@ async def fetch_async(self) -> RatePlanInstance: :returns: The fetched RatePlanInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return RatePlanInstance( @@ -270,17 +276,21 @@ def update( :returns: The updated RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload, sid=self._solution["sid"]) @@ -298,17 +308,21 @@ async def update_async( :returns: The updated RatePlanInstance """ + data = values.of( { "UniqueName": unique_name, "FriendlyName": friendly_name, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return RatePlanInstance(self._version, payload, sid=self._solution["sid"]) @@ -408,6 +422,10 @@ def create( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = self._version.create( method="POST", uri=self._uri, data=data, headers=headers ) @@ -467,6 +485,10 @@ async def create_async( ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + payload = await self._version.create_async( method="POST", uri=self._uri, data=data, headers=headers ) @@ -600,7 +622,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return RatePlanPage(self._version, response) async def page_async( @@ -627,8 +655,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return RatePlanPage(self._version, response) diff --git a/twilio/rest/wireless/v1/sim/__init__.py b/twilio/rest/wireless/v1/sim/__init__.py index f0d21c447e..cba0eeec71 100644 --- a/twilio/rest/wireless/v1/sim/__init__.py +++ b/twilio/rest/wireless/v1/sim/__init__.py @@ -343,10 +343,10 @@ def delete(self) -> bool: :returns: True if delete succeeds, False otherwise """ - return self._version.delete( - method="DELETE", - uri=self._uri, - ) + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) async def delete_async(self) -> bool: """ @@ -355,9 +355,11 @@ async def delete_async(self) -> bool: :returns: True if delete succeeds, False otherwise """ + + headers = values.of({}) + return await self._version.delete_async( - method="DELETE", - uri=self._uri, + method="DELETE", uri=self._uri, headers=headers ) def fetch(self) -> SimInstance: @@ -368,10 +370,11 @@ def fetch(self) -> SimInstance: :returns: The fetched SimInstance """ - payload = self._version.fetch( - method="GET", - uri=self._uri, - ) + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) return SimInstance( self._version, @@ -387,9 +390,12 @@ async def fetch_async(self) -> SimInstance: :returns: The fetched SimInstance """ + headers = values.of({}) + + headers["Accept"] = "application/json" + payload = await self._version.fetch_async( - method="GET", - uri=self._uri, + method="GET", uri=self._uri, headers=headers ) return SimInstance( @@ -443,6 +449,7 @@ def update( :returns: The updated SimInstance """ + data = values.of( { "UniqueName": unique_name, @@ -465,11 +472,14 @@ def update( "AccountSid": account_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = self._version.update( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SimInstance(self._version, payload, sid=self._solution["sid"]) @@ -519,6 +529,7 @@ async def update_async( :returns: The updated SimInstance """ + data = values.of( { "UniqueName": unique_name, @@ -541,11 +552,14 @@ async def update_async( "AccountSid": account_sid, } ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" payload = await self._version.update_async( - method="POST", - uri=self._uri, - data=data, + method="POST", uri=self._uri, data=data, headers=headers ) return SimInstance(self._version, payload, sid=self._solution["sid"]) @@ -822,7 +836,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return SimPage(self._version, response) async def page_async( @@ -864,8 +884,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return SimPage(self._version, response) diff --git a/twilio/rest/wireless/v1/sim/data_session.py b/twilio/rest/wireless/v1/sim/data_session.py index 649eb49631..b4c50d608d 100644 --- a/twilio/rest/wireless/v1/sim/data_session.py +++ b/twilio/rest/wireless/v1/sim/data_session.py @@ -252,7 +252,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return DataSessionPage(self._version, response, self._solution) async def page_async( @@ -279,8 +285,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return DataSessionPage(self._version, response, self._solution) diff --git a/twilio/rest/wireless/v1/sim/usage_record.py b/twilio/rest/wireless/v1/sim/usage_record.py index 8b1db6d0da..1cd26b6c2e 100644 --- a/twilio/rest/wireless/v1/sim/usage_record.py +++ b/twilio/rest/wireless/v1/sim/usage_record.py @@ -269,7 +269,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UsageRecordPage(self._version, response, self._solution) async def page_async( @@ -305,8 +311,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UsageRecordPage(self._version, response, self._solution) diff --git a/twilio/rest/wireless/v1/usage_record.py b/twilio/rest/wireless/v1/usage_record.py index 43e34469ce..07135cf98b 100644 --- a/twilio/rest/wireless/v1/usage_record.py +++ b/twilio/rest/wireless/v1/usage_record.py @@ -256,7 +256,13 @@ def page( } ) - response = self._version.page(method="GET", uri=self._uri, params=data) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) return UsageRecordPage(self._version, response) async def page_async( @@ -292,8 +298,12 @@ async def page_async( } ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + response = await self._version.page_async( - method="GET", uri=self._uri, params=data + method="GET", uri=self._uri, params=data, headers=headers ) return UsageRecordPage(self._version, response) From e256e92103cf1aa03d9c85fd89ed9a3bb3cac7b0 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 12 Dec 2024 17:12:01 +0000 Subject: [PATCH 069/113] Release 9.4.0 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 016e3b95ca..08c45fb9b8 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.3.8", + version="9.4.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index a574bfeb0c..fef80b04ae 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "3", "8") +__version_info__ = ("9", "4", "0") __version__ = ".".join(__version_info__) From 541b312371aaac418f5180141847094db9e1a4c0 Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 13 Dec 2024 11:18:41 +0530 Subject: [PATCH 070/113] chore: fix orgs api changes (#826) --- twilio/rest/preview_iam/__init__.py | 68 +- .../preview_iam/organizations/__init__.py | 59 - .../rest/preview_iam/organizations/account.py | 436 ------- .../organizations/role_assignment.py | 588 --------- twilio/rest/preview_iam/organizations/user.py | 1052 ----------------- 5 files changed, 17 insertions(+), 2186 deletions(-) delete mode 100644 twilio/rest/preview_iam/organizations/__init__.py delete mode 100644 twilio/rest/preview_iam/organizations/account.py delete mode 100644 twilio/rest/preview_iam/organizations/role_assignment.py delete mode 100644 twilio/rest/preview_iam/organizations/user.py diff --git a/twilio/rest/preview_iam/__init__.py b/twilio/rest/preview_iam/__init__.py index dd51b97489..9103436220 100644 --- a/twilio/rest/preview_iam/__init__.py +++ b/twilio/rest/preview_iam/__init__.py @@ -1,59 +1,25 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ +from twilio.rest.preview_iam.PreviewIamBase import PreviewIamBase - Organization Public API - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) +from twilio.rest.preview_iam.v1.authorize import ( + AuthorizeList, +) +from twilio.rest.preview_iam.v1.token import ( + TokenList, +) +from twilio.rest.preview_iam.versionless.organization import ( + OrganizationList, +) - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.preview_iam.organizations.account import AccountList -from twilio.rest.preview_iam.organizations.role_assignment import RoleAssignmentList -from twilio.rest.preview_iam.organizations.user import UserList - - -class Organizations(Version): - - def __init__(self, domain: Domain): - """ - Initialize the Organizations version of PreviewIam - - :param domain: The Twilio.preview_iam domain - """ - super().__init__(domain, "Organizations") - self._accounts: Optional[AccountList] = None - self._role_assignments: Optional[RoleAssignmentList] = None - self._users: Optional[UserList] = None +class PreviewIam(PreviewIamBase): @property - def accounts(self) -> AccountList: - if self._accounts is None: - self._accounts = AccountList(self) - return self._accounts + def organization(self) -> OrganizationList: + return self.versionless.organization @property - def role_assignments(self) -> RoleAssignmentList: - if self._role_assignments is None: - self._role_assignments = RoleAssignmentList(self) - return self._role_assignments + def authorize(self) -> AuthorizeList: + return self.v1.authorize @property - def users(self) -> UserList: - if self._users is None: - self._users = UserList(self) - return self._users - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" + def token(self) -> TokenList: + return self.v1.token diff --git a/twilio/rest/preview_iam/organizations/__init__.py b/twilio/rest/preview_iam/organizations/__init__.py deleted file mode 100644 index dd51b97489..0000000000 --- a/twilio/rest/preview_iam/organizations/__init__.py +++ /dev/null @@ -1,59 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Organization Public API - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.preview_iam.organizations.account import AccountList -from twilio.rest.preview_iam.organizations.role_assignment import RoleAssignmentList -from twilio.rest.preview_iam.organizations.user import UserList - - -class Organizations(Version): - - def __init__(self, domain: Domain): - """ - Initialize the Organizations version of PreviewIam - - :param domain: The Twilio.preview_iam domain - """ - super().__init__(domain, "Organizations") - self._accounts: Optional[AccountList] = None - self._role_assignments: Optional[RoleAssignmentList] = None - self._users: Optional[UserList] = None - - @property - def accounts(self) -> AccountList: - if self._accounts is None: - self._accounts = AccountList(self) - return self._accounts - - @property - def role_assignments(self) -> RoleAssignmentList: - if self._role_assignments is None: - self._role_assignments = RoleAssignmentList(self) - return self._role_assignments - - @property - def users(self) -> UserList: - if self._users is None: - self._users = UserList(self) - return self._users - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview_iam/organizations/account.py b/twilio/rest/preview_iam/organizations/account.py deleted file mode 100644 index bc5f49e28f..0000000000 --- a/twilio/rest/preview_iam/organizations/account.py +++ /dev/null @@ -1,436 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Organization Public API - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class AccountInstance(InstanceResource): - """ - :ivar account_sid: Twilio account sid - :ivar friendly_name: Account friendly name - :ivar status: Account status - :ivar owner_sid: Twilio account sid - :ivar date_created: The date and time when the account was created in the system - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - organization_sid: Optional[str] = None, - account_sid: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.status: Optional[str] = payload.get("status") - self.owner_sid: Optional[str] = payload.get("owner_sid") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - - self._solution = { - "organization_sid": organization_sid or self.organization_sid, - "account_sid": account_sid or self.account_sid, - } - self._context: Optional[AccountContext] = None - - @property - def _proxy(self) -> "AccountContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AccountContext for this AccountInstance - """ - if self._context is None: - self._context = AccountContext( - self._version, - organization_sid=self._solution["organization_sid"], - account_sid=self._solution["account_sid"], - ) - return self._context - - def fetch(self) -> "AccountInstance": - """ - Fetch the AccountInstance - - - :returns: The fetched AccountInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AccountInstance": - """ - Asynchronous coroutine to fetch the AccountInstance - - - :returns: The fetched AccountInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AccountContext(InstanceContext): - - def __init__(self, version: Version, organization_sid: str, account_sid: str): - """ - Initialize the AccountContext - - :param version: Version that contains the resource - :param organization_sid: - :param account_sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "organization_sid": organization_sid, - "account_sid": account_sid, - } - self._uri = "/{organization_sid}/Accounts/{account_sid}".format( - **self._solution - ) - - def fetch(self) -> AccountInstance: - """ - Fetch the AccountInstance - - - :returns: The fetched AccountInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return AccountInstance( - self._version, - payload, - organization_sid=self._solution["organization_sid"], - account_sid=self._solution["account_sid"], - ) - - async def fetch_async(self) -> AccountInstance: - """ - Asynchronous coroutine to fetch the AccountInstance - - - :returns: The fetched AccountInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return AccountInstance( - self._version, - payload, - organization_sid=self._solution["organization_sid"], - account_sid=self._solution["account_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AccountPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> AccountInstance: - """ - Build an instance of AccountInstance - - :param payload: Payload response from the API - """ - return AccountInstance( - self._version, payload, organization_sid=self._solution["organization_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class AccountList(ListResource): - - def __init__(self, version: Version, organization_sid: str): - """ - Initialize the AccountList - - :param version: Version that contains the resource - :param organization_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "organization_sid": organization_sid, - } - self._uri = "/{organization_sid}/Accounts".format(**self._solution) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[AccountInstance]: - """ - Streams AccountInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[AccountInstance]: - """ - Asynchronously streams AccountInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AccountInstance]: - """ - Lists AccountInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AccountInstance]: - """ - Asynchronously lists AccountInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AccountPage: - """ - Retrieve a single page of AccountInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AccountInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return AccountPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AccountPage: - """ - Asynchronously retrieve a single page of AccountInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AccountInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return AccountPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> AccountPage: - """ - Retrieve a specific page of AccountInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AccountInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return AccountPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> AccountPage: - """ - Asynchronously retrieve a specific page of AccountInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AccountInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return AccountPage(self._version, response, self._solution) - - def get(self, organization_sid: str, account_sid: str) -> AccountContext: - """ - Constructs a AccountContext - - :param organization_sid: - :param account_sid: - """ - return AccountContext( - self._version, organization_sid=organization_sid, account_sid=account_sid - ) - - def __call__(self, organization_sid: str, account_sid: str) -> AccountContext: - """ - Constructs a AccountContext - - :param organization_sid: - :param account_sid: - """ - return AccountContext( - self._version, organization_sid=organization_sid, account_sid=account_sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview_iam/organizations/role_assignment.py b/twilio/rest/preview_iam/organizations/role_assignment.py deleted file mode 100644 index 9608e2b806..0000000000 --- a/twilio/rest/preview_iam/organizations/role_assignment.py +++ /dev/null @@ -1,588 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Organization Public API - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class RoleAssignmentInstance(InstanceResource): - - class PublicApiCreateRoleAssignmentRequest(object): - """ - :ivar role_sid: Twilio Role Sid representing assigned role - :ivar scope: Twilio Sid representing scope of this assignment - :ivar identity: Twilio Sid representing identity of this assignment - """ - - def __init__(self, payload: Dict[str, Any]): - - self.role_sid: Optional[str] = payload.get("role_sid") - self.scope: Optional[str] = payload.get("scope") - self.identity: Optional[str] = payload.get("identity") - - def to_dict(self): - return { - "role_sid": self.role_sid, - "scope": self.scope, - "identity": self.identity, - } - - """ - :ivar sid: Twilio Role Assignment Sid representing this role assignment - :ivar role_sid: Twilio Role Sid representing assigned role - :ivar scope: Twilio Sid representing identity of this assignment - :ivar identity: Twilio Sid representing scope of this assignment - :ivar code: Twilio-specific error code - :ivar message: Error message - :ivar more_info: Link to Error Code References - :ivar status: HTTP response status code - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - organization_sid: Optional[str] = None, - role_assignment_sid: Optional[str] = None, - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.role_sid: Optional[str] = payload.get("role_sid") - self.scope: Optional[str] = payload.get("scope") - self.identity: Optional[str] = payload.get("identity") - self.code: Optional[int] = payload.get("code") - self.message: Optional[str] = payload.get("message") - self.more_info: Optional[str] = payload.get("moreInfo") - self.status: Optional[int] = payload.get("status") - - self._solution = { - "organization_sid": organization_sid or self.organization_sid, - "role_assignment_sid": role_assignment_sid or self.role_assignment_sid, - } - self._context: Optional[RoleAssignmentContext] = None - - @property - def _proxy(self) -> "RoleAssignmentContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: RoleAssignmentContext for this RoleAssignmentInstance - """ - if self._context is None: - self._context = RoleAssignmentContext( - self._version, - organization_sid=self._solution["organization_sid"], - role_assignment_sid=self._solution["role_assignment_sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the RoleAssignmentInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the RoleAssignmentInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format( - context - ) - - -class RoleAssignmentContext(InstanceContext): - - class PublicApiCreateRoleAssignmentRequest(object): - """ - :ivar role_sid: Twilio Role Sid representing assigned role - :ivar scope: Twilio Sid representing scope of this assignment - :ivar identity: Twilio Sid representing identity of this assignment - """ - - def __init__(self, payload: Dict[str, Any]): - - self.role_sid: Optional[str] = payload.get("role_sid") - self.scope: Optional[str] = payload.get("scope") - self.identity: Optional[str] = payload.get("identity") - - def to_dict(self): - return { - "role_sid": self.role_sid, - "scope": self.scope, - "identity": self.identity, - } - - def __init__( - self, version: Version, organization_sid: str, role_assignment_sid: str - ): - """ - Initialize the RoleAssignmentContext - - :param version: Version that contains the resource - :param organization_sid: - :param role_assignment_sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "organization_sid": organization_sid, - "role_assignment_sid": role_assignment_sid, - } - self._uri = "/{organization_sid}/RoleAssignments/{role_assignment_sid}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the RoleAssignmentInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - headers["Accept"] = "application/scim+json" - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the RoleAssignmentInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - headers["Accept"] = "application/scim+json" - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format( - context - ) - - -class RoleAssignmentPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> RoleAssignmentInstance: - """ - Build an instance of RoleAssignmentInstance - - :param payload: Payload response from the API - """ - return RoleAssignmentInstance( - self._version, payload, organization_sid=self._solution["organization_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class RoleAssignmentList(ListResource): - - class PublicApiCreateRoleAssignmentRequest(object): - """ - :ivar role_sid: Twilio Role Sid representing assigned role - :ivar scope: Twilio Sid representing scope of this assignment - :ivar identity: Twilio Sid representing identity of this assignment - """ - - def __init__(self, payload: Dict[str, Any]): - - self.role_sid: Optional[str] = payload.get("role_sid") - self.scope: Optional[str] = payload.get("scope") - self.identity: Optional[str] = payload.get("identity") - - def to_dict(self): - return { - "role_sid": self.role_sid, - "scope": self.scope, - "identity": self.identity, - } - - def __init__(self, version: Version, organization_sid: str): - """ - Initialize the RoleAssignmentList - - :param version: Version that contains the resource - :param organization_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "organization_sid": organization_sid, - } - self._uri = "/{organization_sid}/RoleAssignments".format(**self._solution) - - def create( - self, - public_api_create_role_assignment_request: PublicApiCreateRoleAssignmentRequest, - ) -> RoleAssignmentInstance: - """ - Create the RoleAssignmentInstance - - :param public_api_create_role_assignment_request: - - :returns: The created RoleAssignmentInstance - """ - data = public_api_create_role_assignment_request.to_dict() - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/json" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return RoleAssignmentInstance( - self._version, payload, organization_sid=self._solution["organization_sid"] - ) - - async def create_async( - self, - public_api_create_role_assignment_request: PublicApiCreateRoleAssignmentRequest, - ) -> RoleAssignmentInstance: - """ - Asynchronously create the RoleAssignmentInstance - - :param public_api_create_role_assignment_request: - - :returns: The created RoleAssignmentInstance - """ - data = public_api_create_role_assignment_request.to_dict() - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/json" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return RoleAssignmentInstance( - self._version, payload, organization_sid=self._solution["organization_sid"] - ) - - def stream( - self, - identity: Union[str, object] = values.unset, - scope: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[RoleAssignmentInstance]: - """ - Streams RoleAssignmentInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str identity: - :param str scope: - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(identity=identity, scope=scope, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - identity: Union[str, object] = values.unset, - scope: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[RoleAssignmentInstance]: - """ - Asynchronously streams RoleAssignmentInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str identity: - :param str scope: - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - identity=identity, scope=scope, page_size=limits["page_size"] - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - identity: Union[str, object] = values.unset, - scope: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[RoleAssignmentInstance]: - """ - Lists RoleAssignmentInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str identity: - :param str scope: - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - identity=identity, - scope=scope, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - identity: Union[str, object] = values.unset, - scope: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[RoleAssignmentInstance]: - """ - Asynchronously lists RoleAssignmentInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str identity: - :param str scope: - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - identity=identity, - scope=scope, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - identity: Union[str, object] = values.unset, - scope: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> RoleAssignmentPage: - """ - Retrieve a single page of RoleAssignmentInstance records from the API. - Request is executed immediately - - :param identity: - :param scope: - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of RoleAssignmentInstance - """ - data = values.of( - { - "Identity": identity, - "Scope": scope, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return RoleAssignmentPage(self._version, response, self._solution) - - async def page_async( - self, - identity: Union[str, object] = values.unset, - scope: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> RoleAssignmentPage: - """ - Asynchronously retrieve a single page of RoleAssignmentInstance records from the API. - Request is executed immediately - - :param identity: - :param scope: - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of RoleAssignmentInstance - """ - data = values.of( - { - "Identity": identity, - "Scope": scope, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return RoleAssignmentPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> RoleAssignmentPage: - """ - Retrieve a specific page of RoleAssignmentInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of RoleAssignmentInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return RoleAssignmentPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> RoleAssignmentPage: - """ - Asynchronously retrieve a specific page of RoleAssignmentInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of RoleAssignmentInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return RoleAssignmentPage(self._version, response, self._solution) - - def get( - self, organization_sid: str, role_assignment_sid: str - ) -> RoleAssignmentContext: - """ - Constructs a RoleAssignmentContext - - :param organization_sid: - :param role_assignment_sid: - """ - return RoleAssignmentContext( - self._version, - organization_sid=organization_sid, - role_assignment_sid=role_assignment_sid, - ) - - def __call__( - self, organization_sid: str, role_assignment_sid: str - ) -> RoleAssignmentContext: - """ - Constructs a RoleAssignmentContext - - :param organization_sid: - :param role_assignment_sid: - """ - return RoleAssignmentContext( - self._version, - organization_sid=organization_sid, - role_assignment_sid=role_assignment_sid, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview_iam/organizations/user.py b/twilio/rest/preview_iam/organizations/user.py deleted file mode 100644 index 31ee699422..0000000000 --- a/twilio/rest/preview_iam/organizations/user.py +++ /dev/null @@ -1,1052 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Organization Public API - No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class UserInstance(InstanceResource): - - class ScimEmailAddress(object): - """ - :ivar primary: Indicates if this email address is the primary one - :ivar value: The actual email address value - :ivar type: The type of email address (e.g., work, home, etc.) - """ - - def __init__(self, payload: Dict[str, Any]): - - self.primary: Optional[bool] = payload.get("primary") - self.value: Optional[str] = payload.get("value") - self.type: Optional[str] = payload.get("type") - - def to_dict(self): - return { - "primary": self.primary, - "value": self.value, - "type": self.type, - } - - class ScimMeta(object): - """ - :ivar resource_type: Indicates the type of the resource - :ivar created: The date and time when the resource was created in the system - :ivar last_modified: The date and time when the resource was last modified - :ivar version: A version identifier for the resource. This can be used to manage resource versioning and concurrency control. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.resource_type: Optional[str] = payload.get("resource_type") - self.created: Optional[datetime] = payload.get("created") - self.last_modified: Optional[datetime] = payload.get("last_modified") - self.version: Optional[str] = payload.get("version") - - def to_dict(self): - return { - "resource_type": self.resource_type, - "created": self.created, - "last_modified": self.last_modified, - "version": self.version, - } - - class ScimName(object): - """ - :ivar given_name: The user's first or given name - :ivar family_name: The user's last or family name - """ - - def __init__(self, payload: Dict[str, Any]): - - self.given_name: Optional[str] = payload.get("given_name") - self.family_name: Optional[str] = payload.get("family_name") - - def to_dict(self): - return { - "given_name": self.given_name, - "family_name": self.family_name, - } - - class ScimUser(object): - """ - :ivar id: Unique Twilio user sid - :ivar external_id: External unique resource id defined by provisioning client - :ivar user_name: Unique username, MUST be same as primary email address - :ivar display_name: User friendly display name - :ivar name: - :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. - :ivar active: Indicates whether the user is active - :ivar locale: User's locale - :ivar timezone: User's time zone - :ivar schemas: An array of URIs that indicate the schemas supported for this user resource - :ivar meta: - :ivar detail: A human-readable description of the error - :ivar scim_type: A scimType error code as defined in RFC7644 - :ivar status: Http status code - :ivar code: Twilio-specific error code - :ivar more_info: Link to Error Code References - """ - - def __init__(self, payload: Dict[str, Any]): - - self.id: Optional[str] = payload.get("id") - self.external_id: Optional[str] = payload.get("external_id") - self.user_name: Optional[str] = payload.get("user_name") - self.display_name: Optional[str] = payload.get("display_name") - self.name: Optional[UserList.ScimName] = payload.get("name") - self.emails: Optional[List[UserList.ScimEmailAddress]] = payload.get( - "emails" - ) - self.active: Optional[bool] = payload.get("active") - self.locale: Optional[str] = payload.get("locale") - self.timezone: Optional[str] = payload.get("timezone") - self.schemas: Optional[List[str]] = payload.get("schemas") - self.meta: Optional[UserList.ScimMeta] = payload.get("meta") - self.detail: Optional[str] = payload.get("detail") - self.scim_type: Optional[str] = payload.get("scim_type") - self.status: Optional[str] = payload.get("status") - self.code: Optional[int] = payload.get("code") - self.more_info: Optional[str] = payload.get("more_info") - - def to_dict(self): - return { - "id": self.id, - "externalId": self.external_id, - "userName": self.user_name, - "displayName": self.display_name, - "name": self.name.to_dict() if self.name is not None else None, - "emails": ( - [emails.to_dict() for emails in self.emails] - if self.emails is not None - else None - ), - "active": self.active, - "locale": self.locale, - "timezone": self.timezone, - "schemas": self.schemas, - "meta": self.meta.to_dict() if self.meta is not None else None, - "detail": self.detail, - "scimType": self.scim_type, - "status": self.status, - "code": self.code, - "moreInfo": self.more_info, - } - - """ - :ivar id: Unique Twilio user sid - :ivar external_id: External unique resource id defined by provisioning client - :ivar user_name: Unique username, MUST be same as primary email address - :ivar display_name: User friendly display name - :ivar name: - :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. - :ivar active: Indicates whether the user is active - :ivar locale: User's locale - :ivar timezone: User's time zone - :ivar schemas: An array of URIs that indicate the schemas supported for this user resource - :ivar meta: - :ivar detail: A human-readable description of the error - :ivar scim_type: A scimType error code as defined in RFC7644 - :ivar status: Http status code - :ivar code: Twilio-specific error code - :ivar more_info: Link to Error Code References - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - organization_sid: Optional[str] = None, - user_sid: Optional[str] = None, - ): - super().__init__(version) - - self.id: Optional[str] = payload.get("id") - self.external_id: Optional[str] = payload.get("externalId") - self.user_name: Optional[str] = payload.get("userName") - self.display_name: Optional[str] = payload.get("displayName") - self.name: Optional[UserList.str] = payload.get("name") - self.emails: Optional[List[UserList.str]] = payload.get("emails") - self.active: Optional[bool] = payload.get("active") - self.locale: Optional[str] = payload.get("locale") - self.timezone: Optional[str] = payload.get("timezone") - self.schemas: Optional[List[str]] = payload.get("schemas") - self.meta: Optional[UserList.str] = payload.get("meta") - self.detail: Optional[str] = payload.get("detail") - self.scim_type: Optional[str] = payload.get("scimType") - self.status: Optional[str] = payload.get("status") - self.code: Optional[int] = payload.get("code") - self.more_info: Optional[str] = payload.get("moreInfo") - - self._solution = { - "organization_sid": organization_sid or self.organization_sid, - "user_sid": user_sid or self.user_sid, - } - self._context: Optional[UserContext] = None - - @property - def _proxy(self) -> "UserContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: UserContext for this UserInstance - """ - if self._context is None: - self._context = UserContext( - self._version, - organization_sid=self._solution["organization_sid"], - user_sid=self._solution["user_sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the UserInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the UserInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "UserInstance": - """ - Fetch the UserInstance - - - :returns: The fetched UserInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "UserInstance": - """ - Asynchronous coroutine to fetch the UserInstance - - - :returns: The fetched UserInstance - """ - return await self._proxy.fetch_async() - - def update( - self, scim_user: ScimUser, if_match: Union[str, object] = values.unset - ) -> "UserInstance": - """ - Update the UserInstance - - :param scim_user: - :param if_match: - - :returns: The updated UserInstance - """ - return self._proxy.update( - scim_user=scim_user, - if_match=if_match, - ) - - async def update_async( - self, scim_user: ScimUser, if_match: Union[str, object] = values.unset - ) -> "UserInstance": - """ - Asynchronous coroutine to update the UserInstance - - :param scim_user: - :param if_match: - - :returns: The updated UserInstance - """ - return await self._proxy.update_async( - scim_user=scim_user, - if_match=if_match, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class UserContext(InstanceContext): - - class ScimEmailAddress(object): - """ - :ivar primary: Indicates if this email address is the primary one - :ivar value: The actual email address value - :ivar type: The type of email address (e.g., work, home, etc.) - """ - - def __init__(self, payload: Dict[str, Any]): - - self.primary: Optional[bool] = payload.get("primary") - self.value: Optional[str] = payload.get("value") - self.type: Optional[str] = payload.get("type") - - def to_dict(self): - return { - "primary": self.primary, - "value": self.value, - "type": self.type, - } - - class ScimMeta(object): - """ - :ivar resource_type: Indicates the type of the resource - :ivar created: The date and time when the resource was created in the system - :ivar last_modified: The date and time when the resource was last modified - :ivar version: A version identifier for the resource. This can be used to manage resource versioning and concurrency control. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.resource_type: Optional[str] = payload.get("resource_type") - self.created: Optional[datetime] = payload.get("created") - self.last_modified: Optional[datetime] = payload.get("last_modified") - self.version: Optional[str] = payload.get("version") - - def to_dict(self): - return { - "resource_type": self.resource_type, - "created": self.created, - "last_modified": self.last_modified, - "version": self.version, - } - - class ScimName(object): - """ - :ivar given_name: The user's first or given name - :ivar family_name: The user's last or family name - """ - - def __init__(self, payload: Dict[str, Any]): - - self.given_name: Optional[str] = payload.get("given_name") - self.family_name: Optional[str] = payload.get("family_name") - - def to_dict(self): - return { - "given_name": self.given_name, - "family_name": self.family_name, - } - - class ScimUser(object): - """ - :ivar id: Unique Twilio user sid - :ivar external_id: External unique resource id defined by provisioning client - :ivar user_name: Unique username, MUST be same as primary email address - :ivar display_name: User friendly display name - :ivar name: - :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. - :ivar active: Indicates whether the user is active - :ivar locale: User's locale - :ivar timezone: User's time zone - :ivar schemas: An array of URIs that indicate the schemas supported for this user resource - :ivar meta: - :ivar detail: A human-readable description of the error - :ivar scim_type: A scimType error code as defined in RFC7644 - :ivar status: Http status code - :ivar code: Twilio-specific error code - :ivar more_info: Link to Error Code References - """ - - def __init__(self, payload: Dict[str, Any]): - - self.id: Optional[str] = payload.get("id") - self.external_id: Optional[str] = payload.get("external_id") - self.user_name: Optional[str] = payload.get("user_name") - self.display_name: Optional[str] = payload.get("display_name") - self.name: Optional[UserList.ScimName] = payload.get("name") - self.emails: Optional[List[UserList.ScimEmailAddress]] = payload.get( - "emails" - ) - self.active: Optional[bool] = payload.get("active") - self.locale: Optional[str] = payload.get("locale") - self.timezone: Optional[str] = payload.get("timezone") - self.schemas: Optional[List[str]] = payload.get("schemas") - self.meta: Optional[UserList.ScimMeta] = payload.get("meta") - self.detail: Optional[str] = payload.get("detail") - self.scim_type: Optional[str] = payload.get("scim_type") - self.status: Optional[str] = payload.get("status") - self.code: Optional[int] = payload.get("code") - self.more_info: Optional[str] = payload.get("more_info") - - def to_dict(self): - return { - "id": self.id, - "externalId": self.external_id, - "userName": self.user_name, - "displayName": self.display_name, - "name": self.name.to_dict() if self.name is not None else None, - "emails": ( - [emails.to_dict() for emails in self.emails] - if self.emails is not None - else None - ), - "active": self.active, - "locale": self.locale, - "timezone": self.timezone, - "schemas": self.schemas, - "meta": self.meta.to_dict() if self.meta is not None else None, - "detail": self.detail, - "scimType": self.scim_type, - "status": self.status, - "code": self.code, - "moreInfo": self.more_info, - } - - def __init__(self, version: Version, organization_sid: str, user_sid: str): - """ - Initialize the UserContext - - :param version: Version that contains the resource - :param organization_sid: - :param user_sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "organization_sid": organization_sid, - "user_sid": user_sid, - } - self._uri = "/{organization_sid}/scim/Users/{user_sid}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the UserInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - headers["Accept"] = "application/scim+json" - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the UserInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - headers["Accept"] = "application/scim+json" - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> UserInstance: - """ - Fetch the UserInstance - - - :returns: The fetched UserInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/scim+json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return UserInstance( - self._version, - payload, - organization_sid=self._solution["organization_sid"], - user_sid=self._solution["user_sid"], - ) - - async def fetch_async(self) -> UserInstance: - """ - Asynchronous coroutine to fetch the UserInstance - - - :returns: The fetched UserInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/scim+json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return UserInstance( - self._version, - payload, - organization_sid=self._solution["organization_sid"], - user_sid=self._solution["user_sid"], - ) - - def update( - self, scim_user: ScimUser, if_match: Union[str, object] = values.unset - ) -> UserInstance: - """ - Update the UserInstance - - :param scim_user: - :param if_match: - - :returns: The updated UserInstance - """ - data = scim_user.to_dict() - - headers = values.of({}) - - if not ( - if_match is values.unset or (isinstance(if_match, str) and not if_match) - ): - headers["If-Match"] = if_match - - headers["Content-Type"] = "application/json" - - headers["Content-Type"] = "application/scim+json" - - headers["Accept"] = "application/scim+json" - - payload = self._version.update( - method="PUT", uri=self._uri, data=data, headers=headers - ) - - return UserInstance( - self._version, - payload, - organization_sid=self._solution["organization_sid"], - user_sid=self._solution["user_sid"], - ) - - async def update_async( - self, scim_user: ScimUser, if_match: Union[str, object] = values.unset - ) -> UserInstance: - """ - Asynchronous coroutine to update the UserInstance - - :param scim_user: - :param if_match: - - :returns: The updated UserInstance - """ - data = scim_user.to_dict() - - headers = values.of({}) - - if not ( - if_match is values.unset or (isinstance(if_match, str) and not if_match) - ): - headers["If-Match"] = if_match - - headers["Content-Type"] = "application/json" - - headers["Content-Type"] = "application/scim+json" - - headers["Accept"] = "application/scim+json" - - payload = await self._version.update_async( - method="PUT", uri=self._uri, data=data, headers=headers - ) - - return UserInstance( - self._version, - payload, - organization_sid=self._solution["organization_sid"], - user_sid=self._solution["user_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class UserPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> UserInstance: - """ - Build an instance of UserInstance - - :param payload: Payload response from the API - """ - return UserInstance( - self._version, payload, organization_sid=self._solution["organization_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class UserList(ListResource): - - class ScimEmailAddress(object): - """ - :ivar primary: Indicates if this email address is the primary one - :ivar value: The actual email address value - :ivar type: The type of email address (e.g., work, home, etc.) - """ - - def __init__(self, payload: Dict[str, Any]): - - self.primary: Optional[bool] = payload.get("primary") - self.value: Optional[str] = payload.get("value") - self.type: Optional[str] = payload.get("type") - - def to_dict(self): - return { - "primary": self.primary, - "value": self.value, - "type": self.type, - } - - class ScimMeta(object): - """ - :ivar resource_type: Indicates the type of the resource - :ivar created: The date and time when the resource was created in the system - :ivar last_modified: The date and time when the resource was last modified - :ivar version: A version identifier for the resource. This can be used to manage resource versioning and concurrency control. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.resource_type: Optional[str] = payload.get("resource_type") - self.created: Optional[datetime] = payload.get("created") - self.last_modified: Optional[datetime] = payload.get("last_modified") - self.version: Optional[str] = payload.get("version") - - def to_dict(self): - return { - "resource_type": self.resource_type, - "created": self.created, - "last_modified": self.last_modified, - "version": self.version, - } - - class ScimName(object): - """ - :ivar given_name: The user's first or given name - :ivar family_name: The user's last or family name - """ - - def __init__(self, payload: Dict[str, Any]): - - self.given_name: Optional[str] = payload.get("given_name") - self.family_name: Optional[str] = payload.get("family_name") - - def to_dict(self): - return { - "given_name": self.given_name, - "family_name": self.family_name, - } - - class ScimUser(object): - """ - :ivar id: Unique Twilio user sid - :ivar external_id: External unique resource id defined by provisioning client - :ivar user_name: Unique username, MUST be same as primary email address - :ivar display_name: User friendly display name - :ivar name: - :ivar emails: Email address list of the user. Primary email must be defined if there are more than 1 email. Primary email must match the username. - :ivar active: Indicates whether the user is active - :ivar locale: User's locale - :ivar timezone: User's time zone - :ivar schemas: An array of URIs that indicate the schemas supported for this user resource - :ivar meta: - :ivar detail: A human-readable description of the error - :ivar scim_type: A scimType error code as defined in RFC7644 - :ivar status: Http status code - :ivar code: Twilio-specific error code - :ivar more_info: Link to Error Code References - """ - - def __init__(self, payload: Dict[str, Any]): - - self.id: Optional[str] = payload.get("id") - self.external_id: Optional[str] = payload.get("external_id") - self.user_name: Optional[str] = payload.get("user_name") - self.display_name: Optional[str] = payload.get("display_name") - self.name: Optional[UserList.ScimName] = payload.get("name") - self.emails: Optional[List[UserList.ScimEmailAddress]] = payload.get( - "emails" - ) - self.active: Optional[bool] = payload.get("active") - self.locale: Optional[str] = payload.get("locale") - self.timezone: Optional[str] = payload.get("timezone") - self.schemas: Optional[List[str]] = payload.get("schemas") - self.meta: Optional[UserList.ScimMeta] = payload.get("meta") - self.detail: Optional[str] = payload.get("detail") - self.scim_type: Optional[str] = payload.get("scim_type") - self.status: Optional[str] = payload.get("status") - self.code: Optional[int] = payload.get("code") - self.more_info: Optional[str] = payload.get("more_info") - - def to_dict(self): - return { - "id": self.id, - "externalId": self.external_id, - "userName": self.user_name, - "displayName": self.display_name, - "name": self.name.to_dict() if self.name is not None else None, - "emails": ( - [emails.to_dict() for emails in self.emails] - if self.emails is not None - else None - ), - "active": self.active, - "locale": self.locale, - "timezone": self.timezone, - "schemas": self.schemas, - "meta": self.meta.to_dict() if self.meta is not None else None, - "detail": self.detail, - "scimType": self.scim_type, - "status": self.status, - "code": self.code, - "moreInfo": self.more_info, - } - - def __init__(self, version: Version, organization_sid: str): - """ - Initialize the UserList - - :param version: Version that contains the resource - :param organization_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "organization_sid": organization_sid, - } - self._uri = "/{organization_sid}/scim/Users".format(**self._solution) - - def create(self, scim_user: ScimUser) -> UserInstance: - """ - Create the UserInstance - - :param scim_user: - - :returns: The created UserInstance - """ - data = scim_user.to_dict() - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/json" - - headers["Content-Type"] = "application/scim+json" - - headers["Accept"] = "application/scim+json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return UserInstance( - self._version, payload, organization_sid=self._solution["organization_sid"] - ) - - async def create_async(self, scim_user: ScimUser) -> UserInstance: - """ - Asynchronously create the UserInstance - - :param scim_user: - - :returns: The created UserInstance - """ - data = scim_user.to_dict() - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/json" - - headers["Content-Type"] = "application/scim+json" - - headers["Accept"] = "application/scim+json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return UserInstance( - self._version, payload, organization_sid=self._solution["organization_sid"] - ) - - def stream( - self, - filter: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[UserInstance]: - """ - Streams UserInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str filter: - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(filter=filter, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - filter: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[UserInstance]: - """ - Asynchronously streams UserInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str filter: - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(filter=filter, page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - filter: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[UserInstance]: - """ - Lists UserInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str filter: - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - filter=filter, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - filter: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[UserInstance]: - """ - Asynchronously lists UserInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str filter: - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - filter=filter, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - filter: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> UserPage: - """ - Retrieve a single page of UserInstance records from the API. - Request is executed immediately - - :param filter: - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of UserInstance - """ - data = values.of( - { - "filter": filter, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/scim+json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return UserPage(self._version, response, self._solution) - - async def page_async( - self, - filter: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> UserPage: - """ - Asynchronously retrieve a single page of UserInstance records from the API. - Request is executed immediately - - :param filter: - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of UserInstance - """ - data = values.of( - { - "filter": filter, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/scim+json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return UserPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> UserPage: - """ - Retrieve a specific page of UserInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of UserInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return UserPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> UserPage: - """ - Asynchronously retrieve a specific page of UserInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of UserInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return UserPage(self._version, response, self._solution) - - def get(self, organization_sid: str, user_sid: str) -> UserContext: - """ - Constructs a UserContext - - :param organization_sid: - :param user_sid: - """ - return UserContext( - self._version, organization_sid=organization_sid, user_sid=user_sid - ) - - def __call__(self, organization_sid: str, user_sid: str) -> UserContext: - """ - Constructs a UserContext - - :param organization_sid: - :param user_sid: - """ - return UserContext( - self._version, organization_sid=organization_sid, user_sid=user_sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" From 0b16947b3ec7991a373ce68288dc2adf6be8f706 Mon Sep 17 00:00:00 2001 From: Athira Sabu <102021496+AsabuHere@users.noreply.github.com> Date: Fri, 13 Dec 2024 11:56:19 +0530 Subject: [PATCH 071/113] Update __init__.py (#827) --- twilio/rest/preview_iam/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twilio/rest/preview_iam/__init__.py b/twilio/rest/preview_iam/__init__.py index 9103436220..f183fb8393 100644 --- a/twilio/rest/preview_iam/__init__.py +++ b/twilio/rest/preview_iam/__init__.py @@ -9,12 +9,12 @@ from twilio.rest.preview_iam.versionless.organization import ( OrganizationList, ) - +from twilio.rest.preview_iam.versionless import Versionless class PreviewIam(PreviewIamBase): @property def organization(self) -> OrganizationList: - return self.versionless.organization + return Versionless(self).organization @property def authorize(self) -> AuthorizeList: From 38ab9a40aeccb746b4fbfd02d17e30a84605ae23 Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 13 Dec 2024 13:48:19 +0000 Subject: [PATCH 072/113] [Librarian] Regenerated @ b65acba5c4232d15904620906c50336624531359 f22b1df4a255e9c39bba77d26124d8caa19d2902 --- CHANGES.md | 9 +++++++++ twilio/rest/__init__.py | 2 ++ twilio/rest/preview_iam/PreviewIamBase.py | 11 ----------- twilio/rest/preview_iam/__init__.py | 1 + 4 files changed, 12 insertions(+), 11 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3c59707068..f95edb2e60 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,15 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2024-12-13] Version 9.4.1 +-------------------------- +**Library - Fix** +- [PR #827](https://github.com/twilio/twilio-python/pull/827): Fixing init file for preview iam domain. Thanks to [@AsabuHere](https://github.com/AsabuHere)! + +**Library - Chore** +- [PR #826](https://github.com/twilio/twilio-python/pull/826): fix orgs api changes. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + + [2024-12-12] Version 9.4.0 -------------------------- **Library - Feature** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index d727b2467e..5838363c52 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -97,6 +97,7 @@ def __init__( environment=None, edge=None, user_agent_extensions=None, + credential_provider=None, ): """ Initializes the Twilio Client @@ -122,6 +123,7 @@ def __init__( environment, edge, user_agent_extensions, + credential_provider, ) # Domains diff --git a/twilio/rest/preview_iam/PreviewIamBase.py b/twilio/rest/preview_iam/PreviewIamBase.py index bdf047ecd2..22fcbe70b1 100644 --- a/twilio/rest/preview_iam/PreviewIamBase.py +++ b/twilio/rest/preview_iam/PreviewIamBase.py @@ -13,7 +13,6 @@ from twilio.base.domain import Domain from twilio.rest import Client -from twilio.rest.preview_iam.organizations import Organizations from twilio.rest.preview_iam.v1 import V1 @@ -26,18 +25,8 @@ def __init__(self, twilio: Client): :returns: Domain for PreviewIam """ super().__init__(twilio, "https://preview-iam.twilio.com") - self._organizations: Optional[Organizations] = None self._v1: Optional[V1] = None - @property - def organizations(self) -> Organizations: - """ - :returns: Versions organizations of PreviewIam - """ - if self._organizations is None: - self._organizations = Organizations(self) - return self._organizations - @property def v1(self) -> V1: """ diff --git a/twilio/rest/preview_iam/__init__.py b/twilio/rest/preview_iam/__init__.py index f183fb8393..9a5bf85b24 100644 --- a/twilio/rest/preview_iam/__init__.py +++ b/twilio/rest/preview_iam/__init__.py @@ -11,6 +11,7 @@ ) from twilio.rest.preview_iam.versionless import Versionless + class PreviewIam(PreviewIamBase): @property def organization(self) -> OrganizationList: From f61eb7c08b71a7360fbe11bfee6abf9216611e2e Mon Sep 17 00:00:00 2001 From: Twilio Date: Fri, 13 Dec 2024 13:52:44 +0000 Subject: [PATCH 073/113] Release 9.4.1 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 08c45fb9b8..d8a0907ea4 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.4.0", + version="9.4.1", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index fef80b04ae..586ef4d4ab 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "4", "0") +__version_info__ = ("9", "4", "1") __version__ = ".".join(__version_info__) From 6d40febd0bff6f56adcf2ac78e476f648a6af57e Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 9 Jan 2025 13:50:41 +0530 Subject: [PATCH 074/113] chore: remove test for 3.7 (#832) --- .github/workflows/test-and-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 9fdcf4c752..1e1c04d500 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - python-version: [ '3.7', '3.8', '3.9', '3.10', '3.11', '3.12' ] + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] steps: - name: Checkout twilio-python uses: actions/checkout@v3 From 45523ffa72ef79590f9f8e9f7429e6739c14cb0f Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 9 Jan 2025 10:23:49 +0000 Subject: [PATCH 075/113] [Librarian] Regenerated @ 0a245f5931e0ff292c12b643839bbb9a1b3831e3 4727b4211b32329ec55ad87676be1f406d3fd9e9 --- CHANGES.md | 9 ++ .../api/v2010/account/call/transcription.py | 4 +- .../v1/assistant/assistants_knowledge.py | 2 + .../rest/assistants/v1/knowledge/__init__.py | 20 +++++ twilio/rest/content/v1/content/__init__.py | 87 ------------------- .../conversations/v1/address_configuration.py | 1 + twilio/rest/insights/v1/call/call_summary.py | 1 + twilio/rest/insights/v1/call_summaries.py | 1 + twilio/rest/numbers/v1/__init__.py | 24 +++-- ...=> porting_webhook_configuration_fetch.py} | 26 +++--- 10 files changed, 65 insertions(+), 110 deletions(-) rename twilio/rest/numbers/v1/{webhook.py => porting_webhook_configuration_fetch.py} (78%) diff --git a/CHANGES.md b/CHANGES.md index f95edb2e60..b7904a9901 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,15 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-01-09] Version 9.4.2 +-------------------------- +**Library - Chore** +- [PR #832](https://github.com/twilio/twilio-python/pull/832): remove test for 3.7. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Numbers** +- Change beta feature flag to use v2/BulkHostedNumberOrders + + [2024-12-13] Version 9.4.1 -------------------------- **Library - Fix** diff --git a/twilio/rest/api/v2010/account/call/transcription.py b/twilio/rest/api/v2010/account/call/transcription.py index f415928cc8..5921cce12f 100644 --- a/twilio/rest/api/v2010/account/call/transcription.py +++ b/twilio/rest/api/v2010/account/call/transcription.py @@ -287,7 +287,7 @@ def create( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result - :param intelligence_service: The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. + :param intelligence_service: The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. :returns: The created TranscriptionInstance """ @@ -362,7 +362,7 @@ async def create_async( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result - :param intelligence_service: The SID or the unique name of the [IntelligentService](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. + :param intelligence_service: The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. :returns: The created TranscriptionInstance """ diff --git a/twilio/rest/assistants/v1/assistant/assistants_knowledge.py b/twilio/rest/assistants/v1/assistant/assistants_knowledge.py index c3767223e1..681d71789b 100644 --- a/twilio/rest/assistants/v1/assistant/assistants_knowledge.py +++ b/twilio/rest/assistants/v1/assistant/assistants_knowledge.py @@ -32,6 +32,7 @@ class AssistantsKnowledgeInstance(InstanceResource): :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') :ivar url: The url of the knowledge resource. + :ivar embedding_model: The embedding model to be used for the knowledge source. :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. """ @@ -55,6 +56,7 @@ def __init__( self.status: Optional[str] = payload.get("status") self.type: Optional[str] = payload.get("type") self.url: Optional[str] = payload.get("url") + self.embedding_model: Optional[str] = payload.get("embedding_model") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) diff --git a/twilio/rest/assistants/v1/knowledge/__init__.py b/twilio/rest/assistants/v1/knowledge/__init__.py index 993ed922ce..7d616f8682 100644 --- a/twilio/rest/assistants/v1/knowledge/__init__.py +++ b/twilio/rest/assistants/v1/knowledge/__init__.py @@ -34,6 +34,7 @@ class AssistantsV1ServiceCreateKnowledgeRequest(object): :ivar name: The name of the tool. :ivar policy: :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. """ def __init__(self, payload: Dict[str, Any]): @@ -48,6 +49,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -57,6 +59,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } class AssistantsV1ServiceCreatePolicyRequest(object): @@ -94,6 +97,7 @@ class AssistantsV1ServiceUpdateKnowledgeRequest(object): :ivar name: The name of the knowledge source. :ivar policy: :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. """ def __init__(self, payload: Dict[str, Any]): @@ -107,6 +111,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -115,6 +120,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } """ @@ -126,6 +132,7 @@ def to_dict(self): :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') :ivar url: The url of the knowledge resource. + :ivar embedding_model: The embedding model to be used for the knowledge source. :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. """ @@ -145,6 +152,7 @@ def __init__( self.status: Optional[str] = payload.get("status") self.type: Optional[str] = payload.get("type") self.url: Optional[str] = payload.get("url") + self.embedding_model: Optional[str] = payload.get("embedding_model") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( payload.get("date_created") ) @@ -276,6 +284,7 @@ class AssistantsV1ServiceCreateKnowledgeRequest(object): :ivar name: The name of the tool. :ivar policy: :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. """ def __init__(self, payload: Dict[str, Any]): @@ -290,6 +299,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -299,6 +309,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } class AssistantsV1ServiceCreatePolicyRequest(object): @@ -336,6 +347,7 @@ class AssistantsV1ServiceUpdateKnowledgeRequest(object): :ivar name: The name of the knowledge source. :ivar policy: :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. """ def __init__(self, payload: Dict[str, Any]): @@ -349,6 +361,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -357,6 +370,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } def __init__(self, version: Version, id: str): @@ -562,6 +576,7 @@ class AssistantsV1ServiceCreateKnowledgeRequest(object): :ivar name: The name of the tool. :ivar policy: :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. """ def __init__(self, payload: Dict[str, Any]): @@ -576,6 +591,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -585,6 +601,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } class AssistantsV1ServiceCreatePolicyRequest(object): @@ -622,6 +639,7 @@ class AssistantsV1ServiceUpdateKnowledgeRequest(object): :ivar name: The name of the knowledge source. :ivar policy: :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. """ def __init__(self, payload: Dict[str, Any]): @@ -635,6 +653,7 @@ def __init__(self, payload: Dict[str, Any]): KnowledgeList.AssistantsV1ServiceCreatePolicyRequest ] = payload.get("policy") self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") def to_dict(self): return { @@ -643,6 +662,7 @@ def to_dict(self): "name": self.name, "policy": self.policy.to_dict() if self.policy is not None else None, "type": self.type, + "embedding_model": self.embedding_model, } def __init__(self, version: Version): diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index d877b63bc4..60a5b05016 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -247,46 +247,17 @@ class FlowsPageComponent(object): """ :ivar label: :ivar type: - :ivar text: - :ivar options: """ def __init__(self, payload: Dict[str, Any]): self.label: Optional[str] = payload.get("label") self.type: Optional[str] = payload.get("type") - self.text: Optional[str] = payload.get("text") - self.options: Optional[List[ContentList.FlowsPageComponentSelectItem]] = ( - payload.get("options") - ) def to_dict(self): return { "label": self.label, "type": self.type, - "text": self.text, - "options": ( - [options.to_dict() for options in self.options] - if self.options is not None - else None - ), - } - - class FlowsPageComponentSelectItem(object): - """ - :ivar id: - :ivar title: - """ - - def __init__(self, payload: Dict[str, Any]): - - self.id: Optional[str] = payload.get("id") - self.title: Optional[str] = payload.get("title") - - def to_dict(self): - return { - "id": self.id, - "title": self.title, } class ListItem(object): @@ -1106,46 +1077,17 @@ class FlowsPageComponent(object): """ :ivar label: :ivar type: - :ivar text: - :ivar options: """ def __init__(self, payload: Dict[str, Any]): self.label: Optional[str] = payload.get("label") self.type: Optional[str] = payload.get("type") - self.text: Optional[str] = payload.get("text") - self.options: Optional[List[ContentList.FlowsPageComponentSelectItem]] = ( - payload.get("options") - ) def to_dict(self): return { "label": self.label, "type": self.type, - "text": self.text, - "options": ( - [options.to_dict() for options in self.options] - if self.options is not None - else None - ), - } - - class FlowsPageComponentSelectItem(object): - """ - :ivar id: - :ivar title: - """ - - def __init__(self, payload: Dict[str, Any]): - - self.id: Optional[str] = payload.get("id") - self.title: Optional[str] = payload.get("title") - - def to_dict(self): - return { - "id": self.id, - "title": self.title, } class ListItem(object): @@ -1966,46 +1908,17 @@ class FlowsPageComponent(object): """ :ivar label: :ivar type: - :ivar text: - :ivar options: """ def __init__(self, payload: Dict[str, Any]): self.label: Optional[str] = payload.get("label") self.type: Optional[str] = payload.get("type") - self.text: Optional[str] = payload.get("text") - self.options: Optional[List[ContentList.FlowsPageComponentSelectItem]] = ( - payload.get("options") - ) def to_dict(self): return { "label": self.label, "type": self.type, - "text": self.text, - "options": ( - [options.to_dict() for options in self.options] - if self.options is not None - else None - ), - } - - class FlowsPageComponentSelectItem(object): - """ - :ivar id: - :ivar title: - """ - - def __init__(self, payload: Dict[str, Any]): - - self.id: Optional[str] = payload.get("id") - self.title: Optional[str] = payload.get("title") - - def to_dict(self): - return { - "id": self.id, - "title": self.title, } class ListItem(object): diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index 096f023889..4ebfa47fc2 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -39,6 +39,7 @@ class Type(object): MESSENGER = "messenger" GBM = "gbm" EMAIL = "email" + RCS = "rcs" """ :ivar sid: A 34 character string that uniquely identifies this resource. diff --git a/twilio/rest/insights/v1/call/call_summary.py b/twilio/rest/insights/v1/call/call_summary.py index f11aa912ed..e21af100a1 100644 --- a/twilio/rest/insights/v1/call/call_summary.py +++ b/twilio/rest/insights/v1/call/call_summary.py @@ -47,6 +47,7 @@ class CallType(object): SIP = "sip" TRUNKING = "trunking" CLIENT = "client" + WHATSAPP = "whatsapp" class ProcessingState(object): COMPLETE = "complete" diff --git a/twilio/rest/insights/v1/call_summaries.py b/twilio/rest/insights/v1/call_summaries.py index 45fcce98c1..0a75e38454 100644 --- a/twilio/rest/insights/v1/call_summaries.py +++ b/twilio/rest/insights/v1/call_summaries.py @@ -48,6 +48,7 @@ class CallType(object): SIP = "sip" TRUNKING = "trunking" CLIENT = "client" + WHATSAPP = "whatsapp" class ProcessingState(object): COMPLETE = "complete" diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 68f078a88d..043364c3d5 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,10 +28,12 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) +from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( + PortingWebhookConfigurationFetchList, +) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) -from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -56,10 +58,12 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None + self._porting_webhook_configuration_fetch: Optional[ + PortingWebhookConfigurationFetchList + ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None - self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -107,18 +111,22 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete + @property + def porting_webhook_configuration_fetch( + self, + ) -> PortingWebhookConfigurationFetchList: + if self._porting_webhook_configuration_fetch is None: + self._porting_webhook_configuration_fetch = ( + PortingWebhookConfigurationFetchList(self) + ) + return self._porting_webhook_configuration_fetch + @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations - @property - def webhook(self) -> WebhookList: - if self._webhook is None: - self._webhook = WebhookList(self) - return self._webhook - def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/webhook.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py similarity index 78% rename from twilio/rest/numbers/v1/webhook.py rename to twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py index 69bd556326..5d381768c7 100644 --- a/twilio/rest/numbers/v1/webhook.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class WebhookInstance(InstanceResource): +class PortingWebhookConfigurationFetchInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class WebhookList(ListResource): +class PortingWebhookConfigurationFetchList(ListResource): def __init__(self, version: Version): """ - Initialize the WebhookList + Initialize the PortingWebhookConfigurationFetchList :param version: Version that contains the resource @@ -68,12 +68,12 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> WebhookInstance: + def fetch(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -81,14 +81,14 @@ def fetch(self) -> WebhookInstance: payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) - async def fetch_async(self) -> WebhookInstance: + async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -98,7 +98,7 @@ async def fetch_async(self) -> WebhookInstance: method="GET", uri=self._uri, headers=headers ) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) def __repr__(self) -> str: """ @@ -106,4 +106,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" From 5de6bde5d279f45bd97ac88ff589237379f4ce85 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 9 Jan 2025 10:28:47 +0000 Subject: [PATCH 076/113] Release 9.4.2 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d8a0907ea4..0ab6bc732a 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.4.1", + version="9.4.2", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 586ef4d4ab..145e35680b 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "4", "1") +__version_info__ = ("9", "4", "2") __version__ = ".".join(__version_info__) From 6a576aedad5e5ff50cdc19e966b30311364d2c5d Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 13 Jan 2025 11:43:33 +0000 Subject: [PATCH 077/113] [Librarian] Regenerated @ d9b0f7b0297f064eec2f219b29fd4193559c54f3 405f363a58346c6557d4194de16d9911b797e208 --- CHANGES.md | 6 + .../api/v2010/account/call/transcription.py | 4 +- .../conversations/v1/configuration/webhook.py | 10 +- twilio/rest/iam/v1/__init__.py | 12 +- twilio/rest/iam/v1/{new_api_key.py => key.py} | 30 +-- twilio/rest/marketplace/v1/__init__.py | 8 + twilio/rest/marketplace/v1/module_data.py | 176 ++++++++++++++++++ .../marketplace/v1/module_data_management.py | 4 +- twilio/rest/messaging/v1/service/__init__.py | 14 +- twilio/rest/numbers/v1/__init__.py | 24 +-- ...hook_configuration_fetch.py => webhook.py} | 26 +-- 11 files changed, 249 insertions(+), 65 deletions(-) rename twilio/rest/iam/v1/{new_api_key.py => key.py} (88%) create mode 100644 twilio/rest/marketplace/v1/module_data.py rename twilio/rest/numbers/v1/{porting_webhook_configuration_fetch.py => webhook.py} (78%) diff --git a/CHANGES.md b/CHANGES.md index b7904a9901..7c0335ea99 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,12 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-01-13] Version 9.4.3 +-------------------------- +**Messaging** +- Adds validity period Default value in service resource documentation + + [2025-01-09] Version 9.4.2 -------------------------- **Library - Chore** diff --git a/twilio/rest/api/v2010/account/call/transcription.py b/twilio/rest/api/v2010/account/call/transcription.py index 5921cce12f..d64a5507b4 100644 --- a/twilio/rest/api/v2010/account/call/transcription.py +++ b/twilio/rest/api/v2010/account/call/transcription.py @@ -287,7 +287,7 @@ def create( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result - :param intelligence_service: The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. + :param intelligence_service: The SID of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . :returns: The created TranscriptionInstance """ @@ -362,7 +362,7 @@ async def create_async( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result - :param intelligence_service: The SID or the unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) to process the transcription. + :param intelligence_service: The SID of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . :returns: The created TranscriptionInstance """ diff --git a/twilio/rest/conversations/v1/configuration/webhook.py b/twilio/rest/conversations/v1/configuration/webhook.py index 183930708e..f471c879ab 100644 --- a/twilio/rest/conversations/v1/configuration/webhook.py +++ b/twilio/rest/conversations/v1/configuration/webhook.py @@ -33,7 +33,7 @@ class Target(object): """ :ivar account_sid: The unique ID of the [Account](https://www.twilio.com/docs/iam/api/account) responsible for this conversation. :ivar method: - :ivar filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + :ivar filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated` :ivar pre_webhook_url: The absolute url the pre-event webhook request should be sent to. :ivar post_webhook_url: The absolute url the post-event webhook request should be sent to. :ivar target: @@ -97,7 +97,7 @@ def update( Update the WebhookInstance :param method: The HTTP method to be used when sending a webhook request. - :param filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + :param filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated` :param pre_webhook_url: The absolute url the pre-event webhook request should be sent to. :param post_webhook_url: The absolute url the post-event webhook request should be sent to. :param target: @@ -124,7 +124,7 @@ async def update_async( Asynchronous coroutine to update the WebhookInstance :param method: The HTTP method to be used when sending a webhook request. - :param filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + :param filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated` :param pre_webhook_url: The absolute url the pre-event webhook request should be sent to. :param post_webhook_url: The absolute url the post-event webhook request should be sent to. :param target: @@ -213,7 +213,7 @@ def update( Update the WebhookInstance :param method: The HTTP method to be used when sending a webhook request. - :param filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + :param filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated` :param pre_webhook_url: The absolute url the pre-event webhook request should be sent to. :param post_webhook_url: The absolute url the post-event webhook request should be sent to. :param target: @@ -254,7 +254,7 @@ async def update_async( Asynchronous coroutine to update the WebhookInstance :param method: The HTTP method to be used when sending a webhook request. - :param filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + :param filters: The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onMessageAdd`, `onMessageUpdate`, `onMessageRemove`, `onConversationUpdated`, `onConversationRemoved`, `onConversationAdd`, `onConversationAdded`, `onConversationRemove`, `onConversationUpdate`, `onConversationStateUpdated`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onParticipantAdd`, `onParticipantRemove`, `onParticipantUpdate`, `onDeliveryUpdated`, `onUserAdded`, `onUserUpdate`, `onUserUpdated` :param pre_webhook_url: The absolute url the pre-event webhook request should be sent to. :param post_webhook_url: The absolute url the post-event webhook request should be sent to. :param target: diff --git a/twilio/rest/iam/v1/__init__.py b/twilio/rest/iam/v1/__init__.py index 0c46947341..408de11acb 100644 --- a/twilio/rest/iam/v1/__init__.py +++ b/twilio/rest/iam/v1/__init__.py @@ -17,7 +17,7 @@ from twilio.base.domain import Domain from twilio.rest.iam.v1.api_key import ApiKeyList from twilio.rest.iam.v1.get_api_keys import GetApiKeysList -from twilio.rest.iam.v1.new_api_key import NewApiKeyList +from twilio.rest.iam.v1.key import KeyList class V1(Version): @@ -31,7 +31,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._api_key: Optional[ApiKeyList] = None self._get_api_keys: Optional[GetApiKeysList] = None - self._new_api_key: Optional[NewApiKeyList] = None + self._keys: Optional[KeyList] = None @property def api_key(self) -> ApiKeyList: @@ -46,10 +46,10 @@ def get_api_keys(self) -> GetApiKeysList: return self._get_api_keys @property - def new_api_key(self) -> NewApiKeyList: - if self._new_api_key is None: - self._new_api_key = NewApiKeyList(self) - return self._new_api_key + def keys(self) -> KeyList: + if self._keys is None: + self._keys = KeyList(self) + return self._keys def __repr__(self) -> str: """ diff --git a/twilio/rest/iam/v1/new_api_key.py b/twilio/rest/iam/v1/key.py similarity index 88% rename from twilio/rest/iam/v1/new_api_key.py rename to twilio/rest/iam/v1/key.py index 760ce79ca3..cd5556df94 100644 --- a/twilio/rest/iam/v1/new_api_key.py +++ b/twilio/rest/iam/v1/key.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class NewApiKeyInstance(InstanceResource): +class KeyInstance(InstanceResource): class Keytype(object): RESTRICTED = "restricted" @@ -56,14 +56,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class NewApiKeyList(ListResource): +class KeyList(ListResource): def __init__(self, version: Version): """ - Initialize the NewApiKeyList + Initialize the KeyList :param version: Version that contains the resource @@ -76,18 +76,18 @@ def create( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, + key_type: Union["KeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> NewApiKeyInstance: + ) -> KeyInstance: """ - Create the NewApiKeyInstance + Create the KeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created NewApiKeyInstance + :returns: The created KeyInstance """ data = values.of( @@ -108,24 +108,24 @@ def create( method="POST", uri=self._uri, data=data, headers=headers ) - return NewApiKeyInstance(self._version, payload) + return KeyInstance(self._version, payload) async def create_async( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, + key_type: Union["KeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> NewApiKeyInstance: + ) -> KeyInstance: """ - Asynchronously create the NewApiKeyInstance + Asynchronously create the KeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created NewApiKeyInstance + :returns: The created KeyInstance """ data = values.of( @@ -146,7 +146,7 @@ async def create_async( method="POST", uri=self._uri, data=data, headers=headers ) - return NewApiKeyInstance(self._version, payload) + return KeyInstance(self._version, payload) def __repr__(self) -> str: """ @@ -154,4 +154,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/marketplace/v1/__init__.py b/twilio/rest/marketplace/v1/__init__.py index 9a29e0b691..6a84b31cd9 100644 --- a/twilio/rest/marketplace/v1/__init__.py +++ b/twilio/rest/marketplace/v1/__init__.py @@ -17,6 +17,7 @@ from twilio.base.domain import Domain from twilio.rest.marketplace.v1.available_add_on import AvailableAddOnList from twilio.rest.marketplace.v1.installed_add_on import InstalledAddOnList +from twilio.rest.marketplace.v1.module_data import ModuleDataList from twilio.rest.marketplace.v1.module_data_management import ModuleDataManagementList from twilio.rest.marketplace.v1.referral_conversion import ReferralConversionList @@ -32,6 +33,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._available_add_ons: Optional[AvailableAddOnList] = None self._installed_add_ons: Optional[InstalledAddOnList] = None + self._module_data: Optional[ModuleDataList] = None self._module_data_management: Optional[ModuleDataManagementList] = None self._referral_conversion: Optional[ReferralConversionList] = None @@ -47,6 +49,12 @@ def installed_add_ons(self) -> InstalledAddOnList: self._installed_add_ons = InstalledAddOnList(self) return self._installed_add_ons + @property + def module_data(self) -> ModuleDataList: + if self._module_data is None: + self._module_data = ModuleDataList(self) + return self._module_data + @property def module_data_management(self) -> ModuleDataManagementList: if self._module_data_management is None: diff --git a/twilio/rest/marketplace/v1/module_data.py b/twilio/rest/marketplace/v1/module_data.py new file mode 100644 index 0000000000..1308c17a91 --- /dev/null +++ b/twilio/rest/marketplace/v1/module_data.py @@ -0,0 +1,176 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Marketplace + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional, Union +from twilio.base import values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class ModuleDataInstance(InstanceResource): + """ + :ivar url: URL to query the subresource. + :ivar sid: ModuleSid that identifies this Listing. + :ivar description: A JSON object describing the module and is displayed under the Description tab of the Module detail page. You can define the main body of the description, highlight key features or aspects of the module and if applicable, provide code samples for developers + :ivar support: A JSON object containing information on how customers can obtain support for the module. Use this parameter to provide details such as contact information and support description. + :ivar policies: A JSON object describing the module's privacy and legal policies and is displayed under the Policies tab of the Module detail page. The maximum file size for Policies is 5MB + :ivar module_info: A JSON object containing essential attributes that define a module. This information is presented on the Module detail page in the Twilio Marketplace Catalog. You can pass the following attributes in the JSON object + :ivar documentation: A JSON object for providing comprehensive information, instructions, and resources related to the module + :ivar configuration: A JSON object for providing listing specific configuration. Contains button setup, notification url, among others. + :ivar pricing: A JSON object for providing Listing specific pricing information. + :ivar listings: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.url: Optional[str] = payload.get("url") + self.sid: Optional[str] = payload.get("sid") + self.description: Optional[Dict[str, object]] = payload.get("description") + self.support: Optional[Dict[str, object]] = payload.get("support") + self.policies: Optional[Dict[str, object]] = payload.get("policies") + self.module_info: Optional[Dict[str, object]] = payload.get("module_info") + self.documentation: Optional[Dict[str, object]] = payload.get("documentation") + self.configuration: Optional[Dict[str, object]] = payload.get("configuration") + self.pricing: Optional[Dict[str, object]] = payload.get("pricing") + self.listings: Optional[List[Dict[str, object]]] = payload.get("listings") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class ModuleDataList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the ModuleDataList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Listings" + + def create( + self, + module_info: Union[str, object] = values.unset, + configuration: Union[str, object] = values.unset, + ) -> ModuleDataInstance: + """ + Create the ModuleDataInstance + + :param module_info: A JSON object containing essential attributes that define a Listing. + :param configuration: A JSON object for providing Listing-specific configuration. Contains button setup, notification URL, and more. + + :returns: The created ModuleDataInstance + """ + + data = values.of( + { + "ModuleInfo": module_info, + "Configuration": configuration, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ModuleDataInstance(self._version, payload) + + async def create_async( + self, + module_info: Union[str, object] = values.unset, + configuration: Union[str, object] = values.unset, + ) -> ModuleDataInstance: + """ + Asynchronously create the ModuleDataInstance + + :param module_info: A JSON object containing essential attributes that define a Listing. + :param configuration: A JSON object for providing Listing-specific configuration. Contains button setup, notification URL, and more. + + :returns: The created ModuleDataInstance + """ + + data = values.of( + { + "ModuleInfo": module_info, + "Configuration": configuration, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ModuleDataInstance(self._version, payload) + + def fetch(self) -> ModuleDataInstance: + """ + Asynchronously fetch the ModuleDataInstance + + + :returns: The fetched ModuleDataInstance + """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return ModuleDataInstance(self._version, payload) + + async def fetch_async(self) -> ModuleDataInstance: + """ + Asynchronously fetch the ModuleDataInstance + + + :returns: The fetched ModuleDataInstance + """ + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return ModuleDataInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/marketplace/v1/module_data_management.py b/twilio/rest/marketplace/v1/module_data_management.py index 2dbdfe055f..6ed82d846d 100644 --- a/twilio/rest/marketplace/v1/module_data_management.py +++ b/twilio/rest/marketplace/v1/module_data_management.py @@ -12,7 +12,7 @@ Do not edit the class manually. """ -from typing import Any, Dict, Optional, Union +from typing import Any, Dict, List, Optional, Union from twilio.base import values from twilio.base.instance_context import InstanceContext from twilio.base.instance_resource import InstanceResource @@ -31,6 +31,7 @@ class ModuleDataManagementInstance(InstanceResource): :ivar documentation: A JSON object for providing comprehensive information, instructions, and resources related to the module :ivar configuration: A JSON object for providing listing specific configuration. Contains button setup, notification url, among others. :ivar pricing: A JSON object for providing Listing specific pricing information. + :ivar listings: """ def __init__( @@ -47,6 +48,7 @@ def __init__( self.documentation: Optional[Dict[str, object]] = payload.get("documentation") self.configuration: Optional[Dict[str, object]] = payload.get("configuration") self.pricing: Optional[Dict[str, object]] = payload.get("pricing") + self.listings: Optional[List[Dict[str, object]]] = payload.get("listings") self._solution = { "sid": sid or self.sid, diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 197bdf65f9..2ff3d4e191 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -55,7 +55,7 @@ class ScanMessageContent(object): :ivar fallback_to_long_code: [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. :ivar area_code_geomatch: Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. :ivar synchronous_validation: Reserved. - :ivar validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + :ivar validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. Default value is `14,400`. :ivar url: The absolute URL of the Service resource. :ivar links: The absolute URLs of related resources. :ivar usecase: A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. @@ -200,7 +200,7 @@ def update( :param scan_message_content: :param fallback_to_long_code: [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. :param area_code_geomatch: Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. - :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. Default value is `14,400`. :param synchronous_validation: Reserved. :param usecase: A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. :param use_inbound_webhook_on_number: A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. @@ -262,7 +262,7 @@ async def update_async( :param scan_message_content: :param fallback_to_long_code: [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. :param area_code_geomatch: Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. - :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. Default value is `14,400`. :param synchronous_validation: Reserved. :param usecase: A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. :param use_inbound_webhook_on_number: A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. @@ -468,7 +468,7 @@ def update( :param scan_message_content: :param fallback_to_long_code: [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. :param area_code_geomatch: Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. - :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. Default value is `14,400`. :param synchronous_validation: Reserved. :param usecase: A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. :param use_inbound_webhook_on_number: A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. @@ -550,7 +550,7 @@ async def update_async( :param scan_message_content: :param fallback_to_long_code: [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. :param area_code_geomatch: Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. - :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. Default value is `14,400`. :param synchronous_validation: Reserved. :param usecase: A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. :param use_inbound_webhook_on_number: A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. @@ -746,7 +746,7 @@ def create( :param scan_message_content: :param fallback_to_long_code: [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. :param area_code_geomatch: Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. - :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. Default value is `14,400`. :param synchronous_validation: Reserved. :param usecase: A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. :param use_inbound_webhook_on_number: A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. @@ -828,7 +828,7 @@ async def create_async( :param scan_message_content: :param fallback_to_long_code: [OBSOLETE] Former feature used to fallback to long code sender after certain short code message failures. :param area_code_geomatch: Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/messaging/services#area-code-geomatch) on the Service Instance. - :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + :param validity_period: How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. Default value is `14,400`. :param synchronous_validation: Reserved. :param usecase: A string that describes the scenario in which the Messaging Service will be used. Possible values are `notifications`, `marketing`, `verification`, `discussion`, `poll`, `undeclared`. :param use_inbound_webhook_on_number: A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 043364c3d5..68f078a88d 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,12 +28,10 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) -from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( - PortingWebhookConfigurationFetchList, -) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) +from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -58,12 +56,10 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None - self._porting_webhook_configuration_fetch: Optional[ - PortingWebhookConfigurationFetchList - ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None + self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -111,22 +107,18 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete - @property - def porting_webhook_configuration_fetch( - self, - ) -> PortingWebhookConfigurationFetchList: - if self._porting_webhook_configuration_fetch is None: - self._porting_webhook_configuration_fetch = ( - PortingWebhookConfigurationFetchList(self) - ) - return self._porting_webhook_configuration_fetch - @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations + @property + def webhook(self) -> WebhookList: + if self._webhook is None: + self._webhook = WebhookList(self) + return self._webhook + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/webhook.py similarity index 78% rename from twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py rename to twilio/rest/numbers/v1/webhook.py index 5d381768c7..69bd556326 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py +++ b/twilio/rest/numbers/v1/webhook.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class PortingWebhookConfigurationFetchInstance(InstanceResource): +class WebhookInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class PortingWebhookConfigurationFetchList(ListResource): +class WebhookList(ListResource): def __init__(self, version: Version): """ - Initialize the PortingWebhookConfigurationFetchList + Initialize the WebhookList :param version: Version that contains the resource @@ -68,12 +68,12 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> PortingWebhookConfigurationFetchInstance: + def fetch(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -81,14 +81,14 @@ def fetch(self) -> PortingWebhookConfigurationFetchInstance: payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) - async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: + async def fetch_async(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -98,7 +98,7 @@ async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: method="GET", uri=self._uri, headers=headers ) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) def __repr__(self) -> str: """ @@ -106,4 +106,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" From 70d50d2805a13c0e78db049bbb84529d6047fa31 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 13 Jan 2025 11:48:38 +0000 Subject: [PATCH 078/113] Release 9.4.3 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 0ab6bc732a..229d8e1ebe 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.4.2", + version="9.4.3", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 145e35680b..8279b4dbd8 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "4", "2") +__version_info__ = ("9", "4", "3") __version__ = ".".join(__version_info__) From 73a1e2b60b616cb17ed91509a82f867ab8555390 Mon Sep 17 00:00:00 2001 From: sbansla <104902068+sbansla@users.noreply.github.com> Date: Thu, 16 Jan 2025 11:59:05 +0530 Subject: [PATCH 079/113] chore: created bug report issue template (#833) --- .github/ISSUE_TEMPLATE/bug_report.yml | 69 +++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 0000000000..6fb5f5e10e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,69 @@ +name: Bug report +description: Report a bug with the twilio-python helper library. +title: "[BUG] Describe the issue briefly" +labels: "type: bug" +body: + - type: markdown + attributes: + value: | + Thank you for reporting a bug in the twilio-python helper library. Please provide the details below to help us investigate and resolve the issue. + + - type: textarea + attributes: + label: Describe the bug + description: Provide a clear and concise description of the issue. + placeholder: A clear and concise description of the bug. + validations: + required: true + + - type: textarea + attributes: + label: Code snippet + description: Provide the code snippet that reproduces the issue. + placeholder: "```\n// Code snippet here\n```" + validations: + required: true + + - type: textarea + attributes: + label: Actual behavior + description: Describe what actually happened. + placeholder: A description of the actual behavior. + validations: + required: true + + - type: textarea + attributes: + label: Expected behavior + description: Describe what you expected to happen. + placeholder: A description of the expected outcome. + validations: + required: true + + - type: input + attributes: + label: twilio-python version + description: Specify the version of the twilio-python helper library you are using. + placeholder: e.g., 9.4.1 + validations: + required: true + + - type: input + attributes: + label: Python version + description: Specify the version of Python you are using. + placeholder: e.g., 3.9.1 + validations: + required: true + + - type: textarea + attributes: + label: Logs or error messages + description: Provide relevant logs or error messages (if any). + placeholder: "Error: Something went wrong..." + + - type: textarea + attributes: + label: Additional context + description: Add any other context about the problem here. + placeholder: Any additional From 513743f122d5d166790df8e7598522a3758f7ee0 Mon Sep 17 00:00:00 2001 From: Shubham Date: Fri, 24 Jan 2025 15:42:03 +0530 Subject: [PATCH 080/113] chore: enable newer versions of aiohttp-retry (#837) --- requirements.txt | 2 +- setup.py | 2 +- tests/unit/http/test_async_http_client.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index 3de95e70c9..a29abc4d1e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,5 +2,5 @@ pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability requests>=2.31.0 PyJWT>=2.0.0, <3.0.0 aiohttp>=3.9.4 -aiohttp-retry==2.8.3 +aiohttp-retry>=2.8.3 certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability diff --git a/setup.py b/setup.py index 229d8e1ebe..849a9da87f 100644 --- a/setup.py +++ b/setup.py @@ -24,7 +24,7 @@ "requests >= 2.0.0", "PyJWT >= 2.0.0, < 3.0.0", "aiohttp>=3.8.4", - "aiohttp-retry==2.8.3", + "aiohttp-retry>=2.8.3", ], packages=find_packages(exclude=["tests", "tests.*"]), include_package_data=True, diff --git a/tests/unit/http/test_async_http_client.py b/tests/unit/http/test_async_http_client.py index df43606843..23df35dc02 100644 --- a/tests/unit/http/test_async_http_client.py +++ b/tests/unit/http/test_async_http_client.py @@ -10,10 +10,11 @@ class MockResponse(object): A mock of the aiohttp.ClientResponse class """ - def __init__(self, text, status): + def __init__(self, text, status, method="GET"): self._text = text self.status = status self.headers = {} + self.method = method async def text(self): return self._text From 8e1fdefd45ead10e8b4bde55faa5fe7efbfef229 Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Tue, 28 Jan 2025 14:15:01 +0530 Subject: [PATCH 081/113] chore: update httpclient (#834) * chore: update httpclient --- tests/unit/http/test_http_client.py | 1 + twilio/http/http_client.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/unit/http/test_http_client.py b/tests/unit/http/test_http_client.py index 8484e57b17..cbd438251a 100644 --- a/tests/unit/http/test_http_client.py +++ b/tests/unit/http/test_http_client.py @@ -293,6 +293,7 @@ def test_session_not_preserved(self): self.assertEqual(response_2.content, "response_2") + class MyVersion(Version): def __init__(self, domain): super().__init__(domain, "v1") diff --git a/twilio/http/http_client.py b/twilio/http/http_client.py index e15be86354..2f2d363535 100644 --- a/twilio/http/http_client.py +++ b/twilio/http/http_client.py @@ -40,7 +40,7 @@ def __init__( self.session = Session() if pool_connections else None if self.session and max_retries is not None: self.session.mount("https://", HTTPAdapter(max_retries=max_retries)) - if self.session is not None: + elif self.session is not None: self.session.mount( "https://", HTTPAdapter(pool_maxsize=min(32, os.cpu_count() + 4)) ) From ab846b4107ef724cefeac351fc5dbce47bcda342 Mon Sep 17 00:00:00 2001 From: twilio-product-security <67294289+twilio-product-security@users.noreply.github.com> Date: Tue, 28 Jan 2025 08:52:43 +0000 Subject: [PATCH 082/113] fix: requirements.txt to reduce vulnerabilities (#822) The following vulnerabilities are fixed by pinning transitive dependencies: - https://snyk.io/vuln/SNYK-PYTHON-AIOHTTP-6091621 - https://snyk.io/vuln/SNYK-PYTHON-AIOHTTP-6091622 - https://snyk.io/vuln/SNYK-PYTHON-AIOHTTP-6209406 - https://snyk.io/vuln/SNYK-PYTHON-AIOHTTP-6209407 - https://snyk.io/vuln/SNYK-PYTHON-AIOHTTP-6645291 - https://snyk.io/vuln/SNYK-PYTHON-AIOHTTP-6808823 - https://snyk.io/vuln/SNYK-PYTHON-AIOHTTP-7675597 - https://snyk.io/vuln/SNYK-PYTHON-REQUESTS-6928867 - https://snyk.io/vuln/SNYK-PYTHON-URLLIB3-7267250 - https://snyk.io/vuln/SNYK-PYTHON-ZIPP-7430899 Co-authored-by: snyk-bot Co-authored-by: Manisha Singh --- requirements.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/requirements.txt b/requirements.txt index a29abc4d1e..7bc9e41806 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,8 @@ pygments>=2.7.4 # not directly required, pinned by Snyk to avoid a vulnerability -requests>=2.31.0 +requests>=2.32.2 PyJWT>=2.0.0, <3.0.0 -aiohttp>=3.9.4 -aiohttp-retry>=2.8.3 +aiohttp>=3.10.2 +aiohttp-retry==2.8.3 certifi>=2023.7.22 # not directly required, pinned by Snyk to avoid a vulnerability +urllib3>=2.2.2 # not directly required, pinned by Snyk to avoid a vulnerability +zipp>=3.19.1 # not directly required, pinned by Snyk to avoid a vulnerability From 338cbb0e216db7be9faddbca0291db45787447c8 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 28 Jan 2025 11:33:46 +0000 Subject: [PATCH 083/113] [Librarian] Regenerated @ a7caf52aaea6fe6c7b30170a468564bcea4f0362 13ec50967b82ae43900a263102daafb96aa61935 --- CHANGES.md | 23 +++++ tests/unit/http/test_http_client.py | 1 - twilio/rest/content/v1/content/__init__.py | 87 +++++++++++++++++++ .../conversations/v1/address_configuration.py | 1 + .../rest/events/v1/subscription/__init__.py | 40 ++++++++- twilio/rest/iam/v1/__init__.py | 12 +-- twilio/rest/iam/v1/{key.py => new_api_key.py} | 30 +++---- .../rest/insights/v1/conference/__init__.py | 1 + twilio/rest/lookups/v2/phone_number.py | 12 +++ twilio/rest/numbers/v1/__init__.py | 24 +++-- ...=> porting_webhook_configuration_fetch.py} | 26 +++--- 11 files changed, 212 insertions(+), 45 deletions(-) rename twilio/rest/iam/v1/{key.py => new_api_key.py} (88%) rename twilio/rest/numbers/v1/{webhook.py => porting_webhook_configuration_fetch.py} (78%) diff --git a/CHANGES.md b/CHANGES.md index 7c0335ea99..3f7e5575aa 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,29 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-01-28] Version 9.4.4 +-------------------------- +**Library - Fix** +- [PR #822](https://github.com/twilio/twilio-python/pull/822): Fix for 10 vulnerabilities. Thanks to [@twilio-product-security](https://github.com/twilio-product-security)! + +**Library - Chore** +- [PR #834](https://github.com/twilio/twilio-python/pull/834): update httpclient. Thanks to [@manisha1997](https://github.com/manisha1997)! +- [PR #837](https://github.com/twilio/twilio-python/pull/837): enable newer versions of aiohttp-retry. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! +- [PR #833](https://github.com/twilio/twilio-python/pull/833): created bug report issue template. Thanks to [@sbansla](https://github.com/sbansla)! + +**Api** +- Add open-api file tag to `conference/call recordings` and `recording_transcriptions`. + +**Events** +- Add support for subaccount subscriptions (beta) + +**Insights** +- add new region to conference APIs + +**Lookups** +- Add new `parnter_sub_id` query parameter to the lookup request + + [2025-01-13] Version 9.4.3 -------------------------- **Messaging** diff --git a/tests/unit/http/test_http_client.py b/tests/unit/http/test_http_client.py index cbd438251a..8484e57b17 100644 --- a/tests/unit/http/test_http_client.py +++ b/tests/unit/http/test_http_client.py @@ -293,7 +293,6 @@ def test_session_not_preserved(self): self.assertEqual(response_2.content, "response_2") - class MyVersion(Version): def __init__(self, domain): super().__init__(domain, "v1") diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 60a5b05016..6223e940b3 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -525,6 +525,26 @@ def to_dict(self): ), } + class TwilioSchedule(object): + """ + :ivar id: + :ivar title: + :ivar time_slots: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.title: Optional[str] = payload.get("title") + self.time_slots: Optional[str] = payload.get("time_slots") + + def to_dict(self): + return { + "id": self.id, + "title": self.title, + "time_slots": self.time_slots, + } + class TwilioText(object): """ :ivar body: @@ -551,6 +571,7 @@ class Types(object): :ivar twilio_catalog: :ivar twilio_carousel: :ivar twilio_flows: + :ivar twilio_schedule: :ivar whatsapp_card: :ivar whatsapp_authentication: """ @@ -587,6 +608,9 @@ def __init__(self, payload: Dict[str, Any]): self.twilio_flows: Optional[ContentList.TwilioFlows] = payload.get( "twilio_flows" ) + self.twilio_schedule: Optional[ContentList.TwilioSchedule] = payload.get( + "twilio_schedule" + ) self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( "whatsapp_card" ) @@ -642,6 +666,11 @@ def to_dict(self): if self.twilio_flows is not None else None ), + "twilio_schedule": ( + self.twilio_schedule.to_dict() + if self.twilio_schedule is not None + else None + ), "whatsapp_card": ( self.whatsapp_card.to_dict() if self.whatsapp_card is not None @@ -1355,6 +1384,26 @@ def to_dict(self): ), } + class TwilioSchedule(object): + """ + :ivar id: + :ivar title: + :ivar time_slots: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.title: Optional[str] = payload.get("title") + self.time_slots: Optional[str] = payload.get("time_slots") + + def to_dict(self): + return { + "id": self.id, + "title": self.title, + "time_slots": self.time_slots, + } + class TwilioText(object): """ :ivar body: @@ -1381,6 +1430,7 @@ class Types(object): :ivar twilio_catalog: :ivar twilio_carousel: :ivar twilio_flows: + :ivar twilio_schedule: :ivar whatsapp_card: :ivar whatsapp_authentication: """ @@ -1417,6 +1467,9 @@ def __init__(self, payload: Dict[str, Any]): self.twilio_flows: Optional[ContentList.TwilioFlows] = payload.get( "twilio_flows" ) + self.twilio_schedule: Optional[ContentList.TwilioSchedule] = payload.get( + "twilio_schedule" + ) self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( "whatsapp_card" ) @@ -1472,6 +1525,11 @@ def to_dict(self): if self.twilio_flows is not None else None ), + "twilio_schedule": ( + self.twilio_schedule.to_dict() + if self.twilio_schedule is not None + else None + ), "whatsapp_card": ( self.whatsapp_card.to_dict() if self.whatsapp_card is not None @@ -2186,6 +2244,26 @@ def to_dict(self): ), } + class TwilioSchedule(object): + """ + :ivar id: + :ivar title: + :ivar time_slots: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.id: Optional[str] = payload.get("id") + self.title: Optional[str] = payload.get("title") + self.time_slots: Optional[str] = payload.get("time_slots") + + def to_dict(self): + return { + "id": self.id, + "title": self.title, + "time_slots": self.time_slots, + } + class TwilioText(object): """ :ivar body: @@ -2212,6 +2290,7 @@ class Types(object): :ivar twilio_catalog: :ivar twilio_carousel: :ivar twilio_flows: + :ivar twilio_schedule: :ivar whatsapp_card: :ivar whatsapp_authentication: """ @@ -2248,6 +2327,9 @@ def __init__(self, payload: Dict[str, Any]): self.twilio_flows: Optional[ContentList.TwilioFlows] = payload.get( "twilio_flows" ) + self.twilio_schedule: Optional[ContentList.TwilioSchedule] = payload.get( + "twilio_schedule" + ) self.whatsapp_card: Optional[ContentList.WhatsappCard] = payload.get( "whatsapp_card" ) @@ -2303,6 +2385,11 @@ def to_dict(self): if self.twilio_flows is not None else None ), + "twilio_schedule": ( + self.twilio_schedule.to_dict() + if self.twilio_schedule is not None + else None + ), "whatsapp_card": ( self.whatsapp_card.to_dict() if self.whatsapp_card is not None diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index 4ebfa47fc2..1609d99576 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -40,6 +40,7 @@ class Type(object): GBM = "gbm" EMAIL = "email" RCS = "rcs" + APPLE = "apple" """ :ivar sid: A 34 character string that uniquely identifies this resource. diff --git a/twilio/rest/events/v1/subscription/__init__.py b/twilio/rest/events/v1/subscription/__init__.py index 872c9ed7d0..e77cf10b51 100644 --- a/twilio/rest/events/v1/subscription/__init__.py +++ b/twilio/rest/events/v1/subscription/__init__.py @@ -33,6 +33,7 @@ class SubscriptionInstance(InstanceResource): :ivar sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. :ivar url: The URL of this resource. :ivar links: Contains a dictionary of URL links to nested resources of this Subscription. + :ivar receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. """ def __init__( @@ -52,6 +53,9 @@ def __init__( self.sink_sid: Optional[str] = payload.get("sink_sid") self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") + self.receive_events_from_subaccounts: Optional[bool] = payload.get( + "receive_events_from_subaccounts" + ) self._solution = { "sid": sid or self.sid, @@ -113,36 +117,42 @@ def update( self, description: Union[str, object] = values.unset, sink_sid: Union[str, object] = values.unset, + receive_events_from_subaccounts: Union[bool, object] = values.unset, ) -> "SubscriptionInstance": """ Update the SubscriptionInstance :param description: A human readable description for the Subscription. :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The updated SubscriptionInstance """ return self._proxy.update( description=description, sink_sid=sink_sid, + receive_events_from_subaccounts=receive_events_from_subaccounts, ) async def update_async( self, description: Union[str, object] = values.unset, sink_sid: Union[str, object] = values.unset, + receive_events_from_subaccounts: Union[bool, object] = values.unset, ) -> "SubscriptionInstance": """ Asynchronous coroutine to update the SubscriptionInstance :param description: A human readable description for the Subscription. :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The updated SubscriptionInstance """ return await self._proxy.update_async( description=description, sink_sid=sink_sid, + receive_events_from_subaccounts=receive_events_from_subaccounts, ) @property @@ -253,12 +263,14 @@ def update( self, description: Union[str, object] = values.unset, sink_sid: Union[str, object] = values.unset, + receive_events_from_subaccounts: Union[bool, object] = values.unset, ) -> SubscriptionInstance: """ Update the SubscriptionInstance :param description: A human readable description for the Subscription. :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The updated SubscriptionInstance """ @@ -267,6 +279,9 @@ def update( { "Description": description, "SinkSid": sink_sid, + "ReceiveEventsFromSubaccounts": serialize.boolean_to_string( + receive_events_from_subaccounts + ), } ) headers = values.of({}) @@ -285,12 +300,14 @@ async def update_async( self, description: Union[str, object] = values.unset, sink_sid: Union[str, object] = values.unset, + receive_events_from_subaccounts: Union[bool, object] = values.unset, ) -> SubscriptionInstance: """ Asynchronous coroutine to update the SubscriptionInstance :param description: A human readable description for the Subscription. :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The updated SubscriptionInstance """ @@ -299,6 +316,9 @@ async def update_async( { "Description": description, "SinkSid": sink_sid, + "ReceiveEventsFromSubaccounts": serialize.boolean_to_string( + receive_events_from_subaccounts + ), } ) headers = values.of({}) @@ -368,7 +388,11 @@ def __init__(self, version: Version): self._uri = "/Subscriptions" def create( - self, description: str, sink_sid: str, types: List[object] + self, + description: str, + sink_sid: str, + types: List[object], + receive_events_from_subaccounts: Union[bool, object] = values.unset, ) -> SubscriptionInstance: """ Create the SubscriptionInstance @@ -376,6 +400,7 @@ def create( :param description: A human readable description for the Subscription **This value should not contain PII.** :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. :param types: An array of objects containing the subscribed Event Types + :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The created SubscriptionInstance """ @@ -385,6 +410,9 @@ def create( "Description": description, "SinkSid": sink_sid, "Types": serialize.map(types, lambda e: serialize.object(e)), + "ReceiveEventsFromSubaccounts": serialize.boolean_to_string( + receive_events_from_subaccounts + ), } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -400,7 +428,11 @@ def create( return SubscriptionInstance(self._version, payload) async def create_async( - self, description: str, sink_sid: str, types: List[object] + self, + description: str, + sink_sid: str, + types: List[object], + receive_events_from_subaccounts: Union[bool, object] = values.unset, ) -> SubscriptionInstance: """ Asynchronously create the SubscriptionInstance @@ -408,6 +440,7 @@ async def create_async( :param description: A human readable description for the Subscription **This value should not contain PII.** :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. :param types: An array of objects containing the subscribed Event Types + :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The created SubscriptionInstance """ @@ -417,6 +450,9 @@ async def create_async( "Description": description, "SinkSid": sink_sid, "Types": serialize.map(types, lambda e: serialize.object(e)), + "ReceiveEventsFromSubaccounts": serialize.boolean_to_string( + receive_events_from_subaccounts + ), } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) diff --git a/twilio/rest/iam/v1/__init__.py b/twilio/rest/iam/v1/__init__.py index 408de11acb..0c46947341 100644 --- a/twilio/rest/iam/v1/__init__.py +++ b/twilio/rest/iam/v1/__init__.py @@ -17,7 +17,7 @@ from twilio.base.domain import Domain from twilio.rest.iam.v1.api_key import ApiKeyList from twilio.rest.iam.v1.get_api_keys import GetApiKeysList -from twilio.rest.iam.v1.key import KeyList +from twilio.rest.iam.v1.new_api_key import NewApiKeyList class V1(Version): @@ -31,7 +31,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._api_key: Optional[ApiKeyList] = None self._get_api_keys: Optional[GetApiKeysList] = None - self._keys: Optional[KeyList] = None + self._new_api_key: Optional[NewApiKeyList] = None @property def api_key(self) -> ApiKeyList: @@ -46,10 +46,10 @@ def get_api_keys(self) -> GetApiKeysList: return self._get_api_keys @property - def keys(self) -> KeyList: - if self._keys is None: - self._keys = KeyList(self) - return self._keys + def new_api_key(self) -> NewApiKeyList: + if self._new_api_key is None: + self._new_api_key = NewApiKeyList(self) + return self._new_api_key def __repr__(self) -> str: """ diff --git a/twilio/rest/iam/v1/key.py b/twilio/rest/iam/v1/new_api_key.py similarity index 88% rename from twilio/rest/iam/v1/key.py rename to twilio/rest/iam/v1/new_api_key.py index cd5556df94..760ce79ca3 100644 --- a/twilio/rest/iam/v1/key.py +++ b/twilio/rest/iam/v1/new_api_key.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class KeyInstance(InstanceResource): +class NewApiKeyInstance(InstanceResource): class Keytype(object): RESTRICTED = "restricted" @@ -56,14 +56,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class KeyList(ListResource): +class NewApiKeyList(ListResource): def __init__(self, version: Version): """ - Initialize the KeyList + Initialize the NewApiKeyList :param version: Version that contains the resource @@ -76,18 +76,18 @@ def create( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["KeyInstance.Keytype", object] = values.unset, + key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> KeyInstance: + ) -> NewApiKeyInstance: """ - Create the KeyInstance + Create the NewApiKeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created KeyInstance + :returns: The created NewApiKeyInstance """ data = values.of( @@ -108,24 +108,24 @@ def create( method="POST", uri=self._uri, data=data, headers=headers ) - return KeyInstance(self._version, payload) + return NewApiKeyInstance(self._version, payload) async def create_async( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["KeyInstance.Keytype", object] = values.unset, + key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> KeyInstance: + ) -> NewApiKeyInstance: """ - Asynchronously create the KeyInstance + Asynchronously create the NewApiKeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created KeyInstance + :returns: The created NewApiKeyInstance """ data = values.of( @@ -146,7 +146,7 @@ async def create_async( method="POST", uri=self._uri, data=data, headers=headers ) - return KeyInstance(self._version, payload) + return NewApiKeyInstance(self._version, payload) def __repr__(self) -> str: """ @@ -154,4 +154,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/insights/v1/conference/__init__.py b/twilio/rest/insights/v1/conference/__init__.py index 0f9bb118b5..a30de54cd7 100644 --- a/twilio/rest/insights/v1/conference/__init__.py +++ b/twilio/rest/insights/v1/conference/__init__.py @@ -51,6 +51,7 @@ class ProcessingState(object): class Region(object): US1 = "us1" + US2 = "us2" AU1 = "au1" BR1 = "br1" IE1 = "ie1" diff --git a/twilio/rest/lookups/v2/phone_number.py b/twilio/rest/lookups/v2/phone_number.py index ac1b3257ef..fc60eed6d3 100644 --- a/twilio/rest/lookups/v2/phone_number.py +++ b/twilio/rest/lookups/v2/phone_number.py @@ -124,6 +124,7 @@ def fetch( date_of_birth: Union[str, object] = values.unset, last_verified_date: Union[str, object] = values.unset, verification_sid: Union[str, object] = values.unset, + partner_sub_id: Union[str, object] = values.unset, ) -> "PhoneNumberInstance": """ Fetch the PhoneNumberInstance @@ -142,6 +143,7 @@ def fetch( :param date_of_birth: User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. :param last_verified_date: The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. :param verification_sid: The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. + :param partner_sub_id: The optional partnerSubId parameter to provide context for your sub-accounts, tenantIDs, sender IDs or other segmentation, enhancing the accuracy of the risk analysis. :returns: The fetched PhoneNumberInstance """ @@ -160,6 +162,7 @@ def fetch( date_of_birth=date_of_birth, last_verified_date=last_verified_date, verification_sid=verification_sid, + partner_sub_id=partner_sub_id, ) async def fetch_async( @@ -178,6 +181,7 @@ async def fetch_async( date_of_birth: Union[str, object] = values.unset, last_verified_date: Union[str, object] = values.unset, verification_sid: Union[str, object] = values.unset, + partner_sub_id: Union[str, object] = values.unset, ) -> "PhoneNumberInstance": """ Asynchronous coroutine to fetch the PhoneNumberInstance @@ -196,6 +200,7 @@ async def fetch_async( :param date_of_birth: User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. :param last_verified_date: The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. :param verification_sid: The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. + :param partner_sub_id: The optional partnerSubId parameter to provide context for your sub-accounts, tenantIDs, sender IDs or other segmentation, enhancing the accuracy of the risk analysis. :returns: The fetched PhoneNumberInstance """ @@ -214,6 +219,7 @@ async def fetch_async( date_of_birth=date_of_birth, last_verified_date=last_verified_date, verification_sid=verification_sid, + partner_sub_id=partner_sub_id, ) def __repr__(self) -> str: @@ -259,6 +265,7 @@ def fetch( date_of_birth: Union[str, object] = values.unset, last_verified_date: Union[str, object] = values.unset, verification_sid: Union[str, object] = values.unset, + partner_sub_id: Union[str, object] = values.unset, ) -> PhoneNumberInstance: """ Fetch the PhoneNumberInstance @@ -277,6 +284,7 @@ def fetch( :param date_of_birth: User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. :param last_verified_date: The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. :param verification_sid: The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. + :param partner_sub_id: The optional partnerSubId parameter to provide context for your sub-accounts, tenantIDs, sender IDs or other segmentation, enhancing the accuracy of the risk analysis. :returns: The fetched PhoneNumberInstance """ @@ -297,6 +305,7 @@ def fetch( "DateOfBirth": date_of_birth, "LastVerifiedDate": last_verified_date, "VerificationSid": verification_sid, + "PartnerSubId": partner_sub_id, } ) @@ -330,6 +339,7 @@ async def fetch_async( date_of_birth: Union[str, object] = values.unset, last_verified_date: Union[str, object] = values.unset, verification_sid: Union[str, object] = values.unset, + partner_sub_id: Union[str, object] = values.unset, ) -> PhoneNumberInstance: """ Asynchronous coroutine to fetch the PhoneNumberInstance @@ -348,6 +358,7 @@ async def fetch_async( :param date_of_birth: User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. :param last_verified_date: The date you obtained consent to call or text the end-user of the phone number or a date on which you are reasonably certain that the end-user could still be reached at that number. This query parameter is only used (optionally) for reassigned_number package requests. :param verification_sid: The unique identifier associated with a verification process through verify API. This query parameter is only used (optionally) for pre_fill package requests. + :param partner_sub_id: The optional partnerSubId parameter to provide context for your sub-accounts, tenantIDs, sender IDs or other segmentation, enhancing the accuracy of the risk analysis. :returns: The fetched PhoneNumberInstance """ @@ -368,6 +379,7 @@ async def fetch_async( "DateOfBirth": date_of_birth, "LastVerifiedDate": last_verified_date, "VerificationSid": verification_sid, + "PartnerSubId": partner_sub_id, } ) diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 68f078a88d..043364c3d5 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,10 +28,12 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) +from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( + PortingWebhookConfigurationFetchList, +) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) -from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -56,10 +58,12 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None + self._porting_webhook_configuration_fetch: Optional[ + PortingWebhookConfigurationFetchList + ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None - self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -107,18 +111,22 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete + @property + def porting_webhook_configuration_fetch( + self, + ) -> PortingWebhookConfigurationFetchList: + if self._porting_webhook_configuration_fetch is None: + self._porting_webhook_configuration_fetch = ( + PortingWebhookConfigurationFetchList(self) + ) + return self._porting_webhook_configuration_fetch + @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations - @property - def webhook(self) -> WebhookList: - if self._webhook is None: - self._webhook = WebhookList(self) - return self._webhook - def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/webhook.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py similarity index 78% rename from twilio/rest/numbers/v1/webhook.py rename to twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py index 69bd556326..5d381768c7 100644 --- a/twilio/rest/numbers/v1/webhook.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class WebhookInstance(InstanceResource): +class PortingWebhookConfigurationFetchInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class WebhookList(ListResource): +class PortingWebhookConfigurationFetchList(ListResource): def __init__(self, version: Version): """ - Initialize the WebhookList + Initialize the PortingWebhookConfigurationFetchList :param version: Version that contains the resource @@ -68,12 +68,12 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> WebhookInstance: + def fetch(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -81,14 +81,14 @@ def fetch(self) -> WebhookInstance: payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) - async def fetch_async(self) -> WebhookInstance: + async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -98,7 +98,7 @@ async def fetch_async(self) -> WebhookInstance: method="GET", uri=self._uri, headers=headers ) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) def __repr__(self) -> str: """ @@ -106,4 +106,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" From ffc0aa1eb38214c913491750577352cc730f10d7 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 28 Jan 2025 11:38:15 +0000 Subject: [PATCH 084/113] Release 9.4.4 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 849a9da87f..f49018cffb 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.4.3", + version="9.4.4", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 8279b4dbd8..766475c133 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "4", "3") +__version_info__ = ("9", "4", "4") __version__ = ".".join(__version_info__) From d120aff177ecd1eb6220041bd314b78a8bad0d34 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 11 Feb 2025 11:12:19 +0000 Subject: [PATCH 085/113] [Librarian] Regenerated @ 6b85410bb6ecf3aa579d1fa442c7bb74c62cf6f0 ae4a12dded508a988aeaca39721be27984e9aeeb --- CHANGES.md | 15 + .../api/v2010/account/address/__init__.py | 8 +- .../v2/transcript/operator_result.py | 4 + twilio/rest/messaging/v1/service/__init__.py | 23 + .../v1/service/destination_alpha_sender.py | 554 ++++++++++++++++++ 5 files changed, 600 insertions(+), 4 deletions(-) create mode 100644 twilio/rest/messaging/v1/service/destination_alpha_sender.py diff --git a/CHANGES.md b/CHANGES.md index 3f7e5575aa..42fb1a3d15 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,21 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-02-11] Version 9.4.5 +-------------------------- +**Api** +- Change downstream url and change media type for file `base/api/v2010/validation_request.json`. + +**Intelligence** +- Add json_results for Generative JSON operator results + +**Messaging** +- Add DestinationAlphaSender API to support Country-Specific Alpha Senders + +**Video** +- Change codec type from enum to case-insensitive enum in recording and room_recording apis + + [2025-01-28] Version 9.4.4 -------------------------- **Library - Fix** diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index b97628fe87..38a5a231a8 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -148,7 +148,7 @@ def update( """ Update the AddressInstance - :param friendly_name: A descriptive string that you create to describe the address. It can be up to 64 characters long. + :param friendly_name: A descriptive string that you create to describe the new address. It can be up to 64 characters long for Regulatory Compliance addresses and 32 characters long for Emergency addresses. :param customer_name: The name to associate with the address. :param street: The number and street address of the address. :param city: The city of the address. @@ -187,7 +187,7 @@ async def update_async( """ Asynchronous coroutine to update the AddressInstance - :param friendly_name: A descriptive string that you create to describe the address. It can be up to 64 characters long. + :param friendly_name: A descriptive string that you create to describe the new address. It can be up to 64 characters long for Regulatory Compliance addresses and 32 characters long for Emergency addresses. :param customer_name: The name to associate with the address. :param street: The number and street address of the address. :param city: The city of the address. @@ -336,7 +336,7 @@ def update( """ Update the AddressInstance - :param friendly_name: A descriptive string that you create to describe the address. It can be up to 64 characters long. + :param friendly_name: A descriptive string that you create to describe the new address. It can be up to 64 characters long for Regulatory Compliance addresses and 32 characters long for Emergency addresses. :param customer_name: The name to associate with the address. :param street: The number and street address of the address. :param city: The city of the address. @@ -394,7 +394,7 @@ async def update_async( """ Asynchronous coroutine to update the AddressInstance - :param friendly_name: A descriptive string that you create to describe the address. It can be up to 64 characters long. + :param friendly_name: A descriptive string that you create to describe the new address. It can be up to 64 characters long for Regulatory Compliance addresses and 32 characters long for Emergency addresses. :param customer_name: The name to associate with the address. :param street: The number and street address of the address. :param city: The city of the address. diff --git a/twilio/rest/intelligence/v2/transcript/operator_result.py b/twilio/rest/intelligence/v2/transcript/operator_result.py index 4b607b39e8..9ba2c57f62 100644 --- a/twilio/rest/intelligence/v2/transcript/operator_result.py +++ b/twilio/rest/intelligence/v2/transcript/operator_result.py @@ -29,6 +29,8 @@ class OperatorType(object): EXTRACT = "extract" EXTRACT_NORMALIZE = "extract_normalize" PII_EXTRACT = "pii_extract" + TEXT_GENERATION = "text_generation" + JSON = "json" """ :ivar operator_type: @@ -44,6 +46,7 @@ class OperatorType(object): :ivar label_probabilities: The labels probabilities. This might be available on conversation classify model outputs. :ivar extract_results: List of text extraction results. This might be available on classify-extract model outputs. :ivar text_generation_results: Output of a text generation operator for example Conversation Sumamary. + :ivar json_results: :ivar transcript_sid: A 34 character string that uniquely identifies this Transcript. :ivar url: The URL of this resource. """ @@ -84,6 +87,7 @@ def __init__( self.text_generation_results: Optional[Dict[str, object]] = payload.get( "text_generation_results" ) + self.json_results: Optional[Dict[str, object]] = payload.get("json_results") self.transcript_sid: Optional[str] = payload.get("transcript_sid") self.url: Optional[str] = payload.get("url") diff --git a/twilio/rest/messaging/v1/service/__init__.py b/twilio/rest/messaging/v1/service/__init__.py index 2ff3d4e191..06a53c9a20 100644 --- a/twilio/rest/messaging/v1/service/__init__.py +++ b/twilio/rest/messaging/v1/service/__init__.py @@ -22,6 +22,9 @@ from twilio.base.page import Page from twilio.rest.messaging.v1.service.alpha_sender import AlphaSenderList from twilio.rest.messaging.v1.service.channel_sender import ChannelSenderList +from twilio.rest.messaging.v1.service.destination_alpha_sender import ( + DestinationAlphaSenderList, +) from twilio.rest.messaging.v1.service.phone_number import PhoneNumberList from twilio.rest.messaging.v1.service.short_code import ShortCodeList from twilio.rest.messaging.v1.service.us_app_to_person import UsAppToPersonList @@ -302,6 +305,13 @@ def channel_senders(self) -> ChannelSenderList: """ return self._proxy.channel_senders + @property + def destination_alpha_senders(self) -> DestinationAlphaSenderList: + """ + Access the destination_alpha_senders + """ + return self._proxy.destination_alpha_senders + @property def phone_numbers(self) -> PhoneNumberList: """ @@ -359,6 +369,7 @@ def __init__(self, version: Version, sid: str): self._alpha_senders: Optional[AlphaSenderList] = None self._channel_senders: Optional[ChannelSenderList] = None + self._destination_alpha_senders: Optional[DestinationAlphaSenderList] = None self._phone_numbers: Optional[PhoneNumberList] = None self._short_codes: Optional[ShortCodeList] = None self._us_app_to_person: Optional[UsAppToPersonList] = None @@ -620,6 +631,18 @@ def channel_senders(self) -> ChannelSenderList: ) return self._channel_senders + @property + def destination_alpha_senders(self) -> DestinationAlphaSenderList: + """ + Access the destination_alpha_senders + """ + if self._destination_alpha_senders is None: + self._destination_alpha_senders = DestinationAlphaSenderList( + self._version, + self._solution["sid"], + ) + return self._destination_alpha_senders + @property def phone_numbers(self) -> PhoneNumberList: """ diff --git a/twilio/rest/messaging/v1/service/destination_alpha_sender.py b/twilio/rest/messaging/v1/service/destination_alpha_sender.py new file mode 100644 index 0000000000..ffe1700929 --- /dev/null +++ b/twilio/rest/messaging/v1/service/destination_alpha_sender.py @@ -0,0 +1,554 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Messaging + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class DestinationAlphaSenderInstance(InstanceResource): + """ + :ivar sid: The unique string that we created to identify the AlphaSender resource. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the AlphaSender resource. + :ivar service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) the resource is associated with. + :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the resource was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar alpha_sender: The Alphanumeric Sender ID string. + :ivar capabilities: An array of values that describe whether the number can receive calls or messages. Can be: `SMS`. + :ivar url: The absolute URL of the AlphaSender resource. + :ivar iso_country_code: The Two Character ISO Country Code the Alphanumeric Sender ID will be used for. For Default Alpha Senders that work across countries, this value will be an empty string + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + service_sid: str, + sid: Optional[str] = None, + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.service_sid: Optional[str] = payload.get("service_sid") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.alpha_sender: Optional[str] = payload.get("alpha_sender") + self.capabilities: Optional[List[str]] = payload.get("capabilities") + self.url: Optional[str] = payload.get("url") + self.iso_country_code: Optional[str] = payload.get("iso_country_code") + + self._solution = { + "service_sid": service_sid, + "sid": sid or self.sid, + } + self._context: Optional[DestinationAlphaSenderContext] = None + + @property + def _proxy(self) -> "DestinationAlphaSenderContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: DestinationAlphaSenderContext for this DestinationAlphaSenderInstance + """ + if self._context is None: + self._context = DestinationAlphaSenderContext( + self._version, + service_sid=self._solution["service_sid"], + sid=self._solution["sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the DestinationAlphaSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the DestinationAlphaSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "DestinationAlphaSenderInstance": + """ + Fetch the DestinationAlphaSenderInstance + + + :returns: The fetched DestinationAlphaSenderInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "DestinationAlphaSenderInstance": + """ + Asynchronous coroutine to fetch the DestinationAlphaSenderInstance + + + :returns: The fetched DestinationAlphaSenderInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class DestinationAlphaSenderContext(InstanceContext): + + def __init__(self, version: Version, service_sid: str, sid: str): + """ + Initialize the DestinationAlphaSenderContext + + :param version: Version that contains the resource + :param service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to fetch the resource from. + :param sid: The SID of the AlphaSender resource to fetch. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "service_sid": service_sid, + "sid": sid, + } + self._uri = "/Services/{service_sid}/DestinationAlphaSenders/{sid}".format( + **self._solution + ) + + def delete(self) -> bool: + """ + Deletes the DestinationAlphaSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the DestinationAlphaSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + return await self._version.delete_async( + method="DELETE", uri=self._uri, headers=headers + ) + + def fetch(self) -> DestinationAlphaSenderInstance: + """ + Fetch the DestinationAlphaSenderInstance + + + :returns: The fetched DestinationAlphaSenderInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return DestinationAlphaSenderInstance( + self._version, + payload, + service_sid=self._solution["service_sid"], + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> DestinationAlphaSenderInstance: + """ + Asynchronous coroutine to fetch the DestinationAlphaSenderInstance + + + :returns: The fetched DestinationAlphaSenderInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return DestinationAlphaSenderInstance( + self._version, + payload, + service_sid=self._solution["service_sid"], + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class DestinationAlphaSenderPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> DestinationAlphaSenderInstance: + """ + Build an instance of DestinationAlphaSenderInstance + + :param payload: Payload response from the API + """ + return DestinationAlphaSenderInstance( + self._version, payload, service_sid=self._solution["service_sid"] + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class DestinationAlphaSenderList(ListResource): + + def __init__(self, version: Version, service_sid: str): + """ + Initialize the DestinationAlphaSenderList + + :param version: Version that contains the resource + :param service_sid: The SID of the [Service](https://www.twilio.com/docs/chat/rest/service-resource) to read the resources from. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "service_sid": service_sid, + } + self._uri = "/Services/{service_sid}/DestinationAlphaSenders".format( + **self._solution + ) + + def create( + self, alpha_sender: str, iso_country_code: Union[str, object] = values.unset + ) -> DestinationAlphaSenderInstance: + """ + Create the DestinationAlphaSenderInstance + + :param alpha_sender: The Alphanumeric Sender ID string. Can be up to 11 characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers. + :param iso_country_code: The Optional Two Character ISO Country Code the Alphanumeric Sender ID will be used for. If the IsoCountryCode is not provided, a default Alpha Sender will be created that can be used across all countries. + + :returns: The created DestinationAlphaSenderInstance + """ + + data = values.of( + { + "AlphaSender": alpha_sender, + "IsoCountryCode": iso_country_code, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return DestinationAlphaSenderInstance( + self._version, payload, service_sid=self._solution["service_sid"] + ) + + async def create_async( + self, alpha_sender: str, iso_country_code: Union[str, object] = values.unset + ) -> DestinationAlphaSenderInstance: + """ + Asynchronously create the DestinationAlphaSenderInstance + + :param alpha_sender: The Alphanumeric Sender ID string. Can be up to 11 characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers. + :param iso_country_code: The Optional Two Character ISO Country Code the Alphanumeric Sender ID will be used for. If the IsoCountryCode is not provided, a default Alpha Sender will be created that can be used across all countries. + + :returns: The created DestinationAlphaSenderInstance + """ + + data = values.of( + { + "AlphaSender": alpha_sender, + "IsoCountryCode": iso_country_code, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return DestinationAlphaSenderInstance( + self._version, payload, service_sid=self._solution["service_sid"] + ) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[DestinationAlphaSenderInstance]: + """ + Streams DestinationAlphaSenderInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[DestinationAlphaSenderInstance]: + """ + Asynchronously streams DestinationAlphaSenderInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[DestinationAlphaSenderInstance]: + """ + Lists DestinationAlphaSenderInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[DestinationAlphaSenderInstance]: + """ + Asynchronously lists DestinationAlphaSenderInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> DestinationAlphaSenderPage: + """ + Retrieve a single page of DestinationAlphaSenderInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of DestinationAlphaSenderInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return DestinationAlphaSenderPage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> DestinationAlphaSenderPage: + """ + Asynchronously retrieve a single page of DestinationAlphaSenderInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of DestinationAlphaSenderInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return DestinationAlphaSenderPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> DestinationAlphaSenderPage: + """ + Retrieve a specific page of DestinationAlphaSenderInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of DestinationAlphaSenderInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return DestinationAlphaSenderPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> DestinationAlphaSenderPage: + """ + Asynchronously retrieve a specific page of DestinationAlphaSenderInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of DestinationAlphaSenderInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return DestinationAlphaSenderPage(self._version, response, self._solution) + + def get(self, sid: str) -> DestinationAlphaSenderContext: + """ + Constructs a DestinationAlphaSenderContext + + :param sid: The SID of the AlphaSender resource to fetch. + """ + return DestinationAlphaSenderContext( + self._version, service_sid=self._solution["service_sid"], sid=sid + ) + + def __call__(self, sid: str) -> DestinationAlphaSenderContext: + """ + Constructs a DestinationAlphaSenderContext + + :param sid: The SID of the AlphaSender resource to fetch. + """ + return DestinationAlphaSenderContext( + self._version, service_sid=self._solution["service_sid"], sid=sid + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" From 424a9ba73a34f81bd79f6b50df7742a5c73fd7a8 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 11 Feb 2025 11:17:11 +0000 Subject: [PATCH 086/113] Release 9.4.5 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index f49018cffb..8313a29cfc 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.4.4", + version="9.4.5", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 766475c133..7a2fbba6c7 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "4", "4") +__version_info__ = ("9", "4", "5") __version__ = ".".join(__version_info__) From fb163f4157fff46c6894a10b12e89dfb5c140a37 Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Wed, 12 Feb 2025 12:46:29 +0530 Subject: [PATCH 087/113] chore: issue 841 (#842) * chore: update README.md * chore: update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bfbd6a14b5..24ece99218 100644 --- a/README.md +++ b/README.md @@ -135,7 +135,9 @@ client = Client() ### Specify Region and/or Edge -To take advantage of Twilio's [Global Infrastructure](https://www.twilio.com/docs/global-infrastructure), specify the target Region and/or Edge for the client: +To take advantage of Twilio's [Global Infrastructure](https://www.twilio.com/docs/global-infrastructure), specify the target Region and Edge for the client: + +> **Note:** When specifying a `region` parameter for a helper library client, be sure to also specify the `edge` parameter. For backward compatibility purposes, specifying a `region` without specifying an `edge` will result in requests being routed to US1. ```python from twilio.rest import Client From 17cbe04fafef7b2a63aa24cd57d1629ca4fa8470 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 20 Feb 2025 14:12:19 +0000 Subject: [PATCH 088/113] [Librarian] Regenerated @ 125dc871b4170bce0faca169f8a588f6ff356a88 0c222649d98edbac6858ea253f9b77fc22386e47 --- CHANGES.md | 15 + .../api/v2010/account/call/transcription.py | 4 +- .../interaction_channel/__init__.py | 24 + .../interaction_transfer.py | 423 ++++++++++++++++++ twilio/rest/iam/v1/__init__.py | 12 +- twilio/rest/iam/v1/{new_api_key.py => key.py} | 30 +- twilio/rest/numbers/v1/__init__.py | 24 +- ...hook_configuration_fetch.py => webhook.py} | 26 +- .../rest/trusthub/v1/supporting_document.py | 12 +- 9 files changed, 512 insertions(+), 58 deletions(-) create mode 100644 twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.py rename twilio/rest/iam/v1/{new_api_key.py => key.py} (88%) rename twilio/rest/numbers/v1/{porting_webhook_configuration_fetch.py => webhook.py} (78%) diff --git a/CHANGES.md b/CHANGES.md index 42fb1a3d15..c991cee31c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,21 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-02-20] Version 9.4.6 +-------------------------- +**Library - Chore** +- [PR #842](https://github.com/twilio/twilio-python/pull/842): issue 841. Thanks to [@manisha1997](https://github.com/manisha1997)! + +**Flex** +- Adding Digital Transfers APIs under v1/Interactions + +**Numbers** +- Convert webhook_type to ienum type in v1/Porting/Configuration/Webhook/{webhook_type} + +**Trusthub** +- Changing TrustHub SupportingDocument status enum from lowercase to uppercase since kyc-orch returns status capitalized and rest proxy requires strict casing + + [2025-02-11] Version 9.4.5 -------------------------- **Api** diff --git a/twilio/rest/api/v2010/account/call/transcription.py b/twilio/rest/api/v2010/account/call/transcription.py index d64a5507b4..50389f3e68 100644 --- a/twilio/rest/api/v2010/account/call/transcription.py +++ b/twilio/rest/api/v2010/account/call/transcription.py @@ -287,7 +287,7 @@ def create( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result - :param intelligence_service: The SID of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . + :param intelligence_service: The SID or unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . :returns: The created TranscriptionInstance """ @@ -362,7 +362,7 @@ async def create_async( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result - :param intelligence_service: The SID of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . + :param intelligence_service: The SID or unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . :returns: The created TranscriptionInstance """ diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py index 781adb9797..b029104c8d 100644 --- a/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/__init__.py @@ -25,6 +25,9 @@ from twilio.rest.flex_api.v1.interaction.interaction_channel.interaction_channel_participant import ( InteractionChannelParticipantList, ) +from twilio.rest.flex_api.v1.interaction.interaction_channel.interaction_transfer import ( + InteractionTransferList, +) class InteractionChannelInstance(InstanceResource): @@ -171,6 +174,13 @@ def participants(self) -> InteractionChannelParticipantList: """ return self._proxy.participants + @property + def transfers(self) -> InteractionTransferList: + """ + Access the transfers + """ + return self._proxy.transfers + def __repr__(self) -> str: """ Provide a friendly representation @@ -204,6 +214,7 @@ def __init__(self, version: Version, interaction_sid: str, sid: str): self._invites: Optional[InteractionChannelInviteList] = None self._participants: Optional[InteractionChannelParticipantList] = None + self._transfers: Optional[InteractionTransferList] = None def fetch(self) -> InteractionChannelInstance: """ @@ -349,6 +360,19 @@ def participants(self) -> InteractionChannelParticipantList: ) return self._participants + @property + def transfers(self) -> InteractionTransferList: + """ + Access the transfers + """ + if self._transfers is None: + self._transfers = InteractionTransferList( + self._version, + self._solution["interaction_sid"], + self._solution["sid"], + ) + return self._transfers + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.py b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.py new file mode 100644 index 0000000000..04a5afacdb --- /dev/null +++ b/twilio/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.py @@ -0,0 +1,423 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Flex + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional, Union +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class InteractionTransferInstance(InstanceResource): + + class TransferStatus(object): + ACTIVE = "active" + FAILED = "failed" + COMPLETED = "completed" + + class TransferType(object): + WARM = "warm" + COLD = "cold" + EXTERNAL = "external" + + """ + :ivar sid: The unique string created by Twilio to identify an Interaction Transfer resource. + :ivar instance_sid: The SID of the Instance associated with the Transfer. + :ivar account_sid: The SID of the Account that created the Transfer. + :ivar interaction_sid: The Interaction Sid for this channel. + :ivar channel_sid: The Channel Sid for this Transfer. + :ivar execution_sid: The Execution SID associated with the Transfer. + :ivar type: + :ivar status: + :ivar _from: The SID of the Participant initiating the Transfer. + :ivar to: The SID of the Participant receiving the Transfer. + :ivar note_sid: The SID of the Note associated with the Transfer. + :ivar summary_sid: The SID of the Summary associated with the Transfer. + :ivar date_created: The date and time when the Transfer was created. + :ivar date_updated: The date and time when the Transfer was last updated. + :ivar url: + """ + + def __init__( + self, + version: Version, + payload: Dict[str, Any], + interaction_sid: str, + channel_sid: str, + sid: Optional[str] = None, + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.instance_sid: Optional[str] = payload.get("instance_sid") + self.account_sid: Optional[str] = payload.get("account_sid") + self.interaction_sid: Optional[str] = payload.get("interaction_sid") + self.channel_sid: Optional[str] = payload.get("channel_sid") + self.execution_sid: Optional[str] = payload.get("execution_sid") + self.type: Optional["InteractionTransferInstance.TransferType"] = payload.get( + "type" + ) + self.status: Optional["InteractionTransferInstance.TransferStatus"] = ( + payload.get("status") + ) + self._from: Optional[str] = payload.get("from") + self.to: Optional[str] = payload.get("to") + self.note_sid: Optional[str] = payload.get("note_sid") + self.summary_sid: Optional[str] = payload.get("summary_sid") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + self.url: Optional[str] = payload.get("url") + + self._solution = { + "interaction_sid": interaction_sid, + "channel_sid": channel_sid, + "sid": sid or self.sid, + } + self._context: Optional[InteractionTransferContext] = None + + @property + def _proxy(self) -> "InteractionTransferContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: InteractionTransferContext for this InteractionTransferInstance + """ + if self._context is None: + self._context = InteractionTransferContext( + self._version, + interaction_sid=self._solution["interaction_sid"], + channel_sid=self._solution["channel_sid"], + sid=self._solution["sid"], + ) + return self._context + + def fetch(self) -> "InteractionTransferInstance": + """ + Fetch the InteractionTransferInstance + + + :returns: The fetched InteractionTransferInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "InteractionTransferInstance": + """ + Asynchronous coroutine to fetch the InteractionTransferInstance + + + :returns: The fetched InteractionTransferInstance + """ + return await self._proxy.fetch_async() + + def update( + self, body: Union[object, object] = values.unset + ) -> "InteractionTransferInstance": + """ + Update the InteractionTransferInstance + + :param body: + + :returns: The updated InteractionTransferInstance + """ + return self._proxy.update( + body=body, + ) + + async def update_async( + self, body: Union[object, object] = values.unset + ) -> "InteractionTransferInstance": + """ + Asynchronous coroutine to update the InteractionTransferInstance + + :param body: + + :returns: The updated InteractionTransferInstance + """ + return await self._proxy.update_async( + body=body, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class InteractionTransferContext(InstanceContext): + + def __init__( + self, version: Version, interaction_sid: str, channel_sid: str, sid: str + ): + """ + Initialize the InteractionTransferContext + + :param version: Version that contains the resource + :param interaction_sid: The Interaction Sid for this channel. + :param channel_sid: The Channel Sid for this Transfer. + :param sid: The unique string created by Twilio to identify a Transfer resource. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "interaction_sid": interaction_sid, + "channel_sid": channel_sid, + "sid": sid, + } + self._uri = "/Interactions/{interaction_sid}/Channels/{channel_sid}/Transfers/{sid}".format( + **self._solution + ) + + def fetch(self) -> InteractionTransferInstance: + """ + Fetch the InteractionTransferInstance + + + :returns: The fetched InteractionTransferInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return InteractionTransferInstance( + self._version, + payload, + interaction_sid=self._solution["interaction_sid"], + channel_sid=self._solution["channel_sid"], + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> InteractionTransferInstance: + """ + Asynchronous coroutine to fetch the InteractionTransferInstance + + + :returns: The fetched InteractionTransferInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return InteractionTransferInstance( + self._version, + payload, + interaction_sid=self._solution["interaction_sid"], + channel_sid=self._solution["channel_sid"], + sid=self._solution["sid"], + ) + + def update( + self, body: Union[object, object] = values.unset + ) -> InteractionTransferInstance: + """ + Update the InteractionTransferInstance + + :param body: + + :returns: The updated InteractionTransferInstance + """ + data = body.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = self._version.update( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return InteractionTransferInstance( + self._version, + payload, + interaction_sid=self._solution["interaction_sid"], + channel_sid=self._solution["channel_sid"], + sid=self._solution["sid"], + ) + + async def update_async( + self, body: Union[object, object] = values.unset + ) -> InteractionTransferInstance: + """ + Asynchronous coroutine to update the InteractionTransferInstance + + :param body: + + :returns: The updated InteractionTransferInstance + """ + data = body.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = await self._version.update_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return InteractionTransferInstance( + self._version, + payload, + interaction_sid=self._solution["interaction_sid"], + channel_sid=self._solution["channel_sid"], + sid=self._solution["sid"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class InteractionTransferList(ListResource): + + def __init__(self, version: Version, interaction_sid: str, channel_sid: str): + """ + Initialize the InteractionTransferList + + :param version: Version that contains the resource + :param interaction_sid: The Interaction Sid for the Interaction + :param channel_sid: The Channel Sid for the Channel. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "interaction_sid": interaction_sid, + "channel_sid": channel_sid, + } + self._uri = ( + "/Interactions/{interaction_sid}/Channels/{channel_sid}/Transfers".format( + **self._solution + ) + ) + + def create( + self, body: Union[object, object] = values.unset + ) -> InteractionTransferInstance: + """ + Create the InteractionTransferInstance + + :param body: + + :returns: The created InteractionTransferInstance + """ + data = body.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return InteractionTransferInstance( + self._version, + payload, + interaction_sid=self._solution["interaction_sid"], + channel_sid=self._solution["channel_sid"], + ) + + async def create_async( + self, body: Union[object, object] = values.unset + ) -> InteractionTransferInstance: + """ + Asynchronously create the InteractionTransferInstance + + :param body: + + :returns: The created InteractionTransferInstance + """ + data = body.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return InteractionTransferInstance( + self._version, + payload, + interaction_sid=self._solution["interaction_sid"], + channel_sid=self._solution["channel_sid"], + ) + + def get(self, sid: str) -> InteractionTransferContext: + """ + Constructs a InteractionTransferContext + + :param sid: The unique string created by Twilio to identify a Transfer resource. + """ + return InteractionTransferContext( + self._version, + interaction_sid=self._solution["interaction_sid"], + channel_sid=self._solution["channel_sid"], + sid=sid, + ) + + def __call__(self, sid: str) -> InteractionTransferContext: + """ + Constructs a InteractionTransferContext + + :param sid: The unique string created by Twilio to identify a Transfer resource. + """ + return InteractionTransferContext( + self._version, + interaction_sid=self._solution["interaction_sid"], + channel_sid=self._solution["channel_sid"], + sid=sid, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/iam/v1/__init__.py b/twilio/rest/iam/v1/__init__.py index 0c46947341..408de11acb 100644 --- a/twilio/rest/iam/v1/__init__.py +++ b/twilio/rest/iam/v1/__init__.py @@ -17,7 +17,7 @@ from twilio.base.domain import Domain from twilio.rest.iam.v1.api_key import ApiKeyList from twilio.rest.iam.v1.get_api_keys import GetApiKeysList -from twilio.rest.iam.v1.new_api_key import NewApiKeyList +from twilio.rest.iam.v1.key import KeyList class V1(Version): @@ -31,7 +31,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._api_key: Optional[ApiKeyList] = None self._get_api_keys: Optional[GetApiKeysList] = None - self._new_api_key: Optional[NewApiKeyList] = None + self._keys: Optional[KeyList] = None @property def api_key(self) -> ApiKeyList: @@ -46,10 +46,10 @@ def get_api_keys(self) -> GetApiKeysList: return self._get_api_keys @property - def new_api_key(self) -> NewApiKeyList: - if self._new_api_key is None: - self._new_api_key = NewApiKeyList(self) - return self._new_api_key + def keys(self) -> KeyList: + if self._keys is None: + self._keys = KeyList(self) + return self._keys def __repr__(self) -> str: """ diff --git a/twilio/rest/iam/v1/new_api_key.py b/twilio/rest/iam/v1/key.py similarity index 88% rename from twilio/rest/iam/v1/new_api_key.py rename to twilio/rest/iam/v1/key.py index 760ce79ca3..cd5556df94 100644 --- a/twilio/rest/iam/v1/new_api_key.py +++ b/twilio/rest/iam/v1/key.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class NewApiKeyInstance(InstanceResource): +class KeyInstance(InstanceResource): class Keytype(object): RESTRICTED = "restricted" @@ -56,14 +56,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class NewApiKeyList(ListResource): +class KeyList(ListResource): def __init__(self, version: Version): """ - Initialize the NewApiKeyList + Initialize the KeyList :param version: Version that contains the resource @@ -76,18 +76,18 @@ def create( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, + key_type: Union["KeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> NewApiKeyInstance: + ) -> KeyInstance: """ - Create the NewApiKeyInstance + Create the KeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created NewApiKeyInstance + :returns: The created KeyInstance """ data = values.of( @@ -108,24 +108,24 @@ def create( method="POST", uri=self._uri, data=data, headers=headers ) - return NewApiKeyInstance(self._version, payload) + return KeyInstance(self._version, payload) async def create_async( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, + key_type: Union["KeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> NewApiKeyInstance: + ) -> KeyInstance: """ - Asynchronously create the NewApiKeyInstance + Asynchronously create the KeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created NewApiKeyInstance + :returns: The created KeyInstance """ data = values.of( @@ -146,7 +146,7 @@ async def create_async( method="POST", uri=self._uri, data=data, headers=headers ) - return NewApiKeyInstance(self._version, payload) + return KeyInstance(self._version, payload) def __repr__(self) -> str: """ @@ -154,4 +154,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 043364c3d5..68f078a88d 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,12 +28,10 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) -from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( - PortingWebhookConfigurationFetchList, -) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) +from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -58,12 +56,10 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None - self._porting_webhook_configuration_fetch: Optional[ - PortingWebhookConfigurationFetchList - ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None + self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -111,22 +107,18 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete - @property - def porting_webhook_configuration_fetch( - self, - ) -> PortingWebhookConfigurationFetchList: - if self._porting_webhook_configuration_fetch is None: - self._porting_webhook_configuration_fetch = ( - PortingWebhookConfigurationFetchList(self) - ) - return self._porting_webhook_configuration_fetch - @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations + @property + def webhook(self) -> WebhookList: + if self._webhook is None: + self._webhook = WebhookList(self) + return self._webhook + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/webhook.py similarity index 78% rename from twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py rename to twilio/rest/numbers/v1/webhook.py index 5d381768c7..69bd556326 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py +++ b/twilio/rest/numbers/v1/webhook.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class PortingWebhookConfigurationFetchInstance(InstanceResource): +class WebhookInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class PortingWebhookConfigurationFetchList(ListResource): +class WebhookList(ListResource): def __init__(self, version: Version): """ - Initialize the PortingWebhookConfigurationFetchList + Initialize the WebhookList :param version: Version that contains the resource @@ -68,12 +68,12 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> PortingWebhookConfigurationFetchInstance: + def fetch(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -81,14 +81,14 @@ def fetch(self) -> PortingWebhookConfigurationFetchInstance: payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) - async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: + async def fetch_async(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -98,7 +98,7 @@ async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: method="GET", uri=self._uri, headers=headers ) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) def __repr__(self) -> str: """ @@ -106,4 +106,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/trusthub/v1/supporting_document.py b/twilio/rest/trusthub/v1/supporting_document.py index b53d7d319c..f2fd3b7e1c 100644 --- a/twilio/rest/trusthub/v1/supporting_document.py +++ b/twilio/rest/trusthub/v1/supporting_document.py @@ -25,12 +25,12 @@ class SupportingDocumentInstance(InstanceResource): class Status(object): - DRAFT = "draft" - PENDING_REVIEW = "pending-review" - REJECTED = "rejected" - APPROVED = "approved" - EXPIRED = "expired" - PROVISIONALLY_APPROVED = "provisionally-approved" + DRAFT = "DRAFT" + PENDING_REVIEW = "PENDING_REVIEW" + REJECTED = "REJECTED" + APPROVED = "APPROVED" + EXPIRED = "EXPIRED" + PROVISIONALLY_APPROVED = "PROVISIONALLY_APPROVED" """ :ivar sid: The unique string created by Twilio to identify the Supporting Document resource. From 71fb731c9c6356cf08030221d74a900c935109da Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 20 Feb 2025 14:17:19 +0000 Subject: [PATCH 089/113] Release 9.4.6 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 8313a29cfc..deb99437bf 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.4.5", + version="9.4.6", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 7a2fbba6c7..ef7ca2a724 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "4", "5") +__version_info__ = ("9", "4", "6") __version__ = ".".join(__version_info__) From 58cb0e63c1bbd3c4c856aeeb278b8fdb3c233774 Mon Sep 17 00:00:00 2001 From: sbansla <104902068+sbansla@users.noreply.github.com> Date: Thu, 27 Feb 2025 13:48:02 +0530 Subject: [PATCH 090/113] fix: AssistantsBase import (#847) * fix AssistantsBase import --- .github/workflows/test-and-deploy.yml | 1 + tests/cluster/test_cluster.py | 6 ++++++ twilio/rest/assistants/__init__.py | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index 1e1c04d500..db745daca2 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -47,6 +47,7 @@ jobs: TWILIO_FROM_NUMBER: ${{ secrets.TWILIO_FROM_NUMBER }} TWILIO_TO_NUMBER: ${{ secrets.TWILIO_TO_NUMBER }} TWILIO_AUTH_TOKEN: ${{ secrets.TWILIO_AUTH_TOKEN }} + ASSISTANT_ID: ${{ secrets.ASSISTANT_ID }} run: make cluster-test - name: Verify docs generation diff --git a/tests/cluster/test_cluster.py b/tests/cluster/test_cluster.py index 556fa8da75..0c18428d15 100644 --- a/tests/cluster/test_cluster.py +++ b/tests/cluster/test_cluster.py @@ -12,6 +12,7 @@ def setUp(self): self.api_key = os.environ["TWILIO_API_KEY"] self.api_secret = os.environ["TWILIO_API_SECRET"] self.account_sid = os.environ["TWILIO_ACCOUNT_SID"] + self.assistant_id = os.environ["ASSISTANT_ID"] self.client = Client( username=self.api_key, password=self.api_secret, @@ -65,6 +66,11 @@ def test_list_available_numbers(self): self.assertIsNotNone(toll_free_numbers) self.assertEqual(len(toll_free_numbers), 2) + def test_fetch_assistant(self): + assistant = self.client.assistants.v1.assistants(self.assistant_id).fetch() + self.assertIsNotNone(assistant) + self.assertEqual(assistant.account_sid, self.account_sid) + def test_calling_twiml_string(self): call = self.client.calls.create( to=self.to_number, from_=self.from_number, twiml=str(self.voice_twiml) diff --git a/twilio/rest/assistants/__init__.py b/twilio/rest/assistants/__init__.py index 60c812014d..889daf9d29 100644 --- a/twilio/rest/assistants/__init__.py +++ b/twilio/rest/assistants/__init__.py @@ -1,6 +1,6 @@ from warnings import warn -from twilio.rest.assistants import AssistantsBase +from twilio.rest.assistants.AssistantsBase import AssistantsBase from twilio.rest.assistants.v1.assistant import AssistantList from twilio.rest.assistants.v1.knowledge import KnowledgeList from twilio.rest.assistants.v1.policy import PolicyList From 7321899bf7d0d55790ae8e0849ac14e1574f08c6 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 11 Mar 2025 12:44:31 +0000 Subject: [PATCH 091/113] [Librarian] Regenerated @ 1565ca6ea5fc25da35893aea0bc70b60053b86b8 d990df451c3b8033c98bd3ead6be1f25b41b05b9 --- CHANGES.md | 21 +++++++++++++ .../api/v2010/account/address/__init__.py | 18 +++++++++++ .../conversations/v1/address_configuration.py | 1 + twilio/rest/events/v1/sink/__init__.py | 1 + twilio/rest/iam/v1/__init__.py | 12 ++++---- twilio/rest/iam/v1/{key.py => new_api_key.py} | 30 +++++++++---------- .../rest/insights/v1/conference/__init__.py | 1 + .../v1/conference/conference_participant.py | 1 + .../v1/brand_registration/__init__.py | 4 ++- .../v1/brand_registration/brand_vetting.py | 1 + .../messaging/v1/tollfree_verification.py | 1 + twilio/rest/numbers/v2/hosted_number_order.py | 2 ++ 12 files changed, 71 insertions(+), 22 deletions(-) rename twilio/rest/iam/v1/{key.py => new_api_key.py} (88%) diff --git a/CHANGES.md b/CHANGES.md index c991cee31c..e500308927 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,27 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-03-11] Version 9.5.0 +-------------------------- +**Library - Feature** +- [PR #850](https://github.com/twilio/twilio-python/pull/850): Update UPGRADE.md. Thanks to [@manisha1997](https://github.com/manisha1997)! + +**Library - Fix** +- [PR #847](https://github.com/twilio/twilio-python/pull/847): AssistantsBase import. Thanks to [@sbansla](https://github.com/sbansla)! + +**Api** +- Add the missing `emergency_enabled` field for `Address Service` endpoints + +**Messaging** +- Add missing enums for A2P and TF + +**Numbers** +- add missing enum values to hosted_number_order_status + +**Twiml** +- Convert Twiml Attribute `speechModel` of type enum to string **(breaking change)** + + [2025-02-20] Version 9.4.6 -------------------------- **Library - Chore** diff --git a/twilio/rest/api/v2010/account/address/__init__.py b/twilio/rest/api/v2010/account/address/__init__.py index 38a5a231a8..77fc702ccc 100644 --- a/twilio/rest/api/v2010/account/address/__init__.py +++ b/twilio/rest/api/v2010/account/address/__init__.py @@ -619,6 +619,7 @@ def stream( self, customer_name: Union[str, object] = values.unset, friendly_name: Union[str, object] = values.unset, + emergency_enabled: Union[bool, object] = values.unset, iso_country: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, @@ -631,6 +632,7 @@ def stream( :param str customer_name: The `customer_name` of the Address resources to read. :param str friendly_name: The string that identifies the Address resources to read. + :param bool emergency_enabled: Whether the address can be associated to a number for emergency calling. :param str iso_country: The ISO country code of the Address resources to read. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -645,6 +647,7 @@ def stream( page = self.page( customer_name=customer_name, friendly_name=friendly_name, + emergency_enabled=emergency_enabled, iso_country=iso_country, page_size=limits["page_size"], ) @@ -655,6 +658,7 @@ async def stream_async( self, customer_name: Union[str, object] = values.unset, friendly_name: Union[str, object] = values.unset, + emergency_enabled: Union[bool, object] = values.unset, iso_country: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, @@ -667,6 +671,7 @@ async def stream_async( :param str customer_name: The `customer_name` of the Address resources to read. :param str friendly_name: The string that identifies the Address resources to read. + :param bool emergency_enabled: Whether the address can be associated to a number for emergency calling. :param str iso_country: The ISO country code of the Address resources to read. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit @@ -681,6 +686,7 @@ async def stream_async( page = await self.page_async( customer_name=customer_name, friendly_name=friendly_name, + emergency_enabled=emergency_enabled, iso_country=iso_country, page_size=limits["page_size"], ) @@ -691,6 +697,7 @@ def list( self, customer_name: Union[str, object] = values.unset, friendly_name: Union[str, object] = values.unset, + emergency_enabled: Union[bool, object] = values.unset, iso_country: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, @@ -702,6 +709,7 @@ def list( :param str customer_name: The `customer_name` of the Address resources to read. :param str friendly_name: The string that identifies the Address resources to read. + :param bool emergency_enabled: Whether the address can be associated to a number for emergency calling. :param str iso_country: The ISO country code of the Address resources to read. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -716,6 +724,7 @@ def list( self.stream( customer_name=customer_name, friendly_name=friendly_name, + emergency_enabled=emergency_enabled, iso_country=iso_country, limit=limit, page_size=page_size, @@ -726,6 +735,7 @@ async def list_async( self, customer_name: Union[str, object] = values.unset, friendly_name: Union[str, object] = values.unset, + emergency_enabled: Union[bool, object] = values.unset, iso_country: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, @@ -737,6 +747,7 @@ async def list_async( :param str customer_name: The `customer_name` of the Address resources to read. :param str friendly_name: The string that identifies the Address resources to read. + :param bool emergency_enabled: Whether the address can be associated to a number for emergency calling. :param str iso_country: The ISO country code of the Address resources to read. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit @@ -752,6 +763,7 @@ async def list_async( async for record in await self.stream_async( customer_name=customer_name, friendly_name=friendly_name, + emergency_enabled=emergency_enabled, iso_country=iso_country, limit=limit, page_size=page_size, @@ -762,6 +774,7 @@ def page( self, customer_name: Union[str, object] = values.unset, friendly_name: Union[str, object] = values.unset, + emergency_enabled: Union[bool, object] = values.unset, iso_country: Union[str, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, @@ -773,6 +786,7 @@ def page( :param customer_name: The `customer_name` of the Address resources to read. :param friendly_name: The string that identifies the Address resources to read. + :param emergency_enabled: Whether the address can be associated to a number for emergency calling. :param iso_country: The ISO country code of the Address resources to read. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state @@ -784,6 +798,7 @@ def page( { "CustomerName": customer_name, "FriendlyName": friendly_name, + "EmergencyEnabled": serialize.boolean_to_string(emergency_enabled), "IsoCountry": iso_country, "PageToken": page_token, "Page": page_number, @@ -804,6 +819,7 @@ async def page_async( self, customer_name: Union[str, object] = values.unset, friendly_name: Union[str, object] = values.unset, + emergency_enabled: Union[bool, object] = values.unset, iso_country: Union[str, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, @@ -815,6 +831,7 @@ async def page_async( :param customer_name: The `customer_name` of the Address resources to read. :param friendly_name: The string that identifies the Address resources to read. + :param emergency_enabled: Whether the address can be associated to a number for emergency calling. :param iso_country: The ISO country code of the Address resources to read. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state @@ -826,6 +843,7 @@ async def page_async( { "CustomerName": customer_name, "FriendlyName": friendly_name, + "EmergencyEnabled": serialize.boolean_to_string(emergency_enabled), "IsoCountry": iso_country, "PageToken": page_token, "Page": page_number, diff --git a/twilio/rest/conversations/v1/address_configuration.py b/twilio/rest/conversations/v1/address_configuration.py index 1609d99576..c12e3c7170 100644 --- a/twilio/rest/conversations/v1/address_configuration.py +++ b/twilio/rest/conversations/v1/address_configuration.py @@ -41,6 +41,7 @@ class Type(object): EMAIL = "email" RCS = "rcs" APPLE = "apple" + CHAT = "chat" """ :ivar sid: A 34 character string that uniquely identifies this resource. diff --git a/twilio/rest/events/v1/sink/__init__.py b/twilio/rest/events/v1/sink/__init__.py index 886c2947f5..3771f83bbc 100644 --- a/twilio/rest/events/v1/sink/__init__.py +++ b/twilio/rest/events/v1/sink/__init__.py @@ -30,6 +30,7 @@ class SinkType(object): KINESIS = "kinesis" WEBHOOK = "webhook" SEGMENT = "segment" + EMAIL = "email" class Status(object): INITIALIZED = "initialized" diff --git a/twilio/rest/iam/v1/__init__.py b/twilio/rest/iam/v1/__init__.py index 408de11acb..0c46947341 100644 --- a/twilio/rest/iam/v1/__init__.py +++ b/twilio/rest/iam/v1/__init__.py @@ -17,7 +17,7 @@ from twilio.base.domain import Domain from twilio.rest.iam.v1.api_key import ApiKeyList from twilio.rest.iam.v1.get_api_keys import GetApiKeysList -from twilio.rest.iam.v1.key import KeyList +from twilio.rest.iam.v1.new_api_key import NewApiKeyList class V1(Version): @@ -31,7 +31,7 @@ def __init__(self, domain: Domain): super().__init__(domain, "v1") self._api_key: Optional[ApiKeyList] = None self._get_api_keys: Optional[GetApiKeysList] = None - self._keys: Optional[KeyList] = None + self._new_api_key: Optional[NewApiKeyList] = None @property def api_key(self) -> ApiKeyList: @@ -46,10 +46,10 @@ def get_api_keys(self) -> GetApiKeysList: return self._get_api_keys @property - def keys(self) -> KeyList: - if self._keys is None: - self._keys = KeyList(self) - return self._keys + def new_api_key(self) -> NewApiKeyList: + if self._new_api_key is None: + self._new_api_key = NewApiKeyList(self) + return self._new_api_key def __repr__(self) -> str: """ diff --git a/twilio/rest/iam/v1/key.py b/twilio/rest/iam/v1/new_api_key.py similarity index 88% rename from twilio/rest/iam/v1/key.py rename to twilio/rest/iam/v1/new_api_key.py index cd5556df94..760ce79ca3 100644 --- a/twilio/rest/iam/v1/key.py +++ b/twilio/rest/iam/v1/new_api_key.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class KeyInstance(InstanceResource): +class NewApiKeyInstance(InstanceResource): class Keytype(object): RESTRICTED = "restricted" @@ -56,14 +56,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class KeyList(ListResource): +class NewApiKeyList(ListResource): def __init__(self, version: Version): """ - Initialize the KeyList + Initialize the NewApiKeyList :param version: Version that contains the resource @@ -76,18 +76,18 @@ def create( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["KeyInstance.Keytype", object] = values.unset, + key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> KeyInstance: + ) -> NewApiKeyInstance: """ - Create the KeyInstance + Create the NewApiKeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created KeyInstance + :returns: The created NewApiKeyInstance """ data = values.of( @@ -108,24 +108,24 @@ def create( method="POST", uri=self._uri, data=data, headers=headers ) - return KeyInstance(self._version, payload) + return NewApiKeyInstance(self._version, payload) async def create_async( self, account_sid: str, friendly_name: Union[str, object] = values.unset, - key_type: Union["KeyInstance.Keytype", object] = values.unset, + key_type: Union["NewApiKeyInstance.Keytype", object] = values.unset, policy: Union[object, object] = values.unset, - ) -> KeyInstance: + ) -> NewApiKeyInstance: """ - Asynchronously create the KeyInstance + Asynchronously create the NewApiKeyInstance :param account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Payments resource. :param friendly_name: A descriptive string that you create to describe the resource. It can be up to 64 characters long. :param key_type: :param policy: The \\\\`Policy\\\\` object is a collection that specifies the allowed Twilio permissions for the restricted key. For more information on the permissions available with restricted API keys, refer to the [Twilio documentation](https://www.twilio.com/docs/iam/api-keys/restricted-api-keys#permissions-available-with-restricted-api-keys). - :returns: The created KeyInstance + :returns: The created NewApiKeyInstance """ data = values.of( @@ -146,7 +146,7 @@ async def create_async( method="POST", uri=self._uri, data=data, headers=headers ) - return KeyInstance(self._version, payload) + return NewApiKeyInstance(self._version, payload) def __repr__(self) -> str: """ @@ -154,4 +154,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/insights/v1/conference/__init__.py b/twilio/rest/insights/v1/conference/__init__.py index a30de54cd7..ef3c51dac3 100644 --- a/twilio/rest/insights/v1/conference/__init__.py +++ b/twilio/rest/insights/v1/conference/__init__.py @@ -58,6 +58,7 @@ class Region(object): JP1 = "jp1" SG1 = "sg1" DE1 = "de1" + IN1 = "in1" class Tag(object): INVALID_REQUESTED_REGION = "invalid_requested_region" diff --git a/twilio/rest/insights/v1/conference/conference_participant.py b/twilio/rest/insights/v1/conference/conference_participant.py index 203f950699..171f4f1f87 100644 --- a/twilio/rest/insights/v1/conference/conference_participant.py +++ b/twilio/rest/insights/v1/conference/conference_participant.py @@ -62,6 +62,7 @@ class Region(object): JP1 = "jp1" SG1 = "sg1" DE1 = "de1" + IN1 = "in1" """ :ivar participant_sid: SID for this participant. diff --git a/twilio/rest/messaging/v1/brand_registration/__init__.py b/twilio/rest/messaging/v1/brand_registration/__init__.py index e8c2ac40d5..939cba604c 100644 --- a/twilio/rest/messaging/v1/brand_registration/__init__.py +++ b/twilio/rest/messaging/v1/brand_registration/__init__.py @@ -46,7 +46,9 @@ class Status(object): APPROVED = "APPROVED" FAILED = "FAILED" IN_REVIEW = "IN_REVIEW" - DELETED = "DELETED" + DELETION_PENDING = "DELETION_PENDING" + DELETION_FAILED = "DELETION_FAILED" + SUSPENDED = "SUSPENDED" """ :ivar sid: The unique string to identify Brand Registration. diff --git a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py index 680be65037..b633144a71 100644 --- a/twilio/rest/messaging/v1/brand_registration/brand_vetting.py +++ b/twilio/rest/messaging/v1/brand_registration/brand_vetting.py @@ -26,6 +26,7 @@ class BrandVettingInstance(InstanceResource): class VettingProvider(object): CAMPAIGN_VERIFY = "campaign-verify" + AEGIS = "aegis" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the vetting record. diff --git a/twilio/rest/messaging/v1/tollfree_verification.py b/twilio/rest/messaging/v1/tollfree_verification.py index d052bd4cde..00cf9c96e3 100644 --- a/twilio/rest/messaging/v1/tollfree_verification.py +++ b/twilio/rest/messaging/v1/tollfree_verification.py @@ -31,6 +31,7 @@ class OptInType(object): VIA_TEXT = "VIA_TEXT" MOBILE_QR_CODE = "MOBILE_QR_CODE" IMPORT = "IMPORT" + IMPORT_PLEASE_REPLACE = "IMPORT_PLEASE_REPLACE" class Status(object): PENDING_REVIEW = "PENDING_REVIEW" diff --git a/twilio/rest/numbers/v2/hosted_number_order.py b/twilio/rest/numbers/v2/hosted_number_order.py index 5ad2b6d920..6afa755bd3 100644 --- a/twilio/rest/numbers/v2/hosted_number_order.py +++ b/twilio/rest/numbers/v2/hosted_number_order.py @@ -25,11 +25,13 @@ class HostedNumberOrderInstance(InstanceResource): class Status(object): + TWILIO_PROCESSING = "twilio-processing" RECEIVED = "received" PENDING_VERIFICATION = "pending-verification" VERIFIED = "verified" PENDING_LOA = "pending-loa" CARRIER_PROCESSING = "carrier-processing" + TESTING = "testing" COMPLETED = "completed" FAILED = "failed" ACTION_REQUIRED = "action-required" From 317a5bbd59e381a8bd19eb0b871f73c8f55a1a64 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 11 Mar 2025 12:49:50 +0000 Subject: [PATCH 092/113] Release 9.5.0 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index deb99437bf..fc58de0ec1 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.4.6", + version="9.5.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index ef7ca2a724..b2bf5772dd 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "4", "6") +__version_info__ = ("9", "5", "0") __version__ = ".".join(__version_info__) From 518dc8a347e252e15b98cc3787eb0b481488dd28 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 20 Mar 2025 10:24:18 +0000 Subject: [PATCH 093/113] [Librarian] Regenerated @ 160660ccc2266b2b6f15f8e8291a4b07d233dc21 817197bb9e54bf7b3518030a6183a4c45eb689fa --- CHANGES.md | 12 + twilio/rest/accounts/v1/safelist.py | 14 +- .../api/v2010/account/conference/__init__.py | 2 +- .../v2010/account/conference/participant.py | 4 +- .../api/v2010/account/message/__init__.py | 9 + twilio/rest/flex_api/v2/flex_user.py | 42 - twilio/rest/iam/v1/__init__.py | 8 + twilio/rest/iam/v1/token.py | 170 ++++ twilio/rest/insights/v1/room/__init__.py | 12 + twilio/rest/insights/v1/room/participant.py | 12 + twilio/rest/preview/PreviewBase.py | 11 - twilio/rest/preview/sync/__init__.py | 43 - twilio/rest/preview/sync/service/__init__.py | 741 ----------------- .../preview/sync/service/document/__init__.py | 693 ---------------- .../service/document/document_permission.py | 617 -------------- .../sync/service/sync_list/__init__.py | 595 -------------- .../sync/service/sync_list/sync_list_item.py | 763 ----------------- .../service/sync_list/sync_list_permission.py | 617 -------------- .../preview/sync/service/sync_map/__init__.py | 593 -------------- .../sync/service/sync_map/sync_map_item.py | 767 ------------------ .../service/sync_map/sync_map_permission.py | 615 -------------- .../v1/workspace/task/reservation.py | 8 +- .../v1/workspace/worker/reservation.py | 8 +- .../video/v1/room/participant/__init__.py | 1 + twilio/rest/wireless/v1/rate_plan.py | 15 + 25 files changed, 257 insertions(+), 6115 deletions(-) create mode 100644 twilio/rest/iam/v1/token.py delete mode 100644 twilio/rest/preview/sync/__init__.py delete mode 100644 twilio/rest/preview/sync/service/__init__.py delete mode 100644 twilio/rest/preview/sync/service/document/__init__.py delete mode 100644 twilio/rest/preview/sync/service/document/document_permission.py delete mode 100644 twilio/rest/preview/sync/service/sync_list/__init__.py delete mode 100644 twilio/rest/preview/sync/service/sync_list/sync_list_item.py delete mode 100644 twilio/rest/preview/sync/service/sync_list/sync_list_permission.py delete mode 100644 twilio/rest/preview/sync/service/sync_map/__init__.py delete mode 100644 twilio/rest/preview/sync/service/sync_map/sync_map_item.py delete mode 100644 twilio/rest/preview/sync/service/sync_map/sync_map_permission.py diff --git a/CHANGES.md b/CHANGES.md index e500308927..a985cb3245 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,18 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-03-20] Version 9.5.1 +-------------------------- +**Accounts** +- Update Safelist API docs as part of prefix supoort + +**Flex** +- Removing `first_name`, `last_name`, and `friendly_name` from the Flex User API + +**Messaging** +- Add missing tests under transaction/phone_numbers and transaction/short_code + + [2025-03-11] Version 9.5.0 -------------------------- **Library - Feature** diff --git a/twilio/rest/accounts/v1/safelist.py b/twilio/rest/accounts/v1/safelist.py index 0bbbb32420..be8fe416af 100644 --- a/twilio/rest/accounts/v1/safelist.py +++ b/twilio/rest/accounts/v1/safelist.py @@ -23,7 +23,7 @@ class SafelistInstance(InstanceResource): """ :ivar sid: The unique string that we created to identify the SafeList resource. - :ivar phone_number: The phone number in SafeList. + :ivar phone_number: The phone number or phone number 1k prefix in SafeList. """ def __init__(self, version: Version, payload: Dict[str, Any]): @@ -59,7 +59,7 @@ def create(self, phone_number: str) -> SafelistInstance: """ Create the SafelistInstance - :param phone_number: The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + :param phone_number: The phone number or phone number 1k prefix to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: The created SafelistInstance """ @@ -85,7 +85,7 @@ async def create_async(self, phone_number: str) -> SafelistInstance: """ Asynchronously create the SafelistInstance - :param phone_number: The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + :param phone_number: The phone number or phone number 1k prefix to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: The created SafelistInstance """ @@ -111,7 +111,7 @@ def delete(self, phone_number: Union[str, object] = values.unset) -> bool: """ Asynchronously delete the SafelistInstance - :param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + :param phone_number: The phone number or phone number 1k prefix to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: True if delete succeeds, False otherwise """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -131,7 +131,7 @@ async def delete_async( """ Asynchronously delete the SafelistInstance - :param phone_number: The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + :param phone_number: The phone number or phone number 1k prefix to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: True if delete succeeds, False otherwise """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -151,7 +151,7 @@ def fetch( """ Asynchronously fetch the SafelistInstance - :param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + :param phone_number: The phone number or phone number 1k prefix to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: The fetched SafelistInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -176,7 +176,7 @@ async def fetch_async( """ Asynchronously fetch the SafelistInstance - :param phone_number: The phone number to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + :param phone_number: The phone number or phone number 1k prefix to be fetched from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). :returns: The fetched SafelistInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) diff --git a/twilio/rest/api/v2010/account/conference/__init__.py b/twilio/rest/api/v2010/account/conference/__init__.py index 1ff3289a6c..672d9d0fea 100644 --- a/twilio/rest/api/v2010/account/conference/__init__.py +++ b/twilio/rest/api/v2010/account/conference/__init__.py @@ -51,7 +51,7 @@ class UpdateStatus(object): :ivar date_updated: The date and time in UTC that this resource was last updated, specified in [RFC 2822](https://www.ietf.org/rfc/rfc2822.txt) format. :ivar api_version: The API version used to create this conference. :ivar friendly_name: A string that you assigned to describe this conference room. Maximum length is 128 characters. - :ivar region: A string that represents the Twilio Region where the conference audio was mixed. May be `us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will always be mixed in `us1`. Global Conference audio will be mixed nearest to the majority of participants. + :ivar region: A string that represents the Twilio Region where the conference audio was mixed. May be `us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, and `jp1`. Basic conference audio will always be mixed in `us1`. Global Conference audio will be mixed nearest to the majority of participants. :ivar sid: The unique, Twilio-provided string used to identify this Conference resource. :ivar status: :ivar uri: The URI of this resource, relative to `https://api.twilio.com`. diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index a93f9f9adc..c6511dadf6 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -625,7 +625,7 @@ def create( :param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param sip_auth_username: The SIP username used for authentication. :param sip_auth_password: The SIP password for authentication. - :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. :param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. :param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param recording_status_callback_event: The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. @@ -814,7 +814,7 @@ async def create_async( :param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param sip_auth_username: The SIP username used for authentication. :param sip_auth_password: The SIP password for authentication. - :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. :param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. :param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param recording_status_callback_event: The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. diff --git a/twilio/rest/api/v2010/account/message/__init__.py b/twilio/rest/api/v2010/account/message/__init__.py index f41c1c5ad7..d5369d11ce 100644 --- a/twilio/rest/api/v2010/account/message/__init__.py +++ b/twilio/rest/api/v2010/account/message/__init__.py @@ -62,6 +62,9 @@ class Status(object): PARTIALLY_DELIVERED = "partially_delivered" CANCELED = "canceled" + class TrafficType(object): + FREE = "free" + class UpdateStatus(object): CANCELED = "canceled" @@ -505,6 +508,7 @@ def create( ] = values.unset, smart_encoded: Union[bool, object] = values.unset, persistent_action: Union[List[str], object] = values.unset, + traffic_type: Union["MessageInstance.TrafficType", object] = values.unset, shorten_urls: Union[bool, object] = values.unset, schedule_type: Union["MessageInstance.ScheduleType", object] = values.unset, send_at: Union[datetime, object] = values.unset, @@ -532,6 +536,7 @@ def create( :param address_retention: :param smart_encoded: Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. :param persistent_action: Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). + :param traffic_type: :param shorten_urls: For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. :param schedule_type: :param send_at: The time that Twilio will send the message. Must be in ISO 8601 format. @@ -561,6 +566,7 @@ def create( "AddressRetention": address_retention, "SmartEncoded": serialize.boolean_to_string(smart_encoded), "PersistentAction": serialize.map(persistent_action, lambda e: e), + "TrafficType": traffic_type, "ShortenUrls": serialize.boolean_to_string(shorten_urls), "ScheduleType": schedule_type, "SendAt": serialize.iso8601_datetime(send_at), @@ -606,6 +612,7 @@ async def create_async( ] = values.unset, smart_encoded: Union[bool, object] = values.unset, persistent_action: Union[List[str], object] = values.unset, + traffic_type: Union["MessageInstance.TrafficType", object] = values.unset, shorten_urls: Union[bool, object] = values.unset, schedule_type: Union["MessageInstance.ScheduleType", object] = values.unset, send_at: Union[datetime, object] = values.unset, @@ -633,6 +640,7 @@ async def create_async( :param address_retention: :param smart_encoded: Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. :param persistent_action: Rich actions for non-SMS/MMS channels. Used for [sending location in WhatsApp messages](https://www.twilio.com/docs/whatsapp/message-features#location-messages-with-whatsapp). + :param traffic_type: :param shorten_urls: For Messaging Services with [Link Shortening configured](https://www.twilio.com/docs/messaging/features/link-shortening) only: A Boolean indicating whether or not Twilio should shorten links in the `body` of the Message. Default value is `false`. If `true`, the `messaging_service_sid` parameter must also be provided. :param schedule_type: :param send_at: The time that Twilio will send the message. Must be in ISO 8601 format. @@ -662,6 +670,7 @@ async def create_async( "AddressRetention": address_retention, "SmartEncoded": serialize.boolean_to_string(smart_encoded), "PersistentAction": serialize.map(persistent_action, lambda e: e), + "TrafficType": traffic_type, "ShortenUrls": serialize.boolean_to_string(shorten_urls), "ScheduleType": schedule_type, "SendAt": serialize.iso8601_datetime(send_at), diff --git a/twilio/rest/flex_api/v2/flex_user.py b/twilio/rest/flex_api/v2/flex_user.py index 480a439b85..eb2228d015 100644 --- a/twilio/rest/flex_api/v2/flex_user.py +++ b/twilio/rest/flex_api/v2/flex_user.py @@ -30,11 +30,8 @@ class FlexUserInstance(InstanceResource): :ivar worker_sid: The unique SID identifier of the worker. :ivar workspace_sid: The unique SID identifier of the workspace. :ivar flex_team_sid: The unique SID identifier of the Flex Team. - :ivar first_name: First name of the User. - :ivar last_name: Last name of the User. :ivar username: Username of the User. :ivar email: Email of the User. - :ivar friendly_name: Friendly name of the User. :ivar locale: The locale preference of the user. :ivar roles: The roles of the user. :ivar created_date: The date that this user was created, given in ISO 8601 format. @@ -59,11 +56,8 @@ def __init__( self.worker_sid: Optional[str] = payload.get("worker_sid") self.workspace_sid: Optional[str] = payload.get("workspace_sid") self.flex_team_sid: Optional[str] = payload.get("flex_team_sid") - self.first_name: Optional[str] = payload.get("first_name") - self.last_name: Optional[str] = payload.get("last_name") self.username: Optional[str] = payload.get("username") self.email: Optional[str] = payload.get("email") - self.friendly_name: Optional[str] = payload.get("friendly_name") self.locale: Optional[str] = payload.get("locale") self.roles: Optional[List[str]] = payload.get("roles") self.created_date: Optional[datetime] = deserialize.iso8601_datetime( @@ -117,60 +111,42 @@ async def fetch_async(self) -> "FlexUserInstance": def update( self, - first_name: Union[str, object] = values.unset, - last_name: Union[str, object] = values.unset, email: Union[str, object] = values.unset, - friendly_name: Union[str, object] = values.unset, user_sid: Union[str, object] = values.unset, locale: Union[str, object] = values.unset, ) -> "FlexUserInstance": """ Update the FlexUserInstance - :param first_name: First name of the User. - :param last_name: Last name of the User. :param email: Email of the User. - :param friendly_name: Friendly name of the User. :param user_sid: The unique SID identifier of the Twilio Unified User. :param locale: The locale preference of the user. :returns: The updated FlexUserInstance """ return self._proxy.update( - first_name=first_name, - last_name=last_name, email=email, - friendly_name=friendly_name, user_sid=user_sid, locale=locale, ) async def update_async( self, - first_name: Union[str, object] = values.unset, - last_name: Union[str, object] = values.unset, email: Union[str, object] = values.unset, - friendly_name: Union[str, object] = values.unset, user_sid: Union[str, object] = values.unset, locale: Union[str, object] = values.unset, ) -> "FlexUserInstance": """ Asynchronous coroutine to update the FlexUserInstance - :param first_name: First name of the User. - :param last_name: Last name of the User. :param email: Email of the User. - :param friendly_name: Friendly name of the User. :param user_sid: The unique SID identifier of the Twilio Unified User. :param locale: The locale preference of the user. :returns: The updated FlexUserInstance """ return await self._proxy.update_async( - first_name=first_name, - last_name=last_name, email=email, - friendly_name=friendly_name, user_sid=user_sid, locale=locale, ) @@ -252,20 +228,14 @@ async def fetch_async(self) -> FlexUserInstance: def update( self, - first_name: Union[str, object] = values.unset, - last_name: Union[str, object] = values.unset, email: Union[str, object] = values.unset, - friendly_name: Union[str, object] = values.unset, user_sid: Union[str, object] = values.unset, locale: Union[str, object] = values.unset, ) -> FlexUserInstance: """ Update the FlexUserInstance - :param first_name: First name of the User. - :param last_name: Last name of the User. :param email: Email of the User. - :param friendly_name: Friendly name of the User. :param user_sid: The unique SID identifier of the Twilio Unified User. :param locale: The locale preference of the user. @@ -274,10 +244,7 @@ def update( data = values.of( { - "FirstName": first_name, - "LastName": last_name, "Email": email, - "FriendlyName": friendly_name, "UserSid": user_sid, "Locale": locale, } @@ -301,20 +268,14 @@ def update( async def update_async( self, - first_name: Union[str, object] = values.unset, - last_name: Union[str, object] = values.unset, email: Union[str, object] = values.unset, - friendly_name: Union[str, object] = values.unset, user_sid: Union[str, object] = values.unset, locale: Union[str, object] = values.unset, ) -> FlexUserInstance: """ Asynchronous coroutine to update the FlexUserInstance - :param first_name: First name of the User. - :param last_name: Last name of the User. :param email: Email of the User. - :param friendly_name: Friendly name of the User. :param user_sid: The unique SID identifier of the Twilio Unified User. :param locale: The locale preference of the user. @@ -323,10 +284,7 @@ async def update_async( data = values.of( { - "FirstName": first_name, - "LastName": last_name, "Email": email, - "FriendlyName": friendly_name, "UserSid": user_sid, "Locale": locale, } diff --git a/twilio/rest/iam/v1/__init__.py b/twilio/rest/iam/v1/__init__.py index 0c46947341..08c45435a6 100644 --- a/twilio/rest/iam/v1/__init__.py +++ b/twilio/rest/iam/v1/__init__.py @@ -18,6 +18,7 @@ from twilio.rest.iam.v1.api_key import ApiKeyList from twilio.rest.iam.v1.get_api_keys import GetApiKeysList from twilio.rest.iam.v1.new_api_key import NewApiKeyList +from twilio.rest.iam.v1.token import TokenList class V1(Version): @@ -32,6 +33,7 @@ def __init__(self, domain: Domain): self._api_key: Optional[ApiKeyList] = None self._get_api_keys: Optional[GetApiKeysList] = None self._new_api_key: Optional[NewApiKeyList] = None + self._token: Optional[TokenList] = None @property def api_key(self) -> ApiKeyList: @@ -51,6 +53,12 @@ def new_api_key(self) -> NewApiKeyList: self._new_api_key = NewApiKeyList(self) return self._new_api_key + @property + def token(self) -> TokenList: + if self._token is None: + self._token = TokenList(self) + return self._token + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/iam/v1/token.py b/twilio/rest/iam/v1/token.py new file mode 100644 index 0000000000..50d3d11930 --- /dev/null +++ b/twilio/rest/iam/v1/token.py @@ -0,0 +1,170 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Iam + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, Optional, Union +from twilio.base import values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class TokenInstance(InstanceResource): + """ + :ivar access_token: Token which carries the necessary information to access a Twilio resource directly. + :ivar refresh_token: Token which carries the information necessary to get a new access token. + :ivar id_token: Token which carries the information necessary of user profile. + :ivar token_type: Token type + :ivar expires_in: + """ + + def __init__(self, version: Version, payload: Dict[str, Any]): + super().__init__(version) + + self.access_token: Optional[str] = payload.get("access_token") + self.refresh_token: Optional[str] = payload.get("refresh_token") + self.id_token: Optional[str] = payload.get("id_token") + self.token_type: Optional[str] = payload.get("token_type") + self.expires_in: Optional[int] = payload.get("expires_in") + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + + return "" + + +class TokenList(ListResource): + + def __init__(self, version: Version): + """ + Initialize the TokenList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/token" + + def create( + self, + grant_type: str, + client_id: str, + client_secret: Union[str, object] = values.unset, + code: Union[str, object] = values.unset, + redirect_uri: Union[str, object] = values.unset, + audience: Union[str, object] = values.unset, + refresh_token: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + ) -> TokenInstance: + """ + Create the TokenInstance + + :param grant_type: Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. + :param client_id: A 34 character string that uniquely identifies this OAuth App. + :param client_secret: The credential for confidential OAuth App. + :param code: JWT token related to the authorization code grant type. + :param redirect_uri: The redirect uri + :param audience: The targeted audience uri + :param refresh_token: JWT token related to refresh access token. + :param scope: The scope of token + + :returns: The created TokenInstance + """ + + data = values.of( + { + "grant_type": grant_type, + "client_id": client_id, + "client_secret": client_secret, + "code": code, + "redirect_uri": redirect_uri, + "audience": audience, + "refresh_token": refresh_token, + "scope": scope, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return TokenInstance(self._version, payload) + + async def create_async( + self, + grant_type: str, + client_id: str, + client_secret: Union[str, object] = values.unset, + code: Union[str, object] = values.unset, + redirect_uri: Union[str, object] = values.unset, + audience: Union[str, object] = values.unset, + refresh_token: Union[str, object] = values.unset, + scope: Union[str, object] = values.unset, + ) -> TokenInstance: + """ + Asynchronously create the TokenInstance + + :param grant_type: Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. + :param client_id: A 34 character string that uniquely identifies this OAuth App. + :param client_secret: The credential for confidential OAuth App. + :param code: JWT token related to the authorization code grant type. + :param redirect_uri: The redirect uri + :param audience: The targeted audience uri + :param refresh_token: JWT token related to refresh access token. + :param scope: The scope of token + + :returns: The created TokenInstance + """ + + data = values.of( + { + "grant_type": grant_type, + "client_id": client_id, + "client_secret": client_secret, + "code": code, + "redirect_uri": redirect_uri, + "audience": audience, + "refresh_token": refresh_token, + "scope": scope, + } + ) + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return TokenInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/insights/v1/room/__init__.py b/twilio/rest/insights/v1/room/__init__.py index 0b987c020a..6fe0c476b5 100644 --- a/twilio/rest/insights/v1/room/__init__.py +++ b/twilio/rest/insights/v1/room/__init__.py @@ -54,6 +54,8 @@ class EndReason(object): class ProcessingState(object): COMPLETE = "complete" IN_PROGRESS = "in_progress" + TIMEOUT = "timeout" + NOT_STARTED = "not_started" class RoomStatus(object): IN_PROGRESS = "in_progress" @@ -77,7 +79,17 @@ class TwilioRealm(object): DE1 = "de1" GLL = "gll" STAGE_US1 = "stage_us1" + STAGE_US2 = "stage_us2" DEV_US1 = "dev_us1" + DEV_US2 = "dev_us2" + STAGE_DE1 = "stage_de1" + STAGE_IN1 = "stage_in1" + STAGE_IE1 = "stage_ie1" + STAGE_BR1 = "stage_br1" + STAGE_AU1 = "stage_au1" + STAGE_SG1 = "stage_sg1" + STAGE_JP1 = "stage_jp1" + OUTSIDE = "outside" """ :ivar account_sid: Account SID associated with this room. diff --git a/twilio/rest/insights/v1/room/participant.py b/twilio/rest/insights/v1/room/participant.py index 0791ec287c..d0d3e592e0 100644 --- a/twilio/rest/insights/v1/room/participant.py +++ b/twilio/rest/insights/v1/room/participant.py @@ -43,7 +43,9 @@ class EdgeLocation(object): class RoomStatus(object): IN_PROGRESS = "in_progress" + CONNECTED = "connected" COMPLETED = "completed" + DISCONNECTED = "disconnected" class TwilioRealm(object): US1 = "us1" @@ -58,6 +60,16 @@ class TwilioRealm(object): GLL = "gll" STAGE_US1 = "stage_us1" DEV_US1 = "dev_us1" + STAGE_AU1 = "stage_au1" + STAGE_SG1 = "stage_sg1" + STAGE_BR1 = "stage_br1" + STAGE_IN1 = "stage_in1" + STAGE_JP1 = "stage_jp1" + STAGE_DE1 = "stage_de1" + STAGE_IE1 = "stage_ie1" + STAGE_US2 = "stage_us2" + DEV_US2 = "dev_us2" + OUTSIDE = "outside" """ :ivar participant_sid: Unique identifier for the participant. diff --git a/twilio/rest/preview/PreviewBase.py b/twilio/rest/preview/PreviewBase.py index 2b44efaf63..dd8317b4c0 100644 --- a/twilio/rest/preview/PreviewBase.py +++ b/twilio/rest/preview/PreviewBase.py @@ -14,7 +14,6 @@ from twilio.base.domain import Domain from twilio.rest import Client from twilio.rest.preview.hosted_numbers import HostedNumbers -from twilio.rest.preview.sync import Sync from twilio.rest.preview.marketplace import Marketplace from twilio.rest.preview.wireless import Wireless @@ -29,7 +28,6 @@ def __init__(self, twilio: Client): """ super().__init__(twilio, "https://preview.twilio.com") self._hosted_numbers: Optional[HostedNumbers] = None - self._sync: Optional[Sync] = None self._marketplace: Optional[Marketplace] = None self._wireless: Optional[Wireless] = None @@ -42,15 +40,6 @@ def hosted_numbers(self) -> HostedNumbers: self._hosted_numbers = HostedNumbers(self) return self._hosted_numbers - @property - def sync(self) -> Sync: - """ - :returns: Versions sync of Preview - """ - if self._sync is None: - self._sync = Sync(self) - return self._sync - @property def marketplace(self) -> Marketplace: """ diff --git a/twilio/rest/preview/sync/__init__.py b/twilio/rest/preview/sync/__init__.py deleted file mode 100644 index d84c79039b..0000000000 --- a/twilio/rest/preview/sync/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.preview.sync.service import ServiceList - - -class Sync(Version): - - def __init__(self, domain: Domain): - """ - Initialize the Sync version of Preview - - :param domain: The Twilio.preview domain - """ - super().__init__(domain, "Sync") - self._services: Optional[ServiceList] = None - - @property - def services(self) -> ServiceList: - if self._services is None: - self._services = ServiceList(self) - return self._services - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/sync/service/__init__.py b/twilio/rest/preview/sync/service/__init__.py deleted file mode 100644 index 7b09429375..0000000000 --- a/twilio/rest/preview/sync/service/__init__.py +++ /dev/null @@ -1,741 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.preview.sync.service.document import DocumentList -from twilio.rest.preview.sync.service.sync_list import SyncListList -from twilio.rest.preview.sync.service.sync_map import SyncMapList - - -class ServiceInstance(InstanceResource): - """ - :ivar sid: - :ivar account_sid: - :ivar friendly_name: - :ivar date_created: - :ivar date_updated: - :ivar url: - :ivar webhook_url: - :ivar reachability_webhooks_enabled: - :ivar acl_enabled: - :ivar links: - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.account_sid: Optional[str] = payload.get("account_sid") - self.friendly_name: Optional[str] = payload.get("friendly_name") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.url: Optional[str] = payload.get("url") - self.webhook_url: Optional[str] = payload.get("webhook_url") - self.reachability_webhooks_enabled: Optional[bool] = payload.get( - "reachability_webhooks_enabled" - ) - self.acl_enabled: Optional[bool] = payload.get("acl_enabled") - self.links: Optional[Dict[str, object]] = payload.get("links") - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[ServiceContext] = None - - @property - def _proxy(self) -> "ServiceContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: ServiceContext for this ServiceInstance - """ - if self._context is None: - self._context = ServiceContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the ServiceInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the ServiceInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "ServiceInstance": - """ - Fetch the ServiceInstance - - - :returns: The fetched ServiceInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "ServiceInstance": - """ - Asynchronous coroutine to fetch the ServiceInstance - - - :returns: The fetched ServiceInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - webhook_url: Union[str, object] = values.unset, - friendly_name: Union[str, object] = values.unset, - reachability_webhooks_enabled: Union[bool, object] = values.unset, - acl_enabled: Union[bool, object] = values.unset, - ) -> "ServiceInstance": - """ - Update the ServiceInstance - - :param webhook_url: - :param friendly_name: - :param reachability_webhooks_enabled: - :param acl_enabled: - - :returns: The updated ServiceInstance - """ - return self._proxy.update( - webhook_url=webhook_url, - friendly_name=friendly_name, - reachability_webhooks_enabled=reachability_webhooks_enabled, - acl_enabled=acl_enabled, - ) - - async def update_async( - self, - webhook_url: Union[str, object] = values.unset, - friendly_name: Union[str, object] = values.unset, - reachability_webhooks_enabled: Union[bool, object] = values.unset, - acl_enabled: Union[bool, object] = values.unset, - ) -> "ServiceInstance": - """ - Asynchronous coroutine to update the ServiceInstance - - :param webhook_url: - :param friendly_name: - :param reachability_webhooks_enabled: - :param acl_enabled: - - :returns: The updated ServiceInstance - """ - return await self._proxy.update_async( - webhook_url=webhook_url, - friendly_name=friendly_name, - reachability_webhooks_enabled=reachability_webhooks_enabled, - acl_enabled=acl_enabled, - ) - - @property - def documents(self) -> DocumentList: - """ - Access the documents - """ - return self._proxy.documents - - @property - def sync_lists(self) -> SyncListList: - """ - Access the sync_lists - """ - return self._proxy.sync_lists - - @property - def sync_maps(self) -> SyncMapList: - """ - Access the sync_maps - """ - return self._proxy.sync_maps - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class ServiceContext(InstanceContext): - - def __init__(self, version: Version, sid: str): - """ - Initialize the ServiceContext - - :param version: Version that contains the resource - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/Services/{sid}".format(**self._solution) - - self._documents: Optional[DocumentList] = None - self._sync_lists: Optional[SyncListList] = None - self._sync_maps: Optional[SyncMapList] = None - - def delete(self) -> bool: - """ - Deletes the ServiceInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the ServiceInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> ServiceInstance: - """ - Fetch the ServiceInstance - - - :returns: The fetched ServiceInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return ServiceInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> ServiceInstance: - """ - Asynchronous coroutine to fetch the ServiceInstance - - - :returns: The fetched ServiceInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return ServiceInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def update( - self, - webhook_url: Union[str, object] = values.unset, - friendly_name: Union[str, object] = values.unset, - reachability_webhooks_enabled: Union[bool, object] = values.unset, - acl_enabled: Union[bool, object] = values.unset, - ) -> ServiceInstance: - """ - Update the ServiceInstance - - :param webhook_url: - :param friendly_name: - :param reachability_webhooks_enabled: - :param acl_enabled: - - :returns: The updated ServiceInstance - """ - - data = values.of( - { - "WebhookUrl": webhook_url, - "FriendlyName": friendly_name, - "ReachabilityWebhooksEnabled": serialize.boolean_to_string( - reachability_webhooks_enabled - ), - "AclEnabled": serialize.boolean_to_string(acl_enabled), - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return ServiceInstance(self._version, payload, sid=self._solution["sid"]) - - async def update_async( - self, - webhook_url: Union[str, object] = values.unset, - friendly_name: Union[str, object] = values.unset, - reachability_webhooks_enabled: Union[bool, object] = values.unset, - acl_enabled: Union[bool, object] = values.unset, - ) -> ServiceInstance: - """ - Asynchronous coroutine to update the ServiceInstance - - :param webhook_url: - :param friendly_name: - :param reachability_webhooks_enabled: - :param acl_enabled: - - :returns: The updated ServiceInstance - """ - - data = values.of( - { - "WebhookUrl": webhook_url, - "FriendlyName": friendly_name, - "ReachabilityWebhooksEnabled": serialize.boolean_to_string( - reachability_webhooks_enabled - ), - "AclEnabled": serialize.boolean_to_string(acl_enabled), - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return ServiceInstance(self._version, payload, sid=self._solution["sid"]) - - @property - def documents(self) -> DocumentList: - """ - Access the documents - """ - if self._documents is None: - self._documents = DocumentList( - self._version, - self._solution["sid"], - ) - return self._documents - - @property - def sync_lists(self) -> SyncListList: - """ - Access the sync_lists - """ - if self._sync_lists is None: - self._sync_lists = SyncListList( - self._version, - self._solution["sid"], - ) - return self._sync_lists - - @property - def sync_maps(self) -> SyncMapList: - """ - Access the sync_maps - """ - if self._sync_maps is None: - self._sync_maps = SyncMapList( - self._version, - self._solution["sid"], - ) - return self._sync_maps - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class ServicePage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> ServiceInstance: - """ - Build an instance of ServiceInstance - - :param payload: Payload response from the API - """ - return ServiceInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class ServiceList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the ServiceList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Services" - - def create( - self, - friendly_name: Union[str, object] = values.unset, - webhook_url: Union[str, object] = values.unset, - reachability_webhooks_enabled: Union[bool, object] = values.unset, - acl_enabled: Union[bool, object] = values.unset, - ) -> ServiceInstance: - """ - Create the ServiceInstance - - :param friendly_name: - :param webhook_url: - :param reachability_webhooks_enabled: - :param acl_enabled: - - :returns: The created ServiceInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - "WebhookUrl": webhook_url, - "ReachabilityWebhooksEnabled": serialize.boolean_to_string( - reachability_webhooks_enabled - ), - "AclEnabled": serialize.boolean_to_string(acl_enabled), - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return ServiceInstance(self._version, payload) - - async def create_async( - self, - friendly_name: Union[str, object] = values.unset, - webhook_url: Union[str, object] = values.unset, - reachability_webhooks_enabled: Union[bool, object] = values.unset, - acl_enabled: Union[bool, object] = values.unset, - ) -> ServiceInstance: - """ - Asynchronously create the ServiceInstance - - :param friendly_name: - :param webhook_url: - :param reachability_webhooks_enabled: - :param acl_enabled: - - :returns: The created ServiceInstance - """ - - data = values.of( - { - "FriendlyName": friendly_name, - "WebhookUrl": webhook_url, - "ReachabilityWebhooksEnabled": serialize.boolean_to_string( - reachability_webhooks_enabled - ), - "AclEnabled": serialize.boolean_to_string(acl_enabled), - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return ServiceInstance(self._version, payload) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[ServiceInstance]: - """ - Streams ServiceInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[ServiceInstance]: - """ - Asynchronously streams ServiceInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ServiceInstance]: - """ - Lists ServiceInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ServiceInstance]: - """ - Asynchronously lists ServiceInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ServicePage: - """ - Retrieve a single page of ServiceInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of ServiceInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return ServicePage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ServicePage: - """ - Asynchronously retrieve a single page of ServiceInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of ServiceInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return ServicePage(self._version, response) - - def get_page(self, target_url: str) -> ServicePage: - """ - Retrieve a specific page of ServiceInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ServiceInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return ServicePage(self._version, response) - - async def get_page_async(self, target_url: str) -> ServicePage: - """ - Asynchronously retrieve a specific page of ServiceInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ServiceInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return ServicePage(self._version, response) - - def get(self, sid: str) -> ServiceContext: - """ - Constructs a ServiceContext - - :param sid: - """ - return ServiceContext(self._version, sid=sid) - - def __call__(self, sid: str) -> ServiceContext: - """ - Constructs a ServiceContext - - :param sid: - """ - return ServiceContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/sync/service/document/__init__.py b/twilio/rest/preview/sync/service/document/__init__.py deleted file mode 100644 index ee55186ca4..0000000000 --- a/twilio/rest/preview/sync/service/document/__init__.py +++ /dev/null @@ -1,693 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.preview.sync.service.document.document_permission import ( - DocumentPermissionList, -) - - -class DocumentInstance(InstanceResource): - """ - :ivar sid: - :ivar unique_name: - :ivar account_sid: - :ivar service_sid: - :ivar url: - :ivar links: - :ivar revision: - :ivar data: - :ivar date_created: - :ivar date_updated: - :ivar created_by: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - service_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.account_sid: Optional[str] = payload.get("account_sid") - self.service_sid: Optional[str] = payload.get("service_sid") - self.url: Optional[str] = payload.get("url") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.revision: Optional[str] = payload.get("revision") - self.data: Optional[Dict[str, object]] = payload.get("data") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.created_by: Optional[str] = payload.get("created_by") - - self._solution = { - "service_sid": service_sid, - "sid": sid or self.sid, - } - self._context: Optional[DocumentContext] = None - - @property - def _proxy(self) -> "DocumentContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DocumentContext for this DocumentInstance - """ - if self._context is None: - self._context = DocumentContext( - self._version, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the DocumentInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DocumentInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "DocumentInstance": - """ - Fetch the DocumentInstance - - - :returns: The fetched DocumentInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DocumentInstance": - """ - Asynchronous coroutine to fetch the DocumentInstance - - - :returns: The fetched DocumentInstance - """ - return await self._proxy.fetch_async() - - def update( - self, data: object, if_match: Union[str, object] = values.unset - ) -> "DocumentInstance": - """ - Update the DocumentInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated DocumentInstance - """ - return self._proxy.update( - data=data, - if_match=if_match, - ) - - async def update_async( - self, data: object, if_match: Union[str, object] = values.unset - ) -> "DocumentInstance": - """ - Asynchronous coroutine to update the DocumentInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated DocumentInstance - """ - return await self._proxy.update_async( - data=data, - if_match=if_match, - ) - - @property - def document_permissions(self) -> DocumentPermissionList: - """ - Access the document_permissions - """ - return self._proxy.document_permissions - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DocumentContext(InstanceContext): - - def __init__(self, version: Version, service_sid: str, sid: str): - """ - Initialize the DocumentContext - - :param version: Version that contains the resource - :param service_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "sid": sid, - } - self._uri = "/Services/{service_sid}/Documents/{sid}".format(**self._solution) - - self._document_permissions: Optional[DocumentPermissionList] = None - - def delete(self) -> bool: - """ - Deletes the DocumentInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DocumentInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> DocumentInstance: - """ - Fetch the DocumentInstance - - - :returns: The fetched DocumentInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return DocumentInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> DocumentInstance: - """ - Asynchronous coroutine to fetch the DocumentInstance - - - :returns: The fetched DocumentInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return DocumentInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - - def update( - self, data: object, if_match: Union[str, object] = values.unset - ) -> DocumentInstance: - """ - Update the DocumentInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated DocumentInstance - """ - - data = values.of( - { - "Data": serialize.object(data), - } - ) - headers = values.of({}) - - if not ( - if_match is values.unset or (isinstance(if_match, str) and not if_match) - ): - headers["If-Match"] = if_match - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DocumentInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - - async def update_async( - self, data: object, if_match: Union[str, object] = values.unset - ) -> DocumentInstance: - """ - Asynchronous coroutine to update the DocumentInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated DocumentInstance - """ - - data = values.of( - { - "Data": serialize.object(data), - } - ) - headers = values.of({}) - - if not ( - if_match is values.unset or (isinstance(if_match, str) and not if_match) - ): - headers["If-Match"] = if_match - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DocumentInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - - @property - def document_permissions(self) -> DocumentPermissionList: - """ - Access the document_permissions - """ - if self._document_permissions is None: - self._document_permissions = DocumentPermissionList( - self._version, - self._solution["service_sid"], - self._solution["sid"], - ) - return self._document_permissions - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DocumentPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> DocumentInstance: - """ - Build an instance of DocumentInstance - - :param payload: Payload response from the API - """ - return DocumentInstance( - self._version, payload, service_sid=self._solution["service_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class DocumentList(ListResource): - - def __init__(self, version: Version, service_sid: str): - """ - Initialize the DocumentList - - :param version: Version that contains the resource - :param service_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - } - self._uri = "/Services/{service_sid}/Documents".format(**self._solution) - - def create( - self, - unique_name: Union[str, object] = values.unset, - data: Union[object, object] = values.unset, - ) -> DocumentInstance: - """ - Create the DocumentInstance - - :param unique_name: - :param data: - - :returns: The created DocumentInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "Data": serialize.object(data), - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DocumentInstance( - self._version, payload, service_sid=self._solution["service_sid"] - ) - - async def create_async( - self, - unique_name: Union[str, object] = values.unset, - data: Union[object, object] = values.unset, - ) -> DocumentInstance: - """ - Asynchronously create the DocumentInstance - - :param unique_name: - :param data: - - :returns: The created DocumentInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "Data": serialize.object(data), - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DocumentInstance( - self._version, payload, service_sid=self._solution["service_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[DocumentInstance]: - """ - Streams DocumentInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[DocumentInstance]: - """ - Asynchronously streams DocumentInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DocumentInstance]: - """ - Lists DocumentInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DocumentInstance]: - """ - Asynchronously lists DocumentInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DocumentPage: - """ - Retrieve a single page of DocumentInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DocumentInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return DocumentPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DocumentPage: - """ - Asynchronously retrieve a single page of DocumentInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DocumentInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return DocumentPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> DocumentPage: - """ - Retrieve a specific page of DocumentInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DocumentInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return DocumentPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> DocumentPage: - """ - Asynchronously retrieve a specific page of DocumentInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DocumentInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return DocumentPage(self._version, response, self._solution) - - def get(self, sid: str) -> DocumentContext: - """ - Constructs a DocumentContext - - :param sid: - """ - return DocumentContext( - self._version, service_sid=self._solution["service_sid"], sid=sid - ) - - def __call__(self, sid: str) -> DocumentContext: - """ - Constructs a DocumentContext - - :param sid: - """ - return DocumentContext( - self._version, service_sid=self._solution["service_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/sync/service/document/document_permission.py b/twilio/rest/preview/sync/service/document/document_permission.py deleted file mode 100644 index 676efb569f..0000000000 --- a/twilio/rest/preview/sync/service/document/document_permission.py +++ /dev/null @@ -1,617 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class DocumentPermissionInstance(InstanceResource): - """ - :ivar account_sid: The unique SID identifier of the Twilio Account. - :ivar service_sid: The unique SID identifier of the Sync Service Instance. - :ivar document_sid: The unique SID identifier of the Sync Document to which the Permission applies. - :ivar identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - :ivar read: Boolean flag specifying whether the identity can read the Sync Document. - :ivar write: Boolean flag specifying whether the identity can update the Sync Document. - :ivar manage: Boolean flag specifying whether the identity can delete the Sync Document. - :ivar url: Contains an absolute URL for this Sync Document Permission. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - service_sid: str, - document_sid: str, - identity: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.service_sid: Optional[str] = payload.get("service_sid") - self.document_sid: Optional[str] = payload.get("document_sid") - self.identity: Optional[str] = payload.get("identity") - self.read: Optional[bool] = payload.get("read") - self.write: Optional[bool] = payload.get("write") - self.manage: Optional[bool] = payload.get("manage") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "service_sid": service_sid, - "document_sid": document_sid, - "identity": identity or self.identity, - } - self._context: Optional[DocumentPermissionContext] = None - - @property - def _proxy(self) -> "DocumentPermissionContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DocumentPermissionContext for this DocumentPermissionInstance - """ - if self._context is None: - self._context = DocumentPermissionContext( - self._version, - service_sid=self._solution["service_sid"], - document_sid=self._solution["document_sid"], - identity=self._solution["identity"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the DocumentPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DocumentPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "DocumentPermissionInstance": - """ - Fetch the DocumentPermissionInstance - - - :returns: The fetched DocumentPermissionInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DocumentPermissionInstance": - """ - Asynchronous coroutine to fetch the DocumentPermissionInstance - - - :returns: The fetched DocumentPermissionInstance - """ - return await self._proxy.fetch_async() - - def update( - self, read: bool, write: bool, manage: bool - ) -> "DocumentPermissionInstance": - """ - Update the DocumentPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync Document. - :param write: Boolean flag specifying whether the identity can update the Sync Document. - :param manage: Boolean flag specifying whether the identity can delete the Sync Document. - - :returns: The updated DocumentPermissionInstance - """ - return self._proxy.update( - read=read, - write=write, - manage=manage, - ) - - async def update_async( - self, read: bool, write: bool, manage: bool - ) -> "DocumentPermissionInstance": - """ - Asynchronous coroutine to update the DocumentPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync Document. - :param write: Boolean flag specifying whether the identity can update the Sync Document. - :param manage: Boolean flag specifying whether the identity can delete the Sync Document. - - :returns: The updated DocumentPermissionInstance - """ - return await self._proxy.update_async( - read=read, - write=write, - manage=manage, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DocumentPermissionContext(InstanceContext): - - def __init__( - self, version: Version, service_sid: str, document_sid: str, identity: str - ): - """ - Initialize the DocumentPermissionContext - - :param version: Version that contains the resource - :param service_sid: The unique SID identifier of the Sync Service Instance. - :param document_sid: Identifier of the Sync Document. Either a SID or a unique name. - :param identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "document_sid": document_sid, - "identity": identity, - } - self._uri = "/Services/{service_sid}/Documents/{document_sid}/Permissions/{identity}".format( - **self._solution - ) - - def delete(self) -> bool: - """ - Deletes the DocumentPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DocumentPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> DocumentPermissionInstance: - """ - Fetch the DocumentPermissionInstance - - - :returns: The fetched DocumentPermissionInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return DocumentPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - document_sid=self._solution["document_sid"], - identity=self._solution["identity"], - ) - - async def fetch_async(self) -> DocumentPermissionInstance: - """ - Asynchronous coroutine to fetch the DocumentPermissionInstance - - - :returns: The fetched DocumentPermissionInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return DocumentPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - document_sid=self._solution["document_sid"], - identity=self._solution["identity"], - ) - - def update( - self, read: bool, write: bool, manage: bool - ) -> DocumentPermissionInstance: - """ - Update the DocumentPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync Document. - :param write: Boolean flag specifying whether the identity can update the Sync Document. - :param manage: Boolean flag specifying whether the identity can delete the Sync Document. - - :returns: The updated DocumentPermissionInstance - """ - - data = values.of( - { - "Read": serialize.boolean_to_string(read), - "Write": serialize.boolean_to_string(write), - "Manage": serialize.boolean_to_string(manage), - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DocumentPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - document_sid=self._solution["document_sid"], - identity=self._solution["identity"], - ) - - async def update_async( - self, read: bool, write: bool, manage: bool - ) -> DocumentPermissionInstance: - """ - Asynchronous coroutine to update the DocumentPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync Document. - :param write: Boolean flag specifying whether the identity can update the Sync Document. - :param manage: Boolean flag specifying whether the identity can delete the Sync Document. - - :returns: The updated DocumentPermissionInstance - """ - - data = values.of( - { - "Read": serialize.boolean_to_string(read), - "Write": serialize.boolean_to_string(write), - "Manage": serialize.boolean_to_string(manage), - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DocumentPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - document_sid=self._solution["document_sid"], - identity=self._solution["identity"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DocumentPermissionPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> DocumentPermissionInstance: - """ - Build an instance of DocumentPermissionInstance - - :param payload: Payload response from the API - """ - return DocumentPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - document_sid=self._solution["document_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class DocumentPermissionList(ListResource): - - def __init__(self, version: Version, service_sid: str, document_sid: str): - """ - Initialize the DocumentPermissionList - - :param version: Version that contains the resource - :param service_sid: - :param document_sid: Identifier of the Sync Document. Either a SID or a unique name. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "document_sid": document_sid, - } - self._uri = ( - "/Services/{service_sid}/Documents/{document_sid}/Permissions".format( - **self._solution - ) - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[DocumentPermissionInstance]: - """ - Streams DocumentPermissionInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[DocumentPermissionInstance]: - """ - Asynchronously streams DocumentPermissionInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DocumentPermissionInstance]: - """ - Lists DocumentPermissionInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DocumentPermissionInstance]: - """ - Asynchronously lists DocumentPermissionInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DocumentPermissionPage: - """ - Retrieve a single page of DocumentPermissionInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DocumentPermissionInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return DocumentPermissionPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DocumentPermissionPage: - """ - Asynchronously retrieve a single page of DocumentPermissionInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DocumentPermissionInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return DocumentPermissionPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> DocumentPermissionPage: - """ - Retrieve a specific page of DocumentPermissionInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DocumentPermissionInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return DocumentPermissionPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> DocumentPermissionPage: - """ - Asynchronously retrieve a specific page of DocumentPermissionInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DocumentPermissionInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return DocumentPermissionPage(self._version, response, self._solution) - - def get(self, identity: str) -> DocumentPermissionContext: - """ - Constructs a DocumentPermissionContext - - :param identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - """ - return DocumentPermissionContext( - self._version, - service_sid=self._solution["service_sid"], - document_sid=self._solution["document_sid"], - identity=identity, - ) - - def __call__(self, identity: str) -> DocumentPermissionContext: - """ - Constructs a DocumentPermissionContext - - :param identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - """ - return DocumentPermissionContext( - self._version, - service_sid=self._solution["service_sid"], - document_sid=self._solution["document_sid"], - identity=identity, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/sync/service/sync_list/__init__.py b/twilio/rest/preview/sync/service/sync_list/__init__.py deleted file mode 100644 index 0461f22430..0000000000 --- a/twilio/rest/preview/sync/service/sync_list/__init__.py +++ /dev/null @@ -1,595 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.preview.sync.service.sync_list.sync_list_item import SyncListItemList -from twilio.rest.preview.sync.service.sync_list.sync_list_permission import ( - SyncListPermissionList, -) - - -class SyncListInstance(InstanceResource): - """ - :ivar sid: - :ivar unique_name: - :ivar account_sid: - :ivar service_sid: - :ivar url: - :ivar links: - :ivar revision: - :ivar date_created: - :ivar date_updated: - :ivar created_by: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - service_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.account_sid: Optional[str] = payload.get("account_sid") - self.service_sid: Optional[str] = payload.get("service_sid") - self.url: Optional[str] = payload.get("url") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.revision: Optional[str] = payload.get("revision") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.created_by: Optional[str] = payload.get("created_by") - - self._solution = { - "service_sid": service_sid, - "sid": sid or self.sid, - } - self._context: Optional[SyncListContext] = None - - @property - def _proxy(self) -> "SyncListContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: SyncListContext for this SyncListInstance - """ - if self._context is None: - self._context = SyncListContext( - self._version, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the SyncListInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SyncListInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "SyncListInstance": - """ - Fetch the SyncListInstance - - - :returns: The fetched SyncListInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "SyncListInstance": - """ - Asynchronous coroutine to fetch the SyncListInstance - - - :returns: The fetched SyncListInstance - """ - return await self._proxy.fetch_async() - - @property - def sync_list_items(self) -> SyncListItemList: - """ - Access the sync_list_items - """ - return self._proxy.sync_list_items - - @property - def sync_list_permissions(self) -> SyncListPermissionList: - """ - Access the sync_list_permissions - """ - return self._proxy.sync_list_permissions - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncListContext(InstanceContext): - - def __init__(self, version: Version, service_sid: str, sid: str): - """ - Initialize the SyncListContext - - :param version: Version that contains the resource - :param service_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "sid": sid, - } - self._uri = "/Services/{service_sid}/Lists/{sid}".format(**self._solution) - - self._sync_list_items: Optional[SyncListItemList] = None - self._sync_list_permissions: Optional[SyncListPermissionList] = None - - def delete(self) -> bool: - """ - Deletes the SyncListInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SyncListInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> SyncListInstance: - """ - Fetch the SyncListInstance - - - :returns: The fetched SyncListInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return SyncListInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> SyncListInstance: - """ - Asynchronous coroutine to fetch the SyncListInstance - - - :returns: The fetched SyncListInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return SyncListInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - - @property - def sync_list_items(self) -> SyncListItemList: - """ - Access the sync_list_items - """ - if self._sync_list_items is None: - self._sync_list_items = SyncListItemList( - self._version, - self._solution["service_sid"], - self._solution["sid"], - ) - return self._sync_list_items - - @property - def sync_list_permissions(self) -> SyncListPermissionList: - """ - Access the sync_list_permissions - """ - if self._sync_list_permissions is None: - self._sync_list_permissions = SyncListPermissionList( - self._version, - self._solution["service_sid"], - self._solution["sid"], - ) - return self._sync_list_permissions - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncListPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> SyncListInstance: - """ - Build an instance of SyncListInstance - - :param payload: Payload response from the API - """ - return SyncListInstance( - self._version, payload, service_sid=self._solution["service_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class SyncListList(ListResource): - - def __init__(self, version: Version, service_sid: str): - """ - Initialize the SyncListList - - :param version: Version that contains the resource - :param service_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - } - self._uri = "/Services/{service_sid}/Lists".format(**self._solution) - - def create( - self, unique_name: Union[str, object] = values.unset - ) -> SyncListInstance: - """ - Create the SyncListInstance - - :param unique_name: - - :returns: The created SyncListInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncListInstance( - self._version, payload, service_sid=self._solution["service_sid"] - ) - - async def create_async( - self, unique_name: Union[str, object] = values.unset - ) -> SyncListInstance: - """ - Asynchronously create the SyncListInstance - - :param unique_name: - - :returns: The created SyncListInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncListInstance( - self._version, payload, service_sid=self._solution["service_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[SyncListInstance]: - """ - Streams SyncListInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[SyncListInstance]: - """ - Asynchronously streams SyncListInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncListInstance]: - """ - Lists SyncListInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncListInstance]: - """ - Asynchronously lists SyncListInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncListPage: - """ - Retrieve a single page of SyncListInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncListInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncListPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncListPage: - """ - Asynchronously retrieve a single page of SyncListInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncListInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncListPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> SyncListPage: - """ - Retrieve a specific page of SyncListInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncListInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return SyncListPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> SyncListPage: - """ - Asynchronously retrieve a specific page of SyncListInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncListInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return SyncListPage(self._version, response, self._solution) - - def get(self, sid: str) -> SyncListContext: - """ - Constructs a SyncListContext - - :param sid: - """ - return SyncListContext( - self._version, service_sid=self._solution["service_sid"], sid=sid - ) - - def __call__(self, sid: str) -> SyncListContext: - """ - Constructs a SyncListContext - - :param sid: - """ - return SyncListContext( - self._version, service_sid=self._solution["service_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py b/twilio/rest/preview/sync/service/sync_list/sync_list_item.py deleted file mode 100644 index 5220aec215..0000000000 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_item.py +++ /dev/null @@ -1,763 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class SyncListItemInstance(InstanceResource): - - class QueryFromBoundType(object): - INCLUSIVE = "inclusive" - EXCLUSIVE = "exclusive" - - class QueryResultOrder(object): - ASC = "asc" - DESC = "desc" - - """ - :ivar index: - :ivar account_sid: - :ivar service_sid: - :ivar list_sid: - :ivar url: - :ivar revision: - :ivar data: - :ivar date_created: - :ivar date_updated: - :ivar created_by: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - service_sid: str, - list_sid: str, - index: Optional[int] = None, - ): - super().__init__(version) - - self.index: Optional[int] = deserialize.integer(payload.get("index")) - self.account_sid: Optional[str] = payload.get("account_sid") - self.service_sid: Optional[str] = payload.get("service_sid") - self.list_sid: Optional[str] = payload.get("list_sid") - self.url: Optional[str] = payload.get("url") - self.revision: Optional[str] = payload.get("revision") - self.data: Optional[Dict[str, object]] = payload.get("data") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.created_by: Optional[str] = payload.get("created_by") - - self._solution = { - "service_sid": service_sid, - "list_sid": list_sid, - "index": index or self.index, - } - self._context: Optional[SyncListItemContext] = None - - @property - def _proxy(self) -> "SyncListItemContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: SyncListItemContext for this SyncListItemInstance - """ - if self._context is None: - self._context = SyncListItemContext( - self._version, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - index=self._solution["index"], - ) - return self._context - - def delete(self, if_match: Union[str, object] = values.unset) -> bool: - """ - Deletes the SyncListItemInstance - - :param if_match: The If-Match HTTP request header - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete( - if_match=if_match, - ) - - async def delete_async(self, if_match: Union[str, object] = values.unset) -> bool: - """ - Asynchronous coroutine that deletes the SyncListItemInstance - - :param if_match: The If-Match HTTP request header - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async( - if_match=if_match, - ) - - def fetch(self) -> "SyncListItemInstance": - """ - Fetch the SyncListItemInstance - - - :returns: The fetched SyncListItemInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "SyncListItemInstance": - """ - Asynchronous coroutine to fetch the SyncListItemInstance - - - :returns: The fetched SyncListItemInstance - """ - return await self._proxy.fetch_async() - - def update( - self, data: object, if_match: Union[str, object] = values.unset - ) -> "SyncListItemInstance": - """ - Update the SyncListItemInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated SyncListItemInstance - """ - return self._proxy.update( - data=data, - if_match=if_match, - ) - - async def update_async( - self, data: object, if_match: Union[str, object] = values.unset - ) -> "SyncListItemInstance": - """ - Asynchronous coroutine to update the SyncListItemInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated SyncListItemInstance - """ - return await self._proxy.update_async( - data=data, - if_match=if_match, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncListItemContext(InstanceContext): - - def __init__(self, version: Version, service_sid: str, list_sid: str, index: int): - """ - Initialize the SyncListItemContext - - :param version: Version that contains the resource - :param service_sid: - :param list_sid: - :param index: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "list_sid": list_sid, - "index": index, - } - self._uri = "/Services/{service_sid}/Lists/{list_sid}/Items/{index}".format( - **self._solution - ) - - def delete(self, if_match: Union[str, object] = values.unset) -> bool: - """ - Deletes the SyncListItemInstance - - :param if_match: The If-Match HTTP request header - - :returns: True if delete succeeds, False otherwise - """ - headers = values.of( - { - "If-Match": if_match, - } - ) - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self, if_match: Union[str, object] = values.unset) -> bool: - """ - Asynchronous coroutine that deletes the SyncListItemInstance - - :param if_match: The If-Match HTTP request header - - :returns: True if delete succeeds, False otherwise - """ - headers = values.of( - { - "If-Match": if_match, - } - ) - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> SyncListItemInstance: - """ - Fetch the SyncListItemInstance - - - :returns: The fetched SyncListItemInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return SyncListItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - index=self._solution["index"], - ) - - async def fetch_async(self) -> SyncListItemInstance: - """ - Asynchronous coroutine to fetch the SyncListItemInstance - - - :returns: The fetched SyncListItemInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return SyncListItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - index=self._solution["index"], - ) - - def update( - self, data: object, if_match: Union[str, object] = values.unset - ) -> SyncListItemInstance: - """ - Update the SyncListItemInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated SyncListItemInstance - """ - - data = values.of( - { - "Data": serialize.object(data), - } - ) - headers = values.of({}) - - if not ( - if_match is values.unset or (isinstance(if_match, str) and not if_match) - ): - headers["If-Match"] = if_match - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncListItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - index=self._solution["index"], - ) - - async def update_async( - self, data: object, if_match: Union[str, object] = values.unset - ) -> SyncListItemInstance: - """ - Asynchronous coroutine to update the SyncListItemInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated SyncListItemInstance - """ - - data = values.of( - { - "Data": serialize.object(data), - } - ) - headers = values.of({}) - - if not ( - if_match is values.unset or (isinstance(if_match, str) and not if_match) - ): - headers["If-Match"] = if_match - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncListItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - index=self._solution["index"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncListItemPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> SyncListItemInstance: - """ - Build an instance of SyncListItemInstance - - :param payload: Payload response from the API - """ - return SyncListItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class SyncListItemList(ListResource): - - def __init__(self, version: Version, service_sid: str, list_sid: str): - """ - Initialize the SyncListItemList - - :param version: Version that contains the resource - :param service_sid: - :param list_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "list_sid": list_sid, - } - self._uri = "/Services/{service_sid}/Lists/{list_sid}/Items".format( - **self._solution - ) - - def create(self, data: object) -> SyncListItemInstance: - """ - Create the SyncListItemInstance - - :param data: - - :returns: The created SyncListItemInstance - """ - - data = values.of( - { - "Data": serialize.object(data), - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncListItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - ) - - async def create_async(self, data: object) -> SyncListItemInstance: - """ - Asynchronously create the SyncListItemInstance - - :param data: - - :returns: The created SyncListItemInstance - """ - - data = values.of( - { - "Data": serialize.object(data), - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncListItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - ) - - def stream( - self, - order: Union["SyncListItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncListItemInstance.QueryFromBoundType", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[SyncListItemInstance]: - """ - Streams SyncListItemInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param "SyncListItemInstance.QueryResultOrder" order: - :param str from_: - :param "SyncListItemInstance.QueryFromBoundType" bounds: - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page( - order=order, from_=from_, bounds=bounds, page_size=limits["page_size"] - ) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - order: Union["SyncListItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncListItemInstance.QueryFromBoundType", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[SyncListItemInstance]: - """ - Asynchronously streams SyncListItemInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param "SyncListItemInstance.QueryResultOrder" order: - :param str from_: - :param "SyncListItemInstance.QueryFromBoundType" bounds: - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - order=order, from_=from_, bounds=bounds, page_size=limits["page_size"] - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - order: Union["SyncListItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncListItemInstance.QueryFromBoundType", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncListItemInstance]: - """ - Lists SyncListItemInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param "SyncListItemInstance.QueryResultOrder" order: - :param str from_: - :param "SyncListItemInstance.QueryFromBoundType" bounds: - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - order=order, - from_=from_, - bounds=bounds, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - order: Union["SyncListItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncListItemInstance.QueryFromBoundType", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncListItemInstance]: - """ - Asynchronously lists SyncListItemInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param "SyncListItemInstance.QueryResultOrder" order: - :param str from_: - :param "SyncListItemInstance.QueryFromBoundType" bounds: - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - order=order, - from_=from_, - bounds=bounds, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - order: Union["SyncListItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncListItemInstance.QueryFromBoundType", object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncListItemPage: - """ - Retrieve a single page of SyncListItemInstance records from the API. - Request is executed immediately - - :param order: - :param from_: - :param bounds: - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncListItemInstance - """ - data = values.of( - { - "Order": order, - "From": from_, - "Bounds": bounds, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncListItemPage(self._version, response, self._solution) - - async def page_async( - self, - order: Union["SyncListItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncListItemInstance.QueryFromBoundType", object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncListItemPage: - """ - Asynchronously retrieve a single page of SyncListItemInstance records from the API. - Request is executed immediately - - :param order: - :param from_: - :param bounds: - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncListItemInstance - """ - data = values.of( - { - "Order": order, - "From": from_, - "Bounds": bounds, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncListItemPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> SyncListItemPage: - """ - Retrieve a specific page of SyncListItemInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncListItemInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return SyncListItemPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> SyncListItemPage: - """ - Asynchronously retrieve a specific page of SyncListItemInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncListItemInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return SyncListItemPage(self._version, response, self._solution) - - def get(self, index: int) -> SyncListItemContext: - """ - Constructs a SyncListItemContext - - :param index: - """ - return SyncListItemContext( - self._version, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - index=index, - ) - - def __call__(self, index: int) -> SyncListItemContext: - """ - Constructs a SyncListItemContext - - :param index: - """ - return SyncListItemContext( - self._version, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - index=index, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py b/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py deleted file mode 100644 index 334b62dd18..0000000000 --- a/twilio/rest/preview/sync/service/sync_list/sync_list_permission.py +++ /dev/null @@ -1,617 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class SyncListPermissionInstance(InstanceResource): - """ - :ivar account_sid: The unique SID identifier of the Twilio Account. - :ivar service_sid: The unique SID identifier of the Sync Service Instance. - :ivar list_sid: The unique SID identifier of the Sync List to which the Permission applies. - :ivar identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - :ivar read: Boolean flag specifying whether the identity can read the Sync List and its Items. - :ivar write: Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. - :ivar manage: Boolean flag specifying whether the identity can delete the Sync List. - :ivar url: Contains an absolute URL for this Sync List Permission. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - service_sid: str, - list_sid: str, - identity: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.service_sid: Optional[str] = payload.get("service_sid") - self.list_sid: Optional[str] = payload.get("list_sid") - self.identity: Optional[str] = payload.get("identity") - self.read: Optional[bool] = payload.get("read") - self.write: Optional[bool] = payload.get("write") - self.manage: Optional[bool] = payload.get("manage") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "service_sid": service_sid, - "list_sid": list_sid, - "identity": identity or self.identity, - } - self._context: Optional[SyncListPermissionContext] = None - - @property - def _proxy(self) -> "SyncListPermissionContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: SyncListPermissionContext for this SyncListPermissionInstance - """ - if self._context is None: - self._context = SyncListPermissionContext( - self._version, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - identity=self._solution["identity"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the SyncListPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SyncListPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "SyncListPermissionInstance": - """ - Fetch the SyncListPermissionInstance - - - :returns: The fetched SyncListPermissionInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "SyncListPermissionInstance": - """ - Asynchronous coroutine to fetch the SyncListPermissionInstance - - - :returns: The fetched SyncListPermissionInstance - """ - return await self._proxy.fetch_async() - - def update( - self, read: bool, write: bool, manage: bool - ) -> "SyncListPermissionInstance": - """ - Update the SyncListPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync List. - :param write: Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. - :param manage: Boolean flag specifying whether the identity can delete the Sync List. - - :returns: The updated SyncListPermissionInstance - """ - return self._proxy.update( - read=read, - write=write, - manage=manage, - ) - - async def update_async( - self, read: bool, write: bool, manage: bool - ) -> "SyncListPermissionInstance": - """ - Asynchronous coroutine to update the SyncListPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync List. - :param write: Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. - :param manage: Boolean flag specifying whether the identity can delete the Sync List. - - :returns: The updated SyncListPermissionInstance - """ - return await self._proxy.update_async( - read=read, - write=write, - manage=manage, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncListPermissionContext(InstanceContext): - - def __init__( - self, version: Version, service_sid: str, list_sid: str, identity: str - ): - """ - Initialize the SyncListPermissionContext - - :param version: Version that contains the resource - :param service_sid: The unique SID identifier of the Sync Service Instance. - :param list_sid: Identifier of the Sync List. Either a SID or a unique name. - :param identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "list_sid": list_sid, - "identity": identity, - } - self._uri = ( - "/Services/{service_sid}/Lists/{list_sid}/Permissions/{identity}".format( - **self._solution - ) - ) - - def delete(self) -> bool: - """ - Deletes the SyncListPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SyncListPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> SyncListPermissionInstance: - """ - Fetch the SyncListPermissionInstance - - - :returns: The fetched SyncListPermissionInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return SyncListPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - identity=self._solution["identity"], - ) - - async def fetch_async(self) -> SyncListPermissionInstance: - """ - Asynchronous coroutine to fetch the SyncListPermissionInstance - - - :returns: The fetched SyncListPermissionInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return SyncListPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - identity=self._solution["identity"], - ) - - def update( - self, read: bool, write: bool, manage: bool - ) -> SyncListPermissionInstance: - """ - Update the SyncListPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync List. - :param write: Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. - :param manage: Boolean flag specifying whether the identity can delete the Sync List. - - :returns: The updated SyncListPermissionInstance - """ - - data = values.of( - { - "Read": serialize.boolean_to_string(read), - "Write": serialize.boolean_to_string(write), - "Manage": serialize.boolean_to_string(manage), - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncListPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - identity=self._solution["identity"], - ) - - async def update_async( - self, read: bool, write: bool, manage: bool - ) -> SyncListPermissionInstance: - """ - Asynchronous coroutine to update the SyncListPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync List. - :param write: Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. - :param manage: Boolean flag specifying whether the identity can delete the Sync List. - - :returns: The updated SyncListPermissionInstance - """ - - data = values.of( - { - "Read": serialize.boolean_to_string(read), - "Write": serialize.boolean_to_string(write), - "Manage": serialize.boolean_to_string(manage), - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncListPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - identity=self._solution["identity"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncListPermissionPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> SyncListPermissionInstance: - """ - Build an instance of SyncListPermissionInstance - - :param payload: Payload response from the API - """ - return SyncListPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class SyncListPermissionList(ListResource): - - def __init__(self, version: Version, service_sid: str, list_sid: str): - """ - Initialize the SyncListPermissionList - - :param version: Version that contains the resource - :param service_sid: - :param list_sid: Identifier of the Sync List. Either a SID or a unique name. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "list_sid": list_sid, - } - self._uri = "/Services/{service_sid}/Lists/{list_sid}/Permissions".format( - **self._solution - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[SyncListPermissionInstance]: - """ - Streams SyncListPermissionInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[SyncListPermissionInstance]: - """ - Asynchronously streams SyncListPermissionInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncListPermissionInstance]: - """ - Lists SyncListPermissionInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncListPermissionInstance]: - """ - Asynchronously lists SyncListPermissionInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncListPermissionPage: - """ - Retrieve a single page of SyncListPermissionInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncListPermissionInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncListPermissionPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncListPermissionPage: - """ - Asynchronously retrieve a single page of SyncListPermissionInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncListPermissionInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncListPermissionPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> SyncListPermissionPage: - """ - Retrieve a specific page of SyncListPermissionInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncListPermissionInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return SyncListPermissionPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> SyncListPermissionPage: - """ - Asynchronously retrieve a specific page of SyncListPermissionInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncListPermissionInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return SyncListPermissionPage(self._version, response, self._solution) - - def get(self, identity: str) -> SyncListPermissionContext: - """ - Constructs a SyncListPermissionContext - - :param identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - """ - return SyncListPermissionContext( - self._version, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - identity=identity, - ) - - def __call__(self, identity: str) -> SyncListPermissionContext: - """ - Constructs a SyncListPermissionContext - - :param identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - """ - return SyncListPermissionContext( - self._version, - service_sid=self._solution["service_sid"], - list_sid=self._solution["list_sid"], - identity=identity, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/sync/service/sync_map/__init__.py b/twilio/rest/preview/sync/service/sync_map/__init__.py deleted file mode 100644 index 0ecbb6132f..0000000000 --- a/twilio/rest/preview/sync/service/sync_map/__init__.py +++ /dev/null @@ -1,593 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.preview.sync.service.sync_map.sync_map_item import SyncMapItemList -from twilio.rest.preview.sync.service.sync_map.sync_map_permission import ( - SyncMapPermissionList, -) - - -class SyncMapInstance(InstanceResource): - """ - :ivar sid: - :ivar unique_name: - :ivar account_sid: - :ivar service_sid: - :ivar url: - :ivar links: - :ivar revision: - :ivar date_created: - :ivar date_updated: - :ivar created_by: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - service_sid: str, - sid: Optional[str] = None, - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.account_sid: Optional[str] = payload.get("account_sid") - self.service_sid: Optional[str] = payload.get("service_sid") - self.url: Optional[str] = payload.get("url") - self.links: Optional[Dict[str, object]] = payload.get("links") - self.revision: Optional[str] = payload.get("revision") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.created_by: Optional[str] = payload.get("created_by") - - self._solution = { - "service_sid": service_sid, - "sid": sid or self.sid, - } - self._context: Optional[SyncMapContext] = None - - @property - def _proxy(self) -> "SyncMapContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: SyncMapContext for this SyncMapInstance - """ - if self._context is None: - self._context = SyncMapContext( - self._version, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the SyncMapInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SyncMapInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "SyncMapInstance": - """ - Fetch the SyncMapInstance - - - :returns: The fetched SyncMapInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "SyncMapInstance": - """ - Asynchronous coroutine to fetch the SyncMapInstance - - - :returns: The fetched SyncMapInstance - """ - return await self._proxy.fetch_async() - - @property - def sync_map_items(self) -> SyncMapItemList: - """ - Access the sync_map_items - """ - return self._proxy.sync_map_items - - @property - def sync_map_permissions(self) -> SyncMapPermissionList: - """ - Access the sync_map_permissions - """ - return self._proxy.sync_map_permissions - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncMapContext(InstanceContext): - - def __init__(self, version: Version, service_sid: str, sid: str): - """ - Initialize the SyncMapContext - - :param version: Version that contains the resource - :param service_sid: - :param sid: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "sid": sid, - } - self._uri = "/Services/{service_sid}/Maps/{sid}".format(**self._solution) - - self._sync_map_items: Optional[SyncMapItemList] = None - self._sync_map_permissions: Optional[SyncMapPermissionList] = None - - def delete(self) -> bool: - """ - Deletes the SyncMapInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SyncMapInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> SyncMapInstance: - """ - Fetch the SyncMapInstance - - - :returns: The fetched SyncMapInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return SyncMapInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> SyncMapInstance: - """ - Asynchronous coroutine to fetch the SyncMapInstance - - - :returns: The fetched SyncMapInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return SyncMapInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - sid=self._solution["sid"], - ) - - @property - def sync_map_items(self) -> SyncMapItemList: - """ - Access the sync_map_items - """ - if self._sync_map_items is None: - self._sync_map_items = SyncMapItemList( - self._version, - self._solution["service_sid"], - self._solution["sid"], - ) - return self._sync_map_items - - @property - def sync_map_permissions(self) -> SyncMapPermissionList: - """ - Access the sync_map_permissions - """ - if self._sync_map_permissions is None: - self._sync_map_permissions = SyncMapPermissionList( - self._version, - self._solution["service_sid"], - self._solution["sid"], - ) - return self._sync_map_permissions - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncMapPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> SyncMapInstance: - """ - Build an instance of SyncMapInstance - - :param payload: Payload response from the API - """ - return SyncMapInstance( - self._version, payload, service_sid=self._solution["service_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class SyncMapList(ListResource): - - def __init__(self, version: Version, service_sid: str): - """ - Initialize the SyncMapList - - :param version: Version that contains the resource - :param service_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - } - self._uri = "/Services/{service_sid}/Maps".format(**self._solution) - - def create(self, unique_name: Union[str, object] = values.unset) -> SyncMapInstance: - """ - Create the SyncMapInstance - - :param unique_name: - - :returns: The created SyncMapInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncMapInstance( - self._version, payload, service_sid=self._solution["service_sid"] - ) - - async def create_async( - self, unique_name: Union[str, object] = values.unset - ) -> SyncMapInstance: - """ - Asynchronously create the SyncMapInstance - - :param unique_name: - - :returns: The created SyncMapInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncMapInstance( - self._version, payload, service_sid=self._solution["service_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[SyncMapInstance]: - """ - Streams SyncMapInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[SyncMapInstance]: - """ - Asynchronously streams SyncMapInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncMapInstance]: - """ - Lists SyncMapInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncMapInstance]: - """ - Asynchronously lists SyncMapInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncMapPage: - """ - Retrieve a single page of SyncMapInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncMapInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncMapPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncMapPage: - """ - Asynchronously retrieve a single page of SyncMapInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncMapInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncMapPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> SyncMapPage: - """ - Retrieve a specific page of SyncMapInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncMapInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return SyncMapPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> SyncMapPage: - """ - Asynchronously retrieve a specific page of SyncMapInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncMapInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return SyncMapPage(self._version, response, self._solution) - - def get(self, sid: str) -> SyncMapContext: - """ - Constructs a SyncMapContext - - :param sid: - """ - return SyncMapContext( - self._version, service_sid=self._solution["service_sid"], sid=sid - ) - - def __call__(self, sid: str) -> SyncMapContext: - """ - Constructs a SyncMapContext - - :param sid: - """ - return SyncMapContext( - self._version, service_sid=self._solution["service_sid"], sid=sid - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py b/twilio/rest/preview/sync/service/sync_map/sync_map_item.py deleted file mode 100644 index 9ddd1d5afe..0000000000 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_item.py +++ /dev/null @@ -1,767 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class SyncMapItemInstance(InstanceResource): - - class QueryFromBoundType(object): - INCLUSIVE = "inclusive" - EXCLUSIVE = "exclusive" - - class QueryResultOrder(object): - ASC = "asc" - DESC = "desc" - - """ - :ivar key: - :ivar account_sid: - :ivar service_sid: - :ivar map_sid: - :ivar url: - :ivar revision: - :ivar data: - :ivar date_created: - :ivar date_updated: - :ivar created_by: - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - service_sid: str, - map_sid: str, - key: Optional[str] = None, - ): - super().__init__(version) - - self.key: Optional[str] = payload.get("key") - self.account_sid: Optional[str] = payload.get("account_sid") - self.service_sid: Optional[str] = payload.get("service_sid") - self.map_sid: Optional[str] = payload.get("map_sid") - self.url: Optional[str] = payload.get("url") - self.revision: Optional[str] = payload.get("revision") - self.data: Optional[Dict[str, object]] = payload.get("data") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.created_by: Optional[str] = payload.get("created_by") - - self._solution = { - "service_sid": service_sid, - "map_sid": map_sid, - "key": key or self.key, - } - self._context: Optional[SyncMapItemContext] = None - - @property - def _proxy(self) -> "SyncMapItemContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: SyncMapItemContext for this SyncMapItemInstance - """ - if self._context is None: - self._context = SyncMapItemContext( - self._version, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - key=self._solution["key"], - ) - return self._context - - def delete(self, if_match: Union[str, object] = values.unset) -> bool: - """ - Deletes the SyncMapItemInstance - - :param if_match: The If-Match HTTP request header - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete( - if_match=if_match, - ) - - async def delete_async(self, if_match: Union[str, object] = values.unset) -> bool: - """ - Asynchronous coroutine that deletes the SyncMapItemInstance - - :param if_match: The If-Match HTTP request header - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async( - if_match=if_match, - ) - - def fetch(self) -> "SyncMapItemInstance": - """ - Fetch the SyncMapItemInstance - - - :returns: The fetched SyncMapItemInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "SyncMapItemInstance": - """ - Asynchronous coroutine to fetch the SyncMapItemInstance - - - :returns: The fetched SyncMapItemInstance - """ - return await self._proxy.fetch_async() - - def update( - self, data: object, if_match: Union[str, object] = values.unset - ) -> "SyncMapItemInstance": - """ - Update the SyncMapItemInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated SyncMapItemInstance - """ - return self._proxy.update( - data=data, - if_match=if_match, - ) - - async def update_async( - self, data: object, if_match: Union[str, object] = values.unset - ) -> "SyncMapItemInstance": - """ - Asynchronous coroutine to update the SyncMapItemInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated SyncMapItemInstance - """ - return await self._proxy.update_async( - data=data, - if_match=if_match, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncMapItemContext(InstanceContext): - - def __init__(self, version: Version, service_sid: str, map_sid: str, key: str): - """ - Initialize the SyncMapItemContext - - :param version: Version that contains the resource - :param service_sid: - :param map_sid: - :param key: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "map_sid": map_sid, - "key": key, - } - self._uri = "/Services/{service_sid}/Maps/{map_sid}/Items/{key}".format( - **self._solution - ) - - def delete(self, if_match: Union[str, object] = values.unset) -> bool: - """ - Deletes the SyncMapItemInstance - - :param if_match: The If-Match HTTP request header - - :returns: True if delete succeeds, False otherwise - """ - headers = values.of( - { - "If-Match": if_match, - } - ) - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self, if_match: Union[str, object] = values.unset) -> bool: - """ - Asynchronous coroutine that deletes the SyncMapItemInstance - - :param if_match: The If-Match HTTP request header - - :returns: True if delete succeeds, False otherwise - """ - headers = values.of( - { - "If-Match": if_match, - } - ) - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> SyncMapItemInstance: - """ - Fetch the SyncMapItemInstance - - - :returns: The fetched SyncMapItemInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return SyncMapItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - key=self._solution["key"], - ) - - async def fetch_async(self) -> SyncMapItemInstance: - """ - Asynchronous coroutine to fetch the SyncMapItemInstance - - - :returns: The fetched SyncMapItemInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return SyncMapItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - key=self._solution["key"], - ) - - def update( - self, data: object, if_match: Union[str, object] = values.unset - ) -> SyncMapItemInstance: - """ - Update the SyncMapItemInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated SyncMapItemInstance - """ - - data = values.of( - { - "Data": serialize.object(data), - } - ) - headers = values.of({}) - - if not ( - if_match is values.unset or (isinstance(if_match, str) and not if_match) - ): - headers["If-Match"] = if_match - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncMapItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - key=self._solution["key"], - ) - - async def update_async( - self, data: object, if_match: Union[str, object] = values.unset - ) -> SyncMapItemInstance: - """ - Asynchronous coroutine to update the SyncMapItemInstance - - :param data: - :param if_match: The If-Match HTTP request header - - :returns: The updated SyncMapItemInstance - """ - - data = values.of( - { - "Data": serialize.object(data), - } - ) - headers = values.of({}) - - if not ( - if_match is values.unset or (isinstance(if_match, str) and not if_match) - ): - headers["If-Match"] = if_match - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncMapItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - key=self._solution["key"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncMapItemPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> SyncMapItemInstance: - """ - Build an instance of SyncMapItemInstance - - :param payload: Payload response from the API - """ - return SyncMapItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class SyncMapItemList(ListResource): - - def __init__(self, version: Version, service_sid: str, map_sid: str): - """ - Initialize the SyncMapItemList - - :param version: Version that contains the resource - :param service_sid: - :param map_sid: - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "map_sid": map_sid, - } - self._uri = "/Services/{service_sid}/Maps/{map_sid}/Items".format( - **self._solution - ) - - def create(self, key: str, data: object) -> SyncMapItemInstance: - """ - Create the SyncMapItemInstance - - :param key: - :param data: - - :returns: The created SyncMapItemInstance - """ - - data = values.of( - { - "Key": key, - "Data": serialize.object(data), - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncMapItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - ) - - async def create_async(self, key: str, data: object) -> SyncMapItemInstance: - """ - Asynchronously create the SyncMapItemInstance - - :param key: - :param data: - - :returns: The created SyncMapItemInstance - """ - - data = values.of( - { - "Key": key, - "Data": serialize.object(data), - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncMapItemInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - ) - - def stream( - self, - order: Union["SyncMapItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncMapItemInstance.QueryFromBoundType", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[SyncMapItemInstance]: - """ - Streams SyncMapItemInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param "SyncMapItemInstance.QueryResultOrder" order: - :param str from_: - :param "SyncMapItemInstance.QueryFromBoundType" bounds: - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page( - order=order, from_=from_, bounds=bounds, page_size=limits["page_size"] - ) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - order: Union["SyncMapItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncMapItemInstance.QueryFromBoundType", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[SyncMapItemInstance]: - """ - Asynchronously streams SyncMapItemInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param "SyncMapItemInstance.QueryResultOrder" order: - :param str from_: - :param "SyncMapItemInstance.QueryFromBoundType" bounds: - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async( - order=order, from_=from_, bounds=bounds, page_size=limits["page_size"] - ) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - order: Union["SyncMapItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncMapItemInstance.QueryFromBoundType", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncMapItemInstance]: - """ - Lists SyncMapItemInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param "SyncMapItemInstance.QueryResultOrder" order: - :param str from_: - :param "SyncMapItemInstance.QueryFromBoundType" bounds: - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - order=order, - from_=from_, - bounds=bounds, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - order: Union["SyncMapItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncMapItemInstance.QueryFromBoundType", object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncMapItemInstance]: - """ - Asynchronously lists SyncMapItemInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param "SyncMapItemInstance.QueryResultOrder" order: - :param str from_: - :param "SyncMapItemInstance.QueryFromBoundType" bounds: - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - order=order, - from_=from_, - bounds=bounds, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - order: Union["SyncMapItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncMapItemInstance.QueryFromBoundType", object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncMapItemPage: - """ - Retrieve a single page of SyncMapItemInstance records from the API. - Request is executed immediately - - :param order: - :param from_: - :param bounds: - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncMapItemInstance - """ - data = values.of( - { - "Order": order, - "From": from_, - "Bounds": bounds, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncMapItemPage(self._version, response, self._solution) - - async def page_async( - self, - order: Union["SyncMapItemInstance.QueryResultOrder", object] = values.unset, - from_: Union[str, object] = values.unset, - bounds: Union["SyncMapItemInstance.QueryFromBoundType", object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncMapItemPage: - """ - Asynchronously retrieve a single page of SyncMapItemInstance records from the API. - Request is executed immediately - - :param order: - :param from_: - :param bounds: - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncMapItemInstance - """ - data = values.of( - { - "Order": order, - "From": from_, - "Bounds": bounds, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncMapItemPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> SyncMapItemPage: - """ - Retrieve a specific page of SyncMapItemInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncMapItemInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return SyncMapItemPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> SyncMapItemPage: - """ - Asynchronously retrieve a specific page of SyncMapItemInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncMapItemInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return SyncMapItemPage(self._version, response, self._solution) - - def get(self, key: str) -> SyncMapItemContext: - """ - Constructs a SyncMapItemContext - - :param key: - """ - return SyncMapItemContext( - self._version, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - key=key, - ) - - def __call__(self, key: str) -> SyncMapItemContext: - """ - Constructs a SyncMapItemContext - - :param key: - """ - return SyncMapItemContext( - self._version, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - key=key, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py b/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py deleted file mode 100644 index 9e19d56a91..0000000000 --- a/twilio/rest/preview/sync/service/sync_map/sync_map_permission.py +++ /dev/null @@ -1,615 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Preview - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class SyncMapPermissionInstance(InstanceResource): - """ - :ivar account_sid: The unique SID identifier of the Twilio Account. - :ivar service_sid: The unique SID identifier of the Sync Service Instance. - :ivar map_sid: The unique SID identifier of the Sync Map to which the Permission applies. - :ivar identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - :ivar read: Boolean flag specifying whether the identity can read the Sync Map and its Items. - :ivar write: Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. - :ivar manage: Boolean flag specifying whether the identity can delete the Sync Map. - :ivar url: Contains an absolute URL for this Sync Map Permission. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - service_sid: str, - map_sid: str, - identity: Optional[str] = None, - ): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.service_sid: Optional[str] = payload.get("service_sid") - self.map_sid: Optional[str] = payload.get("map_sid") - self.identity: Optional[str] = payload.get("identity") - self.read: Optional[bool] = payload.get("read") - self.write: Optional[bool] = payload.get("write") - self.manage: Optional[bool] = payload.get("manage") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "service_sid": service_sid, - "map_sid": map_sid, - "identity": identity or self.identity, - } - self._context: Optional[SyncMapPermissionContext] = None - - @property - def _proxy(self) -> "SyncMapPermissionContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: SyncMapPermissionContext for this SyncMapPermissionInstance - """ - if self._context is None: - self._context = SyncMapPermissionContext( - self._version, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - identity=self._solution["identity"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the SyncMapPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SyncMapPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "SyncMapPermissionInstance": - """ - Fetch the SyncMapPermissionInstance - - - :returns: The fetched SyncMapPermissionInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "SyncMapPermissionInstance": - """ - Asynchronous coroutine to fetch the SyncMapPermissionInstance - - - :returns: The fetched SyncMapPermissionInstance - """ - return await self._proxy.fetch_async() - - def update( - self, read: bool, write: bool, manage: bool - ) -> "SyncMapPermissionInstance": - """ - Update the SyncMapPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync Map. - :param write: Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. - :param manage: Boolean flag specifying whether the identity can delete the Sync Map. - - :returns: The updated SyncMapPermissionInstance - """ - return self._proxy.update( - read=read, - write=write, - manage=manage, - ) - - async def update_async( - self, read: bool, write: bool, manage: bool - ) -> "SyncMapPermissionInstance": - """ - Asynchronous coroutine to update the SyncMapPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync Map. - :param write: Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. - :param manage: Boolean flag specifying whether the identity can delete the Sync Map. - - :returns: The updated SyncMapPermissionInstance - """ - return await self._proxy.update_async( - read=read, - write=write, - manage=manage, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncMapPermissionContext(InstanceContext): - - def __init__(self, version: Version, service_sid: str, map_sid: str, identity: str): - """ - Initialize the SyncMapPermissionContext - - :param version: Version that contains the resource - :param service_sid: The unique SID identifier of the Sync Service Instance. - :param map_sid: Identifier of the Sync Map. Either a SID or a unique name. - :param identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "map_sid": map_sid, - "identity": identity, - } - self._uri = ( - "/Services/{service_sid}/Maps/{map_sid}/Permissions/{identity}".format( - **self._solution - ) - ) - - def delete(self) -> bool: - """ - Deletes the SyncMapPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the SyncMapPermissionInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> SyncMapPermissionInstance: - """ - Fetch the SyncMapPermissionInstance - - - :returns: The fetched SyncMapPermissionInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return SyncMapPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - identity=self._solution["identity"], - ) - - async def fetch_async(self) -> SyncMapPermissionInstance: - """ - Asynchronous coroutine to fetch the SyncMapPermissionInstance - - - :returns: The fetched SyncMapPermissionInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return SyncMapPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - identity=self._solution["identity"], - ) - - def update( - self, read: bool, write: bool, manage: bool - ) -> SyncMapPermissionInstance: - """ - Update the SyncMapPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync Map. - :param write: Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. - :param manage: Boolean flag specifying whether the identity can delete the Sync Map. - - :returns: The updated SyncMapPermissionInstance - """ - - data = values.of( - { - "Read": serialize.boolean_to_string(read), - "Write": serialize.boolean_to_string(write), - "Manage": serialize.boolean_to_string(manage), - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncMapPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - identity=self._solution["identity"], - ) - - async def update_async( - self, read: bool, write: bool, manage: bool - ) -> SyncMapPermissionInstance: - """ - Asynchronous coroutine to update the SyncMapPermissionInstance - - :param read: Boolean flag specifying whether the identity can read the Sync Map. - :param write: Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. - :param manage: Boolean flag specifying whether the identity can delete the Sync Map. - - :returns: The updated SyncMapPermissionInstance - """ - - data = values.of( - { - "Read": serialize.boolean_to_string(read), - "Write": serialize.boolean_to_string(write), - "Manage": serialize.boolean_to_string(manage), - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return SyncMapPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - identity=self._solution["identity"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class SyncMapPermissionPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> SyncMapPermissionInstance: - """ - Build an instance of SyncMapPermissionInstance - - :param payload: Payload response from the API - """ - return SyncMapPermissionInstance( - self._version, - payload, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class SyncMapPermissionList(ListResource): - - def __init__(self, version: Version, service_sid: str, map_sid: str): - """ - Initialize the SyncMapPermissionList - - :param version: Version that contains the resource - :param service_sid: - :param map_sid: Identifier of the Sync Map. Either a SID or a unique name. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "service_sid": service_sid, - "map_sid": map_sid, - } - self._uri = "/Services/{service_sid}/Maps/{map_sid}/Permissions".format( - **self._solution - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[SyncMapPermissionInstance]: - """ - Streams SyncMapPermissionInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[SyncMapPermissionInstance]: - """ - Asynchronously streams SyncMapPermissionInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncMapPermissionInstance]: - """ - Lists SyncMapPermissionInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[SyncMapPermissionInstance]: - """ - Asynchronously lists SyncMapPermissionInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncMapPermissionPage: - """ - Retrieve a single page of SyncMapPermissionInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncMapPermissionInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncMapPermissionPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> SyncMapPermissionPage: - """ - Asynchronously retrieve a single page of SyncMapPermissionInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of SyncMapPermissionInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return SyncMapPermissionPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> SyncMapPermissionPage: - """ - Retrieve a specific page of SyncMapPermissionInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncMapPermissionInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return SyncMapPermissionPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> SyncMapPermissionPage: - """ - Asynchronously retrieve a specific page of SyncMapPermissionInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of SyncMapPermissionInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return SyncMapPermissionPage(self._version, response, self._solution) - - def get(self, identity: str) -> SyncMapPermissionContext: - """ - Constructs a SyncMapPermissionContext - - :param identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - """ - return SyncMapPermissionContext( - self._version, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - identity=identity, - ) - - def __call__(self, identity: str) -> SyncMapPermissionContext: - """ - Constructs a SyncMapPermissionContext - - :param identity: Arbitrary string identifier representing a human user associated with an FPA token, assigned by the developer. - """ - return SyncMapPermissionContext( - self._version, - service_sid=self._solution["service_sid"], - map_sid=self._solution["map_sid"], - identity=identity, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/taskrouter/v1/workspace/task/reservation.py b/twilio/rest/taskrouter/v1/workspace/task/reservation.py index 5318543ea2..28cb03339a 100644 --- a/twilio/rest/taskrouter/v1/workspace/task/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/task/reservation.py @@ -250,7 +250,7 @@ def update( :param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. :param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. - :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. :param sip_auth_username: The SIP username used for authentication. :param sip_auth_password: The SIP password for authentication. :param dequeue_status_callback_event: The Call progress events sent via webhooks as a result of a Dequeue instruction. @@ -433,7 +433,7 @@ async def update_async( :param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. :param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. - :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. :param sip_auth_username: The SIP username used for authentication. :param sip_auth_password: The SIP password for authentication. :param dequeue_status_callback_event: The Call progress events sent via webhooks as a result of a Dequeue instruction. @@ -697,7 +697,7 @@ def update( :param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. :param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. - :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. :param sip_auth_username: The SIP username used for authentication. :param sip_auth_password: The SIP password for authentication. :param dequeue_status_callback_event: The Call progress events sent via webhooks as a result of a Dequeue instruction. @@ -918,7 +918,7 @@ async def update_async( :param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. :param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. - :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. :param sip_auth_username: The SIP username used for authentication. :param sip_auth_password: The SIP password for authentication. :param dequeue_status_callback_event: The Call progress events sent via webhooks as a result of a Dequeue instruction. diff --git a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py index 11d1ea610d..7f24057806 100644 --- a/twilio/rest/taskrouter/v1/workspace/worker/reservation.py +++ b/twilio/rest/taskrouter/v1/workspace/worker/reservation.py @@ -241,7 +241,7 @@ def update( :param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. :param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. - :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. :param sip_auth_username: The SIP username used for authentication. :param sip_auth_password: The SIP password for authentication. :param dequeue_status_callback_event: The call progress events sent via webhooks as a result of a Dequeue instruction. @@ -416,7 +416,7 @@ async def update_async( :param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. :param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. - :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. :param sip_auth_username: The SIP username used for authentication. :param sip_auth_password: The SIP password for authentication. :param dequeue_status_callback_event: The call progress events sent via webhooks as a result of a Dequeue instruction. @@ -670,7 +670,7 @@ def update( :param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. :param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. - :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. :param sip_auth_username: The SIP username used for authentication. :param sip_auth_password: The SIP password for authentication. :param dequeue_status_callback_event: The call progress events sent via webhooks as a result of a Dequeue instruction. @@ -883,7 +883,7 @@ async def update_async( :param recording_status_callback_method: The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. :param conference_recording_status_callback: The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. :param conference_recording_status_callback_method: The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. - :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + :param region: The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `us2`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. :param sip_auth_username: The SIP username used for authentication. :param sip_auth_password: The SIP password for authentication. :param dequeue_status_callback_event: The call progress events sent via webhooks as a result of a Dequeue instruction. diff --git a/twilio/rest/video/v1/room/participant/__init__.py b/twilio/rest/video/v1/room/participant/__init__.py index 756a166eae..7e012e8d37 100644 --- a/twilio/rest/video/v1/room/participant/__init__.py +++ b/twilio/rest/video/v1/room/participant/__init__.py @@ -31,6 +31,7 @@ class ParticipantInstance(InstanceResource): class Status(object): CONNECTED = "connected" DISCONNECTED = "disconnected" + RECONNECTING = "reconnecting" """ :ivar sid: The unique string that we created to identify the RoomParticipant resource. diff --git a/twilio/rest/wireless/v1/rate_plan.py b/twilio/rest/wireless/v1/rate_plan.py index 458ade0ad5..23efabe9b0 100644 --- a/twilio/rest/wireless/v1/rate_plan.py +++ b/twilio/rest/wireless/v1/rate_plan.py @@ -23,6 +23,11 @@ class RatePlanInstance(InstanceResource): + + class DataLimitStrategy(object): + BLOCK = "block" + THROTTLE = "throttle" + """ :ivar sid: The unique string that we created to identify the RatePlan resource. :ivar unique_name: An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. @@ -382,6 +387,9 @@ def create( international_roaming: Union[List[str], object] = values.unset, national_roaming_data_limit: Union[int, object] = values.unset, international_roaming_data_limit: Union[int, object] = values.unset, + data_limit_strategy: Union[ + "RatePlanInstance.DataLimitStrategy", object + ] = values.unset, ) -> RatePlanInstance: """ Create the RatePlanInstance @@ -397,6 +405,7 @@ def create( :param international_roaming: The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. :param national_roaming_data_limit: The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. :param international_roaming_data_limit: The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. + :param data_limit_strategy: :returns: The created RatePlanInstance """ @@ -418,6 +427,7 @@ def create( ), "NationalRoamingDataLimit": national_roaming_data_limit, "InternationalRoamingDataLimit": international_roaming_data_limit, + "DataLimitStrategy": data_limit_strategy, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -445,6 +455,9 @@ async def create_async( international_roaming: Union[List[str], object] = values.unset, national_roaming_data_limit: Union[int, object] = values.unset, international_roaming_data_limit: Union[int, object] = values.unset, + data_limit_strategy: Union[ + "RatePlanInstance.DataLimitStrategy", object + ] = values.unset, ) -> RatePlanInstance: """ Asynchronously create the RatePlanInstance @@ -460,6 +473,7 @@ async def create_async( :param international_roaming: The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. :param national_roaming_data_limit: The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/iot/wireless/api/rateplan-resource#national-roaming) for more info. :param international_roaming_data_limit: The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. + :param data_limit_strategy: :returns: The created RatePlanInstance """ @@ -481,6 +495,7 @@ async def create_async( ), "NationalRoamingDataLimit": national_roaming_data_limit, "InternationalRoamingDataLimit": international_roaming_data_limit, + "DataLimitStrategy": data_limit_strategy, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) From bf3e6da59d767eb752131c2298fb173673ca7c6a Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 20 Mar 2025 10:29:14 +0000 Subject: [PATCH 094/113] Release 9.5.1 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index fc58de0ec1..6784744561 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.5.0", + version="9.5.1", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index b2bf5772dd..13ccdd0b0d 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "5", "0") +__version_info__ = ("9", "5", "1") __version__ = ".".join(__version_info__) From e57d156b9ea07f8342fe4adbb6da12d4cdcb1ee2 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 7 Apr 2025 12:38:16 +0000 Subject: [PATCH 095/113] [Librarian] Regenerated @ e229c81d086276743ccce5ac8e1e19c4ad654adb 190899e14f985d8b58f0b5a70c5f7156b7333d28 --- CHANGES.md | 6 + twilio/rest/__init__.py | 15 + twilio/rest/knowledge/KnowledgeBase.py | 44 + twilio/rest/knowledge/v1/__init__.py | 43 + .../rest/knowledge/v1/knowledge/__init__.py | 935 ++++++++++++++++++ twilio/rest/knowledge/v1/knowledge/chunk.py | 297 ++++++ .../v1/knowledge/knowledge_status.py | 196 ++++ twilio/rest/lookups/v1/phone_number.py | 8 +- twilio/rest/monitor/v1/event.py | 2 +- .../v1/flow/engagement/step/__init__.py | 2 + .../flow/execution/execution_step/__init__.py | 2 + .../flow/execution/execution_step/__init__.py | 2 + 12 files changed, 1547 insertions(+), 5 deletions(-) create mode 100644 twilio/rest/knowledge/KnowledgeBase.py create mode 100644 twilio/rest/knowledge/v1/__init__.py create mode 100644 twilio/rest/knowledge/v1/knowledge/__init__.py create mode 100644 twilio/rest/knowledge/v1/knowledge/chunk.py create mode 100644 twilio/rest/knowledge/v1/knowledge/knowledge_status.py diff --git a/CHANGES.md b/CHANGES.md index a985cb3245..c3e678a6a0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,12 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-04-07] Version 9.5.2 +-------------------------- +**Studio** +- Add documentation for parent_step_sid field in Step resource + + [2025-03-20] Version 9.5.1 -------------------------- **Accounts** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 5838363c52..dc7741180b 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -29,6 +29,7 @@ from twilio.rest.insights import Insights from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging + from twilio.rest.knowledge import Knowledge from twilio.rest.lookups import Lookups from twilio.rest.marketplace import Marketplace from twilio.rest.messaging import Messaging @@ -142,6 +143,7 @@ def __init__( self._insights: Optional["Insights"] = None self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None + self._knowledge: Optional["Knowledge"] = None self._lookups: Optional["Lookups"] = None self._marketplace: Optional["Marketplace"] = None self._messaging: Optional["Messaging"] = None @@ -361,6 +363,19 @@ def ip_messaging(self) -> "IpMessaging": self._ip_messaging = IpMessaging(self) return self._ip_messaging + @property + def knowledge(self) -> "Knowledge": + """ + Access the Knowledge Twilio Domain + + :returns: Knowledge Twilio Domain + """ + if self._knowledge is None: + from twilio.rest.knowledge import Knowledge + + self._knowledge = Knowledge(self) + return self._knowledge + @property def lookups(self) -> "Lookups": """ diff --git a/twilio/rest/knowledge/KnowledgeBase.py b/twilio/rest/knowledge/KnowledgeBase.py new file mode 100644 index 0000000000..902f0e8b96 --- /dev/null +++ b/twilio/rest/knowledge/KnowledgeBase.py @@ -0,0 +1,44 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional + +from twilio.base.domain import Domain +from twilio.rest import Client +from twilio.rest.knowledge.v1 import V1 + + +class KnowledgeBase(Domain): + + def __init__(self, twilio: Client): + """ + Initialize the Knowledge Domain + + :returns: Domain for Knowledge + """ + super().__init__(twilio, "https://knowledge.twilio.com") + self._v1: Optional[V1] = None + + @property + def v1(self) -> V1: + """ + :returns: Versions v1 of Knowledge + """ + if self._v1 is None: + self._v1 = V1(self) + return self._v1 + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/knowledge/v1/__init__.py b/twilio/rest/knowledge/v1/__init__.py new file mode 100644 index 0000000000..9609bff951 --- /dev/null +++ b/twilio/rest/knowledge/v1/__init__.py @@ -0,0 +1,43 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Knowledge + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.knowledge.v1.knowledge import KnowledgeList + + +class V1(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V1 version of Knowledge + + :param domain: The Twilio.knowledge domain + """ + super().__init__(domain, "v1") + self._knowledge: Optional[KnowledgeList] = None + + @property + def knowledge(self) -> KnowledgeList: + if self._knowledge is None: + self._knowledge = KnowledgeList(self) + return self._knowledge + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/knowledge/v1/knowledge/__init__.py b/twilio/rest/knowledge/v1/knowledge/__init__.py new file mode 100644 index 0000000000..8ba6b2c481 --- /dev/null +++ b/twilio/rest/knowledge/v1/knowledge/__init__.py @@ -0,0 +1,935 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Knowledge + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page +from twilio.rest.knowledge.v1.knowledge.chunk import ChunkList +from twilio.rest.knowledge.v1.knowledge.knowledge_status import KnowledgeStatusList + + +class KnowledgeInstance(InstanceResource): + + class KnowledgeV1ServiceCreateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + class KnowledgeV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class KnowledgeV1ServiceUpdateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar policy: + :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + """ + :ivar description: The type of knowledge source. + :ivar id: The description of knowledge. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') + :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') + :ivar url: The url of the knowledge resource. + :ivar embedding_model: The embedding model to be used for the knowledge source. + :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], id: Optional[str] = None + ): + super().__init__(version) + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.account_sid: Optional[str] = payload.get("account_sid") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.status: Optional[str] = payload.get("status") + self.type: Optional[str] = payload.get("type") + self.url: Optional[str] = payload.get("url") + self.embedding_model: Optional[str] = payload.get("embedding_model") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id or self.id, + } + self._context: Optional[KnowledgeContext] = None + + @property + def _proxy(self) -> "KnowledgeContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: KnowledgeContext for this KnowledgeInstance + """ + if self._context is None: + self._context = KnowledgeContext( + self._version, + id=self._solution["id"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "KnowledgeInstance": + """ + Fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "KnowledgeInstance": + """ + Asynchronous coroutine to fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + return await self._proxy.fetch_async() + + def update( + self, + knowledge_v1_service_update_knowledge_request: Union[ + KnowledgeV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> "KnowledgeInstance": + """ + Update the KnowledgeInstance + + :param knowledge_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + return self._proxy.update( + knowledge_v1_service_update_knowledge_request=knowledge_v1_service_update_knowledge_request, + ) + + async def update_async( + self, + knowledge_v1_service_update_knowledge_request: Union[ + KnowledgeV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> "KnowledgeInstance": + """ + Asynchronous coroutine to update the KnowledgeInstance + + :param knowledge_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + return await self._proxy.update_async( + knowledge_v1_service_update_knowledge_request=knowledge_v1_service_update_knowledge_request, + ) + + @property + def chunks(self) -> ChunkList: + """ + Access the chunks + """ + return self._proxy.chunks + + @property + def knowledge_status(self) -> KnowledgeStatusList: + """ + Access the knowledge_status + """ + return self._proxy.knowledge_status + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgeContext(InstanceContext): + + class KnowledgeV1ServiceCreateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + class KnowledgeV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class KnowledgeV1ServiceUpdateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar policy: + :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + def __init__(self, version: Version, id: str): + """ + Initialize the KnowledgeContext + + :param version: Version that contains the resource + :param id: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Knowledge/{id}".format(**self._solution) + + self._chunks: Optional[ChunkList] = None + self._knowledge_status: Optional[KnowledgeStatusList] = None + + def delete(self) -> bool: + """ + Deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + return await self._version.delete_async( + method="DELETE", uri=self._uri, headers=headers + ) + + def fetch(self) -> KnowledgeInstance: + """ + Fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return KnowledgeInstance( + self._version, + payload, + id=self._solution["id"], + ) + + async def fetch_async(self) -> KnowledgeInstance: + """ + Asynchronous coroutine to fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return KnowledgeInstance( + self._version, + payload, + id=self._solution["id"], + ) + + def update( + self, + knowledge_v1_service_update_knowledge_request: Union[ + KnowledgeV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> KnowledgeInstance: + """ + Update the KnowledgeInstance + + :param knowledge_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + data = knowledge_v1_service_update_knowledge_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = self._version.update( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload, id=self._solution["id"]) + + async def update_async( + self, + knowledge_v1_service_update_knowledge_request: Union[ + KnowledgeV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> KnowledgeInstance: + """ + Asynchronous coroutine to update the KnowledgeInstance + + :param knowledge_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + data = knowledge_v1_service_update_knowledge_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = await self._version.update_async( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload, id=self._solution["id"]) + + @property + def chunks(self) -> ChunkList: + """ + Access the chunks + """ + if self._chunks is None: + self._chunks = ChunkList( + self._version, + self._solution["id"], + ) + return self._chunks + + @property + def knowledge_status(self) -> KnowledgeStatusList: + """ + Access the knowledge_status + """ + if self._knowledge_status is None: + self._knowledge_status = KnowledgeStatusList( + self._version, + self._solution["id"], + ) + return self._knowledge_status + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgePage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> KnowledgeInstance: + """ + Build an instance of KnowledgeInstance + + :param payload: Payload response from the API + """ + return KnowledgeInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class KnowledgeList(ListResource): + + class KnowledgeV1ServiceCreateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + class KnowledgeV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class KnowledgeV1ServiceUpdateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar policy: + :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + def __init__(self, version: Version): + """ + Initialize the KnowledgeList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Knowledge" + + def create( + self, + knowledge_v1_service_create_knowledge_request: KnowledgeV1ServiceCreateKnowledgeRequest, + ) -> KnowledgeInstance: + """ + Create the KnowledgeInstance + + :param knowledge_v1_service_create_knowledge_request: + + :returns: The created KnowledgeInstance + """ + data = knowledge_v1_service_create_knowledge_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload) + + async def create_async( + self, + knowledge_v1_service_create_knowledge_request: KnowledgeV1ServiceCreateKnowledgeRequest, + ) -> KnowledgeInstance: + """ + Asynchronously create the KnowledgeInstance + + :param knowledge_v1_service_create_knowledge_request: + + :returns: The created KnowledgeInstance + """ + data = knowledge_v1_service_create_knowledge_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[KnowledgeInstance]: + """ + Streams KnowledgeInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[KnowledgeInstance]: + """ + Asynchronously streams KnowledgeInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[KnowledgeInstance]: + """ + Lists KnowledgeInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[KnowledgeInstance]: + """ + Asynchronously lists KnowledgeInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> KnowledgePage: + """ + Retrieve a single page of KnowledgeInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of KnowledgeInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return KnowledgePage(self._version, response) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> KnowledgePage: + """ + Asynchronously retrieve a single page of KnowledgeInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of KnowledgeInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return KnowledgePage(self._version, response) + + def get_page(self, target_url: str) -> KnowledgePage: + """ + Retrieve a specific page of KnowledgeInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of KnowledgeInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return KnowledgePage(self._version, response) + + async def get_page_async(self, target_url: str) -> KnowledgePage: + """ + Asynchronously retrieve a specific page of KnowledgeInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of KnowledgeInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return KnowledgePage(self._version, response) + + def get(self, id: str) -> KnowledgeContext: + """ + Constructs a KnowledgeContext + + :param id: + """ + return KnowledgeContext(self._version, id=id) + + def __call__(self, id: str) -> KnowledgeContext: + """ + Constructs a KnowledgeContext + + :param id: + """ + return KnowledgeContext(self._version, id=id) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/knowledge/v1/knowledge/chunk.py b/twilio/rest/knowledge/v1/knowledge/chunk.py new file mode 100644 index 0000000000..55c0b1be1a --- /dev/null +++ b/twilio/rest/knowledge/v1/knowledge/chunk.py @@ -0,0 +1,297 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Knowledge + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class ChunkInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. + :ivar content: The chunk content. + :ivar metadata: The metadata of the chunk. + :ivar date_created: The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], id: str): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.content: Optional[str] = payload.get("content") + self.metadata: Optional[Dict[str, object]] = payload.get("metadata") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ChunkPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> ChunkInstance: + """ + Build an instance of ChunkInstance + + :param payload: Payload response from the API + """ + return ChunkInstance(self._version, payload, id=self._solution["id"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class ChunkList(ListResource): + + def __init__(self, version: Version, id: str): + """ + Initialize the ChunkList + + :param version: Version that contains the resource + :param id: The knowledge ID. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Knowledge/{id}/Chunks".format(**self._solution) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[ChunkInstance]: + """ + Streams ChunkInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[ChunkInstance]: + """ + Asynchronously streams ChunkInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ChunkInstance]: + """ + Lists ChunkInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ChunkInstance]: + """ + Asynchronously lists ChunkInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ChunkPage: + """ + Retrieve a single page of ChunkInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ChunkInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return ChunkPage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ChunkPage: + """ + Asynchronously retrieve a single page of ChunkInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ChunkInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return ChunkPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> ChunkPage: + """ + Retrieve a specific page of ChunkInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ChunkInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return ChunkPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> ChunkPage: + """ + Asynchronously retrieve a specific page of ChunkInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ChunkInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return ChunkPage(self._version, response, self._solution) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/knowledge/v1/knowledge/knowledge_status.py b/twilio/rest/knowledge/v1/knowledge/knowledge_status.py new file mode 100644 index 0000000000..984c577aac --- /dev/null +++ b/twilio/rest/knowledge/v1/knowledge/knowledge_status.py @@ -0,0 +1,196 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Knowledge + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class KnowledgeStatusInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. + :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') + :ivar last_status: The last status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') + :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], id: str): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.status: Optional[str] = payload.get("status") + self.last_status: Optional[str] = payload.get("last_status") + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id, + } + self._context: Optional[KnowledgeStatusContext] = None + + @property + def _proxy(self) -> "KnowledgeStatusContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: KnowledgeStatusContext for this KnowledgeStatusInstance + """ + if self._context is None: + self._context = KnowledgeStatusContext( + self._version, + id=self._solution["id"], + ) + return self._context + + def fetch(self) -> "KnowledgeStatusInstance": + """ + Fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "KnowledgeStatusInstance": + """ + Asynchronous coroutine to fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgeStatusContext(InstanceContext): + + def __init__(self, version: Version, id: str): + """ + Initialize the KnowledgeStatusContext + + :param version: Version that contains the resource + :param id: the Knowledge ID. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Knowledge/{id}/Status".format(**self._solution) + + def fetch(self) -> KnowledgeStatusInstance: + """ + Fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return KnowledgeStatusInstance( + self._version, + payload, + id=self._solution["id"], + ) + + async def fetch_async(self) -> KnowledgeStatusInstance: + """ + Asynchronous coroutine to fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return KnowledgeStatusInstance( + self._version, + payload, + id=self._solution["id"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgeStatusList(ListResource): + + def __init__(self, version: Version, id: str): + """ + Initialize the KnowledgeStatusList + + :param version: Version that contains the resource + :param id: the Knowledge ID. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + + def get(self) -> KnowledgeStatusContext: + """ + Constructs a KnowledgeStatusContext + + """ + return KnowledgeStatusContext(self._version, id=self._solution["id"]) + + def __call__(self) -> KnowledgeStatusContext: + """ + Constructs a KnowledgeStatusContext + + """ + return KnowledgeStatusContext(self._version, id=self._solution["id"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/lookups/v1/phone_number.py b/twilio/rest/lookups/v1/phone_number.py index ace46b67bd..304b89ab15 100644 --- a/twilio/rest/lookups/v1/phone_number.py +++ b/twilio/rest/lookups/v1/phone_number.py @@ -78,7 +78,7 @@ def fetch( Fetch the PhoneNumberInstance :param country_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. - :param type: The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. + :param type: The type of information to return. Can be: `carrier` or `caller-name`. The default is null. To retrieve both types of information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. :param add_ons: The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). :param add_ons_data: Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. @@ -102,7 +102,7 @@ async def fetch_async( Asynchronous coroutine to fetch the PhoneNumberInstance :param country_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. - :param type: The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. + :param type: The type of information to return. Can be: `carrier` or `caller-name`. The default is null. To retrieve both types of information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. :param add_ons: The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). :param add_ons_data: Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. @@ -153,7 +153,7 @@ def fetch( Fetch the PhoneNumberInstance :param country_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. - :param type: The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. + :param type: The type of information to return. Can be: `carrier` or `caller-name`. The default is null. To retrieve both types of information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. :param add_ons: The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). :param add_ons_data: Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. @@ -195,7 +195,7 @@ async def fetch_async( Asynchronous coroutine to fetch the PhoneNumberInstance :param country_code: The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. - :param type: The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. + :param type: The type of information to return. Can be: `carrier` or `caller-name`. The default is null. To retrieve both types of information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. :param add_ons: The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). :param add_ons_data: Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. diff --git a/twilio/rest/monitor/v1/event.py b/twilio/rest/monitor/v1/event.py index 31716b8813..61450c872c 100644 --- a/twilio/rest/monitor/v1/event.py +++ b/twilio/rest/monitor/v1/event.py @@ -25,7 +25,7 @@ class EventInstance(InstanceResource): """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Event resource. - :ivar actor_sid: The SID of the actor that caused the event, if available. Can be `null`. + :ivar actor_sid: The SID of the actor that caused the event, if available. This can be either a User ID (matching the pattern `^US[0-9a-fA-F]{32}$`) or an Account SID (matching the pattern `^AC[0-9a-fA-F]{32}$`). If the actor's SID isn't available, this field will be `null`. :ivar actor_type: The type of actor that caused the event. Can be: `user` for a change made by a logged-in user in the Twilio Console, `account` for an event caused by an API request by an authenticating Account, `twilio-admin` for an event caused by a Twilio employee, and so on. :ivar description: A description of the event. Can be `null`. :ivar event_data: An object with additional data about the event. The contents depend on `event_type`. For example, event-types of the form `RESOURCE.updated`, this value contains a `resource_properties` dictionary that describes the previous and updated properties of the resource. diff --git a/twilio/rest/studio/v1/flow/engagement/step/__init__.py b/twilio/rest/studio/v1/flow/engagement/step/__init__.py index d88d0ad0f6..a5017c3313 100644 --- a/twilio/rest/studio/v1/flow/engagement/step/__init__.py +++ b/twilio/rest/studio/v1/flow/engagement/step/__init__.py @@ -31,6 +31,7 @@ class StepInstance(InstanceResource): :ivar engagement_sid: The SID of the Engagement. :ivar name: The event that caused the Flow to transition to the Step. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. + :ivar parent_step_sid: The SID of the parent Step. :ivar transitioned_from: The Widget that preceded the Widget for the Step. :ivar transitioned_to: The Widget that will follow the Widget for the Step. :ivar date_created: The date and time in GMT when the resource was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. @@ -55,6 +56,7 @@ def __init__( self.engagement_sid: Optional[str] = payload.get("engagement_sid") self.name: Optional[str] = payload.get("name") self.context: Optional[Dict[str, object]] = payload.get("context") + self.parent_step_sid: Optional[str] = payload.get("parent_step_sid") self.transitioned_from: Optional[str] = payload.get("transitioned_from") self.transitioned_to: Optional[str] = payload.get("transitioned_to") self.date_created: Optional[datetime] = deserialize.iso8601_datetime( diff --git a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py index 888506e965..50a1e2371d 100644 --- a/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v1/flow/execution/execution_step/__init__.py @@ -31,6 +31,7 @@ class ExecutionStepInstance(InstanceResource): :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStep resource. :ivar flow_sid: The SID of the Flow. :ivar execution_sid: The SID of the Step's Execution resource. + :ivar parent_step_sid: This field shows the Step SID of the Widget in the parent Flow that started the Subflow. If this Step is not part of a Subflow execution, the value is null. :ivar name: The event that caused the Flow to transition to the Step. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. :ivar transitioned_from: The Widget that preceded the Widget for the Step. @@ -55,6 +56,7 @@ def __init__( self.account_sid: Optional[str] = payload.get("account_sid") self.flow_sid: Optional[str] = payload.get("flow_sid") self.execution_sid: Optional[str] = payload.get("execution_sid") + self.parent_step_sid: Optional[str] = payload.get("parent_step_sid") self.name: Optional[str] = payload.get("name") self.context: Optional[Dict[str, object]] = payload.get("context") self.transitioned_from: Optional[str] = payload.get("transitioned_from") diff --git a/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py b/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py index b088aeab0e..9ffb2502e6 100644 --- a/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py +++ b/twilio/rest/studio/v2/flow/execution/execution_step/__init__.py @@ -31,6 +31,7 @@ class ExecutionStepInstance(InstanceResource): :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the ExecutionStep resource. :ivar flow_sid: The SID of the Flow. :ivar execution_sid: The SID of the Step's Execution resource. + :ivar parent_step_sid: The SID of the parent Step. :ivar name: The event that caused the Flow to transition to the Step. :ivar context: The current state of the Flow's Execution. As a flow executes, we save its state in this context. We save data that your widgets can access as variables in configuration fields or in text areas as variable substitution. :ivar transitioned_from: The Widget that preceded the Widget for the Step. @@ -55,6 +56,7 @@ def __init__( self.account_sid: Optional[str] = payload.get("account_sid") self.flow_sid: Optional[str] = payload.get("flow_sid") self.execution_sid: Optional[str] = payload.get("execution_sid") + self.parent_step_sid: Optional[str] = payload.get("parent_step_sid") self.name: Optional[str] = payload.get("name") self.context: Optional[Dict[str, object]] = payload.get("context") self.transitioned_from: Optional[str] = payload.get("transitioned_from") From a2b5324692ded839205bb317fb55023515fbca8f Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 7 Apr 2025 12:43:10 +0000 Subject: [PATCH 096/113] Release 9.5.2 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6784744561..d03f823242 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.5.1", + version="9.5.2", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 13ccdd0b0d..15e4058354 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "5", "1") +__version_info__ = ("9", "5", "2") __version__ = ".".join(__version_info__) From e44db6bd285b0556bfd17f5a8b84862cf9521df9 Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Thu, 10 Apr 2025 14:14:34 +0530 Subject: [PATCH 097/113] docs: update pagination usage in README.md (#855) * chore: update README.md * chore: fix page_size snakecase --------- Co-authored-by: Shubham --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 24ece99218..e6382a5242 100644 --- a/README.md +++ b/README.md @@ -193,6 +193,8 @@ The library automatically handles paging for you. Collections, such as `calls` a `list` eagerly fetches all records and returns them as a list, whereas `stream` returns an iterator and lazily retrieves pages of records as you iterate over the collection. You can also page manually using the `page` method. +`page_size` as a parameter is used to tell how many records should we get in every page and `limit` parameter is used to limit the max number of records we want to fetch. + #### Use the `list` method ```python @@ -206,6 +208,21 @@ for sms in client.messages.list(): print(sms.to) ``` +```python +client.messages.list(limit=20, page_size=20) +``` +This will make 1 call that will fetch 20 records from backend service. + +```python +client.messages.list(limit=20, page_size=10) +``` +This will make 2 calls that will fetch 10 records each from backend service. + +```python +client.messages.list(limit=20, page_size=100) +``` +This will make 1 call which will fetch 100 records but user will get only 20 records. + ### Asynchronous API Requests By default, the Twilio Client will make synchronous requests to the Twilio API. To allow for asynchronous, non-blocking requests, we've included an optional asynchronous HTTP client. When used with the Client and the accompanying `*_async` methods, requests made to the Twilio API will be performed asynchronously. From 69796205d6b3bf31c056f0e67ffdea029685455f Mon Sep 17 00:00:00 2001 From: Shubham Date: Mon, 5 May 2025 13:54:27 +0530 Subject: [PATCH 098/113] chore: fix oauth examples (#858) --- examples/organization_api.py | 4 ++-- examples/public_oauth.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/organization_api.py b/examples/organization_api.py index 180f18c20b..0d653c12a4 100644 --- a/examples/organization_api.py +++ b/examples/organization_api.py @@ -16,12 +16,12 @@ def example(): """ Some example usage of using organization resources """ - self.client = Client( + client = Client( account_sid=ACCOUNT_SID, credential_provider=OrgsCredentialProvider(CLIENT_ID, CLIENT_SECRET), ) - accounts = self.client.preview_iam.organization( + accounts = client.preview_iam.organization( organization_sid=ORGS_SID ).accounts.stream() for record in accounts: diff --git a/examples/public_oauth.py b/examples/public_oauth.py index 527961f4e3..41eb589c37 100644 --- a/examples/public_oauth.py +++ b/examples/public_oauth.py @@ -17,12 +17,12 @@ def example(): """ Some example usage of message resources. """ - self.client = Client( + client = Client( account_sid=ACCOUNT_SID, credential_provider=ClientCredentialProvider(CLIENT_ID, CLIENT_SECRET), ) - msg = self.client.messages.create( + msg = client.messages.create( to=self.to_number, from_=self.from_number, body="hello world" ) From 807f380346df196cdb02e3d059d64e8b8bfe5fee Mon Sep 17 00:00:00 2001 From: Anderson Bravalheri Date: Mon, 5 May 2025 09:33:57 +0100 Subject: [PATCH 099/113] fix: Fix deprecated/invalid config in `setup.cfg` (#853) --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 0df04dde4d..4c18756789 100644 --- a/setup.cfg +++ b/setup.cfg @@ -2,7 +2,7 @@ universal = 1 [metadata] -description-file = README.md +long_description = file: README.md license = MIT [flake8] From cdd985793a025246ddd2b15f5f75374667dbecc8 Mon Sep 17 00:00:00 2001 From: Pablo2113 <147159042+Pablo2113@users.noreply.github.com> Date: Mon, 5 May 2025 10:57:47 +0200 Subject: [PATCH 100/113] fix: Timezone changes in toke_auth_strategy.py (#848) Co-authored-by: Shubham --- twilio/auth_strategy/token_auth_strategy.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/twilio/auth_strategy/token_auth_strategy.py b/twilio/auth_strategy/token_auth_strategy.py index ee51f05a43..40ee4c80ec 100644 --- a/twilio/auth_strategy/token_auth_strategy.py +++ b/twilio/auth_strategy/token_auth_strategy.py @@ -1,7 +1,7 @@ import jwt import threading import logging -from datetime import datetime +from datetime import datetime, timezone from twilio.auth_strategy.auth_type import AuthType from twilio.auth_strategy.auth_strategy import AuthStrategy @@ -43,8 +43,8 @@ def is_token_expired(self, token): if exp is None: return True # No expiration time present, consider it expired - # Check if the expiration time has passed - return datetime.fromtimestamp(exp) < datetime.utcnow() + # Check if the expiration time has passed by using time-zone + return datetime.fromtimestamp(exp, tz = timezone.utc) < datetime.now(timezone.utc) except jwt.DecodeError: return True # Token is invalid From e6b56157ebefd86561add59cbbfbd9a0215d6729 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 5 May 2025 10:36:46 +0000 Subject: [PATCH 101/113] [Librarian] Regenerated @ 73b691d4309bbf652c00c8e81516e936534d2117 e39c0f89ecf837b35a77b0ecc773832297b7d7e3 --- CHANGES.md | 28 + twilio/auth_strategy/token_auth_strategy.py | 4 +- .../rest/api/v2010/account/call/__init__.py | 4 +- .../v2010/account/conference/participant.py | 12 +- .../rest/flex_api/v1/interaction/__init__.py | 92 ++ twilio/rest/messaging/MessagingBase.py | 11 + twilio/rest/messaging/v2/__init__.py | 43 + twilio/rest/messaging/v2/channels_sender.py | 1242 +++++++++++++++++ twilio/rest/numbers/v1/__init__.py | 24 +- ...=> porting_webhook_configuration_fetch.py} | 26 +- .../serverless/v1/service/build/__init__.py | 2 + twilio/rest/video/v1/room/__init__.py | 20 + 12 files changed, 1478 insertions(+), 30 deletions(-) create mode 100644 twilio/rest/messaging/v2/__init__.py create mode 100644 twilio/rest/messaging/v2/channels_sender.py rename twilio/rest/numbers/v1/{webhook.py => porting_webhook_configuration_fetch.py} (78%) diff --git a/CHANGES.md b/CHANGES.md index c3e678a6a0..a9321f3330 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,34 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-05-05] Version 9.6.0 +-------------------------- +**Library - Fix** +- [PR #848](https://github.com/twilio/twilio-python/pull/848): Timezone changes in token_auth_strategy.py. Thanks to [@Pablo2113](https://github.com/Pablo2113)! +- [PR #853](https://github.com/twilio/twilio-python/pull/853): Fix deprecated/invalid config in `setup.cfg`. Thanks to [@abravalheri](https://github.com/abravalheri)! + +**Library - Chore** +- [PR #858](https://github.com/twilio/twilio-python/pull/858): fix oauth examples. Thanks to [@tiwarishubham635](https://github.com/tiwarishubham635)! + +**Library - Docs** +- [PR #855](https://github.com/twilio/twilio-python/pull/855): update pagination usage in README.md. Thanks to [@manisha1997](https://github.com/manisha1997)! + +**Api** +- Add `response_key` for `Usage Triggers` fetch endpoint. + +**Flex** +- Add Update Interaction API +- Adding `webhook_ttid` as optional parameter in Interactions API + +**Serverless** +- Add node22 as a valid Build runtime +- Add node20 as a valid Build runtime + +**Video** +- removed `transcribe_participants_on_connect` and `transcriptions_configuration` from the room resource **(breaking change)** +- Added `transcribe_participants_on_connect` and `transcriptions_configuration` to the room resource + + [2025-04-07] Version 9.5.2 -------------------------- **Studio** diff --git a/twilio/auth_strategy/token_auth_strategy.py b/twilio/auth_strategy/token_auth_strategy.py index 40ee4c80ec..33a8d385cb 100644 --- a/twilio/auth_strategy/token_auth_strategy.py +++ b/twilio/auth_strategy/token_auth_strategy.py @@ -44,7 +44,9 @@ def is_token_expired(self, token): return True # No expiration time present, consider it expired # Check if the expiration time has passed by using time-zone - return datetime.fromtimestamp(exp, tz = timezone.utc) < datetime.now(timezone.utc) + return datetime.fromtimestamp(exp, tz=timezone.utc) < datetime.now( + timezone.utc + ) except jwt.DecodeError: return True # Token is invalid diff --git a/twilio/rest/api/v2010/account/call/__init__.py b/twilio/rest/api/v2010/account/call/__init__.py index b09550c326..f7756c40ec 100644 --- a/twilio/rest/api/v2010/account/call/__init__.py +++ b/twilio/rest/api/v2010/account/call/__init__.py @@ -769,7 +769,7 @@ def create( :param status_callback: The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). :param status_callback_event: The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. :param status_callback_method: The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. - :param send_digits: A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. + :param send_digits: The string of keys to dial after connecting to the number, with a maximum length of 32 digits. Valid digits in the string include any digit (`0`-`9`), '`A`', '`B`', '`C`', '`D`', '`#`', and '`*`'. You can also use '`w`' to insert a half-second pause and '`W`' to insert a one-second pause. For example, to pause for one second after connecting and then dial extension 1234 followed by the # key, set this parameter to `W1234#`. Be sure to URL-encode this string because the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. :param timeout: The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. :param record: Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. :param recording_channels: The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. @@ -906,7 +906,7 @@ async def create_async( :param status_callback: The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). :param status_callback_event: The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. :param status_callback_method: The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. - :param send_digits: A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. + :param send_digits: The string of keys to dial after connecting to the number, with a maximum length of 32 digits. Valid digits in the string include any digit (`0`-`9`), '`A`', '`B`', '`C`', '`D`', '`#`', and '`*`'. You can also use '`w`' to insert a half-second pause and '`W`' to insert a one-second pause. For example, to pause for one second after connecting and then dial extension 1234 followed by the # key, set this parameter to `W1234#`. Be sure to URL-encode this string because the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. :param timeout: The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. :param record: Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. :param recording_channels: The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. diff --git a/twilio/rest/api/v2010/account/conference/participant.py b/twilio/rest/api/v2010/account/conference/participant.py index c6511dadf6..3c49e5387c 100644 --- a/twilio/rest/api/v2010/account/conference/participant.py +++ b/twilio/rest/api/v2010/account/conference/participant.py @@ -168,7 +168,7 @@ def update( :param hold_method: The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. :param announce_url: The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. :param announce_method: The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. - :param wait_url: The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + :param wait_url: The URL that Twilio calls using the `wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `''`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [ TwiML instruction](https://www.twilio.com/docs/voice/twiml/conference#attributes-waiturl). :param wait_method: The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. :param beep_on_exit: Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. :param end_conference_on_exit: Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. @@ -216,7 +216,7 @@ async def update_async( :param hold_method: The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. :param announce_url: The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. :param announce_method: The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. - :param wait_url: The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + :param wait_url: The URL that Twilio calls using the `wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `''`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [ TwiML instruction](https://www.twilio.com/docs/voice/twiml/conference#attributes-waiturl). :param wait_method: The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. :param beep_on_exit: Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. :param end_conference_on_exit: Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. @@ -371,7 +371,7 @@ def update( :param hold_method: The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. :param announce_url: The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. :param announce_method: The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. - :param wait_url: The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + :param wait_url: The URL that Twilio calls using the `wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `''`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [ TwiML instruction](https://www.twilio.com/docs/voice/twiml/conference#attributes-waiturl). :param wait_method: The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. :param beep_on_exit: Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. :param end_conference_on_exit: Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. @@ -441,7 +441,7 @@ async def update_async( :param hold_method: The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. :param announce_url: The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. :param announce_method: The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. - :param wait_url: The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + :param wait_url: The URL that Twilio calls using the `wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `''`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [ TwiML instruction](https://www.twilio.com/docs/voice/twiml/conference#attributes-waiturl). :param wait_method: The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. :param beep_on_exit: Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. :param end_conference_on_exit: Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. @@ -611,7 +611,7 @@ def create( :param beep: Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. :param start_conference_on_enter: Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. :param end_conference_on_exit: Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. - :param wait_url: The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + :param wait_url: The URL that Twilio calls using the `wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `''`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [ TwiML instruction](https://www.twilio.com/docs/voice/twiml/conference#attributes-waiturl). :param wait_method: The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. :param early_media: Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. :param max_participants: The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. @@ -800,7 +800,7 @@ async def create_async( :param beep: Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. :param start_conference_on_enter: Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. :param end_conference_on_exit: Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. - :param wait_url: The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + :param wait_url: The URL that Twilio calls using the `wait_method` before the conference has started. The URL may return an MP3 file, a WAV file, or a TwiML document. The default value is the URL of our standard hold music. If you do not want anything to play while waiting for the conference to start, specify an empty string by setting `wait_url` to `''`. For more details on the allowable verbs within the `waitUrl`, see the `waitUrl` attribute in the [ TwiML instruction](https://www.twilio.com/docs/voice/twiml/conference#attributes-waiturl). :param wait_method: The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. :param early_media: Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. :param max_participants: The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. diff --git a/twilio/rest/flex_api/v1/interaction/__init__.py b/twilio/rest/flex_api/v1/interaction/__init__.py index c67d9c026e..653938f28d 100644 --- a/twilio/rest/flex_api/v1/interaction/__init__.py +++ b/twilio/rest/flex_api/v1/interaction/__init__.py @@ -32,6 +32,7 @@ class InteractionInstance(InstanceResource): :ivar url: :ivar links: :ivar interaction_context_sid: + :ivar webhook_ttid: """ def __init__( @@ -47,6 +48,7 @@ def __init__( self.interaction_context_sid: Optional[str] = payload.get( "interaction_context_sid" ) + self.webhook_ttid: Optional[str] = payload.get("webhook_ttid") self._solution = { "sid": sid or self.sid, @@ -86,6 +88,34 @@ async def fetch_async(self) -> "InteractionInstance": """ return await self._proxy.fetch_async() + def update( + self, webhook_ttid: Union[str, object] = values.unset + ) -> "InteractionInstance": + """ + Update the InteractionInstance + + :param webhook_ttid: The unique identifier for Interaction level webhook + + :returns: The updated InteractionInstance + """ + return self._proxy.update( + webhook_ttid=webhook_ttid, + ) + + async def update_async( + self, webhook_ttid: Union[str, object] = values.unset + ) -> "InteractionInstance": + """ + Asynchronous coroutine to update the InteractionInstance + + :param webhook_ttid: The unique identifier for Interaction level webhook + + :returns: The updated InteractionInstance + """ + return await self._proxy.update_async( + webhook_ttid=webhook_ttid, + ) + @property def channels(self) -> InteractionChannelList: """ @@ -164,6 +194,62 @@ async def fetch_async(self) -> InteractionInstance: sid=self._solution["sid"], ) + def update( + self, webhook_ttid: Union[str, object] = values.unset + ) -> InteractionInstance: + """ + Update the InteractionInstance + + :param webhook_ttid: The unique identifier for Interaction level webhook + + :returns: The updated InteractionInstance + """ + + data = values.of( + { + "WebhookTtid": webhook_ttid, + } + ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + + payload = self._version.update( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return InteractionInstance(self._version, payload, sid=self._solution["sid"]) + + async def update_async( + self, webhook_ttid: Union[str, object] = values.unset + ) -> InteractionInstance: + """ + Asynchronous coroutine to update the InteractionInstance + + :param webhook_ttid: The unique identifier for Interaction level webhook + + :returns: The updated InteractionInstance + """ + + data = values.of( + { + "WebhookTtid": webhook_ttid, + } + ) + headers = values.of({}) + + headers["Content-Type"] = "application/x-www-form-urlencoded" + + headers["Accept"] = "application/json" + + payload = await self._version.update_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return InteractionInstance(self._version, payload, sid=self._solution["sid"]) + @property def channels(self) -> InteractionChannelList: """ @@ -204,6 +290,7 @@ def create( channel: object, routing: Union[object, object] = values.unset, interaction_context_sid: Union[str, object] = values.unset, + webhook_ttid: Union[str, object] = values.unset, ) -> InteractionInstance: """ Create the InteractionInstance @@ -211,6 +298,7 @@ def create( :param channel: The Interaction's channel. :param routing: The Interaction's routing logic. :param interaction_context_sid: The Interaction context sid is used for adding a context lookup sid + :param webhook_ttid: The unique identifier for Interaction level webhook :returns: The created InteractionInstance """ @@ -220,6 +308,7 @@ def create( "Channel": serialize.object(channel), "Routing": serialize.object(routing), "InteractionContextSid": interaction_context_sid, + "WebhookTtid": webhook_ttid, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -239,6 +328,7 @@ async def create_async( channel: object, routing: Union[object, object] = values.unset, interaction_context_sid: Union[str, object] = values.unset, + webhook_ttid: Union[str, object] = values.unset, ) -> InteractionInstance: """ Asynchronously create the InteractionInstance @@ -246,6 +336,7 @@ async def create_async( :param channel: The Interaction's channel. :param routing: The Interaction's routing logic. :param interaction_context_sid: The Interaction context sid is used for adding a context lookup sid + :param webhook_ttid: The unique identifier for Interaction level webhook :returns: The created InteractionInstance """ @@ -255,6 +346,7 @@ async def create_async( "Channel": serialize.object(channel), "Routing": serialize.object(routing), "InteractionContextSid": interaction_context_sid, + "WebhookTtid": webhook_ttid, } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) diff --git a/twilio/rest/messaging/MessagingBase.py b/twilio/rest/messaging/MessagingBase.py index 4fff74d914..e45ed56fcd 100644 --- a/twilio/rest/messaging/MessagingBase.py +++ b/twilio/rest/messaging/MessagingBase.py @@ -14,6 +14,7 @@ from twilio.base.domain import Domain from twilio.rest import Client from twilio.rest.messaging.v1 import V1 +from twilio.rest.messaging.v2 import V2 class MessagingBase(Domain): @@ -26,6 +27,7 @@ def __init__(self, twilio: Client): """ super().__init__(twilio, "https://messaging.twilio.com") self._v1: Optional[V1] = None + self._v2: Optional[V2] = None @property def v1(self) -> V1: @@ -36,6 +38,15 @@ def v1(self) -> V1: self._v1 = V1(self) return self._v1 + @property + def v2(self) -> V2: + """ + :returns: Versions v2 of Messaging + """ + if self._v2 is None: + self._v2 = V2(self) + return self._v2 + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/messaging/v2/__init__.py b/twilio/rest/messaging/v2/__init__.py new file mode 100644 index 0000000000..7ef89fdc5a --- /dev/null +++ b/twilio/rest/messaging/v2/__init__.py @@ -0,0 +1,43 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Messaging + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.messaging.v2.channels_sender import ChannelsSenderList + + +class V2(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V2 version of Messaging + + :param domain: The Twilio.messaging domain + """ + super().__init__(domain, "v2") + self._channels_senders: Optional[ChannelsSenderList] = None + + @property + def channels_senders(self) -> ChannelsSenderList: + if self._channels_senders is None: + self._channels_senders = ChannelsSenderList(self) + return self._channels_senders + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/messaging/v2/channels_sender.py b/twilio/rest/messaging/v2/channels_sender.py new file mode 100644 index 0000000000..53fa2e6e1e --- /dev/null +++ b/twilio/rest/messaging/v2/channels_sender.py @@ -0,0 +1,1242 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Messaging + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class ChannelsSenderInstance(InstanceResource): + + class MessagingV2ChannelsSenderConfiguration(object): + """ + :ivar waba_id: The ID of the WhatsApp Business Account to use for this sender. + :ivar verification_method: The method to use for verification. Either \"sms\" or \"voice\". + :ivar verification_code: The verification code to use for this sender. + :ivar voice_application_sid: The SID of the Twilio Voice application to use for this sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.waba_id: Optional[str] = payload.get("waba_id") + self.verification_method: Optional["ChannelsSenderInstance.str"] = ( + payload.get("verification_method") + ) + self.verification_code: Optional[str] = payload.get("verification_code") + self.voice_application_sid: Optional[str] = payload.get( + "voice_application_sid" + ) + + def to_dict(self): + return { + "waba_id": self.waba_id, + "verification_method": self.verification_method, + "verification_code": self.verification_code, + "voice_application_sid": self.voice_application_sid, + } + + class MessagingV2ChannelsSenderProfile(object): + """ + :ivar name: The name of the sender. + :ivar about: The about text of the sender. + :ivar address: The address of the sender. + :ivar description: The description of the sender. + :ivar emails: The emails of the sender. + :ivar logo_url: The logo URL of the sender. + :ivar vertical: The vertical of the sender. Allowed values are: - \"Automotive\" - \"Beauty, Spa and Salon\" - \"Clothing and Apparel\" - \"Education\" - \"Entertainment\" - \"Event Planning and Service\" - \"Finance and Banking\" - \"Food and Grocery\" - \"Public Service\" - \"Hotel and Lodging\" - \"Medical and Health\" - \"Non-profit\" - \"Professional Services\" - \"Shopping and Retail\" - \"Travel and Transportation\" - \"Restaurant\" - \"Other\" + :ivar websites: The websites of the sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.name: Optional[str] = payload.get("name") + self.about: Optional[str] = payload.get("about") + self.address: Optional[str] = payload.get("address") + self.description: Optional[str] = payload.get("description") + self.emails: Optional[ + List[ChannelsSenderList.MessagingV2ChannelsSenderProfileEmails] + ] = payload.get("emails") + self.logo_url: Optional[str] = payload.get("logo_url") + self.vertical: Optional[str] = payload.get("vertical") + self.websites: Optional[ + List[ChannelsSenderList.MessagingV2ChannelsSenderProfileWebsites] + ] = payload.get("websites") + + def to_dict(self): + return { + "name": self.name, + "about": self.about, + "address": self.address, + "description": self.description, + "emails": ( + [emails.to_dict() for emails in self.emails] + if self.emails is not None + else None + ), + "logo_url": self.logo_url, + "vertical": self.vertical, + "websites": ( + [websites.to_dict() for websites in self.websites] + if self.websites is not None + else None + ), + } + + class MessagingV2ChannelsSenderProfileEmails(object): + """ + :ivar email: The email of the sender. + :ivar label: The label of the sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.email: Optional[str] = payload.get("email") + self.label: Optional[str] = payload.get("label") + + def to_dict(self): + return { + "email": self.email, + "label": self.label, + } + + class MessagingV2ChannelsSenderProfileWebsites(object): + """ + :ivar label: The label of the sender. + :ivar website: The website of the sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.label: Optional[str] = payload.get("label") + self.website: Optional[str] = payload.get("website") + + def to_dict(self): + return { + "label": self.label, + "website": self.website, + } + + class MessagingV2ChannelsSenderRequestsCreate(object): + """ + :ivar sender_id: The ID of this Sender prefixed with the channel, e.g., `whatsapp:E.164` + :ivar configuration: + :ivar webhook: + :ivar profile: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.sender_id: Optional[str] = payload.get("sender_id") + self.configuration: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderConfiguration + ] = payload.get("configuration") + self.webhook: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderWebhook + ] = payload.get("webhook") + self.profile: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderProfile + ] = payload.get("profile") + + def to_dict(self): + return { + "sender_id": self.sender_id, + "configuration": ( + self.configuration.to_dict() + if self.configuration is not None + else None + ), + "webhook": self.webhook.to_dict() if self.webhook is not None else None, + "profile": self.profile.to_dict() if self.profile is not None else None, + } + + class MessagingV2ChannelsSenderRequestsUpdate(object): + """ + :ivar configuration: + :ivar webhook: + :ivar profile: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.configuration: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderConfiguration + ] = payload.get("configuration") + self.webhook: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderWebhook + ] = payload.get("webhook") + self.profile: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderProfile + ] = payload.get("profile") + + def to_dict(self): + return { + "configuration": ( + self.configuration.to_dict() + if self.configuration is not None + else None + ), + "webhook": self.webhook.to_dict() if self.webhook is not None else None, + "profile": self.profile.to_dict() if self.profile is not None else None, + } + + class MessagingV2ChannelsSenderWebhook(object): + """ + :ivar callback_url: The URL to send the webhook to. + :ivar callback_method: The HTTP method to use for the webhook. Either \"POST\" or \"PUT\". + :ivar fallback_url: The URL to send the fallback webhook to. + :ivar fallback_method: The HTTP method to use for the fallback webhook. Either \"POST\" or \"PUT\". + :ivar status_callback_url: The URL to send the status callback to. + :ivar status_callback_method: The HTTP method to use for the status callback. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.callback_url: Optional[str] = payload.get("callback_url") + self.callback_method: Optional["ChannelsSenderInstance.str"] = payload.get( + "callback_method" + ) + self.fallback_url: Optional[str] = payload.get("fallback_url") + self.fallback_method: Optional["ChannelsSenderInstance.str"] = payload.get( + "fallback_method" + ) + self.status_callback_url: Optional[str] = payload.get("status_callback_url") + self.status_callback_method: Optional[str] = payload.get( + "status_callback_method" + ) + + def to_dict(self): + return { + "callback_url": self.callback_url, + "callback_method": self.callback_method, + "fallback_url": self.fallback_url, + "fallback_method": self.fallback_method, + "status_callback_url": self.status_callback_url, + "status_callback_method": self.status_callback_method, + } + + class Status(object): + CREATING = "CREATING" + ONLINE = "ONLINE" + OFFLINE = "OFFLINE" + PENDING_VERIFICATION = "PENDING_VERIFICATION" + VERIFYING = "VERIFYING" + ONLINE_UPDATING = "ONLINE:UPDATING" + STUBBED = "STUBBED" + + """ + :ivar sid: A 34 character string that uniquely identifies this Sender. + :ivar status: + :ivar sender_id: The ID of this Sender prefixed with the channel, e.g., `whatsapp:E.164` + :ivar configuration: + :ivar webhook: + :ivar profile: + :ivar properties: + :ivar offline_reasons: Reasons why the sender is offline., e.g., [{\"code\": \"21211400\", \"message\": \"Whatsapp business account is banned by provider {provider_name} | Credit line is assigned to another BSP\", \"more_info\": \"https://www.twilio.com/docs/errors/21211400\"}] + :ivar url: The URL of this resource, relative to `https://messaging.twilio.com`. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None + ): + super().__init__(version) + + self.sid: Optional[str] = payload.get("sid") + self.status: Optional["ChannelsSenderInstance.Status"] = payload.get("status") + self.sender_id: Optional[str] = payload.get("sender_id") + self.configuration: Optional[str] = payload.get("configuration") + self.webhook: Optional[str] = payload.get("webhook") + self.profile: Optional[str] = payload.get("profile") + self.properties: Optional[str] = payload.get("properties") + self.offline_reasons: Optional[List[str]] = payload.get("offline_reasons") + self.url: Optional[str] = payload.get("url") + + self._solution = { + "sid": sid or self.sid, + } + self._context: Optional[ChannelsSenderContext] = None + + @property + def _proxy(self) -> "ChannelsSenderContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: ChannelsSenderContext for this ChannelsSenderInstance + """ + if self._context is None: + self._context = ChannelsSenderContext( + self._version, + sid=self._solution["sid"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the ChannelsSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the ChannelsSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "ChannelsSenderInstance": + """ + Fetch the ChannelsSenderInstance + + + :returns: The fetched ChannelsSenderInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "ChannelsSenderInstance": + """ + Asynchronous coroutine to fetch the ChannelsSenderInstance + + + :returns: The fetched ChannelsSenderInstance + """ + return await self._proxy.fetch_async() + + def update( + self, + messaging_v2_channels_sender_requests_update: Union[ + MessagingV2ChannelsSenderRequestsUpdate, object + ] = values.unset, + ) -> "ChannelsSenderInstance": + """ + Update the ChannelsSenderInstance + + :param messaging_v2_channels_sender_requests_update: + + :returns: The updated ChannelsSenderInstance + """ + return self._proxy.update( + messaging_v2_channels_sender_requests_update=messaging_v2_channels_sender_requests_update, + ) + + async def update_async( + self, + messaging_v2_channels_sender_requests_update: Union[ + MessagingV2ChannelsSenderRequestsUpdate, object + ] = values.unset, + ) -> "ChannelsSenderInstance": + """ + Asynchronous coroutine to update the ChannelsSenderInstance + + :param messaging_v2_channels_sender_requests_update: + + :returns: The updated ChannelsSenderInstance + """ + return await self._proxy.update_async( + messaging_v2_channels_sender_requests_update=messaging_v2_channels_sender_requests_update, + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ChannelsSenderContext(InstanceContext): + + class MessagingV2ChannelsSenderConfiguration(object): + """ + :ivar waba_id: The ID of the WhatsApp Business Account to use for this sender. + :ivar verification_method: The method to use for verification. Either \"sms\" or \"voice\". + :ivar verification_code: The verification code to use for this sender. + :ivar voice_application_sid: The SID of the Twilio Voice application to use for this sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.waba_id: Optional[str] = payload.get("waba_id") + self.verification_method: Optional["ChannelsSenderInstance.str"] = ( + payload.get("verification_method") + ) + self.verification_code: Optional[str] = payload.get("verification_code") + self.voice_application_sid: Optional[str] = payload.get( + "voice_application_sid" + ) + + def to_dict(self): + return { + "waba_id": self.waba_id, + "verification_method": self.verification_method, + "verification_code": self.verification_code, + "voice_application_sid": self.voice_application_sid, + } + + class MessagingV2ChannelsSenderProfile(object): + """ + :ivar name: The name of the sender. + :ivar about: The about text of the sender. + :ivar address: The address of the sender. + :ivar description: The description of the sender. + :ivar emails: The emails of the sender. + :ivar logo_url: The logo URL of the sender. + :ivar vertical: The vertical of the sender. Allowed values are: - \"Automotive\" - \"Beauty, Spa and Salon\" - \"Clothing and Apparel\" - \"Education\" - \"Entertainment\" - \"Event Planning and Service\" - \"Finance and Banking\" - \"Food and Grocery\" - \"Public Service\" - \"Hotel and Lodging\" - \"Medical and Health\" - \"Non-profit\" - \"Professional Services\" - \"Shopping and Retail\" - \"Travel and Transportation\" - \"Restaurant\" - \"Other\" + :ivar websites: The websites of the sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.name: Optional[str] = payload.get("name") + self.about: Optional[str] = payload.get("about") + self.address: Optional[str] = payload.get("address") + self.description: Optional[str] = payload.get("description") + self.emails: Optional[ + List[ChannelsSenderList.MessagingV2ChannelsSenderProfileEmails] + ] = payload.get("emails") + self.logo_url: Optional[str] = payload.get("logo_url") + self.vertical: Optional[str] = payload.get("vertical") + self.websites: Optional[ + List[ChannelsSenderList.MessagingV2ChannelsSenderProfileWebsites] + ] = payload.get("websites") + + def to_dict(self): + return { + "name": self.name, + "about": self.about, + "address": self.address, + "description": self.description, + "emails": ( + [emails.to_dict() for emails in self.emails] + if self.emails is not None + else None + ), + "logo_url": self.logo_url, + "vertical": self.vertical, + "websites": ( + [websites.to_dict() for websites in self.websites] + if self.websites is not None + else None + ), + } + + class MessagingV2ChannelsSenderProfileEmails(object): + """ + :ivar email: The email of the sender. + :ivar label: The label of the sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.email: Optional[str] = payload.get("email") + self.label: Optional[str] = payload.get("label") + + def to_dict(self): + return { + "email": self.email, + "label": self.label, + } + + class MessagingV2ChannelsSenderProfileWebsites(object): + """ + :ivar label: The label of the sender. + :ivar website: The website of the sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.label: Optional[str] = payload.get("label") + self.website: Optional[str] = payload.get("website") + + def to_dict(self): + return { + "label": self.label, + "website": self.website, + } + + class MessagingV2ChannelsSenderRequestsCreate(object): + """ + :ivar sender_id: The ID of this Sender prefixed with the channel, e.g., `whatsapp:E.164` + :ivar configuration: + :ivar webhook: + :ivar profile: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.sender_id: Optional[str] = payload.get("sender_id") + self.configuration: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderConfiguration + ] = payload.get("configuration") + self.webhook: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderWebhook + ] = payload.get("webhook") + self.profile: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderProfile + ] = payload.get("profile") + + def to_dict(self): + return { + "sender_id": self.sender_id, + "configuration": ( + self.configuration.to_dict() + if self.configuration is not None + else None + ), + "webhook": self.webhook.to_dict() if self.webhook is not None else None, + "profile": self.profile.to_dict() if self.profile is not None else None, + } + + class MessagingV2ChannelsSenderRequestsUpdate(object): + """ + :ivar configuration: + :ivar webhook: + :ivar profile: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.configuration: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderConfiguration + ] = payload.get("configuration") + self.webhook: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderWebhook + ] = payload.get("webhook") + self.profile: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderProfile + ] = payload.get("profile") + + def to_dict(self): + return { + "configuration": ( + self.configuration.to_dict() + if self.configuration is not None + else None + ), + "webhook": self.webhook.to_dict() if self.webhook is not None else None, + "profile": self.profile.to_dict() if self.profile is not None else None, + } + + class MessagingV2ChannelsSenderWebhook(object): + """ + :ivar callback_url: The URL to send the webhook to. + :ivar callback_method: The HTTP method to use for the webhook. Either \"POST\" or \"PUT\". + :ivar fallback_url: The URL to send the fallback webhook to. + :ivar fallback_method: The HTTP method to use for the fallback webhook. Either \"POST\" or \"PUT\". + :ivar status_callback_url: The URL to send the status callback to. + :ivar status_callback_method: The HTTP method to use for the status callback. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.callback_url: Optional[str] = payload.get("callback_url") + self.callback_method: Optional["ChannelsSenderInstance.str"] = payload.get( + "callback_method" + ) + self.fallback_url: Optional[str] = payload.get("fallback_url") + self.fallback_method: Optional["ChannelsSenderInstance.str"] = payload.get( + "fallback_method" + ) + self.status_callback_url: Optional[str] = payload.get("status_callback_url") + self.status_callback_method: Optional[str] = payload.get( + "status_callback_method" + ) + + def to_dict(self): + return { + "callback_url": self.callback_url, + "callback_method": self.callback_method, + "fallback_url": self.fallback_url, + "fallback_method": self.fallback_method, + "status_callback_url": self.status_callback_url, + "status_callback_method": self.status_callback_method, + } + + def __init__(self, version: Version, sid: str): + """ + Initialize the ChannelsSenderContext + + :param version: Version that contains the resource + :param sid: A 34 character string that uniquely identifies this Sender. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "sid": sid, + } + self._uri = "/Channels/Senders/{sid}".format(**self._solution) + + def delete(self) -> bool: + """ + Deletes the ChannelsSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the ChannelsSenderInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + return await self._version.delete_async( + method="DELETE", uri=self._uri, headers=headers + ) + + def fetch(self) -> ChannelsSenderInstance: + """ + Fetch the ChannelsSenderInstance + + + :returns: The fetched ChannelsSenderInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return ChannelsSenderInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + async def fetch_async(self) -> ChannelsSenderInstance: + """ + Asynchronous coroutine to fetch the ChannelsSenderInstance + + + :returns: The fetched ChannelsSenderInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return ChannelsSenderInstance( + self._version, + payload, + sid=self._solution["sid"], + ) + + def update( + self, + messaging_v2_channels_sender_requests_update: Union[ + MessagingV2ChannelsSenderRequestsUpdate, object + ] = values.unset, + ) -> ChannelsSenderInstance: + """ + Update the ChannelsSenderInstance + + :param messaging_v2_channels_sender_requests_update: + + :returns: The updated ChannelsSenderInstance + """ + data = messaging_v2_channels_sender_requests_update.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = self._version.update( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ChannelsSenderInstance(self._version, payload, sid=self._solution["sid"]) + + async def update_async( + self, + messaging_v2_channels_sender_requests_update: Union[ + MessagingV2ChannelsSenderRequestsUpdate, object + ] = values.unset, + ) -> ChannelsSenderInstance: + """ + Asynchronous coroutine to update the ChannelsSenderInstance + + :param messaging_v2_channels_sender_requests_update: + + :returns: The updated ChannelsSenderInstance + """ + data = messaging_v2_channels_sender_requests_update.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = await self._version.update_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ChannelsSenderInstance(self._version, payload, sid=self._solution["sid"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ChannelsSenderPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> ChannelsSenderInstance: + """ + Build an instance of ChannelsSenderInstance + + :param payload: Payload response from the API + """ + return ChannelsSenderInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class ChannelsSenderList(ListResource): + + class MessagingV2ChannelsSenderConfiguration(object): + """ + :ivar waba_id: The ID of the WhatsApp Business Account to use for this sender. + :ivar verification_method: The method to use for verification. Either \"sms\" or \"voice\". + :ivar verification_code: The verification code to use for this sender. + :ivar voice_application_sid: The SID of the Twilio Voice application to use for this sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.waba_id: Optional[str] = payload.get("waba_id") + self.verification_method: Optional["ChannelsSenderInstance.str"] = ( + payload.get("verification_method") + ) + self.verification_code: Optional[str] = payload.get("verification_code") + self.voice_application_sid: Optional[str] = payload.get( + "voice_application_sid" + ) + + def to_dict(self): + return { + "waba_id": self.waba_id, + "verification_method": self.verification_method, + "verification_code": self.verification_code, + "voice_application_sid": self.voice_application_sid, + } + + class MessagingV2ChannelsSenderProfile(object): + """ + :ivar name: The name of the sender. + :ivar about: The about text of the sender. + :ivar address: The address of the sender. + :ivar description: The description of the sender. + :ivar emails: The emails of the sender. + :ivar logo_url: The logo URL of the sender. + :ivar vertical: The vertical of the sender. Allowed values are: - \"Automotive\" - \"Beauty, Spa and Salon\" - \"Clothing and Apparel\" - \"Education\" - \"Entertainment\" - \"Event Planning and Service\" - \"Finance and Banking\" - \"Food and Grocery\" - \"Public Service\" - \"Hotel and Lodging\" - \"Medical and Health\" - \"Non-profit\" - \"Professional Services\" - \"Shopping and Retail\" - \"Travel and Transportation\" - \"Restaurant\" - \"Other\" + :ivar websites: The websites of the sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.name: Optional[str] = payload.get("name") + self.about: Optional[str] = payload.get("about") + self.address: Optional[str] = payload.get("address") + self.description: Optional[str] = payload.get("description") + self.emails: Optional[ + List[ChannelsSenderList.MessagingV2ChannelsSenderProfileEmails] + ] = payload.get("emails") + self.logo_url: Optional[str] = payload.get("logo_url") + self.vertical: Optional[str] = payload.get("vertical") + self.websites: Optional[ + List[ChannelsSenderList.MessagingV2ChannelsSenderProfileWebsites] + ] = payload.get("websites") + + def to_dict(self): + return { + "name": self.name, + "about": self.about, + "address": self.address, + "description": self.description, + "emails": ( + [emails.to_dict() for emails in self.emails] + if self.emails is not None + else None + ), + "logo_url": self.logo_url, + "vertical": self.vertical, + "websites": ( + [websites.to_dict() for websites in self.websites] + if self.websites is not None + else None + ), + } + + class MessagingV2ChannelsSenderProfileEmails(object): + """ + :ivar email: The email of the sender. + :ivar label: The label of the sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.email: Optional[str] = payload.get("email") + self.label: Optional[str] = payload.get("label") + + def to_dict(self): + return { + "email": self.email, + "label": self.label, + } + + class MessagingV2ChannelsSenderProfileWebsites(object): + """ + :ivar label: The label of the sender. + :ivar website: The website of the sender. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.label: Optional[str] = payload.get("label") + self.website: Optional[str] = payload.get("website") + + def to_dict(self): + return { + "label": self.label, + "website": self.website, + } + + class MessagingV2ChannelsSenderRequestsCreate(object): + """ + :ivar sender_id: The ID of this Sender prefixed with the channel, e.g., `whatsapp:E.164` + :ivar configuration: + :ivar webhook: + :ivar profile: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.sender_id: Optional[str] = payload.get("sender_id") + self.configuration: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderConfiguration + ] = payload.get("configuration") + self.webhook: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderWebhook + ] = payload.get("webhook") + self.profile: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderProfile + ] = payload.get("profile") + + def to_dict(self): + return { + "sender_id": self.sender_id, + "configuration": ( + self.configuration.to_dict() + if self.configuration is not None + else None + ), + "webhook": self.webhook.to_dict() if self.webhook is not None else None, + "profile": self.profile.to_dict() if self.profile is not None else None, + } + + class MessagingV2ChannelsSenderRequestsUpdate(object): + """ + :ivar configuration: + :ivar webhook: + :ivar profile: + """ + + def __init__(self, payload: Dict[str, Any]): + + self.configuration: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderConfiguration + ] = payload.get("configuration") + self.webhook: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderWebhook + ] = payload.get("webhook") + self.profile: Optional[ + ChannelsSenderList.MessagingV2ChannelsSenderProfile + ] = payload.get("profile") + + def to_dict(self): + return { + "configuration": ( + self.configuration.to_dict() + if self.configuration is not None + else None + ), + "webhook": self.webhook.to_dict() if self.webhook is not None else None, + "profile": self.profile.to_dict() if self.profile is not None else None, + } + + class MessagingV2ChannelsSenderWebhook(object): + """ + :ivar callback_url: The URL to send the webhook to. + :ivar callback_method: The HTTP method to use for the webhook. Either \"POST\" or \"PUT\". + :ivar fallback_url: The URL to send the fallback webhook to. + :ivar fallback_method: The HTTP method to use for the fallback webhook. Either \"POST\" or \"PUT\". + :ivar status_callback_url: The URL to send the status callback to. + :ivar status_callback_method: The HTTP method to use for the status callback. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.callback_url: Optional[str] = payload.get("callback_url") + self.callback_method: Optional["ChannelsSenderInstance.str"] = payload.get( + "callback_method" + ) + self.fallback_url: Optional[str] = payload.get("fallback_url") + self.fallback_method: Optional["ChannelsSenderInstance.str"] = payload.get( + "fallback_method" + ) + self.status_callback_url: Optional[str] = payload.get("status_callback_url") + self.status_callback_method: Optional[str] = payload.get( + "status_callback_method" + ) + + def to_dict(self): + return { + "callback_url": self.callback_url, + "callback_method": self.callback_method, + "fallback_url": self.fallback_url, + "fallback_method": self.fallback_method, + "status_callback_url": self.status_callback_url, + "status_callback_method": self.status_callback_method, + } + + def __init__(self, version: Version): + """ + Initialize the ChannelsSenderList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Channels/Senders" + + def create( + self, + messaging_v2_channels_sender_requests_create: MessagingV2ChannelsSenderRequestsCreate, + ) -> ChannelsSenderInstance: + """ + Create the ChannelsSenderInstance + + :param messaging_v2_channels_sender_requests_create: + + :returns: The created ChannelsSenderInstance + """ + data = messaging_v2_channels_sender_requests_create.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ChannelsSenderInstance(self._version, payload) + + async def create_async( + self, + messaging_v2_channels_sender_requests_create: MessagingV2ChannelsSenderRequestsCreate, + ) -> ChannelsSenderInstance: + """ + Asynchronously create the ChannelsSenderInstance + + :param messaging_v2_channels_sender_requests_create: + + :returns: The created ChannelsSenderInstance + """ + data = messaging_v2_channels_sender_requests_create.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return ChannelsSenderInstance(self._version, payload) + + def stream( + self, + channel: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[ChannelsSenderInstance]: + """ + Streams ChannelsSenderInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str channel: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(channel=channel, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + channel: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[ChannelsSenderInstance]: + """ + Asynchronously streams ChannelsSenderInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str channel: + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(channel=channel, page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + channel: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ChannelsSenderInstance]: + """ + Lists ChannelsSenderInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str channel: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + channel=channel, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + channel: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ChannelsSenderInstance]: + """ + Asynchronously lists ChannelsSenderInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str channel: + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + channel=channel, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + channel: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ChannelsSenderPage: + """ + Retrieve a single page of ChannelsSenderInstance records from the API. + Request is executed immediately + + :param channel: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ChannelsSenderInstance + """ + data = values.of( + { + "Channel": channel, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return ChannelsSenderPage(self._version, response) + + async def page_async( + self, + channel: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ChannelsSenderPage: + """ + Asynchronously retrieve a single page of ChannelsSenderInstance records from the API. + Request is executed immediately + + :param channel: + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ChannelsSenderInstance + """ + data = values.of( + { + "Channel": channel, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return ChannelsSenderPage(self._version, response) + + def get_page(self, target_url: str) -> ChannelsSenderPage: + """ + Retrieve a specific page of ChannelsSenderInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ChannelsSenderInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return ChannelsSenderPage(self._version, response) + + async def get_page_async(self, target_url: str) -> ChannelsSenderPage: + """ + Asynchronously retrieve a specific page of ChannelsSenderInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ChannelsSenderInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return ChannelsSenderPage(self._version, response) + + def get(self, sid: str) -> ChannelsSenderContext: + """ + Constructs a ChannelsSenderContext + + :param sid: A 34 character string that uniquely identifies this Sender. + """ + return ChannelsSenderContext(self._version, sid=sid) + + def __call__(self, sid: str) -> ChannelsSenderContext: + """ + Constructs a ChannelsSenderContext + + :param sid: A 34 character string that uniquely identifies this Sender. + """ + return ChannelsSenderContext(self._version, sid=sid) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 68f078a88d..043364c3d5 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,10 +28,12 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) +from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( + PortingWebhookConfigurationFetchList, +) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) -from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -56,10 +58,12 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None + self._porting_webhook_configuration_fetch: Optional[ + PortingWebhookConfigurationFetchList + ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None - self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -107,18 +111,22 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete + @property + def porting_webhook_configuration_fetch( + self, + ) -> PortingWebhookConfigurationFetchList: + if self._porting_webhook_configuration_fetch is None: + self._porting_webhook_configuration_fetch = ( + PortingWebhookConfigurationFetchList(self) + ) + return self._porting_webhook_configuration_fetch + @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations - @property - def webhook(self) -> WebhookList: - if self._webhook is None: - self._webhook = WebhookList(self) - return self._webhook - def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/webhook.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py similarity index 78% rename from twilio/rest/numbers/v1/webhook.py rename to twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py index 69bd556326..5d381768c7 100644 --- a/twilio/rest/numbers/v1/webhook.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class WebhookInstance(InstanceResource): +class PortingWebhookConfigurationFetchInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class WebhookList(ListResource): +class PortingWebhookConfigurationFetchList(ListResource): def __init__(self, version: Version): """ - Initialize the WebhookList + Initialize the PortingWebhookConfigurationFetchList :param version: Version that contains the resource @@ -68,12 +68,12 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> WebhookInstance: + def fetch(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -81,14 +81,14 @@ def fetch(self) -> WebhookInstance: payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) - async def fetch_async(self) -> WebhookInstance: + async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -98,7 +98,7 @@ async def fetch_async(self) -> WebhookInstance: method="GET", uri=self._uri, headers=headers ) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) def __repr__(self) -> str: """ @@ -106,4 +106,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/serverless/v1/service/build/__init__.py b/twilio/rest/serverless/v1/service/build/__init__.py index ddd59918b4..5a7b6b7023 100644 --- a/twilio/rest/serverless/v1/service/build/__init__.py +++ b/twilio/rest/serverless/v1/service/build/__init__.py @@ -34,6 +34,8 @@ class Runtime(object): NODE14 = "node14" NODE16 = "node16" NODE18 = "node18" + NODE20 = "node20" + NODE22 = "node22" class Status(object): BUILDING = "building" diff --git a/twilio/rest/video/v1/room/__init__.py b/twilio/rest/video/v1/room/__init__.py index 0fb7a7b0dd..d51b8b8711 100644 --- a/twilio/rest/video/v1/room/__init__.py +++ b/twilio/rest/video/v1/room/__init__.py @@ -416,9 +416,11 @@ def create( status_callback_method: Union[str, object] = values.unset, max_participants: Union[int, object] = values.unset, record_participants_on_connect: Union[bool, object] = values.unset, + transcribe_participants_on_connect: Union[bool, object] = values.unset, video_codecs: Union[List["RoomInstance.VideoCodec"], object] = values.unset, media_region: Union[str, object] = values.unset, recording_rules: Union[object, object] = values.unset, + transcriptions_configuration: Union[object, object] = values.unset, audio_only: Union[bool, object] = values.unset, max_participant_duration: Union[int, object] = values.unset, empty_room_timeout: Union[int, object] = values.unset, @@ -435,9 +437,11 @@ def create( :param status_callback_method: The HTTP method Twilio should use to call `status_callback`. Can be `POST` or `GET`. :param max_participants: The maximum number of concurrent Participants allowed in the room. The maximum allowed value is 50. :param record_participants_on_connect: Whether to start recording when Participants connect. + :param transcribe_participants_on_connect: Whether to start transcriptions when Participants connect. If TranscriptionsConfiguration is not provided, default settings will be used. :param video_codecs: An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. :param media_region: The region for the Room's media server. Can be one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). :param recording_rules: A collection of Recording Rules that describe how to include or exclude matching tracks for recording + :param transcriptions_configuration: A collection of properties that describe transcription behaviour. If TranscribeParticipantsOnConnect is set to true and TranscriptionsConfiguration is not provided, default settings will be used. :param audio_only: When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. :param max_participant_duration: The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). :param empty_room_timeout: Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). @@ -458,9 +462,15 @@ def create( "RecordParticipantsOnConnect": serialize.boolean_to_string( record_participants_on_connect ), + "TranscribeParticipantsOnConnect": serialize.boolean_to_string( + transcribe_participants_on_connect + ), "VideoCodecs": serialize.map(video_codecs, lambda e: e), "MediaRegion": media_region, "RecordingRules": serialize.object(recording_rules), + "TranscriptionsConfiguration": serialize.object( + transcriptions_configuration + ), "AudioOnly": serialize.boolean_to_string(audio_only), "MaxParticipantDuration": max_participant_duration, "EmptyRoomTimeout": empty_room_timeout, @@ -489,9 +499,11 @@ async def create_async( status_callback_method: Union[str, object] = values.unset, max_participants: Union[int, object] = values.unset, record_participants_on_connect: Union[bool, object] = values.unset, + transcribe_participants_on_connect: Union[bool, object] = values.unset, video_codecs: Union[List["RoomInstance.VideoCodec"], object] = values.unset, media_region: Union[str, object] = values.unset, recording_rules: Union[object, object] = values.unset, + transcriptions_configuration: Union[object, object] = values.unset, audio_only: Union[bool, object] = values.unset, max_participant_duration: Union[int, object] = values.unset, empty_room_timeout: Union[int, object] = values.unset, @@ -508,9 +520,11 @@ async def create_async( :param status_callback_method: The HTTP method Twilio should use to call `status_callback`. Can be `POST` or `GET`. :param max_participants: The maximum number of concurrent Participants allowed in the room. The maximum allowed value is 50. :param record_participants_on_connect: Whether to start recording when Participants connect. + :param transcribe_participants_on_connect: Whether to start transcriptions when Participants connect. If TranscriptionsConfiguration is not provided, default settings will be used. :param video_codecs: An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. :param media_region: The region for the Room's media server. Can be one of the [available Media Regions](https://www.twilio.com/docs/video/ip-addresses#group-rooms-media-servers). :param recording_rules: A collection of Recording Rules that describe how to include or exclude matching tracks for recording + :param transcriptions_configuration: A collection of properties that describe transcription behaviour. If TranscribeParticipantsOnConnect is set to true and TranscriptionsConfiguration is not provided, default settings will be used. :param audio_only: When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. :param max_participant_duration: The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). :param empty_room_timeout: Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). @@ -531,9 +545,15 @@ async def create_async( "RecordParticipantsOnConnect": serialize.boolean_to_string( record_participants_on_connect ), + "TranscribeParticipantsOnConnect": serialize.boolean_to_string( + transcribe_participants_on_connect + ), "VideoCodecs": serialize.map(video_codecs, lambda e: e), "MediaRegion": media_region, "RecordingRules": serialize.object(recording_rules), + "TranscriptionsConfiguration": serialize.object( + transcriptions_configuration + ), "AudioOnly": serialize.boolean_to_string(audio_only), "MaxParticipantDuration": max_participant_duration, "EmptyRoomTimeout": empty_room_timeout, From c5b9ee0c46776db22c24837a62f631d479964755 Mon Sep 17 00:00:00 2001 From: Twilio Date: Mon, 5 May 2025 10:41:40 +0000 Subject: [PATCH 102/113] Release 9.6.0 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index d03f823242..b0ea12a364 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.5.2", + version="9.6.0", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 15e4058354..128c99df6b 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "5", "2") +__version_info__ = ("9", "6", "0") __version__ = ".".join(__version_info__) From 7508e2576c2846c62fab9f8f4444ab16a995909b Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 13 May 2025 09:45:23 +0000 Subject: [PATCH 103/113] [Librarian] Regenerated @ be1009287706f9668165e2c57e337a331cc8e657 217af8d5996ea240f27310f5573ccec8426015bd --- CHANGES.md | 12 ++++ twilio/rest/accounts/v1/bulk_consents.py | 4 +- .../account/address/dependent_phone_number.py | 15 ++--- .../api/v2010/account/call/transcription.py | 4 +- twilio/rest/content/v1/content/__init__.py | 27 ++++++++ .../rest/events/v1/subscription/__init__.py | 40 +----------- .../v2/verification_attempts_summary.py | 4 +- twilio/twiml/voice_response.py | 62 ++++++++++++++----- 8 files changed, 98 insertions(+), 70 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a9321f3330..6ee95a19d9 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,18 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-05-13] Version 9.6.1 +-------------------------- +**Accounts** +- Changes to add date_of_consent param in Bulk Consent API + +**Api** +- Change `friendly_name`, `date_created` and `date_updated` properties to type `string`. + +**Twiml** +- Update twiml definition for `` and `` + + [2025-05-05] Version 9.6.0 -------------------------- **Library - Fix** diff --git a/twilio/rest/accounts/v1/bulk_consents.py b/twilio/rest/accounts/v1/bulk_consents.py index 3e4564386b..9e242552ee 100644 --- a/twilio/rest/accounts/v1/bulk_consents.py +++ b/twilio/rest/accounts/v1/bulk_consents.py @@ -57,7 +57,7 @@ def create(self, items: List[object]) -> BulkConsentsInstance: """ Create the BulkConsentsInstance - :param items: This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; and `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`]. + :param items: This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`]; `date_of_consent`, an optional datetime string field in ISO-8601 format that captures the exact date and time when the user gave or revoked consent. If not provided, it will be empty. :returns: The created BulkConsentsInstance """ @@ -83,7 +83,7 @@ async def create_async(self, items: List[object]) -> BulkConsentsInstance: """ Asynchronously create the BulkConsentsInstance - :param items: This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; and `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`]. + :param items: This is a list of objects that describes a contact's opt-in status. Each object contains the following fields: `contact_id`, which must be a string representing phone number in [E.164 format](https://www.twilio.com/docs/glossary/what-e164); `correlation_id`, a unique 32-character UUID used to uniquely map the request item with the response item; `sender_id`, which can be either a valid messaging service SID or a from phone number; `status`, a string representing the consent status. Can be one of [`opt-in`, `opt-out`]; `source`, a string indicating the medium through which the consent was collected. Can be one of [`website`, `offline`, `opt-in-message`, `opt-out-message`, `others`]; `date_of_consent`, an optional datetime string field in ISO-8601 format that captures the exact date and time when the user gave or revoked consent. If not provided, it will be empty. :returns: The created BulkConsentsInstance """ diff --git a/twilio/rest/api/v2010/account/address/dependent_phone_number.py b/twilio/rest/api/v2010/account/address/dependent_phone_number.py index 504e69bc92..10d1ad306f 100644 --- a/twilio/rest/api/v2010/account/address/dependent_phone_number.py +++ b/twilio/rest/api/v2010/account/address/dependent_phone_number.py @@ -12,9 +12,8 @@ Do not edit the class manually. """ -from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values +from twilio.base import values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -51,7 +50,7 @@ class EmergencyStatus(object): :ivar sms_method: The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`. :ivar sms_url: The URL we call when the phone number receives an incoming SMS message. :ivar address_requirements: - :ivar capabilities: The set of Boolean properties that indicates whether a phone number can receive calls or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can be: `true` or `false`. + :ivar capabilities: :ivar status_callback: The URL we call using the `status_callback_method` to send status information to your application. :ivar status_callback_method: The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`. :ivar api_version: The API version used to start a new TwiML session. @@ -83,12 +82,8 @@ def __init__( self.voice_caller_id_lookup: Optional[bool] = payload.get( "voice_caller_id_lookup" ) - self.date_created: Optional[datetime] = deserialize.rfc2822_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( - payload.get("date_updated") - ) + self.date_created: Optional[str] = payload.get("date_created") + self.date_updated: Optional[str] = payload.get("date_updated") self.sms_fallback_method: Optional[str] = payload.get("sms_fallback_method") self.sms_fallback_url: Optional[str] = payload.get("sms_fallback_url") self.sms_method: Optional[str] = payload.get("sms_method") @@ -96,7 +91,7 @@ def __init__( self.address_requirements: Optional[ "DependentPhoneNumberInstance.AddressRequirement" ] = payload.get("address_requirements") - self.capabilities: Optional[Dict[str, object]] = payload.get("capabilities") + self.capabilities: Optional[str] = payload.get("capabilities") self.status_callback: Optional[str] = payload.get("status_callback") self.status_callback_method: Optional[str] = payload.get( "status_callback_method" diff --git a/twilio/rest/api/v2010/account/call/transcription.py b/twilio/rest/api/v2010/account/call/transcription.py index 50389f3e68..4f8f9125b6 100644 --- a/twilio/rest/api/v2010/account/call/transcription.py +++ b/twilio/rest/api/v2010/account/call/transcription.py @@ -287,7 +287,7 @@ def create( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result - :param intelligence_service: The SID or unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . + :param intelligence_service: The SID or unique name of the [Intelligence Service](https://www.twilio.com/docs/conversational-intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . :returns: The created TranscriptionInstance """ @@ -362,7 +362,7 @@ async def create_async( :param speech_model: Recognition model used by the transcription engine, among those supported by the provider :param hints: A Phrase contains words and phrase \\\"hints\\\" so that the speech recognition engine is more likely to recognize them. :param enable_automatic_punctuation: The provider will add punctuation to recognition result - :param intelligence_service: The SID or unique name of the [Voice Intelligence Service](https://www.twilio.com/docs/voice/intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . + :param intelligence_service: The SID or unique name of the [Intelligence Service](https://www.twilio.com/docs/conversational-intelligence/api/service-resource) for persisting transcripts and running post-call Language Operators . :returns: The created TranscriptionInstance """ diff --git a/twilio/rest/content/v1/content/__init__.py b/twilio/rest/content/v1/content/__init__.py index 6223e940b3..44cc6a67bc 100644 --- a/twilio/rest/content/v1/content/__init__.py +++ b/twilio/rest/content/v1/content/__init__.py @@ -52,6 +52,7 @@ class CallToActionAction(object): :ivar url: :ivar phone: :ivar code: + :ivar id: """ def __init__(self, payload: Dict[str, Any]): @@ -63,6 +64,7 @@ def __init__(self, payload: Dict[str, Any]): self.url: Optional[str] = payload.get("url") self.phone: Optional[str] = payload.get("phone") self.code: Optional[str] = payload.get("code") + self.id: Optional[str] = payload.get("id") def to_dict(self): return { @@ -71,6 +73,7 @@ def to_dict(self): "url": self.url, "phone": self.phone, "code": self.code, + "id": self.id, } class CardAction(object): @@ -470,6 +473,8 @@ class TwilioLocation(object): :ivar latitude: :ivar longitude: :ivar label: + :ivar id: + :ivar address: """ def __init__(self, payload: Dict[str, Any]): @@ -477,12 +482,16 @@ def __init__(self, payload: Dict[str, Any]): self.latitude: Optional[float] = payload.get("latitude") self.longitude: Optional[float] = payload.get("longitude") self.label: Optional[str] = payload.get("label") + self.id: Optional[str] = payload.get("id") + self.address: Optional[str] = payload.get("address") def to_dict(self): return { "latitude": self.latitude, "longitude": self.longitude, "label": self.label, + "id": self.id, + "address": self.address, } class TwilioMedia(object): @@ -911,6 +920,7 @@ class CallToActionAction(object): :ivar url: :ivar phone: :ivar code: + :ivar id: """ def __init__(self, payload: Dict[str, Any]): @@ -922,6 +932,7 @@ def __init__(self, payload: Dict[str, Any]): self.url: Optional[str] = payload.get("url") self.phone: Optional[str] = payload.get("phone") self.code: Optional[str] = payload.get("code") + self.id: Optional[str] = payload.get("id") def to_dict(self): return { @@ -930,6 +941,7 @@ def to_dict(self): "url": self.url, "phone": self.phone, "code": self.code, + "id": self.id, } class CardAction(object): @@ -1329,6 +1341,8 @@ class TwilioLocation(object): :ivar latitude: :ivar longitude: :ivar label: + :ivar id: + :ivar address: """ def __init__(self, payload: Dict[str, Any]): @@ -1336,12 +1350,16 @@ def __init__(self, payload: Dict[str, Any]): self.latitude: Optional[float] = payload.get("latitude") self.longitude: Optional[float] = payload.get("longitude") self.label: Optional[str] = payload.get("label") + self.id: Optional[str] = payload.get("id") + self.address: Optional[str] = payload.get("address") def to_dict(self): return { "latitude": self.latitude, "longitude": self.longitude, "label": self.label, + "id": self.id, + "address": self.address, } class TwilioMedia(object): @@ -1771,6 +1789,7 @@ class CallToActionAction(object): :ivar url: :ivar phone: :ivar code: + :ivar id: """ def __init__(self, payload: Dict[str, Any]): @@ -1782,6 +1801,7 @@ def __init__(self, payload: Dict[str, Any]): self.url: Optional[str] = payload.get("url") self.phone: Optional[str] = payload.get("phone") self.code: Optional[str] = payload.get("code") + self.id: Optional[str] = payload.get("id") def to_dict(self): return { @@ -1790,6 +1810,7 @@ def to_dict(self): "url": self.url, "phone": self.phone, "code": self.code, + "id": self.id, } class CardAction(object): @@ -2189,6 +2210,8 @@ class TwilioLocation(object): :ivar latitude: :ivar longitude: :ivar label: + :ivar id: + :ivar address: """ def __init__(self, payload: Dict[str, Any]): @@ -2196,12 +2219,16 @@ def __init__(self, payload: Dict[str, Any]): self.latitude: Optional[float] = payload.get("latitude") self.longitude: Optional[float] = payload.get("longitude") self.label: Optional[str] = payload.get("label") + self.id: Optional[str] = payload.get("id") + self.address: Optional[str] = payload.get("address") def to_dict(self): return { "latitude": self.latitude, "longitude": self.longitude, "label": self.label, + "id": self.id, + "address": self.address, } class TwilioMedia(object): diff --git a/twilio/rest/events/v1/subscription/__init__.py b/twilio/rest/events/v1/subscription/__init__.py index e77cf10b51..872c9ed7d0 100644 --- a/twilio/rest/events/v1/subscription/__init__.py +++ b/twilio/rest/events/v1/subscription/__init__.py @@ -33,7 +33,6 @@ class SubscriptionInstance(InstanceResource): :ivar sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. :ivar url: The URL of this resource. :ivar links: Contains a dictionary of URL links to nested resources of this Subscription. - :ivar receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. """ def __init__( @@ -53,9 +52,6 @@ def __init__( self.sink_sid: Optional[str] = payload.get("sink_sid") self.url: Optional[str] = payload.get("url") self.links: Optional[Dict[str, object]] = payload.get("links") - self.receive_events_from_subaccounts: Optional[bool] = payload.get( - "receive_events_from_subaccounts" - ) self._solution = { "sid": sid or self.sid, @@ -117,42 +113,36 @@ def update( self, description: Union[str, object] = values.unset, sink_sid: Union[str, object] = values.unset, - receive_events_from_subaccounts: Union[bool, object] = values.unset, ) -> "SubscriptionInstance": """ Update the SubscriptionInstance :param description: A human readable description for the Subscription. :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. - :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The updated SubscriptionInstance """ return self._proxy.update( description=description, sink_sid=sink_sid, - receive_events_from_subaccounts=receive_events_from_subaccounts, ) async def update_async( self, description: Union[str, object] = values.unset, sink_sid: Union[str, object] = values.unset, - receive_events_from_subaccounts: Union[bool, object] = values.unset, ) -> "SubscriptionInstance": """ Asynchronous coroutine to update the SubscriptionInstance :param description: A human readable description for the Subscription. :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. - :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The updated SubscriptionInstance """ return await self._proxy.update_async( description=description, sink_sid=sink_sid, - receive_events_from_subaccounts=receive_events_from_subaccounts, ) @property @@ -263,14 +253,12 @@ def update( self, description: Union[str, object] = values.unset, sink_sid: Union[str, object] = values.unset, - receive_events_from_subaccounts: Union[bool, object] = values.unset, ) -> SubscriptionInstance: """ Update the SubscriptionInstance :param description: A human readable description for the Subscription. :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. - :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The updated SubscriptionInstance """ @@ -279,9 +267,6 @@ def update( { "Description": description, "SinkSid": sink_sid, - "ReceiveEventsFromSubaccounts": serialize.boolean_to_string( - receive_events_from_subaccounts - ), } ) headers = values.of({}) @@ -300,14 +285,12 @@ async def update_async( self, description: Union[str, object] = values.unset, sink_sid: Union[str, object] = values.unset, - receive_events_from_subaccounts: Union[bool, object] = values.unset, ) -> SubscriptionInstance: """ Asynchronous coroutine to update the SubscriptionInstance :param description: A human readable description for the Subscription. :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. - :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The updated SubscriptionInstance """ @@ -316,9 +299,6 @@ async def update_async( { "Description": description, "SinkSid": sink_sid, - "ReceiveEventsFromSubaccounts": serialize.boolean_to_string( - receive_events_from_subaccounts - ), } ) headers = values.of({}) @@ -388,11 +368,7 @@ def __init__(self, version: Version): self._uri = "/Subscriptions" def create( - self, - description: str, - sink_sid: str, - types: List[object], - receive_events_from_subaccounts: Union[bool, object] = values.unset, + self, description: str, sink_sid: str, types: List[object] ) -> SubscriptionInstance: """ Create the SubscriptionInstance @@ -400,7 +376,6 @@ def create( :param description: A human readable description for the Subscription **This value should not contain PII.** :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. :param types: An array of objects containing the subscribed Event Types - :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The created SubscriptionInstance """ @@ -410,9 +385,6 @@ def create( "Description": description, "SinkSid": sink_sid, "Types": serialize.map(types, lambda e: serialize.object(e)), - "ReceiveEventsFromSubaccounts": serialize.boolean_to_string( - receive_events_from_subaccounts - ), } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -428,11 +400,7 @@ def create( return SubscriptionInstance(self._version, payload) async def create_async( - self, - description: str, - sink_sid: str, - types: List[object], - receive_events_from_subaccounts: Union[bool, object] = values.unset, + self, description: str, sink_sid: str, types: List[object] ) -> SubscriptionInstance: """ Asynchronously create the SubscriptionInstance @@ -440,7 +408,6 @@ async def create_async( :param description: A human readable description for the Subscription **This value should not contain PII.** :param sink_sid: The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. :param types: An array of objects containing the subscribed Event Types - :param receive_events_from_subaccounts: Receive events from all children accounts in the parent account subscription. :returns: The created SubscriptionInstance """ @@ -450,9 +417,6 @@ async def create_async( "Description": description, "SinkSid": sink_sid, "Types": serialize.map(types, lambda e: serialize.object(e)), - "ReceiveEventsFromSubaccounts": serialize.boolean_to_string( - receive_events_from_subaccounts - ), } ) headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) diff --git a/twilio/rest/verify/v2/verification_attempts_summary.py b/twilio/rest/verify/v2/verification_attempts_summary.py index 429e9f70bc..d662cf8f55 100644 --- a/twilio/rest/verify/v2/verification_attempts_summary.py +++ b/twilio/rest/verify/v2/verification_attempts_summary.py @@ -49,8 +49,8 @@ def __init__(self, version: Version, payload: Dict[str, Any]): self.total_unconverted: Optional[int] = deserialize.integer( payload.get("total_unconverted") ) - self.conversion_rate_percentage: Optional[float] = deserialize.decimal( - payload.get("conversion_rate_percentage") + self.conversion_rate_percentage: Optional[str] = payload.get( + "conversion_rate_percentage" ) self.url: Optional[str] = payload.get("url") diff --git a/twilio/twiml/voice_response.py b/twilio/twiml/voice_response.py index 6f3d17e92c..18078b90a3 100644 --- a/twilio/twiml/voice_response.py +++ b/twilio/twiml/voice_response.py @@ -2748,9 +2748,14 @@ def conversation_relay( dtmf_detection=None, welcome_greeting=None, partial_prompts=None, - interruptible=None, - interrupt_by_dtmf=None, welcome_greeting_interruptible=None, + interruptible=None, + preemptible=None, + hints=None, + intelligence_service=None, + report_input_during_agent_speech=None, + elevenlabs_text_normalization=None, + interrupt_sensitivity=None, debug=None, **kwargs ): @@ -2769,10 +2774,15 @@ def conversation_relay( :param dtmf_detection: Whether DTMF tones should be detected and reported in speech transcription :param welcome_greeting: The sentence to be played automatically when the session is connected :param partial_prompts: Whether partial prompts should be reported to WebSocket server before the caller finishes speaking - :param interruptible: Whether caller's speaking can interrupt the play of text-to-speech - :param interrupt_by_dtmf: Whether DTMF tone can interrupt the play of text-to-speech - :param welcome_greeting_interruptible: Whether caller's speaking can interrupt the welcome greeting - :param debug: Whether debugging on the session is enabled + :param welcome_greeting_interruptible: "Whether and how the input from a caller, such as speaking or DTMF can interrupt the welcome greeting + :param interruptible: Whether and how the input from a caller, such as speaking or DTMF can interrupt the play of text-to-speech + :param preemptible: Whether subsequent text-to-speech or play media can interrupt the on-going play of text-to-speech or media + :param hints: Phrases to help better accuracy in speech recognition of these pharases + :param intelligence_service: The Conversational Intelligence Service id or unique name to be used for the session + :param report_input_during_agent_speech: Whether prompts should be reported to WebSocket server when text-to-speech playing and interrupt is disabled + :param elevenlabs_text_normalization: When using ElevenLabs as TTS provider, this parameter allows you to enable or disable its text normalization feature + :param interrupt_sensitivity: Set the sensitivity of the interrupt feature for speech. The value can be low, medium, or high + :param debug: Multiple debug options to be used for troubleshooting :param kwargs: additional attributes :returns: element @@ -2791,9 +2801,14 @@ def conversation_relay( dtmf_detection=dtmf_detection, welcome_greeting=welcome_greeting, partial_prompts=partial_prompts, - interruptible=interruptible, - interrupt_by_dtmf=interrupt_by_dtmf, welcome_greeting_interruptible=welcome_greeting_interruptible, + interruptible=interruptible, + preemptible=preemptible, + hints=hints, + intelligence_service=intelligence_service, + report_input_during_agent_speech=report_input_during_agent_speech, + elevenlabs_text_normalization=elevenlabs_text_normalization, + interrupt_sensitivity=interrupt_sensitivity, debug=debug, **kwargs ) @@ -2813,9 +2828,14 @@ def assistant( dtmf_detection=None, welcome_greeting=None, partial_prompts=None, - interruptible=None, - interrupt_by_dtmf=None, welcome_greeting_interruptible=None, + interruptible=None, + preemptible=None, + hints=None, + intelligence_service=None, + report_input_during_agent_speech=None, + elevenlabs_text_normalization=None, + interrupt_sensitivity=None, debug=None, **kwargs ): @@ -2834,10 +2854,15 @@ def assistant( :param dtmf_detection: Whether DTMF tones should be detected and reported in speech transcription :param welcome_greeting: The sentence to be played automatically when the session is connected :param partial_prompts: Whether partial prompts should be reported to WebSocket server before the caller finishes speaking - :param interruptible: Whether caller's speaking can interrupt the play of text-to-speech - :param interrupt_by_dtmf: Whether DTMF tone can interrupt the play of text-to-speech - :param welcome_greeting_interruptible: Whether caller's speaking can interrupt the welcome greeting - :param debug: Whether debugging on the session is enabled + :param welcome_greeting_interruptible: "Whether and how the input from a caller, such as speaking or DTMF can interrupt the welcome greeting + :param interruptible: Whether and how the input from a caller, such as speaking or DTMF can interrupt the play of text-to-speech + :param preemptible: Whether subsequent text-to-speech or play media can interrupt the on-going play of text-to-speech or media + :param hints: Phrases to help better accuracy in speech recognition of these pharases + :param intelligence_service: The Conversational Intelligence Service id or unique name to be used for the session + :param report_input_during_agent_speech: Whether prompts should be reported to WebSocket server when text-to-speech playing and interrupt is disabled + :param elevenlabs_text_normalization: When using ElevenLabs as TTS provider, this parameter allows you to enable or disable its text normalization feature + :param interrupt_sensitivity: Set the sensitivity of the interrupt feature for speech. The value can be low, medium, or high + :param debug: Multiple debug options to be used for troubleshooting :param kwargs: additional attributes :returns: element @@ -2856,9 +2881,14 @@ def assistant( dtmf_detection=dtmf_detection, welcome_greeting=welcome_greeting, partial_prompts=partial_prompts, - interruptible=interruptible, - interrupt_by_dtmf=interrupt_by_dtmf, welcome_greeting_interruptible=welcome_greeting_interruptible, + interruptible=interruptible, + preemptible=preemptible, + hints=hints, + intelligence_service=intelligence_service, + report_input_during_agent_speech=report_input_during_agent_speech, + elevenlabs_text_normalization=elevenlabs_text_normalization, + interrupt_sensitivity=interrupt_sensitivity, debug=debug, **kwargs ) From ce658147b6b3e4d043fc511b52e4ca94129b4f67 Mon Sep 17 00:00:00 2001 From: Twilio Date: Tue, 13 May 2025 09:50:13 +0000 Subject: [PATCH 104/113] Release 9.6.1 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b0ea12a364..61757fd57d 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.6.0", + version="9.6.1", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 128c99df6b..67f6744da9 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "6", "0") +__version_info__ = ("9", "6", "1") __version__ = ".".join(__version_info__) From da6aa6bd68fe606814520742f10373cfb5b3870b Mon Sep 17 00:00:00 2001 From: Manisha Singh Date: Wed, 14 May 2025 20:08:51 +0530 Subject: [PATCH 105/113] chore: update iam token endpoint (#862) --- twilio/http/client_token_manager.py | 2 +- twilio/http/orgs_token_manager.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/twilio/http/client_token_manager.py b/twilio/http/client_token_manager.py index d65acb2ba2..0d42428a2f 100644 --- a/twilio/http/client_token_manager.py +++ b/twilio/http/client_token_manager.py @@ -29,7 +29,7 @@ def __init__( self.client = Client() def fetch_access_token(self): - token_instance = self.client.preview_iam.v1.token.create( + token_instance = self.client.iam.v1.token.create( grant_type=self.grant_type, client_id=self.client_id, client_secret=self.client_secret, diff --git a/twilio/http/orgs_token_manager.py b/twilio/http/orgs_token_manager.py index 767ed270af..76fad5213f 100644 --- a/twilio/http/orgs_token_manager.py +++ b/twilio/http/orgs_token_manager.py @@ -29,7 +29,7 @@ def __init__( self.client = Client() def fetch_access_token(self): - token_instance = self.client.preview_iam.v1.token.create( + token_instance = self.client.iam.v1.token.create( grant_type=self.grant_type, client_id=self.client_id, client_secret=self.client_secret, From a72ada6207f7bef4d9b9b59a78807d626aa38e44 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 29 May 2025 12:12:45 +0000 Subject: [PATCH 106/113] [Librarian] Regenerated @ 8d92bd85f8ef40c37285966629e30e5c7cb9312b e615ab0d23ebf4a44fbefcca67df047f8de43ea5 --- CHANGES.md | 15 + .../v2010/account/usage/record/__init__.py | 496 +++++++++++++++++- .../v2010/account/usage/record/all_time.py | 496 +++++++++++++++++- .../api/v2010/account/usage/record/daily.py | 496 +++++++++++++++++- .../v2010/account/usage/record/last_month.py | 496 +++++++++++++++++- .../api/v2010/account/usage/record/monthly.py | 496 +++++++++++++++++- .../v2010/account/usage/record/this_month.py | 496 +++++++++++++++++- .../api/v2010/account/usage/record/today.py | 496 +++++++++++++++++- .../api/v2010/account/usage/record/yearly.py | 496 +++++++++++++++++- .../v2010/account/usage/record/yesterday.py | 496 +++++++++++++++++- .../rest/api/v2010/account/usage/trigger.py | 496 +++++++++++++++++- twilio/rest/messaging/v2/channels_sender.py | 162 +----- twilio/rest/numbers/v1/__init__.py | 24 +- twilio/rest/numbers/v1/porting_port_in.py | 6 +- ...hook_configuration_fetch.py => webhook.py} | 26 +- twilio/rest/verify/v2/service/__init__.py | 2 +- 16 files changed, 4962 insertions(+), 233 deletions(-) rename twilio/rest/numbers/v1/{porting_webhook_configuration_fetch.py => webhook.py} (78%) diff --git a/CHANGES.md b/CHANGES.md index 6ee95a19d9..90d906f1ea 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,21 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-05-29] Version 9.6.2 +-------------------------- +**Library - Chore** +- [PR #862](https://github.com/twilio/twilio-python/pull/862): update iam token endpoint. Thanks to [@manisha1997](https://github.com/manisha1997)! + +**Api** +- Added several usage category enums to `usage_record` API + +**Numbers** +- Update the porting documentation + +**Verify** +- Update `ienum` type for Channels in Verify Attempts API + + [2025-05-13] Version 9.6.1 -------------------------- **Accounts** diff --git a/twilio/rest/api/v2010/account/usage/record/__init__.py b/twilio/rest/api/v2010/account/usage/record/__init__.py index 1798eb4079..d60bde9b6b 100644 --- a/twilio/rest/api/v2010/account/usage/record/__init__.py +++ b/twilio/rest/api/v2010/account/usage/record/__init__.py @@ -33,33 +33,101 @@ class RecordInstance(InstanceResource): class Category(object): + A2P_10DLC_REGISTRATIONFEES_BRANDREGISTRATION = ( + "a2p-10dlc-registrationfees-brandregistration" + ) + A2P_10DLC_REGISTRATIONFEES_BV = "a2p-10dlc-registrationfees-bv" + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNCHARGES = ( + "a2p-10dlc-registrationfees-campaigncharges" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNREGISTRATION = ( + "a2p-10dlc-registrationfees-campaignregistration" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNVETTING = ( + "a2p-10dlc-registrationfees-campaignvetting" + ) + A2P_10DLC_REGISTRATIONFEES_MONTHLY = "a2p-10dlc-registrationfees-monthly" + A2P_10DLC_REGISTRATIONFEES_ONETIME = "a2p-10dlc-registrationfees-onetime" A2P_REGISTRATION_FEES = "a2p-registration-fees" + ACCOUNT_SECURITY = "account-security" AGENT_CONFERENCE = "agent-conference" + AGENT_COPILOT = "agent-copilot" + AGENT_COPILOT_MESSAGES = "agent-copilot-messages" + AGENT_COPILOT_PARTICIPANT_MINUTES = "agent-copilot-participant-minutes" + AI_ASSISTANTS = "ai-assistants" + AI_ASSISTANTS_VOICE = "ai-assistants-voice" AMAZON_POLLY = "amazon-polly" ANSWERING_MACHINE_DETECTION = "answering-machine-detection" + ASSETS = "assets" + AUDIENCE_MINUTES = "audience-minutes" + AUDIENCE_MINUTES_AUDIO = "audience-minutes-audio" AUTHY_AUTHENTICATIONS = "authy-authentications" AUTHY_CALLS_OUTBOUND = "authy-calls-outbound" + AUTHY_EMAIL_AUTHENTICATIONS = "authy-email-authentications" AUTHY_MONTHLY_FEES = "authy-monthly-fees" + AUTHY_OUTBOUND_EMAIL = "authy-outbound-email" AUTHY_PHONE_INTELLIGENCE = "authy-phone-intelligence" AUTHY_PHONE_VERIFICATIONS = "authy-phone-verifications" AUTHY_SMS_OUTBOUND = "authy-sms-outbound" + AUTHY_VERIFY_EMAIL_VERIFICATIONS = "authy-verify-email-verifications" + AUTHY_VERIFY_OUTBOUND_EMAIL = "authy-verify-outbound-email" + AUTOPILOT = "autopilot" + AUTOPILOT_HOME_ASSISTANTS = "autopilot-home-assistants" + AUTOPILOT_MESSAGING = "autopilot-messaging" + AUTOPILOT_OTHER = "autopilot-other" + AUTOPILOT_VOICE = "autopilot-voice" + BASIC_PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( + "basic-peer-to-peer-rooms-participant-minutes" + ) + BRANDED_CALLING = "branded-calling" + BUNDLE_SMS_BUCKET = "bundle-sms-bucket" + BUNDLE_SUBSCRIPTION_FEES = "bundle-subscription-fees" + CALL_FORWARDING_LOOKUPS = "call-forwarding-lookups" CALL_PROGESS_EVENTS = "call-progess-events" CALLERIDLOOKUPS = "calleridlookups" CALLS = "calls" CALLS_CLIENT = "calls-client" + CALLS_EMERGENCY = "calls-emergency" CALLS_GLOBALCONFERENCE = "calls-globalconference" CALLS_INBOUND = "calls-inbound" CALLS_INBOUND_LOCAL = "calls-inbound-local" CALLS_INBOUND_MOBILE = "calls-inbound-mobile" CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree" + CALLS_INBOUND_TOLLFREE_LOCAL = "calls-inbound-tollfree-local" + CALLS_INBOUND_TOLLFREE_MOBILE = "calls-inbound-tollfree-mobile" + CALLS_MEDIA_STREAM_MINUTES = "calls-media-stream-minutes" CALLS_OUTBOUND = "calls-outbound" CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions" CALLS_RECORDINGS = "calls-recordings" CALLS_SIP = "calls-sip" CALLS_SIP_INBOUND = "calls-sip-inbound" CALLS_SIP_OUTBOUND = "calls-sip-outbound" + CALLS_TEXT_TO_SPEECH = "calls-text-to-speech" CALLS_TRANSFERS = "calls-transfers" CARRIER_LOOKUPS = "carrier-lookups" + CATEGORY = "category" + CHANNELS = "channels" + CHANNELS_MESSAGING = "channels-messaging" + CHANNELS_MESSAGING_INBOUND = "channels-messaging-inbound" + CHANNELS_MESSAGING_OUTBOUND = "channels-messaging-outbound" + CHANNELS_WHATSAPP = "channels-whatsapp" + CHANNELS_WHATSAPP_CONVERSATION_AUTHENTICATION = ( + "channels-whatsapp-conversation-authentication" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE = "channels-whatsapp-conversation-free" + CHANNELS_WHATSAPP_CONVERSATION_MARKETING = ( + "channels-whatsapp-conversation-marketing" + ) + CHANNELS_WHATSAPP_CONVERSATION_SERVICE = ( + "channels-whatsapp-conversation-service" + ) + CHANNELS_WHATSAPP_CONVERSATION_UTILITY = ( + "channels-whatsapp-conversation-utility" + ) + CHANNELS_WHATSAPP_INBOUND = "channels-whatsapp-inbound" + CHANNELS_WHATSAPP_OUTBOUND = "channels-whatsapp-outbound" + CHAT_VIRTUAL_AGENT = "chat-virtual-agent" + CONVERSATION_RELAY = "conversation-relay" CONVERSATIONS = "conversations" CONVERSATIONS_API_REQUESTS = "conversations-api-requests" CONVERSATIONS_CONVERSATION_EVENTS = "conversations-conversation-events" @@ -68,8 +136,40 @@ class Category(object): CONVERSATIONS_PARTICIPANT_EVENTS = "conversations-participant-events" CONVERSATIONS_PARTICIPANTS = "conversations-participants" CPS = "cps" + CREDIT_TRANSFER = "credit-transfer" + EMAIL = "email" + EMERGING_TECH = "emerging-tech" + ENGAGEMENT_SUITE_PACKAGED_PLANS = "engagement-suite-packaged-plans" + ENHANCED_LINE_TYPE_LOOKUPS = "enhanced-line-type-lookups" + ENTERPRISE = "enterprise" + EVENTS = "events" + EXPERIMENT_FRANCE_SMS = "experiment-france-sms" + EXPERIMENT_INDIA_SMS = "experiment-india-sms" + EXPERIMENT_UK_SMS = "experiment-uk-sms" + FAILED_MESSAGE_PROCESSING_FEE = "failed-message-processing-fee" + FLEX = "flex" + FLEX_ACTIVE_USER_HOURS = "flex-active-user-hours" + FLEX_CONCURRENT_USERS = "flex-concurrent-users" + FLEX_CONVERSATIONAL_INSIGHTS = "flex-conversational-insights" + FLEX_CONVERSATIONAL_INSIGHTS_MESSAGES = "flex-conversational-insights-messages" + FLEX_CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = ( + "flex-conversational-insights-voice-minutes" + ) + FLEX_EMAIL_USAGE = "flex-email-usage" + FLEX_MESSAGING_USAGE = "flex-messaging-usage" + FLEX_PARTNER_SPINSCI = "flex-partner-spinsci" + FLEX_PARTNER_XCELERATE = "flex-partner-xcelerate" + FLEX_RESELLER_ECOSYSTEM = "flex-reseller-ecosystem" + FLEX_UNIQUE_USER = "flex-unique-user" FLEX_USAGE = "flex-usage" + FLEX_USERS = "flex-users" + FLEX_VOICE_MINUTE = "flex-voice-minute" + FLEX_YTICA = "flex-ytica" FRAUD_LOOKUPS = "fraud-lookups" + FRONTLINE = "frontline" + FRONTLINE_USERS = "frontline-users" + FUNCTIONS = "functions" + GENERIC_PAY_TRANSACTIONS = "generic-pay-transactions" GROUP_ROOMS = "group-rooms" GROUP_ROOMS_DATA_TRACK = "group-rooms-data-track" GROUP_ROOMS_ENCRYPTED_MEDIA_RECORDED = "group-rooms-encrypted-media-recorded" @@ -79,9 +179,17 @@ class Category(object): GROUP_ROOMS_MEDIA_STORED = "group-rooms-media-stored" GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" - IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING = "ip-messaging" + IP_MESSAGING_COMMANDS = "ip-messaging-commands" + IP_MESSAGING_DATA_STORAGE = "ip-messaging-data-storage" + IP_MESSAGING_DATA_TRANSFER = "ip-messaging-data-transfer" + IP_MESSAGING_ENDPOINT_CONNECTIVITY = "ip-messaging-endpoint-connectivity" IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" + LINE_STATUS_LOOKUPS = "line-status-lookups" + LIVE_ACTIVITY_LOOKUPS = "live-activity-lookups" + LOOKUP_BUCKET_ADJUSTMENT = "lookup-bucket-adjustment" + LOOKUP_IDENTITY_MATCH = "lookup-identity-match" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( @@ -92,6 +200,13 @@ class Category(object): MARKETPLACE_CAPIO_SPEECH_TO_TEXT = "marketplace-capio-speech-to-text" MARKETPLACE_CONVRIZA_ABABA = "marketplace-convriza-ababa" MARKETPLACE_DEEPGRAM_PHRASE_DETECTOR = "marketplace-deepgram-phrase-detector" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION = "marketplace-deepgram-transcription" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION_BASE = ( + "marketplace-deepgram-transcription-base" + ) + MARKETPLACE_DEEPGRAM_TRANSSCRIPTION_ENHANCED = ( + "marketplace-deepgram-transscription-enhanced" + ) MARKETPLACE_DIGITAL_SEGMENT_BUSINESS_INFO = ( "marketplace-digital-segment-business-info" ) @@ -117,6 +232,9 @@ class Category(object): "marketplace-keen-io-contact-center-analytics" ) MARKETPLACE_MARCHEX_CLEANCALL = "marketplace-marchex-cleancall" + MARKETPLACE_MARCHEX_RECORDING_ANALYSIS = ( + "marketplace-marchex-recording-analysis" + ) MARKETPLACE_MARCHEX_SENTIMENT_ANALYSIS_FOR_SMS = ( "marketplace-marchex-sentiment-analysis-for-sms" ) @@ -133,14 +251,42 @@ class Category(object): "marketplace-nextcaller-advanced-caller-identification" ) MARKETPLACE_NOMOROBO_SPAM_SCORE = "marketplace-nomorobo-spam-score" + MARKETPLACE_PAY_ADDONS = "marketplace-pay-addons" + MARKETPLACE_PAY_ADDONS_BASECOMMERCE_PAY_CONNECTOR = ( + "marketplace-pay-addons-basecommerce-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_BRAINTREE_PAY_CONNECTOR = ( + "marketplace-pay-addons-braintree-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CARDCONNECT_PAY_CONNECTOR = ( + "marketplace-pay-addons-cardconnect-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CHASE_PAY_CONNECTOR = ( + "marketplace-pay-addons-chase-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplace-pay-addons-shuttle-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplace-pay-addons-stripe-pay-connector" + ) MARKETPLACE_PAYFONE_TCPA_COMPLIANCE = "marketplace-payfone-tcpa-compliance" + MARKETPLACE_POLY_AI_CONNECTOR = "marketplace-poly-ai-connector" + MARKETPLACE_REALPHONEVALIDATION = "marketplace-realphonevalidation" MARKETPLACE_REMEETING_AUTOMATIC_SPEECH_RECOGNITION = ( "marketplace-remeeting-automatic-speech-recognition" ) + MARKETPLACE_SPOKE_PHONE_LICENSE_PRO = "marketplace-spoke-phone-license-pro" + MARKETPLACE_SPOKE_PHONE_LICENSE_STANDARD = ( + "marketplace-spoke-phone-license-standard" + ) MARKETPLACE_TCPA_DEFENSE_SOLUTIONS_BLACKLIST_FEED = ( "marketplace-tcpa-defense-solutions-blacklist-feed" ) MARKETPLACE_TELO_OPENCNAM = "marketplace-telo-opencnam" + MARKETPLACE_TRESTLE_SOLUTIONS_CALLER_IDENTIFICATION = ( + "marketplace-trestle-solutions-caller-identification" + ) MARKETPLACE_TRUECNAM_TRUE_SPAM = "marketplace-truecnam-true-spam" MARKETPLACE_TWILIO_CALLER_NAME_LOOKUP_US = ( "marketplace-twilio-caller-name-lookup-us" @@ -153,6 +299,9 @@ class Category(object): MARKETPLACE_VOICEBASE_TRANSCRIPTION_CUSTOM_VOCABULARY = ( "marketplace-voicebase-transcription-custom-vocabulary" ) + MARKETPLACE_WEB_PURIFY_PROFANITY_FILTER = ( + "marketplace-web-purify-profanity-filter" + ) MARKETPLACE_WHITEPAGES_PRO_CALLER_IDENTIFICATION = ( "marketplace-whitepages-pro-caller-identification" ) @@ -167,15 +316,23 @@ class Category(object): MARKETPLACE_YTICA_CONTACT_CENTER_REPORTING_ANALYTICS = ( "marketplace-ytica-contact-center-reporting-analytics" ) + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplay-pay-addons-shuttle-pay-connector" + ) + MEDIA_COMPOSER_MINUTES = "media-composer-minutes" MEDIASTORAGE = "mediastorage" + MIN_SPEND_ADJUSTMENTS = "min-spend-adjustments" MMS = "mms" MMS_INBOUND = "mms-inbound" MMS_INBOUND_LONGCODE = "mms-inbound-longcode" MMS_INBOUND_SHORTCODE = "mms-inbound-shortcode" + MMS_INBOUND_TOLL_FREE = "mms-inbound-toll-free" MMS_MESSAGES_CARRIERFEES = "mms-messages-carrierfees" MMS_OUTBOUND = "mms-outbound" MMS_OUTBOUND_LONGCODE = "mms-outbound-longcode" MMS_OUTBOUND_SHORTCODE = "mms-outbound-shortcode" + MMS_OUTBOUND_TOLLFREE = "mms-outbound-tollfree" + MONITOR = "monitor" MONITOR_READS = "monitor-reads" MONITOR_STORAGE = "monitor-storage" MONITOR_WRITES = "monitor-writes" @@ -184,6 +341,12 @@ class Category(object): NOTIFY_CHANNELS = "notify-channels" NUMBER_FORMAT_LOOKUPS = "number-format-lookups" PCHAT = "pchat" + PCHAT_ACTIONS = "pchat-actions" + PCHAT_APS = "pchat-aps" + PCHAT_CONV_MED_STORAGE = "pchat-conv-med-storage" + PCHAT_MESSAGES = "pchat-messages" + PCHAT_NOTIFICATIONS = "pchat-notifications" + PCHAT_READS = "pchat-reads" PCHAT_USERS = "pchat-users" PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( "peer-to-peer-rooms-participant-minutes" @@ -193,18 +356,41 @@ class Category(object): PFAX_MINUTES_INBOUND = "pfax-minutes-inbound" PFAX_MINUTES_OUTBOUND = "pfax-minutes-outbound" PFAX_PAGES = "pfax-pages" + PHONE_QUALITY_SCORE_LOOKUPS = "phone-quality-score-lookups" PHONENUMBERS = "phonenumbers" PHONENUMBERS_CPS = "phonenumbers-cps" PHONENUMBERS_EMERGENCY = "phonenumbers-emergency" PHONENUMBERS_LOCAL = "phonenumbers-local" PHONENUMBERS_MOBILE = "phonenumbers-mobile" + PHONENUMBERS_PORTING = "phonenumbers-porting" PHONENUMBERS_SETUPS = "phonenumbers-setups" PHONENUMBERS_TOLLFREE = "phonenumbers-tollfree" PREMIUMSUPPORT = "premiumsupport" + PREMIUMSUPPORT_PERCENTAGE_SPEND = "premiumsupport-percentage-spend" + PROGRAMMABLEVOICE_PLATFORM = "programmablevoice-platform" + PROGRAMMABLEVOICECONN_CLIENTSDK = "programmablevoiceconn-clientsdk" + PROGRAMMABLEVOICECONN_CLIENTSDK_INBOUND = ( + "programmablevoiceconn-clientsdk-inbound" + ) + PROGRAMMABLEVOICECONN_CLIENTSDK_OUTBOUND = ( + "programmablevoiceconn-clientsdk-outbound" + ) + PROGRAMMABLEVOICECONN_ONNET = "programmablevoiceconn-onnet" + PROGRAMMABLEVOICECONN_ONNET_INBOUND = "programmablevoiceconn-onnet-inbound" + PROGRAMMABLEVOICECONN_ONNET_OUTBOUND = "programmablevoiceconn-onnet-outbound" + PROGRAMMABLEVOICECONN_SIP = "programmablevoiceconn-sip" + PROGRAMMABLEVOICECONN_SIP_INBOUND = "programmablevoiceconn-sip-inbound" + PROGRAMMABLEVOICECONN_SIP_OUTBOUND = "programmablevoiceconn-sip-outbound" + PROGRAMMABLEVOICECONNECTIVITY = "programmablevoiceconnectivity" PROXY = "proxy" PROXY_ACTIVE_SESSIONS = "proxy-active-sessions" + PROXY_BUCKET_ADJUSTMENT = "proxy-bucket-adjustment" + PROXY_LICENSES = "proxy-licenses" PSTNCONNECTIVITY = "pstnconnectivity" + PSTNCONNECTIVITY_INBOUND = "pstnconnectivity-inbound" + PSTNCONNECTIVITY_OUTBOUND = "pstnconnectivity-outbound" PV = "pv" + PV_BASIC_ROOMS = "pv-basic-rooms" PV_COMPOSITION_MEDIA_DOWNLOADED = "pv-composition-media-downloaded" PV_COMPOSITION_MEDIA_ENCRYPTED = "pv-composition-media-encrypted" PV_COMPOSITION_MEDIA_STORED = "pv-composition-media-stored" @@ -220,18 +406,20 @@ class Category(object): PV_ROOM_PARTICIPANTS_US2 = "pv-room-participants-us2" PV_ROOMS = "pv-rooms" PV_SIP_ENDPOINT_REGISTRATIONS = "pv-sip-endpoint-registrations" + RCS_MESSAGES = "rcs-messages" + REASSIGNED_NUMBER = "reassigned-number" RECORDINGS = "recordings" RECORDINGSTORAGE = "recordingstorage" - ROOMS_GROUP_BANDWIDTH = "rooms-group-bandwidth" - ROOMS_GROUP_MINUTES = "rooms-group-minutes" - ROOMS_PEER_TO_PEER_MINUTES = "rooms-peer-to-peer-minutes" SHORTCODES = "shortcodes" SHORTCODES_CUSTOMEROWNED = "shortcodes-customerowned" SHORTCODES_MMS_ENABLEMENT = "shortcodes-mms-enablement" SHORTCODES_MPS = "shortcodes-mps" SHORTCODES_RANDOM = "shortcodes-random" + SHORTCODES_SETUP_FEES = "shortcodes-setup-fees" SHORTCODES_UK = "shortcodes-uk" SHORTCODES_VANITY = "shortcodes-vanity" + SIM_SWAP_LOOKUPS = "sim-swap-lookups" + SIP_SECURE_MEDIA = "sip-secure-media" SMALL_GROUP_ROOMS = "small-group-rooms" SMALL_GROUP_ROOMS_DATA_TRACK = "small-group-rooms-data-track" SMALL_GROUP_ROOMS_PARTICIPANT_MINUTES = "small-group-rooms-participant-minutes" @@ -239,13 +427,30 @@ class Category(object): SMS_INBOUND = "sms-inbound" SMS_INBOUND_LONGCODE = "sms-inbound-longcode" SMS_INBOUND_SHORTCODE = "sms-inbound-shortcode" + SMS_INBOUND_TOLLFREE = "sms-inbound-tollfree" SMS_MESSAGES_CARRIERFEES = "sms-messages-carrierfees" SMS_MESSAGES_FEATURES = "sms-messages-features" + SMS_MESSAGES_FEATURES_ENGAGEMENT_SUITE = ( + "sms-messages-features-engagement-suite" + ) + SMS_MESSAGES_FEATURES_MESSAGE_REDACTION = ( + "sms-messages-features-message-redaction" + ) SMS_MESSAGES_FEATURES_SENDERID = "sms-messages-features-senderid" + SMS_MPS = "sms-mps" + SMS_MPS_SHORTCODE = "sms-mps-shortcode" + SMS_MPS_TOLLFREE = "sms-mps-tollfree" + SMS_MPS_TOLLFREE_SETUP = "sms-mps-tollfree-setup" + SMS_NATIONAL_REGULATORY_PROTECTION = "sms-national-regulatory-protection" SMS_OUTBOUND = "sms-outbound" SMS_OUTBOUND_CONTENT_INSPECTION = "sms-outbound-content-inspection" SMS_OUTBOUND_LONGCODE = "sms-outbound-longcode" SMS_OUTBOUND_SHORTCODE = "sms-outbound-shortcode" + SMS_OUTBOUND_TOLLFREE = "sms-outbound-tollfree" + SMS_PUMPING_PROTECTION = "sms-pumping-protection" + SMS_PUMPING_RISK = "sms-pumping-risk" + SMSMESSAGES_BUCKET_ADJUSTMENTS = "smsmessages-bucket-adjustments" + SMSMESSAGES_OUTBOUND_DOMESTIC = "smsmessages-outbound-domestic" SPEECH_RECOGNITION = "speech-recognition" STUDIO_ENGAGEMENTS = "studio-engagements" SYNC = "sync" @@ -275,13 +480,27 @@ class Category(object): TURNMEGABYTES_SINGAPORE = "turnmegabytes-singapore" TURNMEGABYTES_USEAST = "turnmegabytes-useast" TURNMEGABYTES_USWEST = "turnmegabytes-uswest" + TWILIO_FOR_SALESFORCE = "twilio-for-salesforce" + TWILIO_FOR_SALESFORCE_LICENSES = "twilio-for-salesforce-licenses" TWILIO_INTERCONNECT = "twilio-interconnect" + TWIML = "twiml" + USAGE_FLEX_VIDEO = "usage-flex-video" + USAGE_FUNCTIONS = "usage-functions" + USAGE_RCS_BASIC_MESSAGES_OUTBOUND = "usage-rcs-basic-messages-outbound" + USAGE_RCS_MESSAGES = "usage-rcs-messages" + USAGE_RCS_MESSAGES_INBOUND = "usage-rcs-messages-inbound" + USAGE_RCS_MESSAGING_CARRIER_FEES = "usage-rcs-messaging-carrier-fees" + USAGE_RCS_SINGLE_MESSAGES_OUTBOUND = "usage-rcs-single-messages-outbound" + VERIFY_PACKAGE_PLANS = "verify-package-plans" VERIFY_PUSH = "verify-push" + VERIFY_SNA = "verify-sna" VERIFY_TOTP = "verify-totp" + VERIFY_VOICE_SMS = "verify-voice-sms" VERIFY_WHATSAPP_CONVERSATIONS_BUSINESS_INITIATED = ( "verify-whatsapp-conversations-business-initiated" ) VIDEO_RECORDINGS = "video-recordings" + VIDEO_ROOMS_TURN_MEGABYTES = "video-rooms-turn-megabytes" VIRTUAL_AGENT = "virtual-agent" VOICE_INSIGHTS = "voice-insights" VOICE_INSIGHTS_CLIENT_INSIGHTS_ON_DEMAND_MINUTE = ( @@ -297,14 +516,103 @@ class Category(object): "voice-insights-sip-trunking-insights-on-demand-minute" ) VOICE_INTELLIGENCE = "voice-intelligence" - VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + VOICE_INTELLIGENCE_EIP_OPERATORS = "voice-intelligence-eip-operators" VOICE_INTELLIGENCE_OPERATORS = "voice-intelligence-operators" + VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + WDS = "wds" WIRELESS = "wireless" + WIRELESS_DATA = "wireless-data" + WIRELESS_DATA_PAYG = "wireless-data-payg" + WIRELESS_DATA_PAYG_AFRICA = "wireless-data-payg-africa" + WIRELESS_DATA_PAYG_ASIA = "wireless-data-payg-asia" + WIRELESS_DATA_PAYG_CENTRALANDSOUTHAMERICA = ( + "wireless-data-payg-centralandsouthamerica" + ) + WIRELESS_DATA_PAYG_EUROPE = "wireless-data-payg-europe" + WIRELESS_DATA_PAYG_NORTHAMERICA = "wireless-data-payg-northamerica" + WIRELESS_DATA_PAYG_OCEANIA = "wireless-data-payg-oceania" + WIRELESS_DATA_QUOTA1 = "wireless-data-quota1" + WIRELESS_DATA_QUOTA1_AFRICA = "wireless-data-quota1-africa" + WIRELESS_DATA_QUOTA1_ASIA = "wireless-data-quota1-asia" + WIRELESS_DATA_QUOTA1_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota1-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA1_EUROPE = "wireless-data-quota1-europe" + WIRELESS_DATA_QUOTA1_NORTHAMERICA = "wireless-data-quota1-northamerica" + WIRELESS_DATA_QUOTA1_OCEANIA = "wireless-data-quota1-oceania" + WIRELESS_DATA_QUOTA10 = "wireless-data-quota10" + WIRELESS_DATA_QUOTA10_AFRICA = "wireless-data-quota10-africa" + WIRELESS_DATA_QUOTA10_ASIA = "wireless-data-quota10-asia" + WIRELESS_DATA_QUOTA10_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota10-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA10_EUROPE = "wireless-data-quota10-europe" + WIRELESS_DATA_QUOTA10_NORTHAMERICA = "wireless-data-quota10-northamerica" + WIRELESS_DATA_QUOTA10_OCEANIA = "wireless-data-quota10-oceania" + WIRELESS_DATA_QUOTA50 = "wireless-data-quota50" + WIRELESS_DATA_QUOTA50_AFRICA = "wireless-data-quota50-africa" + WIRELESS_DATA_QUOTA50_ASIA = "wireless-data-quota50-asia" + WIRELESS_DATA_QUOTA50_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota50-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA50_EUROPE = "wireless-data-quota50-europe" + WIRELESS_DATA_QUOTA50_NORTHAMERICA = "wireless-data-quota50-northamerica" + WIRELESS_DATA_QUOTA50_OCEANIA = "wireless-data-quota50-oceania" + WIRELESS_DATA_QUOTACUSTOM = "wireless-data-quotacustom" + WIRELESS_DATA_QUOTACUSTOM_AFRICA = "wireless-data-quotacustom-africa" + WIRELESS_DATA_QUOTACUSTOM_ASIA = "wireless-data-quotacustom-asia" + WIRELESS_DATA_QUOTACUSTOM_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quotacustom-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_EUROPE = "wireless-data-quotacustom-europe" + WIRELESS_DATA_QUOTACUSTOM_NORTHAMERICA = ( + "wireless-data-quotacustom-northamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_OCEANIA = "wireless-data-quotacustom-oceania" + WIRELESS_MRC_PAYG = "wireless-mrc-payg" + WIRELESS_MRC_QUOTA1 = "wireless-mrc-quota1" + WIRELESS_MRC_QUOTA10 = "wireless-mrc-quota10" + WIRELESS_MRC_QUOTA50 = "wireless-mrc-quota50" + WIRELESS_MRC_QUOTACUSTOM = "wireless-mrc-quotacustom" WIRELESS_ORDERS = "wireless-orders" WIRELESS_ORDERS_ARTWORK = "wireless-orders-artwork" WIRELESS_ORDERS_BULK = "wireless-orders-bulk" WIRELESS_ORDERS_ESIM = "wireless-orders-esim" WIRELESS_ORDERS_STARTER = "wireless-orders-starter" + WIRELESS_QUOTAS = "wireless-quotas" + WIRELESS_SMS_AFRICA = "wireless-sms-africa" + WIRELESS_SMS_ASIA = "wireless-sms-asia" + WIRELESS_SMS_CENTRALANDSOUTHAMERICA = "wireless-sms-centralandsouthamerica" + WIRELESS_SMS_EUROPE = "wireless-sms-europe" + WIRELESS_SMS_NORTHAMERICA = "wireless-sms-northamerica" + WIRELESS_SMS_OCEANIA = "wireless-sms-oceania" + WIRELESS_SUPER_SIM = "wireless-super-sim" + WIRELESS_SUPER_SIM_DATA = "wireless-super-sim-data" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA_USA = ( + "wireless-super-sim-data-north-america-usa" + ) + WIRELESS_SUPER_SIM_DATA_PAYG = "wireless-super-sim-data-payg" + WIRELESS_SUPER_SIM_DATA_PAYG_EUROPE = "wireless-super-sim-data-payg-europe" + WIRELESS_SUPER_SIM_DATA_PAYG_NORTH_AMERICA = ( + "wireless-super-sim-data-payg-north-america" + ) + WIRELESS_SUPER_SIM_HARDWARE = "wireless-super-sim-hardware" + WIRELESS_SUPER_SIM_HARDWARE_BULK = "wireless-super-sim-hardware-bulk" + WIRELESS_SUPER_SIM_SMSCOMMANDS = "wireless-super-sim-smscommands" + WIRELESS_SUPER_SIM_SMSCOMMANDS_AFRICA = "wireless-super-sim-smscommands-africa" + WIRELESS_SUPER_SIM_SMSCOMMANDS_ASIA = "wireless-super-sim-smscommands-asia" + WIRELESS_SUPER_SIM_SMSCOMMANDS_CENT_AND_SOUTH_AMERICA = ( + "wireless-super-sim-smscommands-cent-and-south-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_EUROPE = "wireless-super-sim-smscommands-europe" + WIRELESS_SUPER_SIM_SMSCOMMANDS_NORTH_AMERICA = ( + "wireless-super-sim-smscommands-north-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_OCEANIA = ( + "wireless-super-sim-smscommands-oceania" + ) + WIRELESS_SUPER_SIM_SUBSCRIPTION = "wireless-super-sim-subscription" + WIRELESS_SUPER_SIM_SUBSCRIPTION_PAYG = "wireless-super-sim-subscription-payg" WIRELESS_USAGE = "wireless-usage" WIRELESS_USAGE_COMMANDS = "wireless-usage-commands" WIRELESS_USAGE_COMMANDS_AFRICA = "wireless-usage-commands-africa" @@ -356,6 +664,184 @@ class Category(object): WIRELESS_USAGE_MRC_SUSPENDED = "wireless-usage-mrc-suspended" WIRELESS_USAGE_SMS = "wireless-usage-sms" WIRELESS_USAGE_VOICE = "wireless-usage-voice" + A2P_FAST_TRACK_ONBOARDING = "a2p-fast-track-onboarding" + ADVISORY_SERVICES = "advisory-services" + ADVISORY_SERVICES_BILLED = "advisory-services-billed" + ADVISORY_SERVICES_CALL_TRACKING = "advisory-services-call-tracking" + ADVISORY_SERVICES_DATA_SERVICES = "advisory-services-data-services" + ADVISORY_SERVICES_EXPENSES = "advisory-services-expenses" + ADVISORY_SERVICES_SIP_TRUNKING = "advisory-services-sip-trunking" + ASSETS_REQUESTS = "assets-requests" + AUDIENCE_MINUTES_VIDEO = "audience-minutes-video" + AUTHY_BUCKET_ADJUSTMENT = "authy-bucket-adjustment" + AUTHY_SOFTWARE = "authy-software" + CALLERIDLOOKUPS_API = "calleridlookups-api" + CALLERIDLOOKUPS_PROGRAMMABLEVOICE = "calleridlookups-programmablevoice" + CALLERIDLOOKUPS_TRUNKING = "calleridlookups-trunking" + CALLS_TRUNKING_INBOUND_TOLLFREE_LOCAL = "calls-trunking-inbound-tollfree-local" + CALLS_TRUNKING_INBOUND_TOLLFREE_MOBILE = ( + "calls-trunking-inbound-tollfree-mobile" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE_1 = "channels-whatsapp-conversation-free-1" + CONFERENCE = "conference" + CONVERSATIONAL_INSIGHTS = "conversational-insights" + CONVERSATIONAL_INSIGHTS_MESSAGES = "conversational-insights-messages" + CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = "conversational-insights-voice-minutes" + DEMO = "demo" + DEMO_UC_SCRIPT_TEST = "demo-uc-script-test" + ELASTIC_SIP_TRUNKING = "elastic-sip-trunking" + ELASTIC_SIP_TRUNKING_CALL_TRANSFERS = "elastic-sip-trunking-call-transfers" + ENTERPRISE_HIPPA = "enterprise-hippa" + FLEX_NAMED_USERS = "flex-named-users" + FLEX_SPINSCI = "flex-spinsci" + FLEX_USERS_1 = "flex-users-1" + FLEX_WFO_PREMIUM_SPEECH_ANALYTICS = "flex-wfo-premium-speech-analytics" + FLEX_XCELERATE = "flex-xcelerate" + FUNCTIONS_ROLLUP = "functions-rollup" + IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING_ADDONS = "ip-messaging-addons" + IVR = "ivr" + IVR_CONVERSATIONAL = "ivr-conversational" + IVR_DTMF = "ivr-dtmf" + IVR_VIRTUALAGENT = "ivr-virtualagent" + LIVE = "live" + LIVE_MEDIA_RECORDING_MINUTES = "live-media-recording-minutes" + LONGCODE_MPS = "longcode-mps" + MARKETPLACE_ANALYTICS_ADDONS = "marketplace-analytics-addons" + MARKETPLACE_ISV_ADDONS = "marketplace-isv-addons" + MARKETPLACE_MESSAGING_ADDONS = "marketplace-messaging-addons" + MARKETPLACE_PHONENUMBERS_ADDONS = "marketplace-phonenumbers-addons" + MARKETPLACE_RECORDING_ADDONS = "marketplace-recording-addons" + MARKETPLACE_VIRTUALAGENT_ADDONS = "marketplace-virtualagent-addons" + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR_1 = ( + "marketplay-pay-addons-shuttle-pay-connector-1" + ) + MARKETPLAY_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplay-pay-addons-stripe-pay-connector" + ) + MMS_INBOUND_LONGCODE_CANADA = "mms-inbound-longcode-canada" + MMS_INBOUND_LONGCODE_UNITEDSTATES = "mms-inbound-longcode-unitedstates" + MMS_OUTBOUND_LONGCODE_CANADA = "mms-outbound-longcode-canada" + MMS_OUTBOUND_LONGCODE_UNITEDSTATES = "mms-outbound-longcode-unitedstates" + MMS_OUTBOUND_TOLL_FREE = "mms-outbound-toll-free" + NOTIFY_CHATAPPSANDOTHERCHANNELS = "notify-chatappsandotherchannels" + NOTIFY_NOTIFYSERVICES = "notify-notifyservices" + NOTIFY_PUSHNOTIFICATIONS = "notify-pushnotifications" + PAYMENT_GATEWAY_CONNECTORS = "payment-gateway-connectors" + PAYMENT_SOLUTIONS = "payment-solutions" + PCHAT_BUCKET_ADJUSTMENT = "pchat-bucket-adjustment" + PHONENUMBERS_NUMBERS = "phonenumbers-numbers" + PROG_VOICE_CLIENT_ANDROID = "prog-voice-client-android" + PROG_VOICE_CLIENT_ANDROID_INBOUND = "prog-voice-client-android-inbound" + PROG_VOICE_CLIENT_ANDROID_OUTBOUND = "prog-voice-client-android-outbound" + PROG_VOICE_CLIENT_IOS = "prog-voice-client-ios" + PROG_VOICE_CLIENT_IOS_INBOUND = "prog-voice-client-ios-inbound" + PROG_VOICE_CLIENT_IOS_OUTBOUND = "prog-voice-client-ios-outbound" + PROG_VOICE_CLIENT_SDK = "prog-voice-client-sdk" + PROG_VOICE_CLIENT_WEB = "prog-voice-client-web" + PROG_VOICE_CLIENT_WEB_INBOUND = "prog-voice-client-web-inbound" + PROG_VOICE_CLIENT_WEB_OUTBOUND = "prog-voice-client-web-outbound" + PROGRAMMABLEVOICECONNECTIVITY_MEDIA_STREAMS = ( + "programmablevoiceconnectivity-media-streams" + ) + PSTNCONNECTIVITY_BYOC = "pstnconnectivity-byoc" + PSTNCONNECTIVITY_EMERGENCY = "pstnconnectivity-emergency" + PSTNCONNECTIVITY_MINUTES = "pstnconnectivity-minutes" + PSTNCONNECTIVITY_MINUTES_1 = "pstnconnectivity-minutes-1" + PSTNCONNECTIVITY_MINUTESINBOUNDLOCAL = "pstnconnectivity-minutesinboundlocal" + PSTNCONNECTIVITY_MINUTESINBOUNDMOBILE = "pstnconnectivity-minutesinboundmobile" + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREE = ( + "pstnconnectivity-minutesinboundtollfree" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREELOCAL = ( + "pstnconnectivity-minutesinboundtollfreelocal" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREEMOBILE = ( + "pstnconnectivity-minutesinboundtollfreemobile" + ) + PV_ROOM_HOURS = "pv-room-hours" + PV_ROOM_SIMULTANEOUS_PARTICIPANT_CONNECTIONS = ( + "pv-room-simultaneous-participant-connections" + ) + PVIDEO_ROOM_HOURS_AU1 = "pvideo-room-hours-au1" + PVIDEO_ROOM_HOURS_BR1 = "pvideo-room-hours-br1" + PVIDEO_ROOM_HOURS_IE1 = "pvideo-room-hours-ie1" + PVIDEO_ROOM_HOURS_JP1 = "pvideo-room-hours-jp1" + PVIDEO_ROOM_HOURS_SG1 = "pvideo-room-hours-sg1" + PVIDEO_ROOM_HOURS_US1 = "pvideo-room-hours-us1" + PVIDEO_ROOM_HOURS_US2 = "pvideo-room-hours-us2" + RECORDINGS_ENCRYPTED = "recordings-encrypted" + SHORT_CODE_SETUP_FEES = "short-code-setup-fees" + SHORTCODES_MESSAGES_INBOUND = "shortcodes-messages-inbound" + SHORTCODES_MESSAGES_OUTBOUND = "shortcodes-messages-outbound" + SMS_MESSAGES_REGISTRATIONFEES = "sms-messages-registrationfees" + SMS_MMS_PENALTY_FEES = "sms-mms-penalty-fees" + SMS_MMS_PENALTY_FEES_1 = "sms-mms-penalty-fees-1" + SMS_PUMPING_PROTECTION_NON_USCA = "sms-pumping-protection-non-usca" + SMS_PUMPING_PROTECTION_USCA = "sms-pumping-protection-usca" + STUDIO = "studio" + STUDIO_MONTHLY_FEES = "studio-monthly-fees" + SUPERSIM = "supersim" + TASK_ROUTER = "task-router" + TASK_ROUTER_WORKERS = "task-router-workers" + TEST_QUOTA_BUCKETS = "test-quota-buckets" + TEST_UC_SCRIPT_1 = "test-uc-script-1" + TEST_UC_SCRIPT_DEMO_2 = "test-uc-script-demo-2" + TEXT_TO_SPEECH = "text-to-speech" + TME = "tme" + TTS_BASIC = "tts-basic" + TWILIO_EDITIONS = "twilio-editions" + TWILIO_INTERCONNECT_CALIFORNIA = "twilio-interconnect-california" + TWILIO_INTERCONNECT_CALIFORNIA_MONTHLY = ( + "twilio-interconnect-california-monthly" + ) + TWILIO_INTERCONNECT_CALIFORNIA_SETUP = "twilio-interconnect-california-setup" + TWILIO_INTERCONNECT_FRANKFURT = "twilio-interconnect-frankfurt" + TWILIO_INTERCONNECT_FRANKFURT_MO = "twilio-interconnect-frankfurt-mo" + TWILIO_INTERCONNECT_FRANKFURT_SETUP = "twilio-interconnect-frankfurt-setup" + TWILIO_INTERCONNECT_LONDON = "twilio-interconnect-london" + TWILIO_INTERCONNECT_LONDON_MO = "twilio-interconnect-london-mo" + TWILIO_INTERCONNECT_LONDON_SETUP = "twilio-interconnect-london-setup" + TWILIO_INTERCONNECT_SAO_PAULO = "twilio-interconnect-sao-paulo" + TWILIO_INTERCONNECT_SAO_PAULO_MONTHLY = "twilio-interconnect-sao-paulo-monthly" + TWILIO_INTERCONNECT_SAO_PAULO_SETUP = "twilio-interconnect-sao-paulo-setup" + TWILIO_INTERCONNECT_SINGAPORE = "twilio-interconnect-singapore" + TWILIO_INTERCONNECT_SINGAPORE_MO = "twilio-interconnect-singapore-mo" + TWILIO_INTERCONNECT_SINGAPORE_SETUP = "twilio-interconnect-singapore-setup" + TWILIO_INTERCONNECT_SYDNEY = "twilio-interconnect-sydney" + TWILIO_INTERCONNECT_SYDNEY_MO = "twilio-interconnect-sydney-mo" + TWILIO_INTERCONNECT_SYDNEY_SETUP = "twilio-interconnect-sydney-setup" + TWILIO_INTERCONNECT_TOKYO = "twilio-interconnect-tokyo" + TWILIO_INTERCONNECT_TOKYO_MO = "twilio-interconnect-tokyo-mo" + TWILIO_INTERCONNECT_TOKYO_SETUP = "twilio-interconnect-tokyo-setup" + TWILIO_INTERCONNECT_VA = "twilio-interconnect-va" + TWILIO_INTERCONNECT_VA_MO = "twilio-interconnect-va-mo" + TWILIO_INTERCONNECT_VA_SETUP = "twilio-interconnect-va-setup" + TWIML_VERBS = "twiml-verbs" + TWIML_VERBS_SAY = "twiml-verbs-say" + USAGE_PROGRAMMABLE_MESSAGING_ENGAGEMENT_SUITE = ( + "usage-programmable-messaging-engagement-suite" + ) + USAGE_PROGRAMMABLE_MESSAGING_FEES_SERVICES = ( + "usage-programmable-messaging-fees-services" + ) + VERIFY_OUTBOUND_EMAIL = "verify-outbound-email" + VERIFY_PACKAGED_PLANS = "verify-packaged-plans" + VERIFY_SILENT_NETWORK_AUTH = "verify-silent-network-auth" + VERIFY_VOICE_AND_SMS = "verify-voice-and-sms" + VOICE_INSIGHTS_CLIENT_INSIGHTS_MONTHY_COMMIT = ( + "voice-insights-client-insights-monthy-commit" + ) + WIRELESS_DATA_PAYG_ASIA_AFG = "wireless-data-payg-asia-afg" + WIRELESS_MULTI_IMSI_SIM_COMMANDS = "wireless-multi-imsi-sim-commands" + WIRELESS_MULTI_IMSI_SIM_COMMANDS_USA = "wireless-multi-imsi-sim-commands-usa" + WIRELESS_MULTI_IMSI_SIM_DATA = "wireless-multi-imsi-sim-data" + WIRELESS_MULTI_IMSI_SIM_DATA_EU28 = "wireless-multi-imsi-sim-data-eu28" + WIRELESS_MULTI_IMSI_SIM_DATA_USA = "wireless-multi-imsi-sim-data-usa" + WIRELESS_MULTI_IMSI_SIM_MONTHLY_FEES = "wireless-multi-imsi-sim-monthly-fees" + WIRELESS_MULTI_IMSI_SIM_USAGE = "wireless-multi-imsi-sim-usage" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA = "wireless-super-sim-data-north-america" + WIRELESS_SUPER_SIM_USAGE = "wireless-super-sim-usage" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. diff --git a/twilio/rest/api/v2010/account/usage/record/all_time.py b/twilio/rest/api/v2010/account/usage/record/all_time.py index 56145d98a9..991f4a0b70 100644 --- a/twilio/rest/api/v2010/account/usage/record/all_time.py +++ b/twilio/rest/api/v2010/account/usage/record/all_time.py @@ -25,33 +25,101 @@ class AllTimeInstance(InstanceResource): class Category(object): + A2P_10DLC_REGISTRATIONFEES_BRANDREGISTRATION = ( + "a2p-10dlc-registrationfees-brandregistration" + ) + A2P_10DLC_REGISTRATIONFEES_BV = "a2p-10dlc-registrationfees-bv" + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNCHARGES = ( + "a2p-10dlc-registrationfees-campaigncharges" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNREGISTRATION = ( + "a2p-10dlc-registrationfees-campaignregistration" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNVETTING = ( + "a2p-10dlc-registrationfees-campaignvetting" + ) + A2P_10DLC_REGISTRATIONFEES_MONTHLY = "a2p-10dlc-registrationfees-monthly" + A2P_10DLC_REGISTRATIONFEES_ONETIME = "a2p-10dlc-registrationfees-onetime" A2P_REGISTRATION_FEES = "a2p-registration-fees" + ACCOUNT_SECURITY = "account-security" AGENT_CONFERENCE = "agent-conference" + AGENT_COPILOT = "agent-copilot" + AGENT_COPILOT_MESSAGES = "agent-copilot-messages" + AGENT_COPILOT_PARTICIPANT_MINUTES = "agent-copilot-participant-minutes" + AI_ASSISTANTS = "ai-assistants" + AI_ASSISTANTS_VOICE = "ai-assistants-voice" AMAZON_POLLY = "amazon-polly" ANSWERING_MACHINE_DETECTION = "answering-machine-detection" + ASSETS = "assets" + AUDIENCE_MINUTES = "audience-minutes" + AUDIENCE_MINUTES_AUDIO = "audience-minutes-audio" AUTHY_AUTHENTICATIONS = "authy-authentications" AUTHY_CALLS_OUTBOUND = "authy-calls-outbound" + AUTHY_EMAIL_AUTHENTICATIONS = "authy-email-authentications" AUTHY_MONTHLY_FEES = "authy-monthly-fees" + AUTHY_OUTBOUND_EMAIL = "authy-outbound-email" AUTHY_PHONE_INTELLIGENCE = "authy-phone-intelligence" AUTHY_PHONE_VERIFICATIONS = "authy-phone-verifications" AUTHY_SMS_OUTBOUND = "authy-sms-outbound" + AUTHY_VERIFY_EMAIL_VERIFICATIONS = "authy-verify-email-verifications" + AUTHY_VERIFY_OUTBOUND_EMAIL = "authy-verify-outbound-email" + AUTOPILOT = "autopilot" + AUTOPILOT_HOME_ASSISTANTS = "autopilot-home-assistants" + AUTOPILOT_MESSAGING = "autopilot-messaging" + AUTOPILOT_OTHER = "autopilot-other" + AUTOPILOT_VOICE = "autopilot-voice" + BASIC_PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( + "basic-peer-to-peer-rooms-participant-minutes" + ) + BRANDED_CALLING = "branded-calling" + BUNDLE_SMS_BUCKET = "bundle-sms-bucket" + BUNDLE_SUBSCRIPTION_FEES = "bundle-subscription-fees" + CALL_FORWARDING_LOOKUPS = "call-forwarding-lookups" CALL_PROGESS_EVENTS = "call-progess-events" CALLERIDLOOKUPS = "calleridlookups" CALLS = "calls" CALLS_CLIENT = "calls-client" + CALLS_EMERGENCY = "calls-emergency" CALLS_GLOBALCONFERENCE = "calls-globalconference" CALLS_INBOUND = "calls-inbound" CALLS_INBOUND_LOCAL = "calls-inbound-local" CALLS_INBOUND_MOBILE = "calls-inbound-mobile" CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree" + CALLS_INBOUND_TOLLFREE_LOCAL = "calls-inbound-tollfree-local" + CALLS_INBOUND_TOLLFREE_MOBILE = "calls-inbound-tollfree-mobile" + CALLS_MEDIA_STREAM_MINUTES = "calls-media-stream-minutes" CALLS_OUTBOUND = "calls-outbound" CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions" CALLS_RECORDINGS = "calls-recordings" CALLS_SIP = "calls-sip" CALLS_SIP_INBOUND = "calls-sip-inbound" CALLS_SIP_OUTBOUND = "calls-sip-outbound" + CALLS_TEXT_TO_SPEECH = "calls-text-to-speech" CALLS_TRANSFERS = "calls-transfers" CARRIER_LOOKUPS = "carrier-lookups" + CATEGORY = "category" + CHANNELS = "channels" + CHANNELS_MESSAGING = "channels-messaging" + CHANNELS_MESSAGING_INBOUND = "channels-messaging-inbound" + CHANNELS_MESSAGING_OUTBOUND = "channels-messaging-outbound" + CHANNELS_WHATSAPP = "channels-whatsapp" + CHANNELS_WHATSAPP_CONVERSATION_AUTHENTICATION = ( + "channels-whatsapp-conversation-authentication" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE = "channels-whatsapp-conversation-free" + CHANNELS_WHATSAPP_CONVERSATION_MARKETING = ( + "channels-whatsapp-conversation-marketing" + ) + CHANNELS_WHATSAPP_CONVERSATION_SERVICE = ( + "channels-whatsapp-conversation-service" + ) + CHANNELS_WHATSAPP_CONVERSATION_UTILITY = ( + "channels-whatsapp-conversation-utility" + ) + CHANNELS_WHATSAPP_INBOUND = "channels-whatsapp-inbound" + CHANNELS_WHATSAPP_OUTBOUND = "channels-whatsapp-outbound" + CHAT_VIRTUAL_AGENT = "chat-virtual-agent" + CONVERSATION_RELAY = "conversation-relay" CONVERSATIONS = "conversations" CONVERSATIONS_API_REQUESTS = "conversations-api-requests" CONVERSATIONS_CONVERSATION_EVENTS = "conversations-conversation-events" @@ -60,8 +128,40 @@ class Category(object): CONVERSATIONS_PARTICIPANT_EVENTS = "conversations-participant-events" CONVERSATIONS_PARTICIPANTS = "conversations-participants" CPS = "cps" + CREDIT_TRANSFER = "credit-transfer" + EMAIL = "email" + EMERGING_TECH = "emerging-tech" + ENGAGEMENT_SUITE_PACKAGED_PLANS = "engagement-suite-packaged-plans" + ENHANCED_LINE_TYPE_LOOKUPS = "enhanced-line-type-lookups" + ENTERPRISE = "enterprise" + EVENTS = "events" + EXPERIMENT_FRANCE_SMS = "experiment-france-sms" + EXPERIMENT_INDIA_SMS = "experiment-india-sms" + EXPERIMENT_UK_SMS = "experiment-uk-sms" + FAILED_MESSAGE_PROCESSING_FEE = "failed-message-processing-fee" + FLEX = "flex" + FLEX_ACTIVE_USER_HOURS = "flex-active-user-hours" + FLEX_CONCURRENT_USERS = "flex-concurrent-users" + FLEX_CONVERSATIONAL_INSIGHTS = "flex-conversational-insights" + FLEX_CONVERSATIONAL_INSIGHTS_MESSAGES = "flex-conversational-insights-messages" + FLEX_CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = ( + "flex-conversational-insights-voice-minutes" + ) + FLEX_EMAIL_USAGE = "flex-email-usage" + FLEX_MESSAGING_USAGE = "flex-messaging-usage" + FLEX_PARTNER_SPINSCI = "flex-partner-spinsci" + FLEX_PARTNER_XCELERATE = "flex-partner-xcelerate" + FLEX_RESELLER_ECOSYSTEM = "flex-reseller-ecosystem" + FLEX_UNIQUE_USER = "flex-unique-user" FLEX_USAGE = "flex-usage" + FLEX_USERS = "flex-users" + FLEX_VOICE_MINUTE = "flex-voice-minute" + FLEX_YTICA = "flex-ytica" FRAUD_LOOKUPS = "fraud-lookups" + FRONTLINE = "frontline" + FRONTLINE_USERS = "frontline-users" + FUNCTIONS = "functions" + GENERIC_PAY_TRANSACTIONS = "generic-pay-transactions" GROUP_ROOMS = "group-rooms" GROUP_ROOMS_DATA_TRACK = "group-rooms-data-track" GROUP_ROOMS_ENCRYPTED_MEDIA_RECORDED = "group-rooms-encrypted-media-recorded" @@ -71,9 +171,17 @@ class Category(object): GROUP_ROOMS_MEDIA_STORED = "group-rooms-media-stored" GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" - IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING = "ip-messaging" + IP_MESSAGING_COMMANDS = "ip-messaging-commands" + IP_MESSAGING_DATA_STORAGE = "ip-messaging-data-storage" + IP_MESSAGING_DATA_TRANSFER = "ip-messaging-data-transfer" + IP_MESSAGING_ENDPOINT_CONNECTIVITY = "ip-messaging-endpoint-connectivity" IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" + LINE_STATUS_LOOKUPS = "line-status-lookups" + LIVE_ACTIVITY_LOOKUPS = "live-activity-lookups" + LOOKUP_BUCKET_ADJUSTMENT = "lookup-bucket-adjustment" + LOOKUP_IDENTITY_MATCH = "lookup-identity-match" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( @@ -84,6 +192,13 @@ class Category(object): MARKETPLACE_CAPIO_SPEECH_TO_TEXT = "marketplace-capio-speech-to-text" MARKETPLACE_CONVRIZA_ABABA = "marketplace-convriza-ababa" MARKETPLACE_DEEPGRAM_PHRASE_DETECTOR = "marketplace-deepgram-phrase-detector" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION = "marketplace-deepgram-transcription" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION_BASE = ( + "marketplace-deepgram-transcription-base" + ) + MARKETPLACE_DEEPGRAM_TRANSSCRIPTION_ENHANCED = ( + "marketplace-deepgram-transscription-enhanced" + ) MARKETPLACE_DIGITAL_SEGMENT_BUSINESS_INFO = ( "marketplace-digital-segment-business-info" ) @@ -109,6 +224,9 @@ class Category(object): "marketplace-keen-io-contact-center-analytics" ) MARKETPLACE_MARCHEX_CLEANCALL = "marketplace-marchex-cleancall" + MARKETPLACE_MARCHEX_RECORDING_ANALYSIS = ( + "marketplace-marchex-recording-analysis" + ) MARKETPLACE_MARCHEX_SENTIMENT_ANALYSIS_FOR_SMS = ( "marketplace-marchex-sentiment-analysis-for-sms" ) @@ -125,14 +243,42 @@ class Category(object): "marketplace-nextcaller-advanced-caller-identification" ) MARKETPLACE_NOMOROBO_SPAM_SCORE = "marketplace-nomorobo-spam-score" + MARKETPLACE_PAY_ADDONS = "marketplace-pay-addons" + MARKETPLACE_PAY_ADDONS_BASECOMMERCE_PAY_CONNECTOR = ( + "marketplace-pay-addons-basecommerce-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_BRAINTREE_PAY_CONNECTOR = ( + "marketplace-pay-addons-braintree-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CARDCONNECT_PAY_CONNECTOR = ( + "marketplace-pay-addons-cardconnect-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CHASE_PAY_CONNECTOR = ( + "marketplace-pay-addons-chase-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplace-pay-addons-shuttle-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplace-pay-addons-stripe-pay-connector" + ) MARKETPLACE_PAYFONE_TCPA_COMPLIANCE = "marketplace-payfone-tcpa-compliance" + MARKETPLACE_POLY_AI_CONNECTOR = "marketplace-poly-ai-connector" + MARKETPLACE_REALPHONEVALIDATION = "marketplace-realphonevalidation" MARKETPLACE_REMEETING_AUTOMATIC_SPEECH_RECOGNITION = ( "marketplace-remeeting-automatic-speech-recognition" ) + MARKETPLACE_SPOKE_PHONE_LICENSE_PRO = "marketplace-spoke-phone-license-pro" + MARKETPLACE_SPOKE_PHONE_LICENSE_STANDARD = ( + "marketplace-spoke-phone-license-standard" + ) MARKETPLACE_TCPA_DEFENSE_SOLUTIONS_BLACKLIST_FEED = ( "marketplace-tcpa-defense-solutions-blacklist-feed" ) MARKETPLACE_TELO_OPENCNAM = "marketplace-telo-opencnam" + MARKETPLACE_TRESTLE_SOLUTIONS_CALLER_IDENTIFICATION = ( + "marketplace-trestle-solutions-caller-identification" + ) MARKETPLACE_TRUECNAM_TRUE_SPAM = "marketplace-truecnam-true-spam" MARKETPLACE_TWILIO_CALLER_NAME_LOOKUP_US = ( "marketplace-twilio-caller-name-lookup-us" @@ -145,6 +291,9 @@ class Category(object): MARKETPLACE_VOICEBASE_TRANSCRIPTION_CUSTOM_VOCABULARY = ( "marketplace-voicebase-transcription-custom-vocabulary" ) + MARKETPLACE_WEB_PURIFY_PROFANITY_FILTER = ( + "marketplace-web-purify-profanity-filter" + ) MARKETPLACE_WHITEPAGES_PRO_CALLER_IDENTIFICATION = ( "marketplace-whitepages-pro-caller-identification" ) @@ -159,15 +308,23 @@ class Category(object): MARKETPLACE_YTICA_CONTACT_CENTER_REPORTING_ANALYTICS = ( "marketplace-ytica-contact-center-reporting-analytics" ) + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplay-pay-addons-shuttle-pay-connector" + ) + MEDIA_COMPOSER_MINUTES = "media-composer-minutes" MEDIASTORAGE = "mediastorage" + MIN_SPEND_ADJUSTMENTS = "min-spend-adjustments" MMS = "mms" MMS_INBOUND = "mms-inbound" MMS_INBOUND_LONGCODE = "mms-inbound-longcode" MMS_INBOUND_SHORTCODE = "mms-inbound-shortcode" + MMS_INBOUND_TOLL_FREE = "mms-inbound-toll-free" MMS_MESSAGES_CARRIERFEES = "mms-messages-carrierfees" MMS_OUTBOUND = "mms-outbound" MMS_OUTBOUND_LONGCODE = "mms-outbound-longcode" MMS_OUTBOUND_SHORTCODE = "mms-outbound-shortcode" + MMS_OUTBOUND_TOLLFREE = "mms-outbound-tollfree" + MONITOR = "monitor" MONITOR_READS = "monitor-reads" MONITOR_STORAGE = "monitor-storage" MONITOR_WRITES = "monitor-writes" @@ -176,6 +333,12 @@ class Category(object): NOTIFY_CHANNELS = "notify-channels" NUMBER_FORMAT_LOOKUPS = "number-format-lookups" PCHAT = "pchat" + PCHAT_ACTIONS = "pchat-actions" + PCHAT_APS = "pchat-aps" + PCHAT_CONV_MED_STORAGE = "pchat-conv-med-storage" + PCHAT_MESSAGES = "pchat-messages" + PCHAT_NOTIFICATIONS = "pchat-notifications" + PCHAT_READS = "pchat-reads" PCHAT_USERS = "pchat-users" PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( "peer-to-peer-rooms-participant-minutes" @@ -185,18 +348,41 @@ class Category(object): PFAX_MINUTES_INBOUND = "pfax-minutes-inbound" PFAX_MINUTES_OUTBOUND = "pfax-minutes-outbound" PFAX_PAGES = "pfax-pages" + PHONE_QUALITY_SCORE_LOOKUPS = "phone-quality-score-lookups" PHONENUMBERS = "phonenumbers" PHONENUMBERS_CPS = "phonenumbers-cps" PHONENUMBERS_EMERGENCY = "phonenumbers-emergency" PHONENUMBERS_LOCAL = "phonenumbers-local" PHONENUMBERS_MOBILE = "phonenumbers-mobile" + PHONENUMBERS_PORTING = "phonenumbers-porting" PHONENUMBERS_SETUPS = "phonenumbers-setups" PHONENUMBERS_TOLLFREE = "phonenumbers-tollfree" PREMIUMSUPPORT = "premiumsupport" + PREMIUMSUPPORT_PERCENTAGE_SPEND = "premiumsupport-percentage-spend" + PROGRAMMABLEVOICE_PLATFORM = "programmablevoice-platform" + PROGRAMMABLEVOICECONN_CLIENTSDK = "programmablevoiceconn-clientsdk" + PROGRAMMABLEVOICECONN_CLIENTSDK_INBOUND = ( + "programmablevoiceconn-clientsdk-inbound" + ) + PROGRAMMABLEVOICECONN_CLIENTSDK_OUTBOUND = ( + "programmablevoiceconn-clientsdk-outbound" + ) + PROGRAMMABLEVOICECONN_ONNET = "programmablevoiceconn-onnet" + PROGRAMMABLEVOICECONN_ONNET_INBOUND = "programmablevoiceconn-onnet-inbound" + PROGRAMMABLEVOICECONN_ONNET_OUTBOUND = "programmablevoiceconn-onnet-outbound" + PROGRAMMABLEVOICECONN_SIP = "programmablevoiceconn-sip" + PROGRAMMABLEVOICECONN_SIP_INBOUND = "programmablevoiceconn-sip-inbound" + PROGRAMMABLEVOICECONN_SIP_OUTBOUND = "programmablevoiceconn-sip-outbound" + PROGRAMMABLEVOICECONNECTIVITY = "programmablevoiceconnectivity" PROXY = "proxy" PROXY_ACTIVE_SESSIONS = "proxy-active-sessions" + PROXY_BUCKET_ADJUSTMENT = "proxy-bucket-adjustment" + PROXY_LICENSES = "proxy-licenses" PSTNCONNECTIVITY = "pstnconnectivity" + PSTNCONNECTIVITY_INBOUND = "pstnconnectivity-inbound" + PSTNCONNECTIVITY_OUTBOUND = "pstnconnectivity-outbound" PV = "pv" + PV_BASIC_ROOMS = "pv-basic-rooms" PV_COMPOSITION_MEDIA_DOWNLOADED = "pv-composition-media-downloaded" PV_COMPOSITION_MEDIA_ENCRYPTED = "pv-composition-media-encrypted" PV_COMPOSITION_MEDIA_STORED = "pv-composition-media-stored" @@ -212,18 +398,20 @@ class Category(object): PV_ROOM_PARTICIPANTS_US2 = "pv-room-participants-us2" PV_ROOMS = "pv-rooms" PV_SIP_ENDPOINT_REGISTRATIONS = "pv-sip-endpoint-registrations" + RCS_MESSAGES = "rcs-messages" + REASSIGNED_NUMBER = "reassigned-number" RECORDINGS = "recordings" RECORDINGSTORAGE = "recordingstorage" - ROOMS_GROUP_BANDWIDTH = "rooms-group-bandwidth" - ROOMS_GROUP_MINUTES = "rooms-group-minutes" - ROOMS_PEER_TO_PEER_MINUTES = "rooms-peer-to-peer-minutes" SHORTCODES = "shortcodes" SHORTCODES_CUSTOMEROWNED = "shortcodes-customerowned" SHORTCODES_MMS_ENABLEMENT = "shortcodes-mms-enablement" SHORTCODES_MPS = "shortcodes-mps" SHORTCODES_RANDOM = "shortcodes-random" + SHORTCODES_SETUP_FEES = "shortcodes-setup-fees" SHORTCODES_UK = "shortcodes-uk" SHORTCODES_VANITY = "shortcodes-vanity" + SIM_SWAP_LOOKUPS = "sim-swap-lookups" + SIP_SECURE_MEDIA = "sip-secure-media" SMALL_GROUP_ROOMS = "small-group-rooms" SMALL_GROUP_ROOMS_DATA_TRACK = "small-group-rooms-data-track" SMALL_GROUP_ROOMS_PARTICIPANT_MINUTES = "small-group-rooms-participant-minutes" @@ -231,13 +419,30 @@ class Category(object): SMS_INBOUND = "sms-inbound" SMS_INBOUND_LONGCODE = "sms-inbound-longcode" SMS_INBOUND_SHORTCODE = "sms-inbound-shortcode" + SMS_INBOUND_TOLLFREE = "sms-inbound-tollfree" SMS_MESSAGES_CARRIERFEES = "sms-messages-carrierfees" SMS_MESSAGES_FEATURES = "sms-messages-features" + SMS_MESSAGES_FEATURES_ENGAGEMENT_SUITE = ( + "sms-messages-features-engagement-suite" + ) + SMS_MESSAGES_FEATURES_MESSAGE_REDACTION = ( + "sms-messages-features-message-redaction" + ) SMS_MESSAGES_FEATURES_SENDERID = "sms-messages-features-senderid" + SMS_MPS = "sms-mps" + SMS_MPS_SHORTCODE = "sms-mps-shortcode" + SMS_MPS_TOLLFREE = "sms-mps-tollfree" + SMS_MPS_TOLLFREE_SETUP = "sms-mps-tollfree-setup" + SMS_NATIONAL_REGULATORY_PROTECTION = "sms-national-regulatory-protection" SMS_OUTBOUND = "sms-outbound" SMS_OUTBOUND_CONTENT_INSPECTION = "sms-outbound-content-inspection" SMS_OUTBOUND_LONGCODE = "sms-outbound-longcode" SMS_OUTBOUND_SHORTCODE = "sms-outbound-shortcode" + SMS_OUTBOUND_TOLLFREE = "sms-outbound-tollfree" + SMS_PUMPING_PROTECTION = "sms-pumping-protection" + SMS_PUMPING_RISK = "sms-pumping-risk" + SMSMESSAGES_BUCKET_ADJUSTMENTS = "smsmessages-bucket-adjustments" + SMSMESSAGES_OUTBOUND_DOMESTIC = "smsmessages-outbound-domestic" SPEECH_RECOGNITION = "speech-recognition" STUDIO_ENGAGEMENTS = "studio-engagements" SYNC = "sync" @@ -267,13 +472,27 @@ class Category(object): TURNMEGABYTES_SINGAPORE = "turnmegabytes-singapore" TURNMEGABYTES_USEAST = "turnmegabytes-useast" TURNMEGABYTES_USWEST = "turnmegabytes-uswest" + TWILIO_FOR_SALESFORCE = "twilio-for-salesforce" + TWILIO_FOR_SALESFORCE_LICENSES = "twilio-for-salesforce-licenses" TWILIO_INTERCONNECT = "twilio-interconnect" + TWIML = "twiml" + USAGE_FLEX_VIDEO = "usage-flex-video" + USAGE_FUNCTIONS = "usage-functions" + USAGE_RCS_BASIC_MESSAGES_OUTBOUND = "usage-rcs-basic-messages-outbound" + USAGE_RCS_MESSAGES = "usage-rcs-messages" + USAGE_RCS_MESSAGES_INBOUND = "usage-rcs-messages-inbound" + USAGE_RCS_MESSAGING_CARRIER_FEES = "usage-rcs-messaging-carrier-fees" + USAGE_RCS_SINGLE_MESSAGES_OUTBOUND = "usage-rcs-single-messages-outbound" + VERIFY_PACKAGE_PLANS = "verify-package-plans" VERIFY_PUSH = "verify-push" + VERIFY_SNA = "verify-sna" VERIFY_TOTP = "verify-totp" + VERIFY_VOICE_SMS = "verify-voice-sms" VERIFY_WHATSAPP_CONVERSATIONS_BUSINESS_INITIATED = ( "verify-whatsapp-conversations-business-initiated" ) VIDEO_RECORDINGS = "video-recordings" + VIDEO_ROOMS_TURN_MEGABYTES = "video-rooms-turn-megabytes" VIRTUAL_AGENT = "virtual-agent" VOICE_INSIGHTS = "voice-insights" VOICE_INSIGHTS_CLIENT_INSIGHTS_ON_DEMAND_MINUTE = ( @@ -289,14 +508,103 @@ class Category(object): "voice-insights-sip-trunking-insights-on-demand-minute" ) VOICE_INTELLIGENCE = "voice-intelligence" - VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + VOICE_INTELLIGENCE_EIP_OPERATORS = "voice-intelligence-eip-operators" VOICE_INTELLIGENCE_OPERATORS = "voice-intelligence-operators" + VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + WDS = "wds" WIRELESS = "wireless" + WIRELESS_DATA = "wireless-data" + WIRELESS_DATA_PAYG = "wireless-data-payg" + WIRELESS_DATA_PAYG_AFRICA = "wireless-data-payg-africa" + WIRELESS_DATA_PAYG_ASIA = "wireless-data-payg-asia" + WIRELESS_DATA_PAYG_CENTRALANDSOUTHAMERICA = ( + "wireless-data-payg-centralandsouthamerica" + ) + WIRELESS_DATA_PAYG_EUROPE = "wireless-data-payg-europe" + WIRELESS_DATA_PAYG_NORTHAMERICA = "wireless-data-payg-northamerica" + WIRELESS_DATA_PAYG_OCEANIA = "wireless-data-payg-oceania" + WIRELESS_DATA_QUOTA1 = "wireless-data-quota1" + WIRELESS_DATA_QUOTA1_AFRICA = "wireless-data-quota1-africa" + WIRELESS_DATA_QUOTA1_ASIA = "wireless-data-quota1-asia" + WIRELESS_DATA_QUOTA1_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota1-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA1_EUROPE = "wireless-data-quota1-europe" + WIRELESS_DATA_QUOTA1_NORTHAMERICA = "wireless-data-quota1-northamerica" + WIRELESS_DATA_QUOTA1_OCEANIA = "wireless-data-quota1-oceania" + WIRELESS_DATA_QUOTA10 = "wireless-data-quota10" + WIRELESS_DATA_QUOTA10_AFRICA = "wireless-data-quota10-africa" + WIRELESS_DATA_QUOTA10_ASIA = "wireless-data-quota10-asia" + WIRELESS_DATA_QUOTA10_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota10-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA10_EUROPE = "wireless-data-quota10-europe" + WIRELESS_DATA_QUOTA10_NORTHAMERICA = "wireless-data-quota10-northamerica" + WIRELESS_DATA_QUOTA10_OCEANIA = "wireless-data-quota10-oceania" + WIRELESS_DATA_QUOTA50 = "wireless-data-quota50" + WIRELESS_DATA_QUOTA50_AFRICA = "wireless-data-quota50-africa" + WIRELESS_DATA_QUOTA50_ASIA = "wireless-data-quota50-asia" + WIRELESS_DATA_QUOTA50_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota50-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA50_EUROPE = "wireless-data-quota50-europe" + WIRELESS_DATA_QUOTA50_NORTHAMERICA = "wireless-data-quota50-northamerica" + WIRELESS_DATA_QUOTA50_OCEANIA = "wireless-data-quota50-oceania" + WIRELESS_DATA_QUOTACUSTOM = "wireless-data-quotacustom" + WIRELESS_DATA_QUOTACUSTOM_AFRICA = "wireless-data-quotacustom-africa" + WIRELESS_DATA_QUOTACUSTOM_ASIA = "wireless-data-quotacustom-asia" + WIRELESS_DATA_QUOTACUSTOM_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quotacustom-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_EUROPE = "wireless-data-quotacustom-europe" + WIRELESS_DATA_QUOTACUSTOM_NORTHAMERICA = ( + "wireless-data-quotacustom-northamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_OCEANIA = "wireless-data-quotacustom-oceania" + WIRELESS_MRC_PAYG = "wireless-mrc-payg" + WIRELESS_MRC_QUOTA1 = "wireless-mrc-quota1" + WIRELESS_MRC_QUOTA10 = "wireless-mrc-quota10" + WIRELESS_MRC_QUOTA50 = "wireless-mrc-quota50" + WIRELESS_MRC_QUOTACUSTOM = "wireless-mrc-quotacustom" WIRELESS_ORDERS = "wireless-orders" WIRELESS_ORDERS_ARTWORK = "wireless-orders-artwork" WIRELESS_ORDERS_BULK = "wireless-orders-bulk" WIRELESS_ORDERS_ESIM = "wireless-orders-esim" WIRELESS_ORDERS_STARTER = "wireless-orders-starter" + WIRELESS_QUOTAS = "wireless-quotas" + WIRELESS_SMS_AFRICA = "wireless-sms-africa" + WIRELESS_SMS_ASIA = "wireless-sms-asia" + WIRELESS_SMS_CENTRALANDSOUTHAMERICA = "wireless-sms-centralandsouthamerica" + WIRELESS_SMS_EUROPE = "wireless-sms-europe" + WIRELESS_SMS_NORTHAMERICA = "wireless-sms-northamerica" + WIRELESS_SMS_OCEANIA = "wireless-sms-oceania" + WIRELESS_SUPER_SIM = "wireless-super-sim" + WIRELESS_SUPER_SIM_DATA = "wireless-super-sim-data" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA_USA = ( + "wireless-super-sim-data-north-america-usa" + ) + WIRELESS_SUPER_SIM_DATA_PAYG = "wireless-super-sim-data-payg" + WIRELESS_SUPER_SIM_DATA_PAYG_EUROPE = "wireless-super-sim-data-payg-europe" + WIRELESS_SUPER_SIM_DATA_PAYG_NORTH_AMERICA = ( + "wireless-super-sim-data-payg-north-america" + ) + WIRELESS_SUPER_SIM_HARDWARE = "wireless-super-sim-hardware" + WIRELESS_SUPER_SIM_HARDWARE_BULK = "wireless-super-sim-hardware-bulk" + WIRELESS_SUPER_SIM_SMSCOMMANDS = "wireless-super-sim-smscommands" + WIRELESS_SUPER_SIM_SMSCOMMANDS_AFRICA = "wireless-super-sim-smscommands-africa" + WIRELESS_SUPER_SIM_SMSCOMMANDS_ASIA = "wireless-super-sim-smscommands-asia" + WIRELESS_SUPER_SIM_SMSCOMMANDS_CENT_AND_SOUTH_AMERICA = ( + "wireless-super-sim-smscommands-cent-and-south-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_EUROPE = "wireless-super-sim-smscommands-europe" + WIRELESS_SUPER_SIM_SMSCOMMANDS_NORTH_AMERICA = ( + "wireless-super-sim-smscommands-north-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_OCEANIA = ( + "wireless-super-sim-smscommands-oceania" + ) + WIRELESS_SUPER_SIM_SUBSCRIPTION = "wireless-super-sim-subscription" + WIRELESS_SUPER_SIM_SUBSCRIPTION_PAYG = "wireless-super-sim-subscription-payg" WIRELESS_USAGE = "wireless-usage" WIRELESS_USAGE_COMMANDS = "wireless-usage-commands" WIRELESS_USAGE_COMMANDS_AFRICA = "wireless-usage-commands-africa" @@ -348,6 +656,184 @@ class Category(object): WIRELESS_USAGE_MRC_SUSPENDED = "wireless-usage-mrc-suspended" WIRELESS_USAGE_SMS = "wireless-usage-sms" WIRELESS_USAGE_VOICE = "wireless-usage-voice" + A2P_FAST_TRACK_ONBOARDING = "a2p-fast-track-onboarding" + ADVISORY_SERVICES = "advisory-services" + ADVISORY_SERVICES_BILLED = "advisory-services-billed" + ADVISORY_SERVICES_CALL_TRACKING = "advisory-services-call-tracking" + ADVISORY_SERVICES_DATA_SERVICES = "advisory-services-data-services" + ADVISORY_SERVICES_EXPENSES = "advisory-services-expenses" + ADVISORY_SERVICES_SIP_TRUNKING = "advisory-services-sip-trunking" + ASSETS_REQUESTS = "assets-requests" + AUDIENCE_MINUTES_VIDEO = "audience-minutes-video" + AUTHY_BUCKET_ADJUSTMENT = "authy-bucket-adjustment" + AUTHY_SOFTWARE = "authy-software" + CALLERIDLOOKUPS_API = "calleridlookups-api" + CALLERIDLOOKUPS_PROGRAMMABLEVOICE = "calleridlookups-programmablevoice" + CALLERIDLOOKUPS_TRUNKING = "calleridlookups-trunking" + CALLS_TRUNKING_INBOUND_TOLLFREE_LOCAL = "calls-trunking-inbound-tollfree-local" + CALLS_TRUNKING_INBOUND_TOLLFREE_MOBILE = ( + "calls-trunking-inbound-tollfree-mobile" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE_1 = "channels-whatsapp-conversation-free-1" + CONFERENCE = "conference" + CONVERSATIONAL_INSIGHTS = "conversational-insights" + CONVERSATIONAL_INSIGHTS_MESSAGES = "conversational-insights-messages" + CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = "conversational-insights-voice-minutes" + DEMO = "demo" + DEMO_UC_SCRIPT_TEST = "demo-uc-script-test" + ELASTIC_SIP_TRUNKING = "elastic-sip-trunking" + ELASTIC_SIP_TRUNKING_CALL_TRANSFERS = "elastic-sip-trunking-call-transfers" + ENTERPRISE_HIPPA = "enterprise-hippa" + FLEX_NAMED_USERS = "flex-named-users" + FLEX_SPINSCI = "flex-spinsci" + FLEX_USERS_1 = "flex-users-1" + FLEX_WFO_PREMIUM_SPEECH_ANALYTICS = "flex-wfo-premium-speech-analytics" + FLEX_XCELERATE = "flex-xcelerate" + FUNCTIONS_ROLLUP = "functions-rollup" + IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING_ADDONS = "ip-messaging-addons" + IVR = "ivr" + IVR_CONVERSATIONAL = "ivr-conversational" + IVR_DTMF = "ivr-dtmf" + IVR_VIRTUALAGENT = "ivr-virtualagent" + LIVE = "live" + LIVE_MEDIA_RECORDING_MINUTES = "live-media-recording-minutes" + LONGCODE_MPS = "longcode-mps" + MARKETPLACE_ANALYTICS_ADDONS = "marketplace-analytics-addons" + MARKETPLACE_ISV_ADDONS = "marketplace-isv-addons" + MARKETPLACE_MESSAGING_ADDONS = "marketplace-messaging-addons" + MARKETPLACE_PHONENUMBERS_ADDONS = "marketplace-phonenumbers-addons" + MARKETPLACE_RECORDING_ADDONS = "marketplace-recording-addons" + MARKETPLACE_VIRTUALAGENT_ADDONS = "marketplace-virtualagent-addons" + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR_1 = ( + "marketplay-pay-addons-shuttle-pay-connector-1" + ) + MARKETPLAY_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplay-pay-addons-stripe-pay-connector" + ) + MMS_INBOUND_LONGCODE_CANADA = "mms-inbound-longcode-canada" + MMS_INBOUND_LONGCODE_UNITEDSTATES = "mms-inbound-longcode-unitedstates" + MMS_OUTBOUND_LONGCODE_CANADA = "mms-outbound-longcode-canada" + MMS_OUTBOUND_LONGCODE_UNITEDSTATES = "mms-outbound-longcode-unitedstates" + MMS_OUTBOUND_TOLL_FREE = "mms-outbound-toll-free" + NOTIFY_CHATAPPSANDOTHERCHANNELS = "notify-chatappsandotherchannels" + NOTIFY_NOTIFYSERVICES = "notify-notifyservices" + NOTIFY_PUSHNOTIFICATIONS = "notify-pushnotifications" + PAYMENT_GATEWAY_CONNECTORS = "payment-gateway-connectors" + PAYMENT_SOLUTIONS = "payment-solutions" + PCHAT_BUCKET_ADJUSTMENT = "pchat-bucket-adjustment" + PHONENUMBERS_NUMBERS = "phonenumbers-numbers" + PROG_VOICE_CLIENT_ANDROID = "prog-voice-client-android" + PROG_VOICE_CLIENT_ANDROID_INBOUND = "prog-voice-client-android-inbound" + PROG_VOICE_CLIENT_ANDROID_OUTBOUND = "prog-voice-client-android-outbound" + PROG_VOICE_CLIENT_IOS = "prog-voice-client-ios" + PROG_VOICE_CLIENT_IOS_INBOUND = "prog-voice-client-ios-inbound" + PROG_VOICE_CLIENT_IOS_OUTBOUND = "prog-voice-client-ios-outbound" + PROG_VOICE_CLIENT_SDK = "prog-voice-client-sdk" + PROG_VOICE_CLIENT_WEB = "prog-voice-client-web" + PROG_VOICE_CLIENT_WEB_INBOUND = "prog-voice-client-web-inbound" + PROG_VOICE_CLIENT_WEB_OUTBOUND = "prog-voice-client-web-outbound" + PROGRAMMABLEVOICECONNECTIVITY_MEDIA_STREAMS = ( + "programmablevoiceconnectivity-media-streams" + ) + PSTNCONNECTIVITY_BYOC = "pstnconnectivity-byoc" + PSTNCONNECTIVITY_EMERGENCY = "pstnconnectivity-emergency" + PSTNCONNECTIVITY_MINUTES = "pstnconnectivity-minutes" + PSTNCONNECTIVITY_MINUTES_1 = "pstnconnectivity-minutes-1" + PSTNCONNECTIVITY_MINUTESINBOUNDLOCAL = "pstnconnectivity-minutesinboundlocal" + PSTNCONNECTIVITY_MINUTESINBOUNDMOBILE = "pstnconnectivity-minutesinboundmobile" + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREE = ( + "pstnconnectivity-minutesinboundtollfree" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREELOCAL = ( + "pstnconnectivity-minutesinboundtollfreelocal" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREEMOBILE = ( + "pstnconnectivity-minutesinboundtollfreemobile" + ) + PV_ROOM_HOURS = "pv-room-hours" + PV_ROOM_SIMULTANEOUS_PARTICIPANT_CONNECTIONS = ( + "pv-room-simultaneous-participant-connections" + ) + PVIDEO_ROOM_HOURS_AU1 = "pvideo-room-hours-au1" + PVIDEO_ROOM_HOURS_BR1 = "pvideo-room-hours-br1" + PVIDEO_ROOM_HOURS_IE1 = "pvideo-room-hours-ie1" + PVIDEO_ROOM_HOURS_JP1 = "pvideo-room-hours-jp1" + PVIDEO_ROOM_HOURS_SG1 = "pvideo-room-hours-sg1" + PVIDEO_ROOM_HOURS_US1 = "pvideo-room-hours-us1" + PVIDEO_ROOM_HOURS_US2 = "pvideo-room-hours-us2" + RECORDINGS_ENCRYPTED = "recordings-encrypted" + SHORT_CODE_SETUP_FEES = "short-code-setup-fees" + SHORTCODES_MESSAGES_INBOUND = "shortcodes-messages-inbound" + SHORTCODES_MESSAGES_OUTBOUND = "shortcodes-messages-outbound" + SMS_MESSAGES_REGISTRATIONFEES = "sms-messages-registrationfees" + SMS_MMS_PENALTY_FEES = "sms-mms-penalty-fees" + SMS_MMS_PENALTY_FEES_1 = "sms-mms-penalty-fees-1" + SMS_PUMPING_PROTECTION_NON_USCA = "sms-pumping-protection-non-usca" + SMS_PUMPING_PROTECTION_USCA = "sms-pumping-protection-usca" + STUDIO = "studio" + STUDIO_MONTHLY_FEES = "studio-monthly-fees" + SUPERSIM = "supersim" + TASK_ROUTER = "task-router" + TASK_ROUTER_WORKERS = "task-router-workers" + TEST_QUOTA_BUCKETS = "test-quota-buckets" + TEST_UC_SCRIPT_1 = "test-uc-script-1" + TEST_UC_SCRIPT_DEMO_2 = "test-uc-script-demo-2" + TEXT_TO_SPEECH = "text-to-speech" + TME = "tme" + TTS_BASIC = "tts-basic" + TWILIO_EDITIONS = "twilio-editions" + TWILIO_INTERCONNECT_CALIFORNIA = "twilio-interconnect-california" + TWILIO_INTERCONNECT_CALIFORNIA_MONTHLY = ( + "twilio-interconnect-california-monthly" + ) + TWILIO_INTERCONNECT_CALIFORNIA_SETUP = "twilio-interconnect-california-setup" + TWILIO_INTERCONNECT_FRANKFURT = "twilio-interconnect-frankfurt" + TWILIO_INTERCONNECT_FRANKFURT_MO = "twilio-interconnect-frankfurt-mo" + TWILIO_INTERCONNECT_FRANKFURT_SETUP = "twilio-interconnect-frankfurt-setup" + TWILIO_INTERCONNECT_LONDON = "twilio-interconnect-london" + TWILIO_INTERCONNECT_LONDON_MO = "twilio-interconnect-london-mo" + TWILIO_INTERCONNECT_LONDON_SETUP = "twilio-interconnect-london-setup" + TWILIO_INTERCONNECT_SAO_PAULO = "twilio-interconnect-sao-paulo" + TWILIO_INTERCONNECT_SAO_PAULO_MONTHLY = "twilio-interconnect-sao-paulo-monthly" + TWILIO_INTERCONNECT_SAO_PAULO_SETUP = "twilio-interconnect-sao-paulo-setup" + TWILIO_INTERCONNECT_SINGAPORE = "twilio-interconnect-singapore" + TWILIO_INTERCONNECT_SINGAPORE_MO = "twilio-interconnect-singapore-mo" + TWILIO_INTERCONNECT_SINGAPORE_SETUP = "twilio-interconnect-singapore-setup" + TWILIO_INTERCONNECT_SYDNEY = "twilio-interconnect-sydney" + TWILIO_INTERCONNECT_SYDNEY_MO = "twilio-interconnect-sydney-mo" + TWILIO_INTERCONNECT_SYDNEY_SETUP = "twilio-interconnect-sydney-setup" + TWILIO_INTERCONNECT_TOKYO = "twilio-interconnect-tokyo" + TWILIO_INTERCONNECT_TOKYO_MO = "twilio-interconnect-tokyo-mo" + TWILIO_INTERCONNECT_TOKYO_SETUP = "twilio-interconnect-tokyo-setup" + TWILIO_INTERCONNECT_VA = "twilio-interconnect-va" + TWILIO_INTERCONNECT_VA_MO = "twilio-interconnect-va-mo" + TWILIO_INTERCONNECT_VA_SETUP = "twilio-interconnect-va-setup" + TWIML_VERBS = "twiml-verbs" + TWIML_VERBS_SAY = "twiml-verbs-say" + USAGE_PROGRAMMABLE_MESSAGING_ENGAGEMENT_SUITE = ( + "usage-programmable-messaging-engagement-suite" + ) + USAGE_PROGRAMMABLE_MESSAGING_FEES_SERVICES = ( + "usage-programmable-messaging-fees-services" + ) + VERIFY_OUTBOUND_EMAIL = "verify-outbound-email" + VERIFY_PACKAGED_PLANS = "verify-packaged-plans" + VERIFY_SILENT_NETWORK_AUTH = "verify-silent-network-auth" + VERIFY_VOICE_AND_SMS = "verify-voice-and-sms" + VOICE_INSIGHTS_CLIENT_INSIGHTS_MONTHY_COMMIT = ( + "voice-insights-client-insights-monthy-commit" + ) + WIRELESS_DATA_PAYG_ASIA_AFG = "wireless-data-payg-asia-afg" + WIRELESS_MULTI_IMSI_SIM_COMMANDS = "wireless-multi-imsi-sim-commands" + WIRELESS_MULTI_IMSI_SIM_COMMANDS_USA = "wireless-multi-imsi-sim-commands-usa" + WIRELESS_MULTI_IMSI_SIM_DATA = "wireless-multi-imsi-sim-data" + WIRELESS_MULTI_IMSI_SIM_DATA_EU28 = "wireless-multi-imsi-sim-data-eu28" + WIRELESS_MULTI_IMSI_SIM_DATA_USA = "wireless-multi-imsi-sim-data-usa" + WIRELESS_MULTI_IMSI_SIM_MONTHLY_FEES = "wireless-multi-imsi-sim-monthly-fees" + WIRELESS_MULTI_IMSI_SIM_USAGE = "wireless-multi-imsi-sim-usage" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA = "wireless-super-sim-data-north-america" + WIRELESS_SUPER_SIM_USAGE = "wireless-super-sim-usage" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. diff --git a/twilio/rest/api/v2010/account/usage/record/daily.py b/twilio/rest/api/v2010/account/usage/record/daily.py index 49058b8ea2..e89c75cb39 100644 --- a/twilio/rest/api/v2010/account/usage/record/daily.py +++ b/twilio/rest/api/v2010/account/usage/record/daily.py @@ -25,33 +25,101 @@ class DailyInstance(InstanceResource): class Category(object): + A2P_10DLC_REGISTRATIONFEES_BRANDREGISTRATION = ( + "a2p-10dlc-registrationfees-brandregistration" + ) + A2P_10DLC_REGISTRATIONFEES_BV = "a2p-10dlc-registrationfees-bv" + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNCHARGES = ( + "a2p-10dlc-registrationfees-campaigncharges" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNREGISTRATION = ( + "a2p-10dlc-registrationfees-campaignregistration" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNVETTING = ( + "a2p-10dlc-registrationfees-campaignvetting" + ) + A2P_10DLC_REGISTRATIONFEES_MONTHLY = "a2p-10dlc-registrationfees-monthly" + A2P_10DLC_REGISTRATIONFEES_ONETIME = "a2p-10dlc-registrationfees-onetime" A2P_REGISTRATION_FEES = "a2p-registration-fees" + ACCOUNT_SECURITY = "account-security" AGENT_CONFERENCE = "agent-conference" + AGENT_COPILOT = "agent-copilot" + AGENT_COPILOT_MESSAGES = "agent-copilot-messages" + AGENT_COPILOT_PARTICIPANT_MINUTES = "agent-copilot-participant-minutes" + AI_ASSISTANTS = "ai-assistants" + AI_ASSISTANTS_VOICE = "ai-assistants-voice" AMAZON_POLLY = "amazon-polly" ANSWERING_MACHINE_DETECTION = "answering-machine-detection" + ASSETS = "assets" + AUDIENCE_MINUTES = "audience-minutes" + AUDIENCE_MINUTES_AUDIO = "audience-minutes-audio" AUTHY_AUTHENTICATIONS = "authy-authentications" AUTHY_CALLS_OUTBOUND = "authy-calls-outbound" + AUTHY_EMAIL_AUTHENTICATIONS = "authy-email-authentications" AUTHY_MONTHLY_FEES = "authy-monthly-fees" + AUTHY_OUTBOUND_EMAIL = "authy-outbound-email" AUTHY_PHONE_INTELLIGENCE = "authy-phone-intelligence" AUTHY_PHONE_VERIFICATIONS = "authy-phone-verifications" AUTHY_SMS_OUTBOUND = "authy-sms-outbound" + AUTHY_VERIFY_EMAIL_VERIFICATIONS = "authy-verify-email-verifications" + AUTHY_VERIFY_OUTBOUND_EMAIL = "authy-verify-outbound-email" + AUTOPILOT = "autopilot" + AUTOPILOT_HOME_ASSISTANTS = "autopilot-home-assistants" + AUTOPILOT_MESSAGING = "autopilot-messaging" + AUTOPILOT_OTHER = "autopilot-other" + AUTOPILOT_VOICE = "autopilot-voice" + BASIC_PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( + "basic-peer-to-peer-rooms-participant-minutes" + ) + BRANDED_CALLING = "branded-calling" + BUNDLE_SMS_BUCKET = "bundle-sms-bucket" + BUNDLE_SUBSCRIPTION_FEES = "bundle-subscription-fees" + CALL_FORWARDING_LOOKUPS = "call-forwarding-lookups" CALL_PROGESS_EVENTS = "call-progess-events" CALLERIDLOOKUPS = "calleridlookups" CALLS = "calls" CALLS_CLIENT = "calls-client" + CALLS_EMERGENCY = "calls-emergency" CALLS_GLOBALCONFERENCE = "calls-globalconference" CALLS_INBOUND = "calls-inbound" CALLS_INBOUND_LOCAL = "calls-inbound-local" CALLS_INBOUND_MOBILE = "calls-inbound-mobile" CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree" + CALLS_INBOUND_TOLLFREE_LOCAL = "calls-inbound-tollfree-local" + CALLS_INBOUND_TOLLFREE_MOBILE = "calls-inbound-tollfree-mobile" + CALLS_MEDIA_STREAM_MINUTES = "calls-media-stream-minutes" CALLS_OUTBOUND = "calls-outbound" CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions" CALLS_RECORDINGS = "calls-recordings" CALLS_SIP = "calls-sip" CALLS_SIP_INBOUND = "calls-sip-inbound" CALLS_SIP_OUTBOUND = "calls-sip-outbound" + CALLS_TEXT_TO_SPEECH = "calls-text-to-speech" CALLS_TRANSFERS = "calls-transfers" CARRIER_LOOKUPS = "carrier-lookups" + CATEGORY = "category" + CHANNELS = "channels" + CHANNELS_MESSAGING = "channels-messaging" + CHANNELS_MESSAGING_INBOUND = "channels-messaging-inbound" + CHANNELS_MESSAGING_OUTBOUND = "channels-messaging-outbound" + CHANNELS_WHATSAPP = "channels-whatsapp" + CHANNELS_WHATSAPP_CONVERSATION_AUTHENTICATION = ( + "channels-whatsapp-conversation-authentication" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE = "channels-whatsapp-conversation-free" + CHANNELS_WHATSAPP_CONVERSATION_MARKETING = ( + "channels-whatsapp-conversation-marketing" + ) + CHANNELS_WHATSAPP_CONVERSATION_SERVICE = ( + "channels-whatsapp-conversation-service" + ) + CHANNELS_WHATSAPP_CONVERSATION_UTILITY = ( + "channels-whatsapp-conversation-utility" + ) + CHANNELS_WHATSAPP_INBOUND = "channels-whatsapp-inbound" + CHANNELS_WHATSAPP_OUTBOUND = "channels-whatsapp-outbound" + CHAT_VIRTUAL_AGENT = "chat-virtual-agent" + CONVERSATION_RELAY = "conversation-relay" CONVERSATIONS = "conversations" CONVERSATIONS_API_REQUESTS = "conversations-api-requests" CONVERSATIONS_CONVERSATION_EVENTS = "conversations-conversation-events" @@ -60,8 +128,40 @@ class Category(object): CONVERSATIONS_PARTICIPANT_EVENTS = "conversations-participant-events" CONVERSATIONS_PARTICIPANTS = "conversations-participants" CPS = "cps" + CREDIT_TRANSFER = "credit-transfer" + EMAIL = "email" + EMERGING_TECH = "emerging-tech" + ENGAGEMENT_SUITE_PACKAGED_PLANS = "engagement-suite-packaged-plans" + ENHANCED_LINE_TYPE_LOOKUPS = "enhanced-line-type-lookups" + ENTERPRISE = "enterprise" + EVENTS = "events" + EXPERIMENT_FRANCE_SMS = "experiment-france-sms" + EXPERIMENT_INDIA_SMS = "experiment-india-sms" + EXPERIMENT_UK_SMS = "experiment-uk-sms" + FAILED_MESSAGE_PROCESSING_FEE = "failed-message-processing-fee" + FLEX = "flex" + FLEX_ACTIVE_USER_HOURS = "flex-active-user-hours" + FLEX_CONCURRENT_USERS = "flex-concurrent-users" + FLEX_CONVERSATIONAL_INSIGHTS = "flex-conversational-insights" + FLEX_CONVERSATIONAL_INSIGHTS_MESSAGES = "flex-conversational-insights-messages" + FLEX_CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = ( + "flex-conversational-insights-voice-minutes" + ) + FLEX_EMAIL_USAGE = "flex-email-usage" + FLEX_MESSAGING_USAGE = "flex-messaging-usage" + FLEX_PARTNER_SPINSCI = "flex-partner-spinsci" + FLEX_PARTNER_XCELERATE = "flex-partner-xcelerate" + FLEX_RESELLER_ECOSYSTEM = "flex-reseller-ecosystem" + FLEX_UNIQUE_USER = "flex-unique-user" FLEX_USAGE = "flex-usage" + FLEX_USERS = "flex-users" + FLEX_VOICE_MINUTE = "flex-voice-minute" + FLEX_YTICA = "flex-ytica" FRAUD_LOOKUPS = "fraud-lookups" + FRONTLINE = "frontline" + FRONTLINE_USERS = "frontline-users" + FUNCTIONS = "functions" + GENERIC_PAY_TRANSACTIONS = "generic-pay-transactions" GROUP_ROOMS = "group-rooms" GROUP_ROOMS_DATA_TRACK = "group-rooms-data-track" GROUP_ROOMS_ENCRYPTED_MEDIA_RECORDED = "group-rooms-encrypted-media-recorded" @@ -71,9 +171,17 @@ class Category(object): GROUP_ROOMS_MEDIA_STORED = "group-rooms-media-stored" GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" - IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING = "ip-messaging" + IP_MESSAGING_COMMANDS = "ip-messaging-commands" + IP_MESSAGING_DATA_STORAGE = "ip-messaging-data-storage" + IP_MESSAGING_DATA_TRANSFER = "ip-messaging-data-transfer" + IP_MESSAGING_ENDPOINT_CONNECTIVITY = "ip-messaging-endpoint-connectivity" IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" + LINE_STATUS_LOOKUPS = "line-status-lookups" + LIVE_ACTIVITY_LOOKUPS = "live-activity-lookups" + LOOKUP_BUCKET_ADJUSTMENT = "lookup-bucket-adjustment" + LOOKUP_IDENTITY_MATCH = "lookup-identity-match" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( @@ -84,6 +192,13 @@ class Category(object): MARKETPLACE_CAPIO_SPEECH_TO_TEXT = "marketplace-capio-speech-to-text" MARKETPLACE_CONVRIZA_ABABA = "marketplace-convriza-ababa" MARKETPLACE_DEEPGRAM_PHRASE_DETECTOR = "marketplace-deepgram-phrase-detector" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION = "marketplace-deepgram-transcription" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION_BASE = ( + "marketplace-deepgram-transcription-base" + ) + MARKETPLACE_DEEPGRAM_TRANSSCRIPTION_ENHANCED = ( + "marketplace-deepgram-transscription-enhanced" + ) MARKETPLACE_DIGITAL_SEGMENT_BUSINESS_INFO = ( "marketplace-digital-segment-business-info" ) @@ -109,6 +224,9 @@ class Category(object): "marketplace-keen-io-contact-center-analytics" ) MARKETPLACE_MARCHEX_CLEANCALL = "marketplace-marchex-cleancall" + MARKETPLACE_MARCHEX_RECORDING_ANALYSIS = ( + "marketplace-marchex-recording-analysis" + ) MARKETPLACE_MARCHEX_SENTIMENT_ANALYSIS_FOR_SMS = ( "marketplace-marchex-sentiment-analysis-for-sms" ) @@ -125,14 +243,42 @@ class Category(object): "marketplace-nextcaller-advanced-caller-identification" ) MARKETPLACE_NOMOROBO_SPAM_SCORE = "marketplace-nomorobo-spam-score" + MARKETPLACE_PAY_ADDONS = "marketplace-pay-addons" + MARKETPLACE_PAY_ADDONS_BASECOMMERCE_PAY_CONNECTOR = ( + "marketplace-pay-addons-basecommerce-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_BRAINTREE_PAY_CONNECTOR = ( + "marketplace-pay-addons-braintree-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CARDCONNECT_PAY_CONNECTOR = ( + "marketplace-pay-addons-cardconnect-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CHASE_PAY_CONNECTOR = ( + "marketplace-pay-addons-chase-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplace-pay-addons-shuttle-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplace-pay-addons-stripe-pay-connector" + ) MARKETPLACE_PAYFONE_TCPA_COMPLIANCE = "marketplace-payfone-tcpa-compliance" + MARKETPLACE_POLY_AI_CONNECTOR = "marketplace-poly-ai-connector" + MARKETPLACE_REALPHONEVALIDATION = "marketplace-realphonevalidation" MARKETPLACE_REMEETING_AUTOMATIC_SPEECH_RECOGNITION = ( "marketplace-remeeting-automatic-speech-recognition" ) + MARKETPLACE_SPOKE_PHONE_LICENSE_PRO = "marketplace-spoke-phone-license-pro" + MARKETPLACE_SPOKE_PHONE_LICENSE_STANDARD = ( + "marketplace-spoke-phone-license-standard" + ) MARKETPLACE_TCPA_DEFENSE_SOLUTIONS_BLACKLIST_FEED = ( "marketplace-tcpa-defense-solutions-blacklist-feed" ) MARKETPLACE_TELO_OPENCNAM = "marketplace-telo-opencnam" + MARKETPLACE_TRESTLE_SOLUTIONS_CALLER_IDENTIFICATION = ( + "marketplace-trestle-solutions-caller-identification" + ) MARKETPLACE_TRUECNAM_TRUE_SPAM = "marketplace-truecnam-true-spam" MARKETPLACE_TWILIO_CALLER_NAME_LOOKUP_US = ( "marketplace-twilio-caller-name-lookup-us" @@ -145,6 +291,9 @@ class Category(object): MARKETPLACE_VOICEBASE_TRANSCRIPTION_CUSTOM_VOCABULARY = ( "marketplace-voicebase-transcription-custom-vocabulary" ) + MARKETPLACE_WEB_PURIFY_PROFANITY_FILTER = ( + "marketplace-web-purify-profanity-filter" + ) MARKETPLACE_WHITEPAGES_PRO_CALLER_IDENTIFICATION = ( "marketplace-whitepages-pro-caller-identification" ) @@ -159,15 +308,23 @@ class Category(object): MARKETPLACE_YTICA_CONTACT_CENTER_REPORTING_ANALYTICS = ( "marketplace-ytica-contact-center-reporting-analytics" ) + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplay-pay-addons-shuttle-pay-connector" + ) + MEDIA_COMPOSER_MINUTES = "media-composer-minutes" MEDIASTORAGE = "mediastorage" + MIN_SPEND_ADJUSTMENTS = "min-spend-adjustments" MMS = "mms" MMS_INBOUND = "mms-inbound" MMS_INBOUND_LONGCODE = "mms-inbound-longcode" MMS_INBOUND_SHORTCODE = "mms-inbound-shortcode" + MMS_INBOUND_TOLL_FREE = "mms-inbound-toll-free" MMS_MESSAGES_CARRIERFEES = "mms-messages-carrierfees" MMS_OUTBOUND = "mms-outbound" MMS_OUTBOUND_LONGCODE = "mms-outbound-longcode" MMS_OUTBOUND_SHORTCODE = "mms-outbound-shortcode" + MMS_OUTBOUND_TOLLFREE = "mms-outbound-tollfree" + MONITOR = "monitor" MONITOR_READS = "monitor-reads" MONITOR_STORAGE = "monitor-storage" MONITOR_WRITES = "monitor-writes" @@ -176,6 +333,12 @@ class Category(object): NOTIFY_CHANNELS = "notify-channels" NUMBER_FORMAT_LOOKUPS = "number-format-lookups" PCHAT = "pchat" + PCHAT_ACTIONS = "pchat-actions" + PCHAT_APS = "pchat-aps" + PCHAT_CONV_MED_STORAGE = "pchat-conv-med-storage" + PCHAT_MESSAGES = "pchat-messages" + PCHAT_NOTIFICATIONS = "pchat-notifications" + PCHAT_READS = "pchat-reads" PCHAT_USERS = "pchat-users" PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( "peer-to-peer-rooms-participant-minutes" @@ -185,18 +348,41 @@ class Category(object): PFAX_MINUTES_INBOUND = "pfax-minutes-inbound" PFAX_MINUTES_OUTBOUND = "pfax-minutes-outbound" PFAX_PAGES = "pfax-pages" + PHONE_QUALITY_SCORE_LOOKUPS = "phone-quality-score-lookups" PHONENUMBERS = "phonenumbers" PHONENUMBERS_CPS = "phonenumbers-cps" PHONENUMBERS_EMERGENCY = "phonenumbers-emergency" PHONENUMBERS_LOCAL = "phonenumbers-local" PHONENUMBERS_MOBILE = "phonenumbers-mobile" + PHONENUMBERS_PORTING = "phonenumbers-porting" PHONENUMBERS_SETUPS = "phonenumbers-setups" PHONENUMBERS_TOLLFREE = "phonenumbers-tollfree" PREMIUMSUPPORT = "premiumsupport" + PREMIUMSUPPORT_PERCENTAGE_SPEND = "premiumsupport-percentage-spend" + PROGRAMMABLEVOICE_PLATFORM = "programmablevoice-platform" + PROGRAMMABLEVOICECONN_CLIENTSDK = "programmablevoiceconn-clientsdk" + PROGRAMMABLEVOICECONN_CLIENTSDK_INBOUND = ( + "programmablevoiceconn-clientsdk-inbound" + ) + PROGRAMMABLEVOICECONN_CLIENTSDK_OUTBOUND = ( + "programmablevoiceconn-clientsdk-outbound" + ) + PROGRAMMABLEVOICECONN_ONNET = "programmablevoiceconn-onnet" + PROGRAMMABLEVOICECONN_ONNET_INBOUND = "programmablevoiceconn-onnet-inbound" + PROGRAMMABLEVOICECONN_ONNET_OUTBOUND = "programmablevoiceconn-onnet-outbound" + PROGRAMMABLEVOICECONN_SIP = "programmablevoiceconn-sip" + PROGRAMMABLEVOICECONN_SIP_INBOUND = "programmablevoiceconn-sip-inbound" + PROGRAMMABLEVOICECONN_SIP_OUTBOUND = "programmablevoiceconn-sip-outbound" + PROGRAMMABLEVOICECONNECTIVITY = "programmablevoiceconnectivity" PROXY = "proxy" PROXY_ACTIVE_SESSIONS = "proxy-active-sessions" + PROXY_BUCKET_ADJUSTMENT = "proxy-bucket-adjustment" + PROXY_LICENSES = "proxy-licenses" PSTNCONNECTIVITY = "pstnconnectivity" + PSTNCONNECTIVITY_INBOUND = "pstnconnectivity-inbound" + PSTNCONNECTIVITY_OUTBOUND = "pstnconnectivity-outbound" PV = "pv" + PV_BASIC_ROOMS = "pv-basic-rooms" PV_COMPOSITION_MEDIA_DOWNLOADED = "pv-composition-media-downloaded" PV_COMPOSITION_MEDIA_ENCRYPTED = "pv-composition-media-encrypted" PV_COMPOSITION_MEDIA_STORED = "pv-composition-media-stored" @@ -212,18 +398,20 @@ class Category(object): PV_ROOM_PARTICIPANTS_US2 = "pv-room-participants-us2" PV_ROOMS = "pv-rooms" PV_SIP_ENDPOINT_REGISTRATIONS = "pv-sip-endpoint-registrations" + RCS_MESSAGES = "rcs-messages" + REASSIGNED_NUMBER = "reassigned-number" RECORDINGS = "recordings" RECORDINGSTORAGE = "recordingstorage" - ROOMS_GROUP_BANDWIDTH = "rooms-group-bandwidth" - ROOMS_GROUP_MINUTES = "rooms-group-minutes" - ROOMS_PEER_TO_PEER_MINUTES = "rooms-peer-to-peer-minutes" SHORTCODES = "shortcodes" SHORTCODES_CUSTOMEROWNED = "shortcodes-customerowned" SHORTCODES_MMS_ENABLEMENT = "shortcodes-mms-enablement" SHORTCODES_MPS = "shortcodes-mps" SHORTCODES_RANDOM = "shortcodes-random" + SHORTCODES_SETUP_FEES = "shortcodes-setup-fees" SHORTCODES_UK = "shortcodes-uk" SHORTCODES_VANITY = "shortcodes-vanity" + SIM_SWAP_LOOKUPS = "sim-swap-lookups" + SIP_SECURE_MEDIA = "sip-secure-media" SMALL_GROUP_ROOMS = "small-group-rooms" SMALL_GROUP_ROOMS_DATA_TRACK = "small-group-rooms-data-track" SMALL_GROUP_ROOMS_PARTICIPANT_MINUTES = "small-group-rooms-participant-minutes" @@ -231,13 +419,30 @@ class Category(object): SMS_INBOUND = "sms-inbound" SMS_INBOUND_LONGCODE = "sms-inbound-longcode" SMS_INBOUND_SHORTCODE = "sms-inbound-shortcode" + SMS_INBOUND_TOLLFREE = "sms-inbound-tollfree" SMS_MESSAGES_CARRIERFEES = "sms-messages-carrierfees" SMS_MESSAGES_FEATURES = "sms-messages-features" + SMS_MESSAGES_FEATURES_ENGAGEMENT_SUITE = ( + "sms-messages-features-engagement-suite" + ) + SMS_MESSAGES_FEATURES_MESSAGE_REDACTION = ( + "sms-messages-features-message-redaction" + ) SMS_MESSAGES_FEATURES_SENDERID = "sms-messages-features-senderid" + SMS_MPS = "sms-mps" + SMS_MPS_SHORTCODE = "sms-mps-shortcode" + SMS_MPS_TOLLFREE = "sms-mps-tollfree" + SMS_MPS_TOLLFREE_SETUP = "sms-mps-tollfree-setup" + SMS_NATIONAL_REGULATORY_PROTECTION = "sms-national-regulatory-protection" SMS_OUTBOUND = "sms-outbound" SMS_OUTBOUND_CONTENT_INSPECTION = "sms-outbound-content-inspection" SMS_OUTBOUND_LONGCODE = "sms-outbound-longcode" SMS_OUTBOUND_SHORTCODE = "sms-outbound-shortcode" + SMS_OUTBOUND_TOLLFREE = "sms-outbound-tollfree" + SMS_PUMPING_PROTECTION = "sms-pumping-protection" + SMS_PUMPING_RISK = "sms-pumping-risk" + SMSMESSAGES_BUCKET_ADJUSTMENTS = "smsmessages-bucket-adjustments" + SMSMESSAGES_OUTBOUND_DOMESTIC = "smsmessages-outbound-domestic" SPEECH_RECOGNITION = "speech-recognition" STUDIO_ENGAGEMENTS = "studio-engagements" SYNC = "sync" @@ -267,13 +472,27 @@ class Category(object): TURNMEGABYTES_SINGAPORE = "turnmegabytes-singapore" TURNMEGABYTES_USEAST = "turnmegabytes-useast" TURNMEGABYTES_USWEST = "turnmegabytes-uswest" + TWILIO_FOR_SALESFORCE = "twilio-for-salesforce" + TWILIO_FOR_SALESFORCE_LICENSES = "twilio-for-salesforce-licenses" TWILIO_INTERCONNECT = "twilio-interconnect" + TWIML = "twiml" + USAGE_FLEX_VIDEO = "usage-flex-video" + USAGE_FUNCTIONS = "usage-functions" + USAGE_RCS_BASIC_MESSAGES_OUTBOUND = "usage-rcs-basic-messages-outbound" + USAGE_RCS_MESSAGES = "usage-rcs-messages" + USAGE_RCS_MESSAGES_INBOUND = "usage-rcs-messages-inbound" + USAGE_RCS_MESSAGING_CARRIER_FEES = "usage-rcs-messaging-carrier-fees" + USAGE_RCS_SINGLE_MESSAGES_OUTBOUND = "usage-rcs-single-messages-outbound" + VERIFY_PACKAGE_PLANS = "verify-package-plans" VERIFY_PUSH = "verify-push" + VERIFY_SNA = "verify-sna" VERIFY_TOTP = "verify-totp" + VERIFY_VOICE_SMS = "verify-voice-sms" VERIFY_WHATSAPP_CONVERSATIONS_BUSINESS_INITIATED = ( "verify-whatsapp-conversations-business-initiated" ) VIDEO_RECORDINGS = "video-recordings" + VIDEO_ROOMS_TURN_MEGABYTES = "video-rooms-turn-megabytes" VIRTUAL_AGENT = "virtual-agent" VOICE_INSIGHTS = "voice-insights" VOICE_INSIGHTS_CLIENT_INSIGHTS_ON_DEMAND_MINUTE = ( @@ -289,14 +508,103 @@ class Category(object): "voice-insights-sip-trunking-insights-on-demand-minute" ) VOICE_INTELLIGENCE = "voice-intelligence" - VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + VOICE_INTELLIGENCE_EIP_OPERATORS = "voice-intelligence-eip-operators" VOICE_INTELLIGENCE_OPERATORS = "voice-intelligence-operators" + VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + WDS = "wds" WIRELESS = "wireless" + WIRELESS_DATA = "wireless-data" + WIRELESS_DATA_PAYG = "wireless-data-payg" + WIRELESS_DATA_PAYG_AFRICA = "wireless-data-payg-africa" + WIRELESS_DATA_PAYG_ASIA = "wireless-data-payg-asia" + WIRELESS_DATA_PAYG_CENTRALANDSOUTHAMERICA = ( + "wireless-data-payg-centralandsouthamerica" + ) + WIRELESS_DATA_PAYG_EUROPE = "wireless-data-payg-europe" + WIRELESS_DATA_PAYG_NORTHAMERICA = "wireless-data-payg-northamerica" + WIRELESS_DATA_PAYG_OCEANIA = "wireless-data-payg-oceania" + WIRELESS_DATA_QUOTA1 = "wireless-data-quota1" + WIRELESS_DATA_QUOTA1_AFRICA = "wireless-data-quota1-africa" + WIRELESS_DATA_QUOTA1_ASIA = "wireless-data-quota1-asia" + WIRELESS_DATA_QUOTA1_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota1-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA1_EUROPE = "wireless-data-quota1-europe" + WIRELESS_DATA_QUOTA1_NORTHAMERICA = "wireless-data-quota1-northamerica" + WIRELESS_DATA_QUOTA1_OCEANIA = "wireless-data-quota1-oceania" + WIRELESS_DATA_QUOTA10 = "wireless-data-quota10" + WIRELESS_DATA_QUOTA10_AFRICA = "wireless-data-quota10-africa" + WIRELESS_DATA_QUOTA10_ASIA = "wireless-data-quota10-asia" + WIRELESS_DATA_QUOTA10_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota10-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA10_EUROPE = "wireless-data-quota10-europe" + WIRELESS_DATA_QUOTA10_NORTHAMERICA = "wireless-data-quota10-northamerica" + WIRELESS_DATA_QUOTA10_OCEANIA = "wireless-data-quota10-oceania" + WIRELESS_DATA_QUOTA50 = "wireless-data-quota50" + WIRELESS_DATA_QUOTA50_AFRICA = "wireless-data-quota50-africa" + WIRELESS_DATA_QUOTA50_ASIA = "wireless-data-quota50-asia" + WIRELESS_DATA_QUOTA50_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota50-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA50_EUROPE = "wireless-data-quota50-europe" + WIRELESS_DATA_QUOTA50_NORTHAMERICA = "wireless-data-quota50-northamerica" + WIRELESS_DATA_QUOTA50_OCEANIA = "wireless-data-quota50-oceania" + WIRELESS_DATA_QUOTACUSTOM = "wireless-data-quotacustom" + WIRELESS_DATA_QUOTACUSTOM_AFRICA = "wireless-data-quotacustom-africa" + WIRELESS_DATA_QUOTACUSTOM_ASIA = "wireless-data-quotacustom-asia" + WIRELESS_DATA_QUOTACUSTOM_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quotacustom-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_EUROPE = "wireless-data-quotacustom-europe" + WIRELESS_DATA_QUOTACUSTOM_NORTHAMERICA = ( + "wireless-data-quotacustom-northamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_OCEANIA = "wireless-data-quotacustom-oceania" + WIRELESS_MRC_PAYG = "wireless-mrc-payg" + WIRELESS_MRC_QUOTA1 = "wireless-mrc-quota1" + WIRELESS_MRC_QUOTA10 = "wireless-mrc-quota10" + WIRELESS_MRC_QUOTA50 = "wireless-mrc-quota50" + WIRELESS_MRC_QUOTACUSTOM = "wireless-mrc-quotacustom" WIRELESS_ORDERS = "wireless-orders" WIRELESS_ORDERS_ARTWORK = "wireless-orders-artwork" WIRELESS_ORDERS_BULK = "wireless-orders-bulk" WIRELESS_ORDERS_ESIM = "wireless-orders-esim" WIRELESS_ORDERS_STARTER = "wireless-orders-starter" + WIRELESS_QUOTAS = "wireless-quotas" + WIRELESS_SMS_AFRICA = "wireless-sms-africa" + WIRELESS_SMS_ASIA = "wireless-sms-asia" + WIRELESS_SMS_CENTRALANDSOUTHAMERICA = "wireless-sms-centralandsouthamerica" + WIRELESS_SMS_EUROPE = "wireless-sms-europe" + WIRELESS_SMS_NORTHAMERICA = "wireless-sms-northamerica" + WIRELESS_SMS_OCEANIA = "wireless-sms-oceania" + WIRELESS_SUPER_SIM = "wireless-super-sim" + WIRELESS_SUPER_SIM_DATA = "wireless-super-sim-data" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA_USA = ( + "wireless-super-sim-data-north-america-usa" + ) + WIRELESS_SUPER_SIM_DATA_PAYG = "wireless-super-sim-data-payg" + WIRELESS_SUPER_SIM_DATA_PAYG_EUROPE = "wireless-super-sim-data-payg-europe" + WIRELESS_SUPER_SIM_DATA_PAYG_NORTH_AMERICA = ( + "wireless-super-sim-data-payg-north-america" + ) + WIRELESS_SUPER_SIM_HARDWARE = "wireless-super-sim-hardware" + WIRELESS_SUPER_SIM_HARDWARE_BULK = "wireless-super-sim-hardware-bulk" + WIRELESS_SUPER_SIM_SMSCOMMANDS = "wireless-super-sim-smscommands" + WIRELESS_SUPER_SIM_SMSCOMMANDS_AFRICA = "wireless-super-sim-smscommands-africa" + WIRELESS_SUPER_SIM_SMSCOMMANDS_ASIA = "wireless-super-sim-smscommands-asia" + WIRELESS_SUPER_SIM_SMSCOMMANDS_CENT_AND_SOUTH_AMERICA = ( + "wireless-super-sim-smscommands-cent-and-south-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_EUROPE = "wireless-super-sim-smscommands-europe" + WIRELESS_SUPER_SIM_SMSCOMMANDS_NORTH_AMERICA = ( + "wireless-super-sim-smscommands-north-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_OCEANIA = ( + "wireless-super-sim-smscommands-oceania" + ) + WIRELESS_SUPER_SIM_SUBSCRIPTION = "wireless-super-sim-subscription" + WIRELESS_SUPER_SIM_SUBSCRIPTION_PAYG = "wireless-super-sim-subscription-payg" WIRELESS_USAGE = "wireless-usage" WIRELESS_USAGE_COMMANDS = "wireless-usage-commands" WIRELESS_USAGE_COMMANDS_AFRICA = "wireless-usage-commands-africa" @@ -348,6 +656,184 @@ class Category(object): WIRELESS_USAGE_MRC_SUSPENDED = "wireless-usage-mrc-suspended" WIRELESS_USAGE_SMS = "wireless-usage-sms" WIRELESS_USAGE_VOICE = "wireless-usage-voice" + A2P_FAST_TRACK_ONBOARDING = "a2p-fast-track-onboarding" + ADVISORY_SERVICES = "advisory-services" + ADVISORY_SERVICES_BILLED = "advisory-services-billed" + ADVISORY_SERVICES_CALL_TRACKING = "advisory-services-call-tracking" + ADVISORY_SERVICES_DATA_SERVICES = "advisory-services-data-services" + ADVISORY_SERVICES_EXPENSES = "advisory-services-expenses" + ADVISORY_SERVICES_SIP_TRUNKING = "advisory-services-sip-trunking" + ASSETS_REQUESTS = "assets-requests" + AUDIENCE_MINUTES_VIDEO = "audience-minutes-video" + AUTHY_BUCKET_ADJUSTMENT = "authy-bucket-adjustment" + AUTHY_SOFTWARE = "authy-software" + CALLERIDLOOKUPS_API = "calleridlookups-api" + CALLERIDLOOKUPS_PROGRAMMABLEVOICE = "calleridlookups-programmablevoice" + CALLERIDLOOKUPS_TRUNKING = "calleridlookups-trunking" + CALLS_TRUNKING_INBOUND_TOLLFREE_LOCAL = "calls-trunking-inbound-tollfree-local" + CALLS_TRUNKING_INBOUND_TOLLFREE_MOBILE = ( + "calls-trunking-inbound-tollfree-mobile" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE_1 = "channels-whatsapp-conversation-free-1" + CONFERENCE = "conference" + CONVERSATIONAL_INSIGHTS = "conversational-insights" + CONVERSATIONAL_INSIGHTS_MESSAGES = "conversational-insights-messages" + CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = "conversational-insights-voice-minutes" + DEMO = "demo" + DEMO_UC_SCRIPT_TEST = "demo-uc-script-test" + ELASTIC_SIP_TRUNKING = "elastic-sip-trunking" + ELASTIC_SIP_TRUNKING_CALL_TRANSFERS = "elastic-sip-trunking-call-transfers" + ENTERPRISE_HIPPA = "enterprise-hippa" + FLEX_NAMED_USERS = "flex-named-users" + FLEX_SPINSCI = "flex-spinsci" + FLEX_USERS_1 = "flex-users-1" + FLEX_WFO_PREMIUM_SPEECH_ANALYTICS = "flex-wfo-premium-speech-analytics" + FLEX_XCELERATE = "flex-xcelerate" + FUNCTIONS_ROLLUP = "functions-rollup" + IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING_ADDONS = "ip-messaging-addons" + IVR = "ivr" + IVR_CONVERSATIONAL = "ivr-conversational" + IVR_DTMF = "ivr-dtmf" + IVR_VIRTUALAGENT = "ivr-virtualagent" + LIVE = "live" + LIVE_MEDIA_RECORDING_MINUTES = "live-media-recording-minutes" + LONGCODE_MPS = "longcode-mps" + MARKETPLACE_ANALYTICS_ADDONS = "marketplace-analytics-addons" + MARKETPLACE_ISV_ADDONS = "marketplace-isv-addons" + MARKETPLACE_MESSAGING_ADDONS = "marketplace-messaging-addons" + MARKETPLACE_PHONENUMBERS_ADDONS = "marketplace-phonenumbers-addons" + MARKETPLACE_RECORDING_ADDONS = "marketplace-recording-addons" + MARKETPLACE_VIRTUALAGENT_ADDONS = "marketplace-virtualagent-addons" + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR_1 = ( + "marketplay-pay-addons-shuttle-pay-connector-1" + ) + MARKETPLAY_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplay-pay-addons-stripe-pay-connector" + ) + MMS_INBOUND_LONGCODE_CANADA = "mms-inbound-longcode-canada" + MMS_INBOUND_LONGCODE_UNITEDSTATES = "mms-inbound-longcode-unitedstates" + MMS_OUTBOUND_LONGCODE_CANADA = "mms-outbound-longcode-canada" + MMS_OUTBOUND_LONGCODE_UNITEDSTATES = "mms-outbound-longcode-unitedstates" + MMS_OUTBOUND_TOLL_FREE = "mms-outbound-toll-free" + NOTIFY_CHATAPPSANDOTHERCHANNELS = "notify-chatappsandotherchannels" + NOTIFY_NOTIFYSERVICES = "notify-notifyservices" + NOTIFY_PUSHNOTIFICATIONS = "notify-pushnotifications" + PAYMENT_GATEWAY_CONNECTORS = "payment-gateway-connectors" + PAYMENT_SOLUTIONS = "payment-solutions" + PCHAT_BUCKET_ADJUSTMENT = "pchat-bucket-adjustment" + PHONENUMBERS_NUMBERS = "phonenumbers-numbers" + PROG_VOICE_CLIENT_ANDROID = "prog-voice-client-android" + PROG_VOICE_CLIENT_ANDROID_INBOUND = "prog-voice-client-android-inbound" + PROG_VOICE_CLIENT_ANDROID_OUTBOUND = "prog-voice-client-android-outbound" + PROG_VOICE_CLIENT_IOS = "prog-voice-client-ios" + PROG_VOICE_CLIENT_IOS_INBOUND = "prog-voice-client-ios-inbound" + PROG_VOICE_CLIENT_IOS_OUTBOUND = "prog-voice-client-ios-outbound" + PROG_VOICE_CLIENT_SDK = "prog-voice-client-sdk" + PROG_VOICE_CLIENT_WEB = "prog-voice-client-web" + PROG_VOICE_CLIENT_WEB_INBOUND = "prog-voice-client-web-inbound" + PROG_VOICE_CLIENT_WEB_OUTBOUND = "prog-voice-client-web-outbound" + PROGRAMMABLEVOICECONNECTIVITY_MEDIA_STREAMS = ( + "programmablevoiceconnectivity-media-streams" + ) + PSTNCONNECTIVITY_BYOC = "pstnconnectivity-byoc" + PSTNCONNECTIVITY_EMERGENCY = "pstnconnectivity-emergency" + PSTNCONNECTIVITY_MINUTES = "pstnconnectivity-minutes" + PSTNCONNECTIVITY_MINUTES_1 = "pstnconnectivity-minutes-1" + PSTNCONNECTIVITY_MINUTESINBOUNDLOCAL = "pstnconnectivity-minutesinboundlocal" + PSTNCONNECTIVITY_MINUTESINBOUNDMOBILE = "pstnconnectivity-minutesinboundmobile" + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREE = ( + "pstnconnectivity-minutesinboundtollfree" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREELOCAL = ( + "pstnconnectivity-minutesinboundtollfreelocal" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREEMOBILE = ( + "pstnconnectivity-minutesinboundtollfreemobile" + ) + PV_ROOM_HOURS = "pv-room-hours" + PV_ROOM_SIMULTANEOUS_PARTICIPANT_CONNECTIONS = ( + "pv-room-simultaneous-participant-connections" + ) + PVIDEO_ROOM_HOURS_AU1 = "pvideo-room-hours-au1" + PVIDEO_ROOM_HOURS_BR1 = "pvideo-room-hours-br1" + PVIDEO_ROOM_HOURS_IE1 = "pvideo-room-hours-ie1" + PVIDEO_ROOM_HOURS_JP1 = "pvideo-room-hours-jp1" + PVIDEO_ROOM_HOURS_SG1 = "pvideo-room-hours-sg1" + PVIDEO_ROOM_HOURS_US1 = "pvideo-room-hours-us1" + PVIDEO_ROOM_HOURS_US2 = "pvideo-room-hours-us2" + RECORDINGS_ENCRYPTED = "recordings-encrypted" + SHORT_CODE_SETUP_FEES = "short-code-setup-fees" + SHORTCODES_MESSAGES_INBOUND = "shortcodes-messages-inbound" + SHORTCODES_MESSAGES_OUTBOUND = "shortcodes-messages-outbound" + SMS_MESSAGES_REGISTRATIONFEES = "sms-messages-registrationfees" + SMS_MMS_PENALTY_FEES = "sms-mms-penalty-fees" + SMS_MMS_PENALTY_FEES_1 = "sms-mms-penalty-fees-1" + SMS_PUMPING_PROTECTION_NON_USCA = "sms-pumping-protection-non-usca" + SMS_PUMPING_PROTECTION_USCA = "sms-pumping-protection-usca" + STUDIO = "studio" + STUDIO_MONTHLY_FEES = "studio-monthly-fees" + SUPERSIM = "supersim" + TASK_ROUTER = "task-router" + TASK_ROUTER_WORKERS = "task-router-workers" + TEST_QUOTA_BUCKETS = "test-quota-buckets" + TEST_UC_SCRIPT_1 = "test-uc-script-1" + TEST_UC_SCRIPT_DEMO_2 = "test-uc-script-demo-2" + TEXT_TO_SPEECH = "text-to-speech" + TME = "tme" + TTS_BASIC = "tts-basic" + TWILIO_EDITIONS = "twilio-editions" + TWILIO_INTERCONNECT_CALIFORNIA = "twilio-interconnect-california" + TWILIO_INTERCONNECT_CALIFORNIA_MONTHLY = ( + "twilio-interconnect-california-monthly" + ) + TWILIO_INTERCONNECT_CALIFORNIA_SETUP = "twilio-interconnect-california-setup" + TWILIO_INTERCONNECT_FRANKFURT = "twilio-interconnect-frankfurt" + TWILIO_INTERCONNECT_FRANKFURT_MO = "twilio-interconnect-frankfurt-mo" + TWILIO_INTERCONNECT_FRANKFURT_SETUP = "twilio-interconnect-frankfurt-setup" + TWILIO_INTERCONNECT_LONDON = "twilio-interconnect-london" + TWILIO_INTERCONNECT_LONDON_MO = "twilio-interconnect-london-mo" + TWILIO_INTERCONNECT_LONDON_SETUP = "twilio-interconnect-london-setup" + TWILIO_INTERCONNECT_SAO_PAULO = "twilio-interconnect-sao-paulo" + TWILIO_INTERCONNECT_SAO_PAULO_MONTHLY = "twilio-interconnect-sao-paulo-monthly" + TWILIO_INTERCONNECT_SAO_PAULO_SETUP = "twilio-interconnect-sao-paulo-setup" + TWILIO_INTERCONNECT_SINGAPORE = "twilio-interconnect-singapore" + TWILIO_INTERCONNECT_SINGAPORE_MO = "twilio-interconnect-singapore-mo" + TWILIO_INTERCONNECT_SINGAPORE_SETUP = "twilio-interconnect-singapore-setup" + TWILIO_INTERCONNECT_SYDNEY = "twilio-interconnect-sydney" + TWILIO_INTERCONNECT_SYDNEY_MO = "twilio-interconnect-sydney-mo" + TWILIO_INTERCONNECT_SYDNEY_SETUP = "twilio-interconnect-sydney-setup" + TWILIO_INTERCONNECT_TOKYO = "twilio-interconnect-tokyo" + TWILIO_INTERCONNECT_TOKYO_MO = "twilio-interconnect-tokyo-mo" + TWILIO_INTERCONNECT_TOKYO_SETUP = "twilio-interconnect-tokyo-setup" + TWILIO_INTERCONNECT_VA = "twilio-interconnect-va" + TWILIO_INTERCONNECT_VA_MO = "twilio-interconnect-va-mo" + TWILIO_INTERCONNECT_VA_SETUP = "twilio-interconnect-va-setup" + TWIML_VERBS = "twiml-verbs" + TWIML_VERBS_SAY = "twiml-verbs-say" + USAGE_PROGRAMMABLE_MESSAGING_ENGAGEMENT_SUITE = ( + "usage-programmable-messaging-engagement-suite" + ) + USAGE_PROGRAMMABLE_MESSAGING_FEES_SERVICES = ( + "usage-programmable-messaging-fees-services" + ) + VERIFY_OUTBOUND_EMAIL = "verify-outbound-email" + VERIFY_PACKAGED_PLANS = "verify-packaged-plans" + VERIFY_SILENT_NETWORK_AUTH = "verify-silent-network-auth" + VERIFY_VOICE_AND_SMS = "verify-voice-and-sms" + VOICE_INSIGHTS_CLIENT_INSIGHTS_MONTHY_COMMIT = ( + "voice-insights-client-insights-monthy-commit" + ) + WIRELESS_DATA_PAYG_ASIA_AFG = "wireless-data-payg-asia-afg" + WIRELESS_MULTI_IMSI_SIM_COMMANDS = "wireless-multi-imsi-sim-commands" + WIRELESS_MULTI_IMSI_SIM_COMMANDS_USA = "wireless-multi-imsi-sim-commands-usa" + WIRELESS_MULTI_IMSI_SIM_DATA = "wireless-multi-imsi-sim-data" + WIRELESS_MULTI_IMSI_SIM_DATA_EU28 = "wireless-multi-imsi-sim-data-eu28" + WIRELESS_MULTI_IMSI_SIM_DATA_USA = "wireless-multi-imsi-sim-data-usa" + WIRELESS_MULTI_IMSI_SIM_MONTHLY_FEES = "wireless-multi-imsi-sim-monthly-fees" + WIRELESS_MULTI_IMSI_SIM_USAGE = "wireless-multi-imsi-sim-usage" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA = "wireless-super-sim-data-north-america" + WIRELESS_SUPER_SIM_USAGE = "wireless-super-sim-usage" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. diff --git a/twilio/rest/api/v2010/account/usage/record/last_month.py b/twilio/rest/api/v2010/account/usage/record/last_month.py index acd98874ca..4057283e4a 100644 --- a/twilio/rest/api/v2010/account/usage/record/last_month.py +++ b/twilio/rest/api/v2010/account/usage/record/last_month.py @@ -25,33 +25,101 @@ class LastMonthInstance(InstanceResource): class Category(object): + A2P_10DLC_REGISTRATIONFEES_BRANDREGISTRATION = ( + "a2p-10dlc-registrationfees-brandregistration" + ) + A2P_10DLC_REGISTRATIONFEES_BV = "a2p-10dlc-registrationfees-bv" + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNCHARGES = ( + "a2p-10dlc-registrationfees-campaigncharges" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNREGISTRATION = ( + "a2p-10dlc-registrationfees-campaignregistration" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNVETTING = ( + "a2p-10dlc-registrationfees-campaignvetting" + ) + A2P_10DLC_REGISTRATIONFEES_MONTHLY = "a2p-10dlc-registrationfees-monthly" + A2P_10DLC_REGISTRATIONFEES_ONETIME = "a2p-10dlc-registrationfees-onetime" A2P_REGISTRATION_FEES = "a2p-registration-fees" + ACCOUNT_SECURITY = "account-security" AGENT_CONFERENCE = "agent-conference" + AGENT_COPILOT = "agent-copilot" + AGENT_COPILOT_MESSAGES = "agent-copilot-messages" + AGENT_COPILOT_PARTICIPANT_MINUTES = "agent-copilot-participant-minutes" + AI_ASSISTANTS = "ai-assistants" + AI_ASSISTANTS_VOICE = "ai-assistants-voice" AMAZON_POLLY = "amazon-polly" ANSWERING_MACHINE_DETECTION = "answering-machine-detection" + ASSETS = "assets" + AUDIENCE_MINUTES = "audience-minutes" + AUDIENCE_MINUTES_AUDIO = "audience-minutes-audio" AUTHY_AUTHENTICATIONS = "authy-authentications" AUTHY_CALLS_OUTBOUND = "authy-calls-outbound" + AUTHY_EMAIL_AUTHENTICATIONS = "authy-email-authentications" AUTHY_MONTHLY_FEES = "authy-monthly-fees" + AUTHY_OUTBOUND_EMAIL = "authy-outbound-email" AUTHY_PHONE_INTELLIGENCE = "authy-phone-intelligence" AUTHY_PHONE_VERIFICATIONS = "authy-phone-verifications" AUTHY_SMS_OUTBOUND = "authy-sms-outbound" + AUTHY_VERIFY_EMAIL_VERIFICATIONS = "authy-verify-email-verifications" + AUTHY_VERIFY_OUTBOUND_EMAIL = "authy-verify-outbound-email" + AUTOPILOT = "autopilot" + AUTOPILOT_HOME_ASSISTANTS = "autopilot-home-assistants" + AUTOPILOT_MESSAGING = "autopilot-messaging" + AUTOPILOT_OTHER = "autopilot-other" + AUTOPILOT_VOICE = "autopilot-voice" + BASIC_PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( + "basic-peer-to-peer-rooms-participant-minutes" + ) + BRANDED_CALLING = "branded-calling" + BUNDLE_SMS_BUCKET = "bundle-sms-bucket" + BUNDLE_SUBSCRIPTION_FEES = "bundle-subscription-fees" + CALL_FORWARDING_LOOKUPS = "call-forwarding-lookups" CALL_PROGESS_EVENTS = "call-progess-events" CALLERIDLOOKUPS = "calleridlookups" CALLS = "calls" CALLS_CLIENT = "calls-client" + CALLS_EMERGENCY = "calls-emergency" CALLS_GLOBALCONFERENCE = "calls-globalconference" CALLS_INBOUND = "calls-inbound" CALLS_INBOUND_LOCAL = "calls-inbound-local" CALLS_INBOUND_MOBILE = "calls-inbound-mobile" CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree" + CALLS_INBOUND_TOLLFREE_LOCAL = "calls-inbound-tollfree-local" + CALLS_INBOUND_TOLLFREE_MOBILE = "calls-inbound-tollfree-mobile" + CALLS_MEDIA_STREAM_MINUTES = "calls-media-stream-minutes" CALLS_OUTBOUND = "calls-outbound" CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions" CALLS_RECORDINGS = "calls-recordings" CALLS_SIP = "calls-sip" CALLS_SIP_INBOUND = "calls-sip-inbound" CALLS_SIP_OUTBOUND = "calls-sip-outbound" + CALLS_TEXT_TO_SPEECH = "calls-text-to-speech" CALLS_TRANSFERS = "calls-transfers" CARRIER_LOOKUPS = "carrier-lookups" + CATEGORY = "category" + CHANNELS = "channels" + CHANNELS_MESSAGING = "channels-messaging" + CHANNELS_MESSAGING_INBOUND = "channels-messaging-inbound" + CHANNELS_MESSAGING_OUTBOUND = "channels-messaging-outbound" + CHANNELS_WHATSAPP = "channels-whatsapp" + CHANNELS_WHATSAPP_CONVERSATION_AUTHENTICATION = ( + "channels-whatsapp-conversation-authentication" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE = "channels-whatsapp-conversation-free" + CHANNELS_WHATSAPP_CONVERSATION_MARKETING = ( + "channels-whatsapp-conversation-marketing" + ) + CHANNELS_WHATSAPP_CONVERSATION_SERVICE = ( + "channels-whatsapp-conversation-service" + ) + CHANNELS_WHATSAPP_CONVERSATION_UTILITY = ( + "channels-whatsapp-conversation-utility" + ) + CHANNELS_WHATSAPP_INBOUND = "channels-whatsapp-inbound" + CHANNELS_WHATSAPP_OUTBOUND = "channels-whatsapp-outbound" + CHAT_VIRTUAL_AGENT = "chat-virtual-agent" + CONVERSATION_RELAY = "conversation-relay" CONVERSATIONS = "conversations" CONVERSATIONS_API_REQUESTS = "conversations-api-requests" CONVERSATIONS_CONVERSATION_EVENTS = "conversations-conversation-events" @@ -60,8 +128,40 @@ class Category(object): CONVERSATIONS_PARTICIPANT_EVENTS = "conversations-participant-events" CONVERSATIONS_PARTICIPANTS = "conversations-participants" CPS = "cps" + CREDIT_TRANSFER = "credit-transfer" + EMAIL = "email" + EMERGING_TECH = "emerging-tech" + ENGAGEMENT_SUITE_PACKAGED_PLANS = "engagement-suite-packaged-plans" + ENHANCED_LINE_TYPE_LOOKUPS = "enhanced-line-type-lookups" + ENTERPRISE = "enterprise" + EVENTS = "events" + EXPERIMENT_FRANCE_SMS = "experiment-france-sms" + EXPERIMENT_INDIA_SMS = "experiment-india-sms" + EXPERIMENT_UK_SMS = "experiment-uk-sms" + FAILED_MESSAGE_PROCESSING_FEE = "failed-message-processing-fee" + FLEX = "flex" + FLEX_ACTIVE_USER_HOURS = "flex-active-user-hours" + FLEX_CONCURRENT_USERS = "flex-concurrent-users" + FLEX_CONVERSATIONAL_INSIGHTS = "flex-conversational-insights" + FLEX_CONVERSATIONAL_INSIGHTS_MESSAGES = "flex-conversational-insights-messages" + FLEX_CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = ( + "flex-conversational-insights-voice-minutes" + ) + FLEX_EMAIL_USAGE = "flex-email-usage" + FLEX_MESSAGING_USAGE = "flex-messaging-usage" + FLEX_PARTNER_SPINSCI = "flex-partner-spinsci" + FLEX_PARTNER_XCELERATE = "flex-partner-xcelerate" + FLEX_RESELLER_ECOSYSTEM = "flex-reseller-ecosystem" + FLEX_UNIQUE_USER = "flex-unique-user" FLEX_USAGE = "flex-usage" + FLEX_USERS = "flex-users" + FLEX_VOICE_MINUTE = "flex-voice-minute" + FLEX_YTICA = "flex-ytica" FRAUD_LOOKUPS = "fraud-lookups" + FRONTLINE = "frontline" + FRONTLINE_USERS = "frontline-users" + FUNCTIONS = "functions" + GENERIC_PAY_TRANSACTIONS = "generic-pay-transactions" GROUP_ROOMS = "group-rooms" GROUP_ROOMS_DATA_TRACK = "group-rooms-data-track" GROUP_ROOMS_ENCRYPTED_MEDIA_RECORDED = "group-rooms-encrypted-media-recorded" @@ -71,9 +171,17 @@ class Category(object): GROUP_ROOMS_MEDIA_STORED = "group-rooms-media-stored" GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" - IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING = "ip-messaging" + IP_MESSAGING_COMMANDS = "ip-messaging-commands" + IP_MESSAGING_DATA_STORAGE = "ip-messaging-data-storage" + IP_MESSAGING_DATA_TRANSFER = "ip-messaging-data-transfer" + IP_MESSAGING_ENDPOINT_CONNECTIVITY = "ip-messaging-endpoint-connectivity" IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" + LINE_STATUS_LOOKUPS = "line-status-lookups" + LIVE_ACTIVITY_LOOKUPS = "live-activity-lookups" + LOOKUP_BUCKET_ADJUSTMENT = "lookup-bucket-adjustment" + LOOKUP_IDENTITY_MATCH = "lookup-identity-match" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( @@ -84,6 +192,13 @@ class Category(object): MARKETPLACE_CAPIO_SPEECH_TO_TEXT = "marketplace-capio-speech-to-text" MARKETPLACE_CONVRIZA_ABABA = "marketplace-convriza-ababa" MARKETPLACE_DEEPGRAM_PHRASE_DETECTOR = "marketplace-deepgram-phrase-detector" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION = "marketplace-deepgram-transcription" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION_BASE = ( + "marketplace-deepgram-transcription-base" + ) + MARKETPLACE_DEEPGRAM_TRANSSCRIPTION_ENHANCED = ( + "marketplace-deepgram-transscription-enhanced" + ) MARKETPLACE_DIGITAL_SEGMENT_BUSINESS_INFO = ( "marketplace-digital-segment-business-info" ) @@ -109,6 +224,9 @@ class Category(object): "marketplace-keen-io-contact-center-analytics" ) MARKETPLACE_MARCHEX_CLEANCALL = "marketplace-marchex-cleancall" + MARKETPLACE_MARCHEX_RECORDING_ANALYSIS = ( + "marketplace-marchex-recording-analysis" + ) MARKETPLACE_MARCHEX_SENTIMENT_ANALYSIS_FOR_SMS = ( "marketplace-marchex-sentiment-analysis-for-sms" ) @@ -125,14 +243,42 @@ class Category(object): "marketplace-nextcaller-advanced-caller-identification" ) MARKETPLACE_NOMOROBO_SPAM_SCORE = "marketplace-nomorobo-spam-score" + MARKETPLACE_PAY_ADDONS = "marketplace-pay-addons" + MARKETPLACE_PAY_ADDONS_BASECOMMERCE_PAY_CONNECTOR = ( + "marketplace-pay-addons-basecommerce-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_BRAINTREE_PAY_CONNECTOR = ( + "marketplace-pay-addons-braintree-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CARDCONNECT_PAY_CONNECTOR = ( + "marketplace-pay-addons-cardconnect-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CHASE_PAY_CONNECTOR = ( + "marketplace-pay-addons-chase-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplace-pay-addons-shuttle-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplace-pay-addons-stripe-pay-connector" + ) MARKETPLACE_PAYFONE_TCPA_COMPLIANCE = "marketplace-payfone-tcpa-compliance" + MARKETPLACE_POLY_AI_CONNECTOR = "marketplace-poly-ai-connector" + MARKETPLACE_REALPHONEVALIDATION = "marketplace-realphonevalidation" MARKETPLACE_REMEETING_AUTOMATIC_SPEECH_RECOGNITION = ( "marketplace-remeeting-automatic-speech-recognition" ) + MARKETPLACE_SPOKE_PHONE_LICENSE_PRO = "marketplace-spoke-phone-license-pro" + MARKETPLACE_SPOKE_PHONE_LICENSE_STANDARD = ( + "marketplace-spoke-phone-license-standard" + ) MARKETPLACE_TCPA_DEFENSE_SOLUTIONS_BLACKLIST_FEED = ( "marketplace-tcpa-defense-solutions-blacklist-feed" ) MARKETPLACE_TELO_OPENCNAM = "marketplace-telo-opencnam" + MARKETPLACE_TRESTLE_SOLUTIONS_CALLER_IDENTIFICATION = ( + "marketplace-trestle-solutions-caller-identification" + ) MARKETPLACE_TRUECNAM_TRUE_SPAM = "marketplace-truecnam-true-spam" MARKETPLACE_TWILIO_CALLER_NAME_LOOKUP_US = ( "marketplace-twilio-caller-name-lookup-us" @@ -145,6 +291,9 @@ class Category(object): MARKETPLACE_VOICEBASE_TRANSCRIPTION_CUSTOM_VOCABULARY = ( "marketplace-voicebase-transcription-custom-vocabulary" ) + MARKETPLACE_WEB_PURIFY_PROFANITY_FILTER = ( + "marketplace-web-purify-profanity-filter" + ) MARKETPLACE_WHITEPAGES_PRO_CALLER_IDENTIFICATION = ( "marketplace-whitepages-pro-caller-identification" ) @@ -159,15 +308,23 @@ class Category(object): MARKETPLACE_YTICA_CONTACT_CENTER_REPORTING_ANALYTICS = ( "marketplace-ytica-contact-center-reporting-analytics" ) + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplay-pay-addons-shuttle-pay-connector" + ) + MEDIA_COMPOSER_MINUTES = "media-composer-minutes" MEDIASTORAGE = "mediastorage" + MIN_SPEND_ADJUSTMENTS = "min-spend-adjustments" MMS = "mms" MMS_INBOUND = "mms-inbound" MMS_INBOUND_LONGCODE = "mms-inbound-longcode" MMS_INBOUND_SHORTCODE = "mms-inbound-shortcode" + MMS_INBOUND_TOLL_FREE = "mms-inbound-toll-free" MMS_MESSAGES_CARRIERFEES = "mms-messages-carrierfees" MMS_OUTBOUND = "mms-outbound" MMS_OUTBOUND_LONGCODE = "mms-outbound-longcode" MMS_OUTBOUND_SHORTCODE = "mms-outbound-shortcode" + MMS_OUTBOUND_TOLLFREE = "mms-outbound-tollfree" + MONITOR = "monitor" MONITOR_READS = "monitor-reads" MONITOR_STORAGE = "monitor-storage" MONITOR_WRITES = "monitor-writes" @@ -176,6 +333,12 @@ class Category(object): NOTIFY_CHANNELS = "notify-channels" NUMBER_FORMAT_LOOKUPS = "number-format-lookups" PCHAT = "pchat" + PCHAT_ACTIONS = "pchat-actions" + PCHAT_APS = "pchat-aps" + PCHAT_CONV_MED_STORAGE = "pchat-conv-med-storage" + PCHAT_MESSAGES = "pchat-messages" + PCHAT_NOTIFICATIONS = "pchat-notifications" + PCHAT_READS = "pchat-reads" PCHAT_USERS = "pchat-users" PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( "peer-to-peer-rooms-participant-minutes" @@ -185,18 +348,41 @@ class Category(object): PFAX_MINUTES_INBOUND = "pfax-minutes-inbound" PFAX_MINUTES_OUTBOUND = "pfax-minutes-outbound" PFAX_PAGES = "pfax-pages" + PHONE_QUALITY_SCORE_LOOKUPS = "phone-quality-score-lookups" PHONENUMBERS = "phonenumbers" PHONENUMBERS_CPS = "phonenumbers-cps" PHONENUMBERS_EMERGENCY = "phonenumbers-emergency" PHONENUMBERS_LOCAL = "phonenumbers-local" PHONENUMBERS_MOBILE = "phonenumbers-mobile" + PHONENUMBERS_PORTING = "phonenumbers-porting" PHONENUMBERS_SETUPS = "phonenumbers-setups" PHONENUMBERS_TOLLFREE = "phonenumbers-tollfree" PREMIUMSUPPORT = "premiumsupport" + PREMIUMSUPPORT_PERCENTAGE_SPEND = "premiumsupport-percentage-spend" + PROGRAMMABLEVOICE_PLATFORM = "programmablevoice-platform" + PROGRAMMABLEVOICECONN_CLIENTSDK = "programmablevoiceconn-clientsdk" + PROGRAMMABLEVOICECONN_CLIENTSDK_INBOUND = ( + "programmablevoiceconn-clientsdk-inbound" + ) + PROGRAMMABLEVOICECONN_CLIENTSDK_OUTBOUND = ( + "programmablevoiceconn-clientsdk-outbound" + ) + PROGRAMMABLEVOICECONN_ONNET = "programmablevoiceconn-onnet" + PROGRAMMABLEVOICECONN_ONNET_INBOUND = "programmablevoiceconn-onnet-inbound" + PROGRAMMABLEVOICECONN_ONNET_OUTBOUND = "programmablevoiceconn-onnet-outbound" + PROGRAMMABLEVOICECONN_SIP = "programmablevoiceconn-sip" + PROGRAMMABLEVOICECONN_SIP_INBOUND = "programmablevoiceconn-sip-inbound" + PROGRAMMABLEVOICECONN_SIP_OUTBOUND = "programmablevoiceconn-sip-outbound" + PROGRAMMABLEVOICECONNECTIVITY = "programmablevoiceconnectivity" PROXY = "proxy" PROXY_ACTIVE_SESSIONS = "proxy-active-sessions" + PROXY_BUCKET_ADJUSTMENT = "proxy-bucket-adjustment" + PROXY_LICENSES = "proxy-licenses" PSTNCONNECTIVITY = "pstnconnectivity" + PSTNCONNECTIVITY_INBOUND = "pstnconnectivity-inbound" + PSTNCONNECTIVITY_OUTBOUND = "pstnconnectivity-outbound" PV = "pv" + PV_BASIC_ROOMS = "pv-basic-rooms" PV_COMPOSITION_MEDIA_DOWNLOADED = "pv-composition-media-downloaded" PV_COMPOSITION_MEDIA_ENCRYPTED = "pv-composition-media-encrypted" PV_COMPOSITION_MEDIA_STORED = "pv-composition-media-stored" @@ -212,18 +398,20 @@ class Category(object): PV_ROOM_PARTICIPANTS_US2 = "pv-room-participants-us2" PV_ROOMS = "pv-rooms" PV_SIP_ENDPOINT_REGISTRATIONS = "pv-sip-endpoint-registrations" + RCS_MESSAGES = "rcs-messages" + REASSIGNED_NUMBER = "reassigned-number" RECORDINGS = "recordings" RECORDINGSTORAGE = "recordingstorage" - ROOMS_GROUP_BANDWIDTH = "rooms-group-bandwidth" - ROOMS_GROUP_MINUTES = "rooms-group-minutes" - ROOMS_PEER_TO_PEER_MINUTES = "rooms-peer-to-peer-minutes" SHORTCODES = "shortcodes" SHORTCODES_CUSTOMEROWNED = "shortcodes-customerowned" SHORTCODES_MMS_ENABLEMENT = "shortcodes-mms-enablement" SHORTCODES_MPS = "shortcodes-mps" SHORTCODES_RANDOM = "shortcodes-random" + SHORTCODES_SETUP_FEES = "shortcodes-setup-fees" SHORTCODES_UK = "shortcodes-uk" SHORTCODES_VANITY = "shortcodes-vanity" + SIM_SWAP_LOOKUPS = "sim-swap-lookups" + SIP_SECURE_MEDIA = "sip-secure-media" SMALL_GROUP_ROOMS = "small-group-rooms" SMALL_GROUP_ROOMS_DATA_TRACK = "small-group-rooms-data-track" SMALL_GROUP_ROOMS_PARTICIPANT_MINUTES = "small-group-rooms-participant-minutes" @@ -231,13 +419,30 @@ class Category(object): SMS_INBOUND = "sms-inbound" SMS_INBOUND_LONGCODE = "sms-inbound-longcode" SMS_INBOUND_SHORTCODE = "sms-inbound-shortcode" + SMS_INBOUND_TOLLFREE = "sms-inbound-tollfree" SMS_MESSAGES_CARRIERFEES = "sms-messages-carrierfees" SMS_MESSAGES_FEATURES = "sms-messages-features" + SMS_MESSAGES_FEATURES_ENGAGEMENT_SUITE = ( + "sms-messages-features-engagement-suite" + ) + SMS_MESSAGES_FEATURES_MESSAGE_REDACTION = ( + "sms-messages-features-message-redaction" + ) SMS_MESSAGES_FEATURES_SENDERID = "sms-messages-features-senderid" + SMS_MPS = "sms-mps" + SMS_MPS_SHORTCODE = "sms-mps-shortcode" + SMS_MPS_TOLLFREE = "sms-mps-tollfree" + SMS_MPS_TOLLFREE_SETUP = "sms-mps-tollfree-setup" + SMS_NATIONAL_REGULATORY_PROTECTION = "sms-national-regulatory-protection" SMS_OUTBOUND = "sms-outbound" SMS_OUTBOUND_CONTENT_INSPECTION = "sms-outbound-content-inspection" SMS_OUTBOUND_LONGCODE = "sms-outbound-longcode" SMS_OUTBOUND_SHORTCODE = "sms-outbound-shortcode" + SMS_OUTBOUND_TOLLFREE = "sms-outbound-tollfree" + SMS_PUMPING_PROTECTION = "sms-pumping-protection" + SMS_PUMPING_RISK = "sms-pumping-risk" + SMSMESSAGES_BUCKET_ADJUSTMENTS = "smsmessages-bucket-adjustments" + SMSMESSAGES_OUTBOUND_DOMESTIC = "smsmessages-outbound-domestic" SPEECH_RECOGNITION = "speech-recognition" STUDIO_ENGAGEMENTS = "studio-engagements" SYNC = "sync" @@ -267,13 +472,27 @@ class Category(object): TURNMEGABYTES_SINGAPORE = "turnmegabytes-singapore" TURNMEGABYTES_USEAST = "turnmegabytes-useast" TURNMEGABYTES_USWEST = "turnmegabytes-uswest" + TWILIO_FOR_SALESFORCE = "twilio-for-salesforce" + TWILIO_FOR_SALESFORCE_LICENSES = "twilio-for-salesforce-licenses" TWILIO_INTERCONNECT = "twilio-interconnect" + TWIML = "twiml" + USAGE_FLEX_VIDEO = "usage-flex-video" + USAGE_FUNCTIONS = "usage-functions" + USAGE_RCS_BASIC_MESSAGES_OUTBOUND = "usage-rcs-basic-messages-outbound" + USAGE_RCS_MESSAGES = "usage-rcs-messages" + USAGE_RCS_MESSAGES_INBOUND = "usage-rcs-messages-inbound" + USAGE_RCS_MESSAGING_CARRIER_FEES = "usage-rcs-messaging-carrier-fees" + USAGE_RCS_SINGLE_MESSAGES_OUTBOUND = "usage-rcs-single-messages-outbound" + VERIFY_PACKAGE_PLANS = "verify-package-plans" VERIFY_PUSH = "verify-push" + VERIFY_SNA = "verify-sna" VERIFY_TOTP = "verify-totp" + VERIFY_VOICE_SMS = "verify-voice-sms" VERIFY_WHATSAPP_CONVERSATIONS_BUSINESS_INITIATED = ( "verify-whatsapp-conversations-business-initiated" ) VIDEO_RECORDINGS = "video-recordings" + VIDEO_ROOMS_TURN_MEGABYTES = "video-rooms-turn-megabytes" VIRTUAL_AGENT = "virtual-agent" VOICE_INSIGHTS = "voice-insights" VOICE_INSIGHTS_CLIENT_INSIGHTS_ON_DEMAND_MINUTE = ( @@ -289,14 +508,103 @@ class Category(object): "voice-insights-sip-trunking-insights-on-demand-minute" ) VOICE_INTELLIGENCE = "voice-intelligence" - VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + VOICE_INTELLIGENCE_EIP_OPERATORS = "voice-intelligence-eip-operators" VOICE_INTELLIGENCE_OPERATORS = "voice-intelligence-operators" + VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + WDS = "wds" WIRELESS = "wireless" + WIRELESS_DATA = "wireless-data" + WIRELESS_DATA_PAYG = "wireless-data-payg" + WIRELESS_DATA_PAYG_AFRICA = "wireless-data-payg-africa" + WIRELESS_DATA_PAYG_ASIA = "wireless-data-payg-asia" + WIRELESS_DATA_PAYG_CENTRALANDSOUTHAMERICA = ( + "wireless-data-payg-centralandsouthamerica" + ) + WIRELESS_DATA_PAYG_EUROPE = "wireless-data-payg-europe" + WIRELESS_DATA_PAYG_NORTHAMERICA = "wireless-data-payg-northamerica" + WIRELESS_DATA_PAYG_OCEANIA = "wireless-data-payg-oceania" + WIRELESS_DATA_QUOTA1 = "wireless-data-quota1" + WIRELESS_DATA_QUOTA1_AFRICA = "wireless-data-quota1-africa" + WIRELESS_DATA_QUOTA1_ASIA = "wireless-data-quota1-asia" + WIRELESS_DATA_QUOTA1_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota1-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA1_EUROPE = "wireless-data-quota1-europe" + WIRELESS_DATA_QUOTA1_NORTHAMERICA = "wireless-data-quota1-northamerica" + WIRELESS_DATA_QUOTA1_OCEANIA = "wireless-data-quota1-oceania" + WIRELESS_DATA_QUOTA10 = "wireless-data-quota10" + WIRELESS_DATA_QUOTA10_AFRICA = "wireless-data-quota10-africa" + WIRELESS_DATA_QUOTA10_ASIA = "wireless-data-quota10-asia" + WIRELESS_DATA_QUOTA10_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota10-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA10_EUROPE = "wireless-data-quota10-europe" + WIRELESS_DATA_QUOTA10_NORTHAMERICA = "wireless-data-quota10-northamerica" + WIRELESS_DATA_QUOTA10_OCEANIA = "wireless-data-quota10-oceania" + WIRELESS_DATA_QUOTA50 = "wireless-data-quota50" + WIRELESS_DATA_QUOTA50_AFRICA = "wireless-data-quota50-africa" + WIRELESS_DATA_QUOTA50_ASIA = "wireless-data-quota50-asia" + WIRELESS_DATA_QUOTA50_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota50-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA50_EUROPE = "wireless-data-quota50-europe" + WIRELESS_DATA_QUOTA50_NORTHAMERICA = "wireless-data-quota50-northamerica" + WIRELESS_DATA_QUOTA50_OCEANIA = "wireless-data-quota50-oceania" + WIRELESS_DATA_QUOTACUSTOM = "wireless-data-quotacustom" + WIRELESS_DATA_QUOTACUSTOM_AFRICA = "wireless-data-quotacustom-africa" + WIRELESS_DATA_QUOTACUSTOM_ASIA = "wireless-data-quotacustom-asia" + WIRELESS_DATA_QUOTACUSTOM_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quotacustom-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_EUROPE = "wireless-data-quotacustom-europe" + WIRELESS_DATA_QUOTACUSTOM_NORTHAMERICA = ( + "wireless-data-quotacustom-northamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_OCEANIA = "wireless-data-quotacustom-oceania" + WIRELESS_MRC_PAYG = "wireless-mrc-payg" + WIRELESS_MRC_QUOTA1 = "wireless-mrc-quota1" + WIRELESS_MRC_QUOTA10 = "wireless-mrc-quota10" + WIRELESS_MRC_QUOTA50 = "wireless-mrc-quota50" + WIRELESS_MRC_QUOTACUSTOM = "wireless-mrc-quotacustom" WIRELESS_ORDERS = "wireless-orders" WIRELESS_ORDERS_ARTWORK = "wireless-orders-artwork" WIRELESS_ORDERS_BULK = "wireless-orders-bulk" WIRELESS_ORDERS_ESIM = "wireless-orders-esim" WIRELESS_ORDERS_STARTER = "wireless-orders-starter" + WIRELESS_QUOTAS = "wireless-quotas" + WIRELESS_SMS_AFRICA = "wireless-sms-africa" + WIRELESS_SMS_ASIA = "wireless-sms-asia" + WIRELESS_SMS_CENTRALANDSOUTHAMERICA = "wireless-sms-centralandsouthamerica" + WIRELESS_SMS_EUROPE = "wireless-sms-europe" + WIRELESS_SMS_NORTHAMERICA = "wireless-sms-northamerica" + WIRELESS_SMS_OCEANIA = "wireless-sms-oceania" + WIRELESS_SUPER_SIM = "wireless-super-sim" + WIRELESS_SUPER_SIM_DATA = "wireless-super-sim-data" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA_USA = ( + "wireless-super-sim-data-north-america-usa" + ) + WIRELESS_SUPER_SIM_DATA_PAYG = "wireless-super-sim-data-payg" + WIRELESS_SUPER_SIM_DATA_PAYG_EUROPE = "wireless-super-sim-data-payg-europe" + WIRELESS_SUPER_SIM_DATA_PAYG_NORTH_AMERICA = ( + "wireless-super-sim-data-payg-north-america" + ) + WIRELESS_SUPER_SIM_HARDWARE = "wireless-super-sim-hardware" + WIRELESS_SUPER_SIM_HARDWARE_BULK = "wireless-super-sim-hardware-bulk" + WIRELESS_SUPER_SIM_SMSCOMMANDS = "wireless-super-sim-smscommands" + WIRELESS_SUPER_SIM_SMSCOMMANDS_AFRICA = "wireless-super-sim-smscommands-africa" + WIRELESS_SUPER_SIM_SMSCOMMANDS_ASIA = "wireless-super-sim-smscommands-asia" + WIRELESS_SUPER_SIM_SMSCOMMANDS_CENT_AND_SOUTH_AMERICA = ( + "wireless-super-sim-smscommands-cent-and-south-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_EUROPE = "wireless-super-sim-smscommands-europe" + WIRELESS_SUPER_SIM_SMSCOMMANDS_NORTH_AMERICA = ( + "wireless-super-sim-smscommands-north-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_OCEANIA = ( + "wireless-super-sim-smscommands-oceania" + ) + WIRELESS_SUPER_SIM_SUBSCRIPTION = "wireless-super-sim-subscription" + WIRELESS_SUPER_SIM_SUBSCRIPTION_PAYG = "wireless-super-sim-subscription-payg" WIRELESS_USAGE = "wireless-usage" WIRELESS_USAGE_COMMANDS = "wireless-usage-commands" WIRELESS_USAGE_COMMANDS_AFRICA = "wireless-usage-commands-africa" @@ -348,6 +656,184 @@ class Category(object): WIRELESS_USAGE_MRC_SUSPENDED = "wireless-usage-mrc-suspended" WIRELESS_USAGE_SMS = "wireless-usage-sms" WIRELESS_USAGE_VOICE = "wireless-usage-voice" + A2P_FAST_TRACK_ONBOARDING = "a2p-fast-track-onboarding" + ADVISORY_SERVICES = "advisory-services" + ADVISORY_SERVICES_BILLED = "advisory-services-billed" + ADVISORY_SERVICES_CALL_TRACKING = "advisory-services-call-tracking" + ADVISORY_SERVICES_DATA_SERVICES = "advisory-services-data-services" + ADVISORY_SERVICES_EXPENSES = "advisory-services-expenses" + ADVISORY_SERVICES_SIP_TRUNKING = "advisory-services-sip-trunking" + ASSETS_REQUESTS = "assets-requests" + AUDIENCE_MINUTES_VIDEO = "audience-minutes-video" + AUTHY_BUCKET_ADJUSTMENT = "authy-bucket-adjustment" + AUTHY_SOFTWARE = "authy-software" + CALLERIDLOOKUPS_API = "calleridlookups-api" + CALLERIDLOOKUPS_PROGRAMMABLEVOICE = "calleridlookups-programmablevoice" + CALLERIDLOOKUPS_TRUNKING = "calleridlookups-trunking" + CALLS_TRUNKING_INBOUND_TOLLFREE_LOCAL = "calls-trunking-inbound-tollfree-local" + CALLS_TRUNKING_INBOUND_TOLLFREE_MOBILE = ( + "calls-trunking-inbound-tollfree-mobile" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE_1 = "channels-whatsapp-conversation-free-1" + CONFERENCE = "conference" + CONVERSATIONAL_INSIGHTS = "conversational-insights" + CONVERSATIONAL_INSIGHTS_MESSAGES = "conversational-insights-messages" + CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = "conversational-insights-voice-minutes" + DEMO = "demo" + DEMO_UC_SCRIPT_TEST = "demo-uc-script-test" + ELASTIC_SIP_TRUNKING = "elastic-sip-trunking" + ELASTIC_SIP_TRUNKING_CALL_TRANSFERS = "elastic-sip-trunking-call-transfers" + ENTERPRISE_HIPPA = "enterprise-hippa" + FLEX_NAMED_USERS = "flex-named-users" + FLEX_SPINSCI = "flex-spinsci" + FLEX_USERS_1 = "flex-users-1" + FLEX_WFO_PREMIUM_SPEECH_ANALYTICS = "flex-wfo-premium-speech-analytics" + FLEX_XCELERATE = "flex-xcelerate" + FUNCTIONS_ROLLUP = "functions-rollup" + IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING_ADDONS = "ip-messaging-addons" + IVR = "ivr" + IVR_CONVERSATIONAL = "ivr-conversational" + IVR_DTMF = "ivr-dtmf" + IVR_VIRTUALAGENT = "ivr-virtualagent" + LIVE = "live" + LIVE_MEDIA_RECORDING_MINUTES = "live-media-recording-minutes" + LONGCODE_MPS = "longcode-mps" + MARKETPLACE_ANALYTICS_ADDONS = "marketplace-analytics-addons" + MARKETPLACE_ISV_ADDONS = "marketplace-isv-addons" + MARKETPLACE_MESSAGING_ADDONS = "marketplace-messaging-addons" + MARKETPLACE_PHONENUMBERS_ADDONS = "marketplace-phonenumbers-addons" + MARKETPLACE_RECORDING_ADDONS = "marketplace-recording-addons" + MARKETPLACE_VIRTUALAGENT_ADDONS = "marketplace-virtualagent-addons" + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR_1 = ( + "marketplay-pay-addons-shuttle-pay-connector-1" + ) + MARKETPLAY_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplay-pay-addons-stripe-pay-connector" + ) + MMS_INBOUND_LONGCODE_CANADA = "mms-inbound-longcode-canada" + MMS_INBOUND_LONGCODE_UNITEDSTATES = "mms-inbound-longcode-unitedstates" + MMS_OUTBOUND_LONGCODE_CANADA = "mms-outbound-longcode-canada" + MMS_OUTBOUND_LONGCODE_UNITEDSTATES = "mms-outbound-longcode-unitedstates" + MMS_OUTBOUND_TOLL_FREE = "mms-outbound-toll-free" + NOTIFY_CHATAPPSANDOTHERCHANNELS = "notify-chatappsandotherchannels" + NOTIFY_NOTIFYSERVICES = "notify-notifyservices" + NOTIFY_PUSHNOTIFICATIONS = "notify-pushnotifications" + PAYMENT_GATEWAY_CONNECTORS = "payment-gateway-connectors" + PAYMENT_SOLUTIONS = "payment-solutions" + PCHAT_BUCKET_ADJUSTMENT = "pchat-bucket-adjustment" + PHONENUMBERS_NUMBERS = "phonenumbers-numbers" + PROG_VOICE_CLIENT_ANDROID = "prog-voice-client-android" + PROG_VOICE_CLIENT_ANDROID_INBOUND = "prog-voice-client-android-inbound" + PROG_VOICE_CLIENT_ANDROID_OUTBOUND = "prog-voice-client-android-outbound" + PROG_VOICE_CLIENT_IOS = "prog-voice-client-ios" + PROG_VOICE_CLIENT_IOS_INBOUND = "prog-voice-client-ios-inbound" + PROG_VOICE_CLIENT_IOS_OUTBOUND = "prog-voice-client-ios-outbound" + PROG_VOICE_CLIENT_SDK = "prog-voice-client-sdk" + PROG_VOICE_CLIENT_WEB = "prog-voice-client-web" + PROG_VOICE_CLIENT_WEB_INBOUND = "prog-voice-client-web-inbound" + PROG_VOICE_CLIENT_WEB_OUTBOUND = "prog-voice-client-web-outbound" + PROGRAMMABLEVOICECONNECTIVITY_MEDIA_STREAMS = ( + "programmablevoiceconnectivity-media-streams" + ) + PSTNCONNECTIVITY_BYOC = "pstnconnectivity-byoc" + PSTNCONNECTIVITY_EMERGENCY = "pstnconnectivity-emergency" + PSTNCONNECTIVITY_MINUTES = "pstnconnectivity-minutes" + PSTNCONNECTIVITY_MINUTES_1 = "pstnconnectivity-minutes-1" + PSTNCONNECTIVITY_MINUTESINBOUNDLOCAL = "pstnconnectivity-minutesinboundlocal" + PSTNCONNECTIVITY_MINUTESINBOUNDMOBILE = "pstnconnectivity-minutesinboundmobile" + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREE = ( + "pstnconnectivity-minutesinboundtollfree" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREELOCAL = ( + "pstnconnectivity-minutesinboundtollfreelocal" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREEMOBILE = ( + "pstnconnectivity-minutesinboundtollfreemobile" + ) + PV_ROOM_HOURS = "pv-room-hours" + PV_ROOM_SIMULTANEOUS_PARTICIPANT_CONNECTIONS = ( + "pv-room-simultaneous-participant-connections" + ) + PVIDEO_ROOM_HOURS_AU1 = "pvideo-room-hours-au1" + PVIDEO_ROOM_HOURS_BR1 = "pvideo-room-hours-br1" + PVIDEO_ROOM_HOURS_IE1 = "pvideo-room-hours-ie1" + PVIDEO_ROOM_HOURS_JP1 = "pvideo-room-hours-jp1" + PVIDEO_ROOM_HOURS_SG1 = "pvideo-room-hours-sg1" + PVIDEO_ROOM_HOURS_US1 = "pvideo-room-hours-us1" + PVIDEO_ROOM_HOURS_US2 = "pvideo-room-hours-us2" + RECORDINGS_ENCRYPTED = "recordings-encrypted" + SHORT_CODE_SETUP_FEES = "short-code-setup-fees" + SHORTCODES_MESSAGES_INBOUND = "shortcodes-messages-inbound" + SHORTCODES_MESSAGES_OUTBOUND = "shortcodes-messages-outbound" + SMS_MESSAGES_REGISTRATIONFEES = "sms-messages-registrationfees" + SMS_MMS_PENALTY_FEES = "sms-mms-penalty-fees" + SMS_MMS_PENALTY_FEES_1 = "sms-mms-penalty-fees-1" + SMS_PUMPING_PROTECTION_NON_USCA = "sms-pumping-protection-non-usca" + SMS_PUMPING_PROTECTION_USCA = "sms-pumping-protection-usca" + STUDIO = "studio" + STUDIO_MONTHLY_FEES = "studio-monthly-fees" + SUPERSIM = "supersim" + TASK_ROUTER = "task-router" + TASK_ROUTER_WORKERS = "task-router-workers" + TEST_QUOTA_BUCKETS = "test-quota-buckets" + TEST_UC_SCRIPT_1 = "test-uc-script-1" + TEST_UC_SCRIPT_DEMO_2 = "test-uc-script-demo-2" + TEXT_TO_SPEECH = "text-to-speech" + TME = "tme" + TTS_BASIC = "tts-basic" + TWILIO_EDITIONS = "twilio-editions" + TWILIO_INTERCONNECT_CALIFORNIA = "twilio-interconnect-california" + TWILIO_INTERCONNECT_CALIFORNIA_MONTHLY = ( + "twilio-interconnect-california-monthly" + ) + TWILIO_INTERCONNECT_CALIFORNIA_SETUP = "twilio-interconnect-california-setup" + TWILIO_INTERCONNECT_FRANKFURT = "twilio-interconnect-frankfurt" + TWILIO_INTERCONNECT_FRANKFURT_MO = "twilio-interconnect-frankfurt-mo" + TWILIO_INTERCONNECT_FRANKFURT_SETUP = "twilio-interconnect-frankfurt-setup" + TWILIO_INTERCONNECT_LONDON = "twilio-interconnect-london" + TWILIO_INTERCONNECT_LONDON_MO = "twilio-interconnect-london-mo" + TWILIO_INTERCONNECT_LONDON_SETUP = "twilio-interconnect-london-setup" + TWILIO_INTERCONNECT_SAO_PAULO = "twilio-interconnect-sao-paulo" + TWILIO_INTERCONNECT_SAO_PAULO_MONTHLY = "twilio-interconnect-sao-paulo-monthly" + TWILIO_INTERCONNECT_SAO_PAULO_SETUP = "twilio-interconnect-sao-paulo-setup" + TWILIO_INTERCONNECT_SINGAPORE = "twilio-interconnect-singapore" + TWILIO_INTERCONNECT_SINGAPORE_MO = "twilio-interconnect-singapore-mo" + TWILIO_INTERCONNECT_SINGAPORE_SETUP = "twilio-interconnect-singapore-setup" + TWILIO_INTERCONNECT_SYDNEY = "twilio-interconnect-sydney" + TWILIO_INTERCONNECT_SYDNEY_MO = "twilio-interconnect-sydney-mo" + TWILIO_INTERCONNECT_SYDNEY_SETUP = "twilio-interconnect-sydney-setup" + TWILIO_INTERCONNECT_TOKYO = "twilio-interconnect-tokyo" + TWILIO_INTERCONNECT_TOKYO_MO = "twilio-interconnect-tokyo-mo" + TWILIO_INTERCONNECT_TOKYO_SETUP = "twilio-interconnect-tokyo-setup" + TWILIO_INTERCONNECT_VA = "twilio-interconnect-va" + TWILIO_INTERCONNECT_VA_MO = "twilio-interconnect-va-mo" + TWILIO_INTERCONNECT_VA_SETUP = "twilio-interconnect-va-setup" + TWIML_VERBS = "twiml-verbs" + TWIML_VERBS_SAY = "twiml-verbs-say" + USAGE_PROGRAMMABLE_MESSAGING_ENGAGEMENT_SUITE = ( + "usage-programmable-messaging-engagement-suite" + ) + USAGE_PROGRAMMABLE_MESSAGING_FEES_SERVICES = ( + "usage-programmable-messaging-fees-services" + ) + VERIFY_OUTBOUND_EMAIL = "verify-outbound-email" + VERIFY_PACKAGED_PLANS = "verify-packaged-plans" + VERIFY_SILENT_NETWORK_AUTH = "verify-silent-network-auth" + VERIFY_VOICE_AND_SMS = "verify-voice-and-sms" + VOICE_INSIGHTS_CLIENT_INSIGHTS_MONTHY_COMMIT = ( + "voice-insights-client-insights-monthy-commit" + ) + WIRELESS_DATA_PAYG_ASIA_AFG = "wireless-data-payg-asia-afg" + WIRELESS_MULTI_IMSI_SIM_COMMANDS = "wireless-multi-imsi-sim-commands" + WIRELESS_MULTI_IMSI_SIM_COMMANDS_USA = "wireless-multi-imsi-sim-commands-usa" + WIRELESS_MULTI_IMSI_SIM_DATA = "wireless-multi-imsi-sim-data" + WIRELESS_MULTI_IMSI_SIM_DATA_EU28 = "wireless-multi-imsi-sim-data-eu28" + WIRELESS_MULTI_IMSI_SIM_DATA_USA = "wireless-multi-imsi-sim-data-usa" + WIRELESS_MULTI_IMSI_SIM_MONTHLY_FEES = "wireless-multi-imsi-sim-monthly-fees" + WIRELESS_MULTI_IMSI_SIM_USAGE = "wireless-multi-imsi-sim-usage" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA = "wireless-super-sim-data-north-america" + WIRELESS_SUPER_SIM_USAGE = "wireless-super-sim-usage" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. diff --git a/twilio/rest/api/v2010/account/usage/record/monthly.py b/twilio/rest/api/v2010/account/usage/record/monthly.py index 3258e5f4fe..117db692bf 100644 --- a/twilio/rest/api/v2010/account/usage/record/monthly.py +++ b/twilio/rest/api/v2010/account/usage/record/monthly.py @@ -25,33 +25,101 @@ class MonthlyInstance(InstanceResource): class Category(object): + A2P_10DLC_REGISTRATIONFEES_BRANDREGISTRATION = ( + "a2p-10dlc-registrationfees-brandregistration" + ) + A2P_10DLC_REGISTRATIONFEES_BV = "a2p-10dlc-registrationfees-bv" + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNCHARGES = ( + "a2p-10dlc-registrationfees-campaigncharges" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNREGISTRATION = ( + "a2p-10dlc-registrationfees-campaignregistration" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNVETTING = ( + "a2p-10dlc-registrationfees-campaignvetting" + ) + A2P_10DLC_REGISTRATIONFEES_MONTHLY = "a2p-10dlc-registrationfees-monthly" + A2P_10DLC_REGISTRATIONFEES_ONETIME = "a2p-10dlc-registrationfees-onetime" A2P_REGISTRATION_FEES = "a2p-registration-fees" + ACCOUNT_SECURITY = "account-security" AGENT_CONFERENCE = "agent-conference" + AGENT_COPILOT = "agent-copilot" + AGENT_COPILOT_MESSAGES = "agent-copilot-messages" + AGENT_COPILOT_PARTICIPANT_MINUTES = "agent-copilot-participant-minutes" + AI_ASSISTANTS = "ai-assistants" + AI_ASSISTANTS_VOICE = "ai-assistants-voice" AMAZON_POLLY = "amazon-polly" ANSWERING_MACHINE_DETECTION = "answering-machine-detection" + ASSETS = "assets" + AUDIENCE_MINUTES = "audience-minutes" + AUDIENCE_MINUTES_AUDIO = "audience-minutes-audio" AUTHY_AUTHENTICATIONS = "authy-authentications" AUTHY_CALLS_OUTBOUND = "authy-calls-outbound" + AUTHY_EMAIL_AUTHENTICATIONS = "authy-email-authentications" AUTHY_MONTHLY_FEES = "authy-monthly-fees" + AUTHY_OUTBOUND_EMAIL = "authy-outbound-email" AUTHY_PHONE_INTELLIGENCE = "authy-phone-intelligence" AUTHY_PHONE_VERIFICATIONS = "authy-phone-verifications" AUTHY_SMS_OUTBOUND = "authy-sms-outbound" + AUTHY_VERIFY_EMAIL_VERIFICATIONS = "authy-verify-email-verifications" + AUTHY_VERIFY_OUTBOUND_EMAIL = "authy-verify-outbound-email" + AUTOPILOT = "autopilot" + AUTOPILOT_HOME_ASSISTANTS = "autopilot-home-assistants" + AUTOPILOT_MESSAGING = "autopilot-messaging" + AUTOPILOT_OTHER = "autopilot-other" + AUTOPILOT_VOICE = "autopilot-voice" + BASIC_PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( + "basic-peer-to-peer-rooms-participant-minutes" + ) + BRANDED_CALLING = "branded-calling" + BUNDLE_SMS_BUCKET = "bundle-sms-bucket" + BUNDLE_SUBSCRIPTION_FEES = "bundle-subscription-fees" + CALL_FORWARDING_LOOKUPS = "call-forwarding-lookups" CALL_PROGESS_EVENTS = "call-progess-events" CALLERIDLOOKUPS = "calleridlookups" CALLS = "calls" CALLS_CLIENT = "calls-client" + CALLS_EMERGENCY = "calls-emergency" CALLS_GLOBALCONFERENCE = "calls-globalconference" CALLS_INBOUND = "calls-inbound" CALLS_INBOUND_LOCAL = "calls-inbound-local" CALLS_INBOUND_MOBILE = "calls-inbound-mobile" CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree" + CALLS_INBOUND_TOLLFREE_LOCAL = "calls-inbound-tollfree-local" + CALLS_INBOUND_TOLLFREE_MOBILE = "calls-inbound-tollfree-mobile" + CALLS_MEDIA_STREAM_MINUTES = "calls-media-stream-minutes" CALLS_OUTBOUND = "calls-outbound" CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions" CALLS_RECORDINGS = "calls-recordings" CALLS_SIP = "calls-sip" CALLS_SIP_INBOUND = "calls-sip-inbound" CALLS_SIP_OUTBOUND = "calls-sip-outbound" + CALLS_TEXT_TO_SPEECH = "calls-text-to-speech" CALLS_TRANSFERS = "calls-transfers" CARRIER_LOOKUPS = "carrier-lookups" + CATEGORY = "category" + CHANNELS = "channels" + CHANNELS_MESSAGING = "channels-messaging" + CHANNELS_MESSAGING_INBOUND = "channels-messaging-inbound" + CHANNELS_MESSAGING_OUTBOUND = "channels-messaging-outbound" + CHANNELS_WHATSAPP = "channels-whatsapp" + CHANNELS_WHATSAPP_CONVERSATION_AUTHENTICATION = ( + "channels-whatsapp-conversation-authentication" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE = "channels-whatsapp-conversation-free" + CHANNELS_WHATSAPP_CONVERSATION_MARKETING = ( + "channels-whatsapp-conversation-marketing" + ) + CHANNELS_WHATSAPP_CONVERSATION_SERVICE = ( + "channels-whatsapp-conversation-service" + ) + CHANNELS_WHATSAPP_CONVERSATION_UTILITY = ( + "channels-whatsapp-conversation-utility" + ) + CHANNELS_WHATSAPP_INBOUND = "channels-whatsapp-inbound" + CHANNELS_WHATSAPP_OUTBOUND = "channels-whatsapp-outbound" + CHAT_VIRTUAL_AGENT = "chat-virtual-agent" + CONVERSATION_RELAY = "conversation-relay" CONVERSATIONS = "conversations" CONVERSATIONS_API_REQUESTS = "conversations-api-requests" CONVERSATIONS_CONVERSATION_EVENTS = "conversations-conversation-events" @@ -60,8 +128,40 @@ class Category(object): CONVERSATIONS_PARTICIPANT_EVENTS = "conversations-participant-events" CONVERSATIONS_PARTICIPANTS = "conversations-participants" CPS = "cps" + CREDIT_TRANSFER = "credit-transfer" + EMAIL = "email" + EMERGING_TECH = "emerging-tech" + ENGAGEMENT_SUITE_PACKAGED_PLANS = "engagement-suite-packaged-plans" + ENHANCED_LINE_TYPE_LOOKUPS = "enhanced-line-type-lookups" + ENTERPRISE = "enterprise" + EVENTS = "events" + EXPERIMENT_FRANCE_SMS = "experiment-france-sms" + EXPERIMENT_INDIA_SMS = "experiment-india-sms" + EXPERIMENT_UK_SMS = "experiment-uk-sms" + FAILED_MESSAGE_PROCESSING_FEE = "failed-message-processing-fee" + FLEX = "flex" + FLEX_ACTIVE_USER_HOURS = "flex-active-user-hours" + FLEX_CONCURRENT_USERS = "flex-concurrent-users" + FLEX_CONVERSATIONAL_INSIGHTS = "flex-conversational-insights" + FLEX_CONVERSATIONAL_INSIGHTS_MESSAGES = "flex-conversational-insights-messages" + FLEX_CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = ( + "flex-conversational-insights-voice-minutes" + ) + FLEX_EMAIL_USAGE = "flex-email-usage" + FLEX_MESSAGING_USAGE = "flex-messaging-usage" + FLEX_PARTNER_SPINSCI = "flex-partner-spinsci" + FLEX_PARTNER_XCELERATE = "flex-partner-xcelerate" + FLEX_RESELLER_ECOSYSTEM = "flex-reseller-ecosystem" + FLEX_UNIQUE_USER = "flex-unique-user" FLEX_USAGE = "flex-usage" + FLEX_USERS = "flex-users" + FLEX_VOICE_MINUTE = "flex-voice-minute" + FLEX_YTICA = "flex-ytica" FRAUD_LOOKUPS = "fraud-lookups" + FRONTLINE = "frontline" + FRONTLINE_USERS = "frontline-users" + FUNCTIONS = "functions" + GENERIC_PAY_TRANSACTIONS = "generic-pay-transactions" GROUP_ROOMS = "group-rooms" GROUP_ROOMS_DATA_TRACK = "group-rooms-data-track" GROUP_ROOMS_ENCRYPTED_MEDIA_RECORDED = "group-rooms-encrypted-media-recorded" @@ -71,9 +171,17 @@ class Category(object): GROUP_ROOMS_MEDIA_STORED = "group-rooms-media-stored" GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" - IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING = "ip-messaging" + IP_MESSAGING_COMMANDS = "ip-messaging-commands" + IP_MESSAGING_DATA_STORAGE = "ip-messaging-data-storage" + IP_MESSAGING_DATA_TRANSFER = "ip-messaging-data-transfer" + IP_MESSAGING_ENDPOINT_CONNECTIVITY = "ip-messaging-endpoint-connectivity" IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" + LINE_STATUS_LOOKUPS = "line-status-lookups" + LIVE_ACTIVITY_LOOKUPS = "live-activity-lookups" + LOOKUP_BUCKET_ADJUSTMENT = "lookup-bucket-adjustment" + LOOKUP_IDENTITY_MATCH = "lookup-identity-match" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( @@ -84,6 +192,13 @@ class Category(object): MARKETPLACE_CAPIO_SPEECH_TO_TEXT = "marketplace-capio-speech-to-text" MARKETPLACE_CONVRIZA_ABABA = "marketplace-convriza-ababa" MARKETPLACE_DEEPGRAM_PHRASE_DETECTOR = "marketplace-deepgram-phrase-detector" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION = "marketplace-deepgram-transcription" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION_BASE = ( + "marketplace-deepgram-transcription-base" + ) + MARKETPLACE_DEEPGRAM_TRANSSCRIPTION_ENHANCED = ( + "marketplace-deepgram-transscription-enhanced" + ) MARKETPLACE_DIGITAL_SEGMENT_BUSINESS_INFO = ( "marketplace-digital-segment-business-info" ) @@ -109,6 +224,9 @@ class Category(object): "marketplace-keen-io-contact-center-analytics" ) MARKETPLACE_MARCHEX_CLEANCALL = "marketplace-marchex-cleancall" + MARKETPLACE_MARCHEX_RECORDING_ANALYSIS = ( + "marketplace-marchex-recording-analysis" + ) MARKETPLACE_MARCHEX_SENTIMENT_ANALYSIS_FOR_SMS = ( "marketplace-marchex-sentiment-analysis-for-sms" ) @@ -125,14 +243,42 @@ class Category(object): "marketplace-nextcaller-advanced-caller-identification" ) MARKETPLACE_NOMOROBO_SPAM_SCORE = "marketplace-nomorobo-spam-score" + MARKETPLACE_PAY_ADDONS = "marketplace-pay-addons" + MARKETPLACE_PAY_ADDONS_BASECOMMERCE_PAY_CONNECTOR = ( + "marketplace-pay-addons-basecommerce-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_BRAINTREE_PAY_CONNECTOR = ( + "marketplace-pay-addons-braintree-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CARDCONNECT_PAY_CONNECTOR = ( + "marketplace-pay-addons-cardconnect-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CHASE_PAY_CONNECTOR = ( + "marketplace-pay-addons-chase-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplace-pay-addons-shuttle-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplace-pay-addons-stripe-pay-connector" + ) MARKETPLACE_PAYFONE_TCPA_COMPLIANCE = "marketplace-payfone-tcpa-compliance" + MARKETPLACE_POLY_AI_CONNECTOR = "marketplace-poly-ai-connector" + MARKETPLACE_REALPHONEVALIDATION = "marketplace-realphonevalidation" MARKETPLACE_REMEETING_AUTOMATIC_SPEECH_RECOGNITION = ( "marketplace-remeeting-automatic-speech-recognition" ) + MARKETPLACE_SPOKE_PHONE_LICENSE_PRO = "marketplace-spoke-phone-license-pro" + MARKETPLACE_SPOKE_PHONE_LICENSE_STANDARD = ( + "marketplace-spoke-phone-license-standard" + ) MARKETPLACE_TCPA_DEFENSE_SOLUTIONS_BLACKLIST_FEED = ( "marketplace-tcpa-defense-solutions-blacklist-feed" ) MARKETPLACE_TELO_OPENCNAM = "marketplace-telo-opencnam" + MARKETPLACE_TRESTLE_SOLUTIONS_CALLER_IDENTIFICATION = ( + "marketplace-trestle-solutions-caller-identification" + ) MARKETPLACE_TRUECNAM_TRUE_SPAM = "marketplace-truecnam-true-spam" MARKETPLACE_TWILIO_CALLER_NAME_LOOKUP_US = ( "marketplace-twilio-caller-name-lookup-us" @@ -145,6 +291,9 @@ class Category(object): MARKETPLACE_VOICEBASE_TRANSCRIPTION_CUSTOM_VOCABULARY = ( "marketplace-voicebase-transcription-custom-vocabulary" ) + MARKETPLACE_WEB_PURIFY_PROFANITY_FILTER = ( + "marketplace-web-purify-profanity-filter" + ) MARKETPLACE_WHITEPAGES_PRO_CALLER_IDENTIFICATION = ( "marketplace-whitepages-pro-caller-identification" ) @@ -159,15 +308,23 @@ class Category(object): MARKETPLACE_YTICA_CONTACT_CENTER_REPORTING_ANALYTICS = ( "marketplace-ytica-contact-center-reporting-analytics" ) + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplay-pay-addons-shuttle-pay-connector" + ) + MEDIA_COMPOSER_MINUTES = "media-composer-minutes" MEDIASTORAGE = "mediastorage" + MIN_SPEND_ADJUSTMENTS = "min-spend-adjustments" MMS = "mms" MMS_INBOUND = "mms-inbound" MMS_INBOUND_LONGCODE = "mms-inbound-longcode" MMS_INBOUND_SHORTCODE = "mms-inbound-shortcode" + MMS_INBOUND_TOLL_FREE = "mms-inbound-toll-free" MMS_MESSAGES_CARRIERFEES = "mms-messages-carrierfees" MMS_OUTBOUND = "mms-outbound" MMS_OUTBOUND_LONGCODE = "mms-outbound-longcode" MMS_OUTBOUND_SHORTCODE = "mms-outbound-shortcode" + MMS_OUTBOUND_TOLLFREE = "mms-outbound-tollfree" + MONITOR = "monitor" MONITOR_READS = "monitor-reads" MONITOR_STORAGE = "monitor-storage" MONITOR_WRITES = "monitor-writes" @@ -176,6 +333,12 @@ class Category(object): NOTIFY_CHANNELS = "notify-channels" NUMBER_FORMAT_LOOKUPS = "number-format-lookups" PCHAT = "pchat" + PCHAT_ACTIONS = "pchat-actions" + PCHAT_APS = "pchat-aps" + PCHAT_CONV_MED_STORAGE = "pchat-conv-med-storage" + PCHAT_MESSAGES = "pchat-messages" + PCHAT_NOTIFICATIONS = "pchat-notifications" + PCHAT_READS = "pchat-reads" PCHAT_USERS = "pchat-users" PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( "peer-to-peer-rooms-participant-minutes" @@ -185,18 +348,41 @@ class Category(object): PFAX_MINUTES_INBOUND = "pfax-minutes-inbound" PFAX_MINUTES_OUTBOUND = "pfax-minutes-outbound" PFAX_PAGES = "pfax-pages" + PHONE_QUALITY_SCORE_LOOKUPS = "phone-quality-score-lookups" PHONENUMBERS = "phonenumbers" PHONENUMBERS_CPS = "phonenumbers-cps" PHONENUMBERS_EMERGENCY = "phonenumbers-emergency" PHONENUMBERS_LOCAL = "phonenumbers-local" PHONENUMBERS_MOBILE = "phonenumbers-mobile" + PHONENUMBERS_PORTING = "phonenumbers-porting" PHONENUMBERS_SETUPS = "phonenumbers-setups" PHONENUMBERS_TOLLFREE = "phonenumbers-tollfree" PREMIUMSUPPORT = "premiumsupport" + PREMIUMSUPPORT_PERCENTAGE_SPEND = "premiumsupport-percentage-spend" + PROGRAMMABLEVOICE_PLATFORM = "programmablevoice-platform" + PROGRAMMABLEVOICECONN_CLIENTSDK = "programmablevoiceconn-clientsdk" + PROGRAMMABLEVOICECONN_CLIENTSDK_INBOUND = ( + "programmablevoiceconn-clientsdk-inbound" + ) + PROGRAMMABLEVOICECONN_CLIENTSDK_OUTBOUND = ( + "programmablevoiceconn-clientsdk-outbound" + ) + PROGRAMMABLEVOICECONN_ONNET = "programmablevoiceconn-onnet" + PROGRAMMABLEVOICECONN_ONNET_INBOUND = "programmablevoiceconn-onnet-inbound" + PROGRAMMABLEVOICECONN_ONNET_OUTBOUND = "programmablevoiceconn-onnet-outbound" + PROGRAMMABLEVOICECONN_SIP = "programmablevoiceconn-sip" + PROGRAMMABLEVOICECONN_SIP_INBOUND = "programmablevoiceconn-sip-inbound" + PROGRAMMABLEVOICECONN_SIP_OUTBOUND = "programmablevoiceconn-sip-outbound" + PROGRAMMABLEVOICECONNECTIVITY = "programmablevoiceconnectivity" PROXY = "proxy" PROXY_ACTIVE_SESSIONS = "proxy-active-sessions" + PROXY_BUCKET_ADJUSTMENT = "proxy-bucket-adjustment" + PROXY_LICENSES = "proxy-licenses" PSTNCONNECTIVITY = "pstnconnectivity" + PSTNCONNECTIVITY_INBOUND = "pstnconnectivity-inbound" + PSTNCONNECTIVITY_OUTBOUND = "pstnconnectivity-outbound" PV = "pv" + PV_BASIC_ROOMS = "pv-basic-rooms" PV_COMPOSITION_MEDIA_DOWNLOADED = "pv-composition-media-downloaded" PV_COMPOSITION_MEDIA_ENCRYPTED = "pv-composition-media-encrypted" PV_COMPOSITION_MEDIA_STORED = "pv-composition-media-stored" @@ -212,18 +398,20 @@ class Category(object): PV_ROOM_PARTICIPANTS_US2 = "pv-room-participants-us2" PV_ROOMS = "pv-rooms" PV_SIP_ENDPOINT_REGISTRATIONS = "pv-sip-endpoint-registrations" + RCS_MESSAGES = "rcs-messages" + REASSIGNED_NUMBER = "reassigned-number" RECORDINGS = "recordings" RECORDINGSTORAGE = "recordingstorage" - ROOMS_GROUP_BANDWIDTH = "rooms-group-bandwidth" - ROOMS_GROUP_MINUTES = "rooms-group-minutes" - ROOMS_PEER_TO_PEER_MINUTES = "rooms-peer-to-peer-minutes" SHORTCODES = "shortcodes" SHORTCODES_CUSTOMEROWNED = "shortcodes-customerowned" SHORTCODES_MMS_ENABLEMENT = "shortcodes-mms-enablement" SHORTCODES_MPS = "shortcodes-mps" SHORTCODES_RANDOM = "shortcodes-random" + SHORTCODES_SETUP_FEES = "shortcodes-setup-fees" SHORTCODES_UK = "shortcodes-uk" SHORTCODES_VANITY = "shortcodes-vanity" + SIM_SWAP_LOOKUPS = "sim-swap-lookups" + SIP_SECURE_MEDIA = "sip-secure-media" SMALL_GROUP_ROOMS = "small-group-rooms" SMALL_GROUP_ROOMS_DATA_TRACK = "small-group-rooms-data-track" SMALL_GROUP_ROOMS_PARTICIPANT_MINUTES = "small-group-rooms-participant-minutes" @@ -231,13 +419,30 @@ class Category(object): SMS_INBOUND = "sms-inbound" SMS_INBOUND_LONGCODE = "sms-inbound-longcode" SMS_INBOUND_SHORTCODE = "sms-inbound-shortcode" + SMS_INBOUND_TOLLFREE = "sms-inbound-tollfree" SMS_MESSAGES_CARRIERFEES = "sms-messages-carrierfees" SMS_MESSAGES_FEATURES = "sms-messages-features" + SMS_MESSAGES_FEATURES_ENGAGEMENT_SUITE = ( + "sms-messages-features-engagement-suite" + ) + SMS_MESSAGES_FEATURES_MESSAGE_REDACTION = ( + "sms-messages-features-message-redaction" + ) SMS_MESSAGES_FEATURES_SENDERID = "sms-messages-features-senderid" + SMS_MPS = "sms-mps" + SMS_MPS_SHORTCODE = "sms-mps-shortcode" + SMS_MPS_TOLLFREE = "sms-mps-tollfree" + SMS_MPS_TOLLFREE_SETUP = "sms-mps-tollfree-setup" + SMS_NATIONAL_REGULATORY_PROTECTION = "sms-national-regulatory-protection" SMS_OUTBOUND = "sms-outbound" SMS_OUTBOUND_CONTENT_INSPECTION = "sms-outbound-content-inspection" SMS_OUTBOUND_LONGCODE = "sms-outbound-longcode" SMS_OUTBOUND_SHORTCODE = "sms-outbound-shortcode" + SMS_OUTBOUND_TOLLFREE = "sms-outbound-tollfree" + SMS_PUMPING_PROTECTION = "sms-pumping-protection" + SMS_PUMPING_RISK = "sms-pumping-risk" + SMSMESSAGES_BUCKET_ADJUSTMENTS = "smsmessages-bucket-adjustments" + SMSMESSAGES_OUTBOUND_DOMESTIC = "smsmessages-outbound-domestic" SPEECH_RECOGNITION = "speech-recognition" STUDIO_ENGAGEMENTS = "studio-engagements" SYNC = "sync" @@ -267,13 +472,27 @@ class Category(object): TURNMEGABYTES_SINGAPORE = "turnmegabytes-singapore" TURNMEGABYTES_USEAST = "turnmegabytes-useast" TURNMEGABYTES_USWEST = "turnmegabytes-uswest" + TWILIO_FOR_SALESFORCE = "twilio-for-salesforce" + TWILIO_FOR_SALESFORCE_LICENSES = "twilio-for-salesforce-licenses" TWILIO_INTERCONNECT = "twilio-interconnect" + TWIML = "twiml" + USAGE_FLEX_VIDEO = "usage-flex-video" + USAGE_FUNCTIONS = "usage-functions" + USAGE_RCS_BASIC_MESSAGES_OUTBOUND = "usage-rcs-basic-messages-outbound" + USAGE_RCS_MESSAGES = "usage-rcs-messages" + USAGE_RCS_MESSAGES_INBOUND = "usage-rcs-messages-inbound" + USAGE_RCS_MESSAGING_CARRIER_FEES = "usage-rcs-messaging-carrier-fees" + USAGE_RCS_SINGLE_MESSAGES_OUTBOUND = "usage-rcs-single-messages-outbound" + VERIFY_PACKAGE_PLANS = "verify-package-plans" VERIFY_PUSH = "verify-push" + VERIFY_SNA = "verify-sna" VERIFY_TOTP = "verify-totp" + VERIFY_VOICE_SMS = "verify-voice-sms" VERIFY_WHATSAPP_CONVERSATIONS_BUSINESS_INITIATED = ( "verify-whatsapp-conversations-business-initiated" ) VIDEO_RECORDINGS = "video-recordings" + VIDEO_ROOMS_TURN_MEGABYTES = "video-rooms-turn-megabytes" VIRTUAL_AGENT = "virtual-agent" VOICE_INSIGHTS = "voice-insights" VOICE_INSIGHTS_CLIENT_INSIGHTS_ON_DEMAND_MINUTE = ( @@ -289,14 +508,103 @@ class Category(object): "voice-insights-sip-trunking-insights-on-demand-minute" ) VOICE_INTELLIGENCE = "voice-intelligence" - VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + VOICE_INTELLIGENCE_EIP_OPERATORS = "voice-intelligence-eip-operators" VOICE_INTELLIGENCE_OPERATORS = "voice-intelligence-operators" + VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + WDS = "wds" WIRELESS = "wireless" + WIRELESS_DATA = "wireless-data" + WIRELESS_DATA_PAYG = "wireless-data-payg" + WIRELESS_DATA_PAYG_AFRICA = "wireless-data-payg-africa" + WIRELESS_DATA_PAYG_ASIA = "wireless-data-payg-asia" + WIRELESS_DATA_PAYG_CENTRALANDSOUTHAMERICA = ( + "wireless-data-payg-centralandsouthamerica" + ) + WIRELESS_DATA_PAYG_EUROPE = "wireless-data-payg-europe" + WIRELESS_DATA_PAYG_NORTHAMERICA = "wireless-data-payg-northamerica" + WIRELESS_DATA_PAYG_OCEANIA = "wireless-data-payg-oceania" + WIRELESS_DATA_QUOTA1 = "wireless-data-quota1" + WIRELESS_DATA_QUOTA1_AFRICA = "wireless-data-quota1-africa" + WIRELESS_DATA_QUOTA1_ASIA = "wireless-data-quota1-asia" + WIRELESS_DATA_QUOTA1_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota1-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA1_EUROPE = "wireless-data-quota1-europe" + WIRELESS_DATA_QUOTA1_NORTHAMERICA = "wireless-data-quota1-northamerica" + WIRELESS_DATA_QUOTA1_OCEANIA = "wireless-data-quota1-oceania" + WIRELESS_DATA_QUOTA10 = "wireless-data-quota10" + WIRELESS_DATA_QUOTA10_AFRICA = "wireless-data-quota10-africa" + WIRELESS_DATA_QUOTA10_ASIA = "wireless-data-quota10-asia" + WIRELESS_DATA_QUOTA10_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota10-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA10_EUROPE = "wireless-data-quota10-europe" + WIRELESS_DATA_QUOTA10_NORTHAMERICA = "wireless-data-quota10-northamerica" + WIRELESS_DATA_QUOTA10_OCEANIA = "wireless-data-quota10-oceania" + WIRELESS_DATA_QUOTA50 = "wireless-data-quota50" + WIRELESS_DATA_QUOTA50_AFRICA = "wireless-data-quota50-africa" + WIRELESS_DATA_QUOTA50_ASIA = "wireless-data-quota50-asia" + WIRELESS_DATA_QUOTA50_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota50-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA50_EUROPE = "wireless-data-quota50-europe" + WIRELESS_DATA_QUOTA50_NORTHAMERICA = "wireless-data-quota50-northamerica" + WIRELESS_DATA_QUOTA50_OCEANIA = "wireless-data-quota50-oceania" + WIRELESS_DATA_QUOTACUSTOM = "wireless-data-quotacustom" + WIRELESS_DATA_QUOTACUSTOM_AFRICA = "wireless-data-quotacustom-africa" + WIRELESS_DATA_QUOTACUSTOM_ASIA = "wireless-data-quotacustom-asia" + WIRELESS_DATA_QUOTACUSTOM_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quotacustom-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_EUROPE = "wireless-data-quotacustom-europe" + WIRELESS_DATA_QUOTACUSTOM_NORTHAMERICA = ( + "wireless-data-quotacustom-northamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_OCEANIA = "wireless-data-quotacustom-oceania" + WIRELESS_MRC_PAYG = "wireless-mrc-payg" + WIRELESS_MRC_QUOTA1 = "wireless-mrc-quota1" + WIRELESS_MRC_QUOTA10 = "wireless-mrc-quota10" + WIRELESS_MRC_QUOTA50 = "wireless-mrc-quota50" + WIRELESS_MRC_QUOTACUSTOM = "wireless-mrc-quotacustom" WIRELESS_ORDERS = "wireless-orders" WIRELESS_ORDERS_ARTWORK = "wireless-orders-artwork" WIRELESS_ORDERS_BULK = "wireless-orders-bulk" WIRELESS_ORDERS_ESIM = "wireless-orders-esim" WIRELESS_ORDERS_STARTER = "wireless-orders-starter" + WIRELESS_QUOTAS = "wireless-quotas" + WIRELESS_SMS_AFRICA = "wireless-sms-africa" + WIRELESS_SMS_ASIA = "wireless-sms-asia" + WIRELESS_SMS_CENTRALANDSOUTHAMERICA = "wireless-sms-centralandsouthamerica" + WIRELESS_SMS_EUROPE = "wireless-sms-europe" + WIRELESS_SMS_NORTHAMERICA = "wireless-sms-northamerica" + WIRELESS_SMS_OCEANIA = "wireless-sms-oceania" + WIRELESS_SUPER_SIM = "wireless-super-sim" + WIRELESS_SUPER_SIM_DATA = "wireless-super-sim-data" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA_USA = ( + "wireless-super-sim-data-north-america-usa" + ) + WIRELESS_SUPER_SIM_DATA_PAYG = "wireless-super-sim-data-payg" + WIRELESS_SUPER_SIM_DATA_PAYG_EUROPE = "wireless-super-sim-data-payg-europe" + WIRELESS_SUPER_SIM_DATA_PAYG_NORTH_AMERICA = ( + "wireless-super-sim-data-payg-north-america" + ) + WIRELESS_SUPER_SIM_HARDWARE = "wireless-super-sim-hardware" + WIRELESS_SUPER_SIM_HARDWARE_BULK = "wireless-super-sim-hardware-bulk" + WIRELESS_SUPER_SIM_SMSCOMMANDS = "wireless-super-sim-smscommands" + WIRELESS_SUPER_SIM_SMSCOMMANDS_AFRICA = "wireless-super-sim-smscommands-africa" + WIRELESS_SUPER_SIM_SMSCOMMANDS_ASIA = "wireless-super-sim-smscommands-asia" + WIRELESS_SUPER_SIM_SMSCOMMANDS_CENT_AND_SOUTH_AMERICA = ( + "wireless-super-sim-smscommands-cent-and-south-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_EUROPE = "wireless-super-sim-smscommands-europe" + WIRELESS_SUPER_SIM_SMSCOMMANDS_NORTH_AMERICA = ( + "wireless-super-sim-smscommands-north-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_OCEANIA = ( + "wireless-super-sim-smscommands-oceania" + ) + WIRELESS_SUPER_SIM_SUBSCRIPTION = "wireless-super-sim-subscription" + WIRELESS_SUPER_SIM_SUBSCRIPTION_PAYG = "wireless-super-sim-subscription-payg" WIRELESS_USAGE = "wireless-usage" WIRELESS_USAGE_COMMANDS = "wireless-usage-commands" WIRELESS_USAGE_COMMANDS_AFRICA = "wireless-usage-commands-africa" @@ -348,6 +656,184 @@ class Category(object): WIRELESS_USAGE_MRC_SUSPENDED = "wireless-usage-mrc-suspended" WIRELESS_USAGE_SMS = "wireless-usage-sms" WIRELESS_USAGE_VOICE = "wireless-usage-voice" + A2P_FAST_TRACK_ONBOARDING = "a2p-fast-track-onboarding" + ADVISORY_SERVICES = "advisory-services" + ADVISORY_SERVICES_BILLED = "advisory-services-billed" + ADVISORY_SERVICES_CALL_TRACKING = "advisory-services-call-tracking" + ADVISORY_SERVICES_DATA_SERVICES = "advisory-services-data-services" + ADVISORY_SERVICES_EXPENSES = "advisory-services-expenses" + ADVISORY_SERVICES_SIP_TRUNKING = "advisory-services-sip-trunking" + ASSETS_REQUESTS = "assets-requests" + AUDIENCE_MINUTES_VIDEO = "audience-minutes-video" + AUTHY_BUCKET_ADJUSTMENT = "authy-bucket-adjustment" + AUTHY_SOFTWARE = "authy-software" + CALLERIDLOOKUPS_API = "calleridlookups-api" + CALLERIDLOOKUPS_PROGRAMMABLEVOICE = "calleridlookups-programmablevoice" + CALLERIDLOOKUPS_TRUNKING = "calleridlookups-trunking" + CALLS_TRUNKING_INBOUND_TOLLFREE_LOCAL = "calls-trunking-inbound-tollfree-local" + CALLS_TRUNKING_INBOUND_TOLLFREE_MOBILE = ( + "calls-trunking-inbound-tollfree-mobile" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE_1 = "channels-whatsapp-conversation-free-1" + CONFERENCE = "conference" + CONVERSATIONAL_INSIGHTS = "conversational-insights" + CONVERSATIONAL_INSIGHTS_MESSAGES = "conversational-insights-messages" + CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = "conversational-insights-voice-minutes" + DEMO = "demo" + DEMO_UC_SCRIPT_TEST = "demo-uc-script-test" + ELASTIC_SIP_TRUNKING = "elastic-sip-trunking" + ELASTIC_SIP_TRUNKING_CALL_TRANSFERS = "elastic-sip-trunking-call-transfers" + ENTERPRISE_HIPPA = "enterprise-hippa" + FLEX_NAMED_USERS = "flex-named-users" + FLEX_SPINSCI = "flex-spinsci" + FLEX_USERS_1 = "flex-users-1" + FLEX_WFO_PREMIUM_SPEECH_ANALYTICS = "flex-wfo-premium-speech-analytics" + FLEX_XCELERATE = "flex-xcelerate" + FUNCTIONS_ROLLUP = "functions-rollup" + IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING_ADDONS = "ip-messaging-addons" + IVR = "ivr" + IVR_CONVERSATIONAL = "ivr-conversational" + IVR_DTMF = "ivr-dtmf" + IVR_VIRTUALAGENT = "ivr-virtualagent" + LIVE = "live" + LIVE_MEDIA_RECORDING_MINUTES = "live-media-recording-minutes" + LONGCODE_MPS = "longcode-mps" + MARKETPLACE_ANALYTICS_ADDONS = "marketplace-analytics-addons" + MARKETPLACE_ISV_ADDONS = "marketplace-isv-addons" + MARKETPLACE_MESSAGING_ADDONS = "marketplace-messaging-addons" + MARKETPLACE_PHONENUMBERS_ADDONS = "marketplace-phonenumbers-addons" + MARKETPLACE_RECORDING_ADDONS = "marketplace-recording-addons" + MARKETPLACE_VIRTUALAGENT_ADDONS = "marketplace-virtualagent-addons" + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR_1 = ( + "marketplay-pay-addons-shuttle-pay-connector-1" + ) + MARKETPLAY_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplay-pay-addons-stripe-pay-connector" + ) + MMS_INBOUND_LONGCODE_CANADA = "mms-inbound-longcode-canada" + MMS_INBOUND_LONGCODE_UNITEDSTATES = "mms-inbound-longcode-unitedstates" + MMS_OUTBOUND_LONGCODE_CANADA = "mms-outbound-longcode-canada" + MMS_OUTBOUND_LONGCODE_UNITEDSTATES = "mms-outbound-longcode-unitedstates" + MMS_OUTBOUND_TOLL_FREE = "mms-outbound-toll-free" + NOTIFY_CHATAPPSANDOTHERCHANNELS = "notify-chatappsandotherchannels" + NOTIFY_NOTIFYSERVICES = "notify-notifyservices" + NOTIFY_PUSHNOTIFICATIONS = "notify-pushnotifications" + PAYMENT_GATEWAY_CONNECTORS = "payment-gateway-connectors" + PAYMENT_SOLUTIONS = "payment-solutions" + PCHAT_BUCKET_ADJUSTMENT = "pchat-bucket-adjustment" + PHONENUMBERS_NUMBERS = "phonenumbers-numbers" + PROG_VOICE_CLIENT_ANDROID = "prog-voice-client-android" + PROG_VOICE_CLIENT_ANDROID_INBOUND = "prog-voice-client-android-inbound" + PROG_VOICE_CLIENT_ANDROID_OUTBOUND = "prog-voice-client-android-outbound" + PROG_VOICE_CLIENT_IOS = "prog-voice-client-ios" + PROG_VOICE_CLIENT_IOS_INBOUND = "prog-voice-client-ios-inbound" + PROG_VOICE_CLIENT_IOS_OUTBOUND = "prog-voice-client-ios-outbound" + PROG_VOICE_CLIENT_SDK = "prog-voice-client-sdk" + PROG_VOICE_CLIENT_WEB = "prog-voice-client-web" + PROG_VOICE_CLIENT_WEB_INBOUND = "prog-voice-client-web-inbound" + PROG_VOICE_CLIENT_WEB_OUTBOUND = "prog-voice-client-web-outbound" + PROGRAMMABLEVOICECONNECTIVITY_MEDIA_STREAMS = ( + "programmablevoiceconnectivity-media-streams" + ) + PSTNCONNECTIVITY_BYOC = "pstnconnectivity-byoc" + PSTNCONNECTIVITY_EMERGENCY = "pstnconnectivity-emergency" + PSTNCONNECTIVITY_MINUTES = "pstnconnectivity-minutes" + PSTNCONNECTIVITY_MINUTES_1 = "pstnconnectivity-minutes-1" + PSTNCONNECTIVITY_MINUTESINBOUNDLOCAL = "pstnconnectivity-minutesinboundlocal" + PSTNCONNECTIVITY_MINUTESINBOUNDMOBILE = "pstnconnectivity-minutesinboundmobile" + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREE = ( + "pstnconnectivity-minutesinboundtollfree" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREELOCAL = ( + "pstnconnectivity-minutesinboundtollfreelocal" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREEMOBILE = ( + "pstnconnectivity-minutesinboundtollfreemobile" + ) + PV_ROOM_HOURS = "pv-room-hours" + PV_ROOM_SIMULTANEOUS_PARTICIPANT_CONNECTIONS = ( + "pv-room-simultaneous-participant-connections" + ) + PVIDEO_ROOM_HOURS_AU1 = "pvideo-room-hours-au1" + PVIDEO_ROOM_HOURS_BR1 = "pvideo-room-hours-br1" + PVIDEO_ROOM_HOURS_IE1 = "pvideo-room-hours-ie1" + PVIDEO_ROOM_HOURS_JP1 = "pvideo-room-hours-jp1" + PVIDEO_ROOM_HOURS_SG1 = "pvideo-room-hours-sg1" + PVIDEO_ROOM_HOURS_US1 = "pvideo-room-hours-us1" + PVIDEO_ROOM_HOURS_US2 = "pvideo-room-hours-us2" + RECORDINGS_ENCRYPTED = "recordings-encrypted" + SHORT_CODE_SETUP_FEES = "short-code-setup-fees" + SHORTCODES_MESSAGES_INBOUND = "shortcodes-messages-inbound" + SHORTCODES_MESSAGES_OUTBOUND = "shortcodes-messages-outbound" + SMS_MESSAGES_REGISTRATIONFEES = "sms-messages-registrationfees" + SMS_MMS_PENALTY_FEES = "sms-mms-penalty-fees" + SMS_MMS_PENALTY_FEES_1 = "sms-mms-penalty-fees-1" + SMS_PUMPING_PROTECTION_NON_USCA = "sms-pumping-protection-non-usca" + SMS_PUMPING_PROTECTION_USCA = "sms-pumping-protection-usca" + STUDIO = "studio" + STUDIO_MONTHLY_FEES = "studio-monthly-fees" + SUPERSIM = "supersim" + TASK_ROUTER = "task-router" + TASK_ROUTER_WORKERS = "task-router-workers" + TEST_QUOTA_BUCKETS = "test-quota-buckets" + TEST_UC_SCRIPT_1 = "test-uc-script-1" + TEST_UC_SCRIPT_DEMO_2 = "test-uc-script-demo-2" + TEXT_TO_SPEECH = "text-to-speech" + TME = "tme" + TTS_BASIC = "tts-basic" + TWILIO_EDITIONS = "twilio-editions" + TWILIO_INTERCONNECT_CALIFORNIA = "twilio-interconnect-california" + TWILIO_INTERCONNECT_CALIFORNIA_MONTHLY = ( + "twilio-interconnect-california-monthly" + ) + TWILIO_INTERCONNECT_CALIFORNIA_SETUP = "twilio-interconnect-california-setup" + TWILIO_INTERCONNECT_FRANKFURT = "twilio-interconnect-frankfurt" + TWILIO_INTERCONNECT_FRANKFURT_MO = "twilio-interconnect-frankfurt-mo" + TWILIO_INTERCONNECT_FRANKFURT_SETUP = "twilio-interconnect-frankfurt-setup" + TWILIO_INTERCONNECT_LONDON = "twilio-interconnect-london" + TWILIO_INTERCONNECT_LONDON_MO = "twilio-interconnect-london-mo" + TWILIO_INTERCONNECT_LONDON_SETUP = "twilio-interconnect-london-setup" + TWILIO_INTERCONNECT_SAO_PAULO = "twilio-interconnect-sao-paulo" + TWILIO_INTERCONNECT_SAO_PAULO_MONTHLY = "twilio-interconnect-sao-paulo-monthly" + TWILIO_INTERCONNECT_SAO_PAULO_SETUP = "twilio-interconnect-sao-paulo-setup" + TWILIO_INTERCONNECT_SINGAPORE = "twilio-interconnect-singapore" + TWILIO_INTERCONNECT_SINGAPORE_MO = "twilio-interconnect-singapore-mo" + TWILIO_INTERCONNECT_SINGAPORE_SETUP = "twilio-interconnect-singapore-setup" + TWILIO_INTERCONNECT_SYDNEY = "twilio-interconnect-sydney" + TWILIO_INTERCONNECT_SYDNEY_MO = "twilio-interconnect-sydney-mo" + TWILIO_INTERCONNECT_SYDNEY_SETUP = "twilio-interconnect-sydney-setup" + TWILIO_INTERCONNECT_TOKYO = "twilio-interconnect-tokyo" + TWILIO_INTERCONNECT_TOKYO_MO = "twilio-interconnect-tokyo-mo" + TWILIO_INTERCONNECT_TOKYO_SETUP = "twilio-interconnect-tokyo-setup" + TWILIO_INTERCONNECT_VA = "twilio-interconnect-va" + TWILIO_INTERCONNECT_VA_MO = "twilio-interconnect-va-mo" + TWILIO_INTERCONNECT_VA_SETUP = "twilio-interconnect-va-setup" + TWIML_VERBS = "twiml-verbs" + TWIML_VERBS_SAY = "twiml-verbs-say" + USAGE_PROGRAMMABLE_MESSAGING_ENGAGEMENT_SUITE = ( + "usage-programmable-messaging-engagement-suite" + ) + USAGE_PROGRAMMABLE_MESSAGING_FEES_SERVICES = ( + "usage-programmable-messaging-fees-services" + ) + VERIFY_OUTBOUND_EMAIL = "verify-outbound-email" + VERIFY_PACKAGED_PLANS = "verify-packaged-plans" + VERIFY_SILENT_NETWORK_AUTH = "verify-silent-network-auth" + VERIFY_VOICE_AND_SMS = "verify-voice-and-sms" + VOICE_INSIGHTS_CLIENT_INSIGHTS_MONTHY_COMMIT = ( + "voice-insights-client-insights-monthy-commit" + ) + WIRELESS_DATA_PAYG_ASIA_AFG = "wireless-data-payg-asia-afg" + WIRELESS_MULTI_IMSI_SIM_COMMANDS = "wireless-multi-imsi-sim-commands" + WIRELESS_MULTI_IMSI_SIM_COMMANDS_USA = "wireless-multi-imsi-sim-commands-usa" + WIRELESS_MULTI_IMSI_SIM_DATA = "wireless-multi-imsi-sim-data" + WIRELESS_MULTI_IMSI_SIM_DATA_EU28 = "wireless-multi-imsi-sim-data-eu28" + WIRELESS_MULTI_IMSI_SIM_DATA_USA = "wireless-multi-imsi-sim-data-usa" + WIRELESS_MULTI_IMSI_SIM_MONTHLY_FEES = "wireless-multi-imsi-sim-monthly-fees" + WIRELESS_MULTI_IMSI_SIM_USAGE = "wireless-multi-imsi-sim-usage" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA = "wireless-super-sim-data-north-america" + WIRELESS_SUPER_SIM_USAGE = "wireless-super-sim-usage" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. diff --git a/twilio/rest/api/v2010/account/usage/record/this_month.py b/twilio/rest/api/v2010/account/usage/record/this_month.py index cf120b91d3..ab65a177d3 100644 --- a/twilio/rest/api/v2010/account/usage/record/this_month.py +++ b/twilio/rest/api/v2010/account/usage/record/this_month.py @@ -25,33 +25,101 @@ class ThisMonthInstance(InstanceResource): class Category(object): + A2P_10DLC_REGISTRATIONFEES_BRANDREGISTRATION = ( + "a2p-10dlc-registrationfees-brandregistration" + ) + A2P_10DLC_REGISTRATIONFEES_BV = "a2p-10dlc-registrationfees-bv" + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNCHARGES = ( + "a2p-10dlc-registrationfees-campaigncharges" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNREGISTRATION = ( + "a2p-10dlc-registrationfees-campaignregistration" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNVETTING = ( + "a2p-10dlc-registrationfees-campaignvetting" + ) + A2P_10DLC_REGISTRATIONFEES_MONTHLY = "a2p-10dlc-registrationfees-monthly" + A2P_10DLC_REGISTRATIONFEES_ONETIME = "a2p-10dlc-registrationfees-onetime" A2P_REGISTRATION_FEES = "a2p-registration-fees" + ACCOUNT_SECURITY = "account-security" AGENT_CONFERENCE = "agent-conference" + AGENT_COPILOT = "agent-copilot" + AGENT_COPILOT_MESSAGES = "agent-copilot-messages" + AGENT_COPILOT_PARTICIPANT_MINUTES = "agent-copilot-participant-minutes" + AI_ASSISTANTS = "ai-assistants" + AI_ASSISTANTS_VOICE = "ai-assistants-voice" AMAZON_POLLY = "amazon-polly" ANSWERING_MACHINE_DETECTION = "answering-machine-detection" + ASSETS = "assets" + AUDIENCE_MINUTES = "audience-minutes" + AUDIENCE_MINUTES_AUDIO = "audience-minutes-audio" AUTHY_AUTHENTICATIONS = "authy-authentications" AUTHY_CALLS_OUTBOUND = "authy-calls-outbound" + AUTHY_EMAIL_AUTHENTICATIONS = "authy-email-authentications" AUTHY_MONTHLY_FEES = "authy-monthly-fees" + AUTHY_OUTBOUND_EMAIL = "authy-outbound-email" AUTHY_PHONE_INTELLIGENCE = "authy-phone-intelligence" AUTHY_PHONE_VERIFICATIONS = "authy-phone-verifications" AUTHY_SMS_OUTBOUND = "authy-sms-outbound" + AUTHY_VERIFY_EMAIL_VERIFICATIONS = "authy-verify-email-verifications" + AUTHY_VERIFY_OUTBOUND_EMAIL = "authy-verify-outbound-email" + AUTOPILOT = "autopilot" + AUTOPILOT_HOME_ASSISTANTS = "autopilot-home-assistants" + AUTOPILOT_MESSAGING = "autopilot-messaging" + AUTOPILOT_OTHER = "autopilot-other" + AUTOPILOT_VOICE = "autopilot-voice" + BASIC_PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( + "basic-peer-to-peer-rooms-participant-minutes" + ) + BRANDED_CALLING = "branded-calling" + BUNDLE_SMS_BUCKET = "bundle-sms-bucket" + BUNDLE_SUBSCRIPTION_FEES = "bundle-subscription-fees" + CALL_FORWARDING_LOOKUPS = "call-forwarding-lookups" CALL_PROGESS_EVENTS = "call-progess-events" CALLERIDLOOKUPS = "calleridlookups" CALLS = "calls" CALLS_CLIENT = "calls-client" + CALLS_EMERGENCY = "calls-emergency" CALLS_GLOBALCONFERENCE = "calls-globalconference" CALLS_INBOUND = "calls-inbound" CALLS_INBOUND_LOCAL = "calls-inbound-local" CALLS_INBOUND_MOBILE = "calls-inbound-mobile" CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree" + CALLS_INBOUND_TOLLFREE_LOCAL = "calls-inbound-tollfree-local" + CALLS_INBOUND_TOLLFREE_MOBILE = "calls-inbound-tollfree-mobile" + CALLS_MEDIA_STREAM_MINUTES = "calls-media-stream-minutes" CALLS_OUTBOUND = "calls-outbound" CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions" CALLS_RECORDINGS = "calls-recordings" CALLS_SIP = "calls-sip" CALLS_SIP_INBOUND = "calls-sip-inbound" CALLS_SIP_OUTBOUND = "calls-sip-outbound" + CALLS_TEXT_TO_SPEECH = "calls-text-to-speech" CALLS_TRANSFERS = "calls-transfers" CARRIER_LOOKUPS = "carrier-lookups" + CATEGORY = "category" + CHANNELS = "channels" + CHANNELS_MESSAGING = "channels-messaging" + CHANNELS_MESSAGING_INBOUND = "channels-messaging-inbound" + CHANNELS_MESSAGING_OUTBOUND = "channels-messaging-outbound" + CHANNELS_WHATSAPP = "channels-whatsapp" + CHANNELS_WHATSAPP_CONVERSATION_AUTHENTICATION = ( + "channels-whatsapp-conversation-authentication" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE = "channels-whatsapp-conversation-free" + CHANNELS_WHATSAPP_CONVERSATION_MARKETING = ( + "channels-whatsapp-conversation-marketing" + ) + CHANNELS_WHATSAPP_CONVERSATION_SERVICE = ( + "channels-whatsapp-conversation-service" + ) + CHANNELS_WHATSAPP_CONVERSATION_UTILITY = ( + "channels-whatsapp-conversation-utility" + ) + CHANNELS_WHATSAPP_INBOUND = "channels-whatsapp-inbound" + CHANNELS_WHATSAPP_OUTBOUND = "channels-whatsapp-outbound" + CHAT_VIRTUAL_AGENT = "chat-virtual-agent" + CONVERSATION_RELAY = "conversation-relay" CONVERSATIONS = "conversations" CONVERSATIONS_API_REQUESTS = "conversations-api-requests" CONVERSATIONS_CONVERSATION_EVENTS = "conversations-conversation-events" @@ -60,8 +128,40 @@ class Category(object): CONVERSATIONS_PARTICIPANT_EVENTS = "conversations-participant-events" CONVERSATIONS_PARTICIPANTS = "conversations-participants" CPS = "cps" + CREDIT_TRANSFER = "credit-transfer" + EMAIL = "email" + EMERGING_TECH = "emerging-tech" + ENGAGEMENT_SUITE_PACKAGED_PLANS = "engagement-suite-packaged-plans" + ENHANCED_LINE_TYPE_LOOKUPS = "enhanced-line-type-lookups" + ENTERPRISE = "enterprise" + EVENTS = "events" + EXPERIMENT_FRANCE_SMS = "experiment-france-sms" + EXPERIMENT_INDIA_SMS = "experiment-india-sms" + EXPERIMENT_UK_SMS = "experiment-uk-sms" + FAILED_MESSAGE_PROCESSING_FEE = "failed-message-processing-fee" + FLEX = "flex" + FLEX_ACTIVE_USER_HOURS = "flex-active-user-hours" + FLEX_CONCURRENT_USERS = "flex-concurrent-users" + FLEX_CONVERSATIONAL_INSIGHTS = "flex-conversational-insights" + FLEX_CONVERSATIONAL_INSIGHTS_MESSAGES = "flex-conversational-insights-messages" + FLEX_CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = ( + "flex-conversational-insights-voice-minutes" + ) + FLEX_EMAIL_USAGE = "flex-email-usage" + FLEX_MESSAGING_USAGE = "flex-messaging-usage" + FLEX_PARTNER_SPINSCI = "flex-partner-spinsci" + FLEX_PARTNER_XCELERATE = "flex-partner-xcelerate" + FLEX_RESELLER_ECOSYSTEM = "flex-reseller-ecosystem" + FLEX_UNIQUE_USER = "flex-unique-user" FLEX_USAGE = "flex-usage" + FLEX_USERS = "flex-users" + FLEX_VOICE_MINUTE = "flex-voice-minute" + FLEX_YTICA = "flex-ytica" FRAUD_LOOKUPS = "fraud-lookups" + FRONTLINE = "frontline" + FRONTLINE_USERS = "frontline-users" + FUNCTIONS = "functions" + GENERIC_PAY_TRANSACTIONS = "generic-pay-transactions" GROUP_ROOMS = "group-rooms" GROUP_ROOMS_DATA_TRACK = "group-rooms-data-track" GROUP_ROOMS_ENCRYPTED_MEDIA_RECORDED = "group-rooms-encrypted-media-recorded" @@ -71,9 +171,17 @@ class Category(object): GROUP_ROOMS_MEDIA_STORED = "group-rooms-media-stored" GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" - IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING = "ip-messaging" + IP_MESSAGING_COMMANDS = "ip-messaging-commands" + IP_MESSAGING_DATA_STORAGE = "ip-messaging-data-storage" + IP_MESSAGING_DATA_TRANSFER = "ip-messaging-data-transfer" + IP_MESSAGING_ENDPOINT_CONNECTIVITY = "ip-messaging-endpoint-connectivity" IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" + LINE_STATUS_LOOKUPS = "line-status-lookups" + LIVE_ACTIVITY_LOOKUPS = "live-activity-lookups" + LOOKUP_BUCKET_ADJUSTMENT = "lookup-bucket-adjustment" + LOOKUP_IDENTITY_MATCH = "lookup-identity-match" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( @@ -84,6 +192,13 @@ class Category(object): MARKETPLACE_CAPIO_SPEECH_TO_TEXT = "marketplace-capio-speech-to-text" MARKETPLACE_CONVRIZA_ABABA = "marketplace-convriza-ababa" MARKETPLACE_DEEPGRAM_PHRASE_DETECTOR = "marketplace-deepgram-phrase-detector" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION = "marketplace-deepgram-transcription" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION_BASE = ( + "marketplace-deepgram-transcription-base" + ) + MARKETPLACE_DEEPGRAM_TRANSSCRIPTION_ENHANCED = ( + "marketplace-deepgram-transscription-enhanced" + ) MARKETPLACE_DIGITAL_SEGMENT_BUSINESS_INFO = ( "marketplace-digital-segment-business-info" ) @@ -109,6 +224,9 @@ class Category(object): "marketplace-keen-io-contact-center-analytics" ) MARKETPLACE_MARCHEX_CLEANCALL = "marketplace-marchex-cleancall" + MARKETPLACE_MARCHEX_RECORDING_ANALYSIS = ( + "marketplace-marchex-recording-analysis" + ) MARKETPLACE_MARCHEX_SENTIMENT_ANALYSIS_FOR_SMS = ( "marketplace-marchex-sentiment-analysis-for-sms" ) @@ -125,14 +243,42 @@ class Category(object): "marketplace-nextcaller-advanced-caller-identification" ) MARKETPLACE_NOMOROBO_SPAM_SCORE = "marketplace-nomorobo-spam-score" + MARKETPLACE_PAY_ADDONS = "marketplace-pay-addons" + MARKETPLACE_PAY_ADDONS_BASECOMMERCE_PAY_CONNECTOR = ( + "marketplace-pay-addons-basecommerce-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_BRAINTREE_PAY_CONNECTOR = ( + "marketplace-pay-addons-braintree-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CARDCONNECT_PAY_CONNECTOR = ( + "marketplace-pay-addons-cardconnect-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CHASE_PAY_CONNECTOR = ( + "marketplace-pay-addons-chase-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplace-pay-addons-shuttle-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplace-pay-addons-stripe-pay-connector" + ) MARKETPLACE_PAYFONE_TCPA_COMPLIANCE = "marketplace-payfone-tcpa-compliance" + MARKETPLACE_POLY_AI_CONNECTOR = "marketplace-poly-ai-connector" + MARKETPLACE_REALPHONEVALIDATION = "marketplace-realphonevalidation" MARKETPLACE_REMEETING_AUTOMATIC_SPEECH_RECOGNITION = ( "marketplace-remeeting-automatic-speech-recognition" ) + MARKETPLACE_SPOKE_PHONE_LICENSE_PRO = "marketplace-spoke-phone-license-pro" + MARKETPLACE_SPOKE_PHONE_LICENSE_STANDARD = ( + "marketplace-spoke-phone-license-standard" + ) MARKETPLACE_TCPA_DEFENSE_SOLUTIONS_BLACKLIST_FEED = ( "marketplace-tcpa-defense-solutions-blacklist-feed" ) MARKETPLACE_TELO_OPENCNAM = "marketplace-telo-opencnam" + MARKETPLACE_TRESTLE_SOLUTIONS_CALLER_IDENTIFICATION = ( + "marketplace-trestle-solutions-caller-identification" + ) MARKETPLACE_TRUECNAM_TRUE_SPAM = "marketplace-truecnam-true-spam" MARKETPLACE_TWILIO_CALLER_NAME_LOOKUP_US = ( "marketplace-twilio-caller-name-lookup-us" @@ -145,6 +291,9 @@ class Category(object): MARKETPLACE_VOICEBASE_TRANSCRIPTION_CUSTOM_VOCABULARY = ( "marketplace-voicebase-transcription-custom-vocabulary" ) + MARKETPLACE_WEB_PURIFY_PROFANITY_FILTER = ( + "marketplace-web-purify-profanity-filter" + ) MARKETPLACE_WHITEPAGES_PRO_CALLER_IDENTIFICATION = ( "marketplace-whitepages-pro-caller-identification" ) @@ -159,15 +308,23 @@ class Category(object): MARKETPLACE_YTICA_CONTACT_CENTER_REPORTING_ANALYTICS = ( "marketplace-ytica-contact-center-reporting-analytics" ) + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplay-pay-addons-shuttle-pay-connector" + ) + MEDIA_COMPOSER_MINUTES = "media-composer-minutes" MEDIASTORAGE = "mediastorage" + MIN_SPEND_ADJUSTMENTS = "min-spend-adjustments" MMS = "mms" MMS_INBOUND = "mms-inbound" MMS_INBOUND_LONGCODE = "mms-inbound-longcode" MMS_INBOUND_SHORTCODE = "mms-inbound-shortcode" + MMS_INBOUND_TOLL_FREE = "mms-inbound-toll-free" MMS_MESSAGES_CARRIERFEES = "mms-messages-carrierfees" MMS_OUTBOUND = "mms-outbound" MMS_OUTBOUND_LONGCODE = "mms-outbound-longcode" MMS_OUTBOUND_SHORTCODE = "mms-outbound-shortcode" + MMS_OUTBOUND_TOLLFREE = "mms-outbound-tollfree" + MONITOR = "monitor" MONITOR_READS = "monitor-reads" MONITOR_STORAGE = "monitor-storage" MONITOR_WRITES = "monitor-writes" @@ -176,6 +333,12 @@ class Category(object): NOTIFY_CHANNELS = "notify-channels" NUMBER_FORMAT_LOOKUPS = "number-format-lookups" PCHAT = "pchat" + PCHAT_ACTIONS = "pchat-actions" + PCHAT_APS = "pchat-aps" + PCHAT_CONV_MED_STORAGE = "pchat-conv-med-storage" + PCHAT_MESSAGES = "pchat-messages" + PCHAT_NOTIFICATIONS = "pchat-notifications" + PCHAT_READS = "pchat-reads" PCHAT_USERS = "pchat-users" PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( "peer-to-peer-rooms-participant-minutes" @@ -185,18 +348,41 @@ class Category(object): PFAX_MINUTES_INBOUND = "pfax-minutes-inbound" PFAX_MINUTES_OUTBOUND = "pfax-minutes-outbound" PFAX_PAGES = "pfax-pages" + PHONE_QUALITY_SCORE_LOOKUPS = "phone-quality-score-lookups" PHONENUMBERS = "phonenumbers" PHONENUMBERS_CPS = "phonenumbers-cps" PHONENUMBERS_EMERGENCY = "phonenumbers-emergency" PHONENUMBERS_LOCAL = "phonenumbers-local" PHONENUMBERS_MOBILE = "phonenumbers-mobile" + PHONENUMBERS_PORTING = "phonenumbers-porting" PHONENUMBERS_SETUPS = "phonenumbers-setups" PHONENUMBERS_TOLLFREE = "phonenumbers-tollfree" PREMIUMSUPPORT = "premiumsupport" + PREMIUMSUPPORT_PERCENTAGE_SPEND = "premiumsupport-percentage-spend" + PROGRAMMABLEVOICE_PLATFORM = "programmablevoice-platform" + PROGRAMMABLEVOICECONN_CLIENTSDK = "programmablevoiceconn-clientsdk" + PROGRAMMABLEVOICECONN_CLIENTSDK_INBOUND = ( + "programmablevoiceconn-clientsdk-inbound" + ) + PROGRAMMABLEVOICECONN_CLIENTSDK_OUTBOUND = ( + "programmablevoiceconn-clientsdk-outbound" + ) + PROGRAMMABLEVOICECONN_ONNET = "programmablevoiceconn-onnet" + PROGRAMMABLEVOICECONN_ONNET_INBOUND = "programmablevoiceconn-onnet-inbound" + PROGRAMMABLEVOICECONN_ONNET_OUTBOUND = "programmablevoiceconn-onnet-outbound" + PROGRAMMABLEVOICECONN_SIP = "programmablevoiceconn-sip" + PROGRAMMABLEVOICECONN_SIP_INBOUND = "programmablevoiceconn-sip-inbound" + PROGRAMMABLEVOICECONN_SIP_OUTBOUND = "programmablevoiceconn-sip-outbound" + PROGRAMMABLEVOICECONNECTIVITY = "programmablevoiceconnectivity" PROXY = "proxy" PROXY_ACTIVE_SESSIONS = "proxy-active-sessions" + PROXY_BUCKET_ADJUSTMENT = "proxy-bucket-adjustment" + PROXY_LICENSES = "proxy-licenses" PSTNCONNECTIVITY = "pstnconnectivity" + PSTNCONNECTIVITY_INBOUND = "pstnconnectivity-inbound" + PSTNCONNECTIVITY_OUTBOUND = "pstnconnectivity-outbound" PV = "pv" + PV_BASIC_ROOMS = "pv-basic-rooms" PV_COMPOSITION_MEDIA_DOWNLOADED = "pv-composition-media-downloaded" PV_COMPOSITION_MEDIA_ENCRYPTED = "pv-composition-media-encrypted" PV_COMPOSITION_MEDIA_STORED = "pv-composition-media-stored" @@ -212,18 +398,20 @@ class Category(object): PV_ROOM_PARTICIPANTS_US2 = "pv-room-participants-us2" PV_ROOMS = "pv-rooms" PV_SIP_ENDPOINT_REGISTRATIONS = "pv-sip-endpoint-registrations" + RCS_MESSAGES = "rcs-messages" + REASSIGNED_NUMBER = "reassigned-number" RECORDINGS = "recordings" RECORDINGSTORAGE = "recordingstorage" - ROOMS_GROUP_BANDWIDTH = "rooms-group-bandwidth" - ROOMS_GROUP_MINUTES = "rooms-group-minutes" - ROOMS_PEER_TO_PEER_MINUTES = "rooms-peer-to-peer-minutes" SHORTCODES = "shortcodes" SHORTCODES_CUSTOMEROWNED = "shortcodes-customerowned" SHORTCODES_MMS_ENABLEMENT = "shortcodes-mms-enablement" SHORTCODES_MPS = "shortcodes-mps" SHORTCODES_RANDOM = "shortcodes-random" + SHORTCODES_SETUP_FEES = "shortcodes-setup-fees" SHORTCODES_UK = "shortcodes-uk" SHORTCODES_VANITY = "shortcodes-vanity" + SIM_SWAP_LOOKUPS = "sim-swap-lookups" + SIP_SECURE_MEDIA = "sip-secure-media" SMALL_GROUP_ROOMS = "small-group-rooms" SMALL_GROUP_ROOMS_DATA_TRACK = "small-group-rooms-data-track" SMALL_GROUP_ROOMS_PARTICIPANT_MINUTES = "small-group-rooms-participant-minutes" @@ -231,13 +419,30 @@ class Category(object): SMS_INBOUND = "sms-inbound" SMS_INBOUND_LONGCODE = "sms-inbound-longcode" SMS_INBOUND_SHORTCODE = "sms-inbound-shortcode" + SMS_INBOUND_TOLLFREE = "sms-inbound-tollfree" SMS_MESSAGES_CARRIERFEES = "sms-messages-carrierfees" SMS_MESSAGES_FEATURES = "sms-messages-features" + SMS_MESSAGES_FEATURES_ENGAGEMENT_SUITE = ( + "sms-messages-features-engagement-suite" + ) + SMS_MESSAGES_FEATURES_MESSAGE_REDACTION = ( + "sms-messages-features-message-redaction" + ) SMS_MESSAGES_FEATURES_SENDERID = "sms-messages-features-senderid" + SMS_MPS = "sms-mps" + SMS_MPS_SHORTCODE = "sms-mps-shortcode" + SMS_MPS_TOLLFREE = "sms-mps-tollfree" + SMS_MPS_TOLLFREE_SETUP = "sms-mps-tollfree-setup" + SMS_NATIONAL_REGULATORY_PROTECTION = "sms-national-regulatory-protection" SMS_OUTBOUND = "sms-outbound" SMS_OUTBOUND_CONTENT_INSPECTION = "sms-outbound-content-inspection" SMS_OUTBOUND_LONGCODE = "sms-outbound-longcode" SMS_OUTBOUND_SHORTCODE = "sms-outbound-shortcode" + SMS_OUTBOUND_TOLLFREE = "sms-outbound-tollfree" + SMS_PUMPING_PROTECTION = "sms-pumping-protection" + SMS_PUMPING_RISK = "sms-pumping-risk" + SMSMESSAGES_BUCKET_ADJUSTMENTS = "smsmessages-bucket-adjustments" + SMSMESSAGES_OUTBOUND_DOMESTIC = "smsmessages-outbound-domestic" SPEECH_RECOGNITION = "speech-recognition" STUDIO_ENGAGEMENTS = "studio-engagements" SYNC = "sync" @@ -267,13 +472,27 @@ class Category(object): TURNMEGABYTES_SINGAPORE = "turnmegabytes-singapore" TURNMEGABYTES_USEAST = "turnmegabytes-useast" TURNMEGABYTES_USWEST = "turnmegabytes-uswest" + TWILIO_FOR_SALESFORCE = "twilio-for-salesforce" + TWILIO_FOR_SALESFORCE_LICENSES = "twilio-for-salesforce-licenses" TWILIO_INTERCONNECT = "twilio-interconnect" + TWIML = "twiml" + USAGE_FLEX_VIDEO = "usage-flex-video" + USAGE_FUNCTIONS = "usage-functions" + USAGE_RCS_BASIC_MESSAGES_OUTBOUND = "usage-rcs-basic-messages-outbound" + USAGE_RCS_MESSAGES = "usage-rcs-messages" + USAGE_RCS_MESSAGES_INBOUND = "usage-rcs-messages-inbound" + USAGE_RCS_MESSAGING_CARRIER_FEES = "usage-rcs-messaging-carrier-fees" + USAGE_RCS_SINGLE_MESSAGES_OUTBOUND = "usage-rcs-single-messages-outbound" + VERIFY_PACKAGE_PLANS = "verify-package-plans" VERIFY_PUSH = "verify-push" + VERIFY_SNA = "verify-sna" VERIFY_TOTP = "verify-totp" + VERIFY_VOICE_SMS = "verify-voice-sms" VERIFY_WHATSAPP_CONVERSATIONS_BUSINESS_INITIATED = ( "verify-whatsapp-conversations-business-initiated" ) VIDEO_RECORDINGS = "video-recordings" + VIDEO_ROOMS_TURN_MEGABYTES = "video-rooms-turn-megabytes" VIRTUAL_AGENT = "virtual-agent" VOICE_INSIGHTS = "voice-insights" VOICE_INSIGHTS_CLIENT_INSIGHTS_ON_DEMAND_MINUTE = ( @@ -289,14 +508,103 @@ class Category(object): "voice-insights-sip-trunking-insights-on-demand-minute" ) VOICE_INTELLIGENCE = "voice-intelligence" - VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + VOICE_INTELLIGENCE_EIP_OPERATORS = "voice-intelligence-eip-operators" VOICE_INTELLIGENCE_OPERATORS = "voice-intelligence-operators" + VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + WDS = "wds" WIRELESS = "wireless" + WIRELESS_DATA = "wireless-data" + WIRELESS_DATA_PAYG = "wireless-data-payg" + WIRELESS_DATA_PAYG_AFRICA = "wireless-data-payg-africa" + WIRELESS_DATA_PAYG_ASIA = "wireless-data-payg-asia" + WIRELESS_DATA_PAYG_CENTRALANDSOUTHAMERICA = ( + "wireless-data-payg-centralandsouthamerica" + ) + WIRELESS_DATA_PAYG_EUROPE = "wireless-data-payg-europe" + WIRELESS_DATA_PAYG_NORTHAMERICA = "wireless-data-payg-northamerica" + WIRELESS_DATA_PAYG_OCEANIA = "wireless-data-payg-oceania" + WIRELESS_DATA_QUOTA1 = "wireless-data-quota1" + WIRELESS_DATA_QUOTA1_AFRICA = "wireless-data-quota1-africa" + WIRELESS_DATA_QUOTA1_ASIA = "wireless-data-quota1-asia" + WIRELESS_DATA_QUOTA1_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota1-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA1_EUROPE = "wireless-data-quota1-europe" + WIRELESS_DATA_QUOTA1_NORTHAMERICA = "wireless-data-quota1-northamerica" + WIRELESS_DATA_QUOTA1_OCEANIA = "wireless-data-quota1-oceania" + WIRELESS_DATA_QUOTA10 = "wireless-data-quota10" + WIRELESS_DATA_QUOTA10_AFRICA = "wireless-data-quota10-africa" + WIRELESS_DATA_QUOTA10_ASIA = "wireless-data-quota10-asia" + WIRELESS_DATA_QUOTA10_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota10-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA10_EUROPE = "wireless-data-quota10-europe" + WIRELESS_DATA_QUOTA10_NORTHAMERICA = "wireless-data-quota10-northamerica" + WIRELESS_DATA_QUOTA10_OCEANIA = "wireless-data-quota10-oceania" + WIRELESS_DATA_QUOTA50 = "wireless-data-quota50" + WIRELESS_DATA_QUOTA50_AFRICA = "wireless-data-quota50-africa" + WIRELESS_DATA_QUOTA50_ASIA = "wireless-data-quota50-asia" + WIRELESS_DATA_QUOTA50_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota50-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA50_EUROPE = "wireless-data-quota50-europe" + WIRELESS_DATA_QUOTA50_NORTHAMERICA = "wireless-data-quota50-northamerica" + WIRELESS_DATA_QUOTA50_OCEANIA = "wireless-data-quota50-oceania" + WIRELESS_DATA_QUOTACUSTOM = "wireless-data-quotacustom" + WIRELESS_DATA_QUOTACUSTOM_AFRICA = "wireless-data-quotacustom-africa" + WIRELESS_DATA_QUOTACUSTOM_ASIA = "wireless-data-quotacustom-asia" + WIRELESS_DATA_QUOTACUSTOM_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quotacustom-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_EUROPE = "wireless-data-quotacustom-europe" + WIRELESS_DATA_QUOTACUSTOM_NORTHAMERICA = ( + "wireless-data-quotacustom-northamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_OCEANIA = "wireless-data-quotacustom-oceania" + WIRELESS_MRC_PAYG = "wireless-mrc-payg" + WIRELESS_MRC_QUOTA1 = "wireless-mrc-quota1" + WIRELESS_MRC_QUOTA10 = "wireless-mrc-quota10" + WIRELESS_MRC_QUOTA50 = "wireless-mrc-quota50" + WIRELESS_MRC_QUOTACUSTOM = "wireless-mrc-quotacustom" WIRELESS_ORDERS = "wireless-orders" WIRELESS_ORDERS_ARTWORK = "wireless-orders-artwork" WIRELESS_ORDERS_BULK = "wireless-orders-bulk" WIRELESS_ORDERS_ESIM = "wireless-orders-esim" WIRELESS_ORDERS_STARTER = "wireless-orders-starter" + WIRELESS_QUOTAS = "wireless-quotas" + WIRELESS_SMS_AFRICA = "wireless-sms-africa" + WIRELESS_SMS_ASIA = "wireless-sms-asia" + WIRELESS_SMS_CENTRALANDSOUTHAMERICA = "wireless-sms-centralandsouthamerica" + WIRELESS_SMS_EUROPE = "wireless-sms-europe" + WIRELESS_SMS_NORTHAMERICA = "wireless-sms-northamerica" + WIRELESS_SMS_OCEANIA = "wireless-sms-oceania" + WIRELESS_SUPER_SIM = "wireless-super-sim" + WIRELESS_SUPER_SIM_DATA = "wireless-super-sim-data" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA_USA = ( + "wireless-super-sim-data-north-america-usa" + ) + WIRELESS_SUPER_SIM_DATA_PAYG = "wireless-super-sim-data-payg" + WIRELESS_SUPER_SIM_DATA_PAYG_EUROPE = "wireless-super-sim-data-payg-europe" + WIRELESS_SUPER_SIM_DATA_PAYG_NORTH_AMERICA = ( + "wireless-super-sim-data-payg-north-america" + ) + WIRELESS_SUPER_SIM_HARDWARE = "wireless-super-sim-hardware" + WIRELESS_SUPER_SIM_HARDWARE_BULK = "wireless-super-sim-hardware-bulk" + WIRELESS_SUPER_SIM_SMSCOMMANDS = "wireless-super-sim-smscommands" + WIRELESS_SUPER_SIM_SMSCOMMANDS_AFRICA = "wireless-super-sim-smscommands-africa" + WIRELESS_SUPER_SIM_SMSCOMMANDS_ASIA = "wireless-super-sim-smscommands-asia" + WIRELESS_SUPER_SIM_SMSCOMMANDS_CENT_AND_SOUTH_AMERICA = ( + "wireless-super-sim-smscommands-cent-and-south-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_EUROPE = "wireless-super-sim-smscommands-europe" + WIRELESS_SUPER_SIM_SMSCOMMANDS_NORTH_AMERICA = ( + "wireless-super-sim-smscommands-north-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_OCEANIA = ( + "wireless-super-sim-smscommands-oceania" + ) + WIRELESS_SUPER_SIM_SUBSCRIPTION = "wireless-super-sim-subscription" + WIRELESS_SUPER_SIM_SUBSCRIPTION_PAYG = "wireless-super-sim-subscription-payg" WIRELESS_USAGE = "wireless-usage" WIRELESS_USAGE_COMMANDS = "wireless-usage-commands" WIRELESS_USAGE_COMMANDS_AFRICA = "wireless-usage-commands-africa" @@ -348,6 +656,184 @@ class Category(object): WIRELESS_USAGE_MRC_SUSPENDED = "wireless-usage-mrc-suspended" WIRELESS_USAGE_SMS = "wireless-usage-sms" WIRELESS_USAGE_VOICE = "wireless-usage-voice" + A2P_FAST_TRACK_ONBOARDING = "a2p-fast-track-onboarding" + ADVISORY_SERVICES = "advisory-services" + ADVISORY_SERVICES_BILLED = "advisory-services-billed" + ADVISORY_SERVICES_CALL_TRACKING = "advisory-services-call-tracking" + ADVISORY_SERVICES_DATA_SERVICES = "advisory-services-data-services" + ADVISORY_SERVICES_EXPENSES = "advisory-services-expenses" + ADVISORY_SERVICES_SIP_TRUNKING = "advisory-services-sip-trunking" + ASSETS_REQUESTS = "assets-requests" + AUDIENCE_MINUTES_VIDEO = "audience-minutes-video" + AUTHY_BUCKET_ADJUSTMENT = "authy-bucket-adjustment" + AUTHY_SOFTWARE = "authy-software" + CALLERIDLOOKUPS_API = "calleridlookups-api" + CALLERIDLOOKUPS_PROGRAMMABLEVOICE = "calleridlookups-programmablevoice" + CALLERIDLOOKUPS_TRUNKING = "calleridlookups-trunking" + CALLS_TRUNKING_INBOUND_TOLLFREE_LOCAL = "calls-trunking-inbound-tollfree-local" + CALLS_TRUNKING_INBOUND_TOLLFREE_MOBILE = ( + "calls-trunking-inbound-tollfree-mobile" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE_1 = "channels-whatsapp-conversation-free-1" + CONFERENCE = "conference" + CONVERSATIONAL_INSIGHTS = "conversational-insights" + CONVERSATIONAL_INSIGHTS_MESSAGES = "conversational-insights-messages" + CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = "conversational-insights-voice-minutes" + DEMO = "demo" + DEMO_UC_SCRIPT_TEST = "demo-uc-script-test" + ELASTIC_SIP_TRUNKING = "elastic-sip-trunking" + ELASTIC_SIP_TRUNKING_CALL_TRANSFERS = "elastic-sip-trunking-call-transfers" + ENTERPRISE_HIPPA = "enterprise-hippa" + FLEX_NAMED_USERS = "flex-named-users" + FLEX_SPINSCI = "flex-spinsci" + FLEX_USERS_1 = "flex-users-1" + FLEX_WFO_PREMIUM_SPEECH_ANALYTICS = "flex-wfo-premium-speech-analytics" + FLEX_XCELERATE = "flex-xcelerate" + FUNCTIONS_ROLLUP = "functions-rollup" + IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING_ADDONS = "ip-messaging-addons" + IVR = "ivr" + IVR_CONVERSATIONAL = "ivr-conversational" + IVR_DTMF = "ivr-dtmf" + IVR_VIRTUALAGENT = "ivr-virtualagent" + LIVE = "live" + LIVE_MEDIA_RECORDING_MINUTES = "live-media-recording-minutes" + LONGCODE_MPS = "longcode-mps" + MARKETPLACE_ANALYTICS_ADDONS = "marketplace-analytics-addons" + MARKETPLACE_ISV_ADDONS = "marketplace-isv-addons" + MARKETPLACE_MESSAGING_ADDONS = "marketplace-messaging-addons" + MARKETPLACE_PHONENUMBERS_ADDONS = "marketplace-phonenumbers-addons" + MARKETPLACE_RECORDING_ADDONS = "marketplace-recording-addons" + MARKETPLACE_VIRTUALAGENT_ADDONS = "marketplace-virtualagent-addons" + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR_1 = ( + "marketplay-pay-addons-shuttle-pay-connector-1" + ) + MARKETPLAY_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplay-pay-addons-stripe-pay-connector" + ) + MMS_INBOUND_LONGCODE_CANADA = "mms-inbound-longcode-canada" + MMS_INBOUND_LONGCODE_UNITEDSTATES = "mms-inbound-longcode-unitedstates" + MMS_OUTBOUND_LONGCODE_CANADA = "mms-outbound-longcode-canada" + MMS_OUTBOUND_LONGCODE_UNITEDSTATES = "mms-outbound-longcode-unitedstates" + MMS_OUTBOUND_TOLL_FREE = "mms-outbound-toll-free" + NOTIFY_CHATAPPSANDOTHERCHANNELS = "notify-chatappsandotherchannels" + NOTIFY_NOTIFYSERVICES = "notify-notifyservices" + NOTIFY_PUSHNOTIFICATIONS = "notify-pushnotifications" + PAYMENT_GATEWAY_CONNECTORS = "payment-gateway-connectors" + PAYMENT_SOLUTIONS = "payment-solutions" + PCHAT_BUCKET_ADJUSTMENT = "pchat-bucket-adjustment" + PHONENUMBERS_NUMBERS = "phonenumbers-numbers" + PROG_VOICE_CLIENT_ANDROID = "prog-voice-client-android" + PROG_VOICE_CLIENT_ANDROID_INBOUND = "prog-voice-client-android-inbound" + PROG_VOICE_CLIENT_ANDROID_OUTBOUND = "prog-voice-client-android-outbound" + PROG_VOICE_CLIENT_IOS = "prog-voice-client-ios" + PROG_VOICE_CLIENT_IOS_INBOUND = "prog-voice-client-ios-inbound" + PROG_VOICE_CLIENT_IOS_OUTBOUND = "prog-voice-client-ios-outbound" + PROG_VOICE_CLIENT_SDK = "prog-voice-client-sdk" + PROG_VOICE_CLIENT_WEB = "prog-voice-client-web" + PROG_VOICE_CLIENT_WEB_INBOUND = "prog-voice-client-web-inbound" + PROG_VOICE_CLIENT_WEB_OUTBOUND = "prog-voice-client-web-outbound" + PROGRAMMABLEVOICECONNECTIVITY_MEDIA_STREAMS = ( + "programmablevoiceconnectivity-media-streams" + ) + PSTNCONNECTIVITY_BYOC = "pstnconnectivity-byoc" + PSTNCONNECTIVITY_EMERGENCY = "pstnconnectivity-emergency" + PSTNCONNECTIVITY_MINUTES = "pstnconnectivity-minutes" + PSTNCONNECTIVITY_MINUTES_1 = "pstnconnectivity-minutes-1" + PSTNCONNECTIVITY_MINUTESINBOUNDLOCAL = "pstnconnectivity-minutesinboundlocal" + PSTNCONNECTIVITY_MINUTESINBOUNDMOBILE = "pstnconnectivity-minutesinboundmobile" + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREE = ( + "pstnconnectivity-minutesinboundtollfree" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREELOCAL = ( + "pstnconnectivity-minutesinboundtollfreelocal" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREEMOBILE = ( + "pstnconnectivity-minutesinboundtollfreemobile" + ) + PV_ROOM_HOURS = "pv-room-hours" + PV_ROOM_SIMULTANEOUS_PARTICIPANT_CONNECTIONS = ( + "pv-room-simultaneous-participant-connections" + ) + PVIDEO_ROOM_HOURS_AU1 = "pvideo-room-hours-au1" + PVIDEO_ROOM_HOURS_BR1 = "pvideo-room-hours-br1" + PVIDEO_ROOM_HOURS_IE1 = "pvideo-room-hours-ie1" + PVIDEO_ROOM_HOURS_JP1 = "pvideo-room-hours-jp1" + PVIDEO_ROOM_HOURS_SG1 = "pvideo-room-hours-sg1" + PVIDEO_ROOM_HOURS_US1 = "pvideo-room-hours-us1" + PVIDEO_ROOM_HOURS_US2 = "pvideo-room-hours-us2" + RECORDINGS_ENCRYPTED = "recordings-encrypted" + SHORT_CODE_SETUP_FEES = "short-code-setup-fees" + SHORTCODES_MESSAGES_INBOUND = "shortcodes-messages-inbound" + SHORTCODES_MESSAGES_OUTBOUND = "shortcodes-messages-outbound" + SMS_MESSAGES_REGISTRATIONFEES = "sms-messages-registrationfees" + SMS_MMS_PENALTY_FEES = "sms-mms-penalty-fees" + SMS_MMS_PENALTY_FEES_1 = "sms-mms-penalty-fees-1" + SMS_PUMPING_PROTECTION_NON_USCA = "sms-pumping-protection-non-usca" + SMS_PUMPING_PROTECTION_USCA = "sms-pumping-protection-usca" + STUDIO = "studio" + STUDIO_MONTHLY_FEES = "studio-monthly-fees" + SUPERSIM = "supersim" + TASK_ROUTER = "task-router" + TASK_ROUTER_WORKERS = "task-router-workers" + TEST_QUOTA_BUCKETS = "test-quota-buckets" + TEST_UC_SCRIPT_1 = "test-uc-script-1" + TEST_UC_SCRIPT_DEMO_2 = "test-uc-script-demo-2" + TEXT_TO_SPEECH = "text-to-speech" + TME = "tme" + TTS_BASIC = "tts-basic" + TWILIO_EDITIONS = "twilio-editions" + TWILIO_INTERCONNECT_CALIFORNIA = "twilio-interconnect-california" + TWILIO_INTERCONNECT_CALIFORNIA_MONTHLY = ( + "twilio-interconnect-california-monthly" + ) + TWILIO_INTERCONNECT_CALIFORNIA_SETUP = "twilio-interconnect-california-setup" + TWILIO_INTERCONNECT_FRANKFURT = "twilio-interconnect-frankfurt" + TWILIO_INTERCONNECT_FRANKFURT_MO = "twilio-interconnect-frankfurt-mo" + TWILIO_INTERCONNECT_FRANKFURT_SETUP = "twilio-interconnect-frankfurt-setup" + TWILIO_INTERCONNECT_LONDON = "twilio-interconnect-london" + TWILIO_INTERCONNECT_LONDON_MO = "twilio-interconnect-london-mo" + TWILIO_INTERCONNECT_LONDON_SETUP = "twilio-interconnect-london-setup" + TWILIO_INTERCONNECT_SAO_PAULO = "twilio-interconnect-sao-paulo" + TWILIO_INTERCONNECT_SAO_PAULO_MONTHLY = "twilio-interconnect-sao-paulo-monthly" + TWILIO_INTERCONNECT_SAO_PAULO_SETUP = "twilio-interconnect-sao-paulo-setup" + TWILIO_INTERCONNECT_SINGAPORE = "twilio-interconnect-singapore" + TWILIO_INTERCONNECT_SINGAPORE_MO = "twilio-interconnect-singapore-mo" + TWILIO_INTERCONNECT_SINGAPORE_SETUP = "twilio-interconnect-singapore-setup" + TWILIO_INTERCONNECT_SYDNEY = "twilio-interconnect-sydney" + TWILIO_INTERCONNECT_SYDNEY_MO = "twilio-interconnect-sydney-mo" + TWILIO_INTERCONNECT_SYDNEY_SETUP = "twilio-interconnect-sydney-setup" + TWILIO_INTERCONNECT_TOKYO = "twilio-interconnect-tokyo" + TWILIO_INTERCONNECT_TOKYO_MO = "twilio-interconnect-tokyo-mo" + TWILIO_INTERCONNECT_TOKYO_SETUP = "twilio-interconnect-tokyo-setup" + TWILIO_INTERCONNECT_VA = "twilio-interconnect-va" + TWILIO_INTERCONNECT_VA_MO = "twilio-interconnect-va-mo" + TWILIO_INTERCONNECT_VA_SETUP = "twilio-interconnect-va-setup" + TWIML_VERBS = "twiml-verbs" + TWIML_VERBS_SAY = "twiml-verbs-say" + USAGE_PROGRAMMABLE_MESSAGING_ENGAGEMENT_SUITE = ( + "usage-programmable-messaging-engagement-suite" + ) + USAGE_PROGRAMMABLE_MESSAGING_FEES_SERVICES = ( + "usage-programmable-messaging-fees-services" + ) + VERIFY_OUTBOUND_EMAIL = "verify-outbound-email" + VERIFY_PACKAGED_PLANS = "verify-packaged-plans" + VERIFY_SILENT_NETWORK_AUTH = "verify-silent-network-auth" + VERIFY_VOICE_AND_SMS = "verify-voice-and-sms" + VOICE_INSIGHTS_CLIENT_INSIGHTS_MONTHY_COMMIT = ( + "voice-insights-client-insights-monthy-commit" + ) + WIRELESS_DATA_PAYG_ASIA_AFG = "wireless-data-payg-asia-afg" + WIRELESS_MULTI_IMSI_SIM_COMMANDS = "wireless-multi-imsi-sim-commands" + WIRELESS_MULTI_IMSI_SIM_COMMANDS_USA = "wireless-multi-imsi-sim-commands-usa" + WIRELESS_MULTI_IMSI_SIM_DATA = "wireless-multi-imsi-sim-data" + WIRELESS_MULTI_IMSI_SIM_DATA_EU28 = "wireless-multi-imsi-sim-data-eu28" + WIRELESS_MULTI_IMSI_SIM_DATA_USA = "wireless-multi-imsi-sim-data-usa" + WIRELESS_MULTI_IMSI_SIM_MONTHLY_FEES = "wireless-multi-imsi-sim-monthly-fees" + WIRELESS_MULTI_IMSI_SIM_USAGE = "wireless-multi-imsi-sim-usage" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA = "wireless-super-sim-data-north-america" + WIRELESS_SUPER_SIM_USAGE = "wireless-super-sim-usage" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. diff --git a/twilio/rest/api/v2010/account/usage/record/today.py b/twilio/rest/api/v2010/account/usage/record/today.py index b2387c95b4..393238e76f 100644 --- a/twilio/rest/api/v2010/account/usage/record/today.py +++ b/twilio/rest/api/v2010/account/usage/record/today.py @@ -25,33 +25,101 @@ class TodayInstance(InstanceResource): class Category(object): + A2P_10DLC_REGISTRATIONFEES_BRANDREGISTRATION = ( + "a2p-10dlc-registrationfees-brandregistration" + ) + A2P_10DLC_REGISTRATIONFEES_BV = "a2p-10dlc-registrationfees-bv" + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNCHARGES = ( + "a2p-10dlc-registrationfees-campaigncharges" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNREGISTRATION = ( + "a2p-10dlc-registrationfees-campaignregistration" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNVETTING = ( + "a2p-10dlc-registrationfees-campaignvetting" + ) + A2P_10DLC_REGISTRATIONFEES_MONTHLY = "a2p-10dlc-registrationfees-monthly" + A2P_10DLC_REGISTRATIONFEES_ONETIME = "a2p-10dlc-registrationfees-onetime" A2P_REGISTRATION_FEES = "a2p-registration-fees" + ACCOUNT_SECURITY = "account-security" AGENT_CONFERENCE = "agent-conference" + AGENT_COPILOT = "agent-copilot" + AGENT_COPILOT_MESSAGES = "agent-copilot-messages" + AGENT_COPILOT_PARTICIPANT_MINUTES = "agent-copilot-participant-minutes" + AI_ASSISTANTS = "ai-assistants" + AI_ASSISTANTS_VOICE = "ai-assistants-voice" AMAZON_POLLY = "amazon-polly" ANSWERING_MACHINE_DETECTION = "answering-machine-detection" + ASSETS = "assets" + AUDIENCE_MINUTES = "audience-minutes" + AUDIENCE_MINUTES_AUDIO = "audience-minutes-audio" AUTHY_AUTHENTICATIONS = "authy-authentications" AUTHY_CALLS_OUTBOUND = "authy-calls-outbound" + AUTHY_EMAIL_AUTHENTICATIONS = "authy-email-authentications" AUTHY_MONTHLY_FEES = "authy-monthly-fees" + AUTHY_OUTBOUND_EMAIL = "authy-outbound-email" AUTHY_PHONE_INTELLIGENCE = "authy-phone-intelligence" AUTHY_PHONE_VERIFICATIONS = "authy-phone-verifications" AUTHY_SMS_OUTBOUND = "authy-sms-outbound" + AUTHY_VERIFY_EMAIL_VERIFICATIONS = "authy-verify-email-verifications" + AUTHY_VERIFY_OUTBOUND_EMAIL = "authy-verify-outbound-email" + AUTOPILOT = "autopilot" + AUTOPILOT_HOME_ASSISTANTS = "autopilot-home-assistants" + AUTOPILOT_MESSAGING = "autopilot-messaging" + AUTOPILOT_OTHER = "autopilot-other" + AUTOPILOT_VOICE = "autopilot-voice" + BASIC_PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( + "basic-peer-to-peer-rooms-participant-minutes" + ) + BRANDED_CALLING = "branded-calling" + BUNDLE_SMS_BUCKET = "bundle-sms-bucket" + BUNDLE_SUBSCRIPTION_FEES = "bundle-subscription-fees" + CALL_FORWARDING_LOOKUPS = "call-forwarding-lookups" CALL_PROGESS_EVENTS = "call-progess-events" CALLERIDLOOKUPS = "calleridlookups" CALLS = "calls" CALLS_CLIENT = "calls-client" + CALLS_EMERGENCY = "calls-emergency" CALLS_GLOBALCONFERENCE = "calls-globalconference" CALLS_INBOUND = "calls-inbound" CALLS_INBOUND_LOCAL = "calls-inbound-local" CALLS_INBOUND_MOBILE = "calls-inbound-mobile" CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree" + CALLS_INBOUND_TOLLFREE_LOCAL = "calls-inbound-tollfree-local" + CALLS_INBOUND_TOLLFREE_MOBILE = "calls-inbound-tollfree-mobile" + CALLS_MEDIA_STREAM_MINUTES = "calls-media-stream-minutes" CALLS_OUTBOUND = "calls-outbound" CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions" CALLS_RECORDINGS = "calls-recordings" CALLS_SIP = "calls-sip" CALLS_SIP_INBOUND = "calls-sip-inbound" CALLS_SIP_OUTBOUND = "calls-sip-outbound" + CALLS_TEXT_TO_SPEECH = "calls-text-to-speech" CALLS_TRANSFERS = "calls-transfers" CARRIER_LOOKUPS = "carrier-lookups" + CATEGORY = "category" + CHANNELS = "channels" + CHANNELS_MESSAGING = "channels-messaging" + CHANNELS_MESSAGING_INBOUND = "channels-messaging-inbound" + CHANNELS_MESSAGING_OUTBOUND = "channels-messaging-outbound" + CHANNELS_WHATSAPP = "channels-whatsapp" + CHANNELS_WHATSAPP_CONVERSATION_AUTHENTICATION = ( + "channels-whatsapp-conversation-authentication" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE = "channels-whatsapp-conversation-free" + CHANNELS_WHATSAPP_CONVERSATION_MARKETING = ( + "channels-whatsapp-conversation-marketing" + ) + CHANNELS_WHATSAPP_CONVERSATION_SERVICE = ( + "channels-whatsapp-conversation-service" + ) + CHANNELS_WHATSAPP_CONVERSATION_UTILITY = ( + "channels-whatsapp-conversation-utility" + ) + CHANNELS_WHATSAPP_INBOUND = "channels-whatsapp-inbound" + CHANNELS_WHATSAPP_OUTBOUND = "channels-whatsapp-outbound" + CHAT_VIRTUAL_AGENT = "chat-virtual-agent" + CONVERSATION_RELAY = "conversation-relay" CONVERSATIONS = "conversations" CONVERSATIONS_API_REQUESTS = "conversations-api-requests" CONVERSATIONS_CONVERSATION_EVENTS = "conversations-conversation-events" @@ -60,8 +128,40 @@ class Category(object): CONVERSATIONS_PARTICIPANT_EVENTS = "conversations-participant-events" CONVERSATIONS_PARTICIPANTS = "conversations-participants" CPS = "cps" + CREDIT_TRANSFER = "credit-transfer" + EMAIL = "email" + EMERGING_TECH = "emerging-tech" + ENGAGEMENT_SUITE_PACKAGED_PLANS = "engagement-suite-packaged-plans" + ENHANCED_LINE_TYPE_LOOKUPS = "enhanced-line-type-lookups" + ENTERPRISE = "enterprise" + EVENTS = "events" + EXPERIMENT_FRANCE_SMS = "experiment-france-sms" + EXPERIMENT_INDIA_SMS = "experiment-india-sms" + EXPERIMENT_UK_SMS = "experiment-uk-sms" + FAILED_MESSAGE_PROCESSING_FEE = "failed-message-processing-fee" + FLEX = "flex" + FLEX_ACTIVE_USER_HOURS = "flex-active-user-hours" + FLEX_CONCURRENT_USERS = "flex-concurrent-users" + FLEX_CONVERSATIONAL_INSIGHTS = "flex-conversational-insights" + FLEX_CONVERSATIONAL_INSIGHTS_MESSAGES = "flex-conversational-insights-messages" + FLEX_CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = ( + "flex-conversational-insights-voice-minutes" + ) + FLEX_EMAIL_USAGE = "flex-email-usage" + FLEX_MESSAGING_USAGE = "flex-messaging-usage" + FLEX_PARTNER_SPINSCI = "flex-partner-spinsci" + FLEX_PARTNER_XCELERATE = "flex-partner-xcelerate" + FLEX_RESELLER_ECOSYSTEM = "flex-reseller-ecosystem" + FLEX_UNIQUE_USER = "flex-unique-user" FLEX_USAGE = "flex-usage" + FLEX_USERS = "flex-users" + FLEX_VOICE_MINUTE = "flex-voice-minute" + FLEX_YTICA = "flex-ytica" FRAUD_LOOKUPS = "fraud-lookups" + FRONTLINE = "frontline" + FRONTLINE_USERS = "frontline-users" + FUNCTIONS = "functions" + GENERIC_PAY_TRANSACTIONS = "generic-pay-transactions" GROUP_ROOMS = "group-rooms" GROUP_ROOMS_DATA_TRACK = "group-rooms-data-track" GROUP_ROOMS_ENCRYPTED_MEDIA_RECORDED = "group-rooms-encrypted-media-recorded" @@ -71,9 +171,17 @@ class Category(object): GROUP_ROOMS_MEDIA_STORED = "group-rooms-media-stored" GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" - IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING = "ip-messaging" + IP_MESSAGING_COMMANDS = "ip-messaging-commands" + IP_MESSAGING_DATA_STORAGE = "ip-messaging-data-storage" + IP_MESSAGING_DATA_TRANSFER = "ip-messaging-data-transfer" + IP_MESSAGING_ENDPOINT_CONNECTIVITY = "ip-messaging-endpoint-connectivity" IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" + LINE_STATUS_LOOKUPS = "line-status-lookups" + LIVE_ACTIVITY_LOOKUPS = "live-activity-lookups" + LOOKUP_BUCKET_ADJUSTMENT = "lookup-bucket-adjustment" + LOOKUP_IDENTITY_MATCH = "lookup-identity-match" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( @@ -84,6 +192,13 @@ class Category(object): MARKETPLACE_CAPIO_SPEECH_TO_TEXT = "marketplace-capio-speech-to-text" MARKETPLACE_CONVRIZA_ABABA = "marketplace-convriza-ababa" MARKETPLACE_DEEPGRAM_PHRASE_DETECTOR = "marketplace-deepgram-phrase-detector" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION = "marketplace-deepgram-transcription" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION_BASE = ( + "marketplace-deepgram-transcription-base" + ) + MARKETPLACE_DEEPGRAM_TRANSSCRIPTION_ENHANCED = ( + "marketplace-deepgram-transscription-enhanced" + ) MARKETPLACE_DIGITAL_SEGMENT_BUSINESS_INFO = ( "marketplace-digital-segment-business-info" ) @@ -109,6 +224,9 @@ class Category(object): "marketplace-keen-io-contact-center-analytics" ) MARKETPLACE_MARCHEX_CLEANCALL = "marketplace-marchex-cleancall" + MARKETPLACE_MARCHEX_RECORDING_ANALYSIS = ( + "marketplace-marchex-recording-analysis" + ) MARKETPLACE_MARCHEX_SENTIMENT_ANALYSIS_FOR_SMS = ( "marketplace-marchex-sentiment-analysis-for-sms" ) @@ -125,14 +243,42 @@ class Category(object): "marketplace-nextcaller-advanced-caller-identification" ) MARKETPLACE_NOMOROBO_SPAM_SCORE = "marketplace-nomorobo-spam-score" + MARKETPLACE_PAY_ADDONS = "marketplace-pay-addons" + MARKETPLACE_PAY_ADDONS_BASECOMMERCE_PAY_CONNECTOR = ( + "marketplace-pay-addons-basecommerce-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_BRAINTREE_PAY_CONNECTOR = ( + "marketplace-pay-addons-braintree-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CARDCONNECT_PAY_CONNECTOR = ( + "marketplace-pay-addons-cardconnect-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CHASE_PAY_CONNECTOR = ( + "marketplace-pay-addons-chase-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplace-pay-addons-shuttle-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplace-pay-addons-stripe-pay-connector" + ) MARKETPLACE_PAYFONE_TCPA_COMPLIANCE = "marketplace-payfone-tcpa-compliance" + MARKETPLACE_POLY_AI_CONNECTOR = "marketplace-poly-ai-connector" + MARKETPLACE_REALPHONEVALIDATION = "marketplace-realphonevalidation" MARKETPLACE_REMEETING_AUTOMATIC_SPEECH_RECOGNITION = ( "marketplace-remeeting-automatic-speech-recognition" ) + MARKETPLACE_SPOKE_PHONE_LICENSE_PRO = "marketplace-spoke-phone-license-pro" + MARKETPLACE_SPOKE_PHONE_LICENSE_STANDARD = ( + "marketplace-spoke-phone-license-standard" + ) MARKETPLACE_TCPA_DEFENSE_SOLUTIONS_BLACKLIST_FEED = ( "marketplace-tcpa-defense-solutions-blacklist-feed" ) MARKETPLACE_TELO_OPENCNAM = "marketplace-telo-opencnam" + MARKETPLACE_TRESTLE_SOLUTIONS_CALLER_IDENTIFICATION = ( + "marketplace-trestle-solutions-caller-identification" + ) MARKETPLACE_TRUECNAM_TRUE_SPAM = "marketplace-truecnam-true-spam" MARKETPLACE_TWILIO_CALLER_NAME_LOOKUP_US = ( "marketplace-twilio-caller-name-lookup-us" @@ -145,6 +291,9 @@ class Category(object): MARKETPLACE_VOICEBASE_TRANSCRIPTION_CUSTOM_VOCABULARY = ( "marketplace-voicebase-transcription-custom-vocabulary" ) + MARKETPLACE_WEB_PURIFY_PROFANITY_FILTER = ( + "marketplace-web-purify-profanity-filter" + ) MARKETPLACE_WHITEPAGES_PRO_CALLER_IDENTIFICATION = ( "marketplace-whitepages-pro-caller-identification" ) @@ -159,15 +308,23 @@ class Category(object): MARKETPLACE_YTICA_CONTACT_CENTER_REPORTING_ANALYTICS = ( "marketplace-ytica-contact-center-reporting-analytics" ) + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplay-pay-addons-shuttle-pay-connector" + ) + MEDIA_COMPOSER_MINUTES = "media-composer-minutes" MEDIASTORAGE = "mediastorage" + MIN_SPEND_ADJUSTMENTS = "min-spend-adjustments" MMS = "mms" MMS_INBOUND = "mms-inbound" MMS_INBOUND_LONGCODE = "mms-inbound-longcode" MMS_INBOUND_SHORTCODE = "mms-inbound-shortcode" + MMS_INBOUND_TOLL_FREE = "mms-inbound-toll-free" MMS_MESSAGES_CARRIERFEES = "mms-messages-carrierfees" MMS_OUTBOUND = "mms-outbound" MMS_OUTBOUND_LONGCODE = "mms-outbound-longcode" MMS_OUTBOUND_SHORTCODE = "mms-outbound-shortcode" + MMS_OUTBOUND_TOLLFREE = "mms-outbound-tollfree" + MONITOR = "monitor" MONITOR_READS = "monitor-reads" MONITOR_STORAGE = "monitor-storage" MONITOR_WRITES = "monitor-writes" @@ -176,6 +333,12 @@ class Category(object): NOTIFY_CHANNELS = "notify-channels" NUMBER_FORMAT_LOOKUPS = "number-format-lookups" PCHAT = "pchat" + PCHAT_ACTIONS = "pchat-actions" + PCHAT_APS = "pchat-aps" + PCHAT_CONV_MED_STORAGE = "pchat-conv-med-storage" + PCHAT_MESSAGES = "pchat-messages" + PCHAT_NOTIFICATIONS = "pchat-notifications" + PCHAT_READS = "pchat-reads" PCHAT_USERS = "pchat-users" PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( "peer-to-peer-rooms-participant-minutes" @@ -185,18 +348,41 @@ class Category(object): PFAX_MINUTES_INBOUND = "pfax-minutes-inbound" PFAX_MINUTES_OUTBOUND = "pfax-minutes-outbound" PFAX_PAGES = "pfax-pages" + PHONE_QUALITY_SCORE_LOOKUPS = "phone-quality-score-lookups" PHONENUMBERS = "phonenumbers" PHONENUMBERS_CPS = "phonenumbers-cps" PHONENUMBERS_EMERGENCY = "phonenumbers-emergency" PHONENUMBERS_LOCAL = "phonenumbers-local" PHONENUMBERS_MOBILE = "phonenumbers-mobile" + PHONENUMBERS_PORTING = "phonenumbers-porting" PHONENUMBERS_SETUPS = "phonenumbers-setups" PHONENUMBERS_TOLLFREE = "phonenumbers-tollfree" PREMIUMSUPPORT = "premiumsupport" + PREMIUMSUPPORT_PERCENTAGE_SPEND = "premiumsupport-percentage-spend" + PROGRAMMABLEVOICE_PLATFORM = "programmablevoice-platform" + PROGRAMMABLEVOICECONN_CLIENTSDK = "programmablevoiceconn-clientsdk" + PROGRAMMABLEVOICECONN_CLIENTSDK_INBOUND = ( + "programmablevoiceconn-clientsdk-inbound" + ) + PROGRAMMABLEVOICECONN_CLIENTSDK_OUTBOUND = ( + "programmablevoiceconn-clientsdk-outbound" + ) + PROGRAMMABLEVOICECONN_ONNET = "programmablevoiceconn-onnet" + PROGRAMMABLEVOICECONN_ONNET_INBOUND = "programmablevoiceconn-onnet-inbound" + PROGRAMMABLEVOICECONN_ONNET_OUTBOUND = "programmablevoiceconn-onnet-outbound" + PROGRAMMABLEVOICECONN_SIP = "programmablevoiceconn-sip" + PROGRAMMABLEVOICECONN_SIP_INBOUND = "programmablevoiceconn-sip-inbound" + PROGRAMMABLEVOICECONN_SIP_OUTBOUND = "programmablevoiceconn-sip-outbound" + PROGRAMMABLEVOICECONNECTIVITY = "programmablevoiceconnectivity" PROXY = "proxy" PROXY_ACTIVE_SESSIONS = "proxy-active-sessions" + PROXY_BUCKET_ADJUSTMENT = "proxy-bucket-adjustment" + PROXY_LICENSES = "proxy-licenses" PSTNCONNECTIVITY = "pstnconnectivity" + PSTNCONNECTIVITY_INBOUND = "pstnconnectivity-inbound" + PSTNCONNECTIVITY_OUTBOUND = "pstnconnectivity-outbound" PV = "pv" + PV_BASIC_ROOMS = "pv-basic-rooms" PV_COMPOSITION_MEDIA_DOWNLOADED = "pv-composition-media-downloaded" PV_COMPOSITION_MEDIA_ENCRYPTED = "pv-composition-media-encrypted" PV_COMPOSITION_MEDIA_STORED = "pv-composition-media-stored" @@ -212,18 +398,20 @@ class Category(object): PV_ROOM_PARTICIPANTS_US2 = "pv-room-participants-us2" PV_ROOMS = "pv-rooms" PV_SIP_ENDPOINT_REGISTRATIONS = "pv-sip-endpoint-registrations" + RCS_MESSAGES = "rcs-messages" + REASSIGNED_NUMBER = "reassigned-number" RECORDINGS = "recordings" RECORDINGSTORAGE = "recordingstorage" - ROOMS_GROUP_BANDWIDTH = "rooms-group-bandwidth" - ROOMS_GROUP_MINUTES = "rooms-group-minutes" - ROOMS_PEER_TO_PEER_MINUTES = "rooms-peer-to-peer-minutes" SHORTCODES = "shortcodes" SHORTCODES_CUSTOMEROWNED = "shortcodes-customerowned" SHORTCODES_MMS_ENABLEMENT = "shortcodes-mms-enablement" SHORTCODES_MPS = "shortcodes-mps" SHORTCODES_RANDOM = "shortcodes-random" + SHORTCODES_SETUP_FEES = "shortcodes-setup-fees" SHORTCODES_UK = "shortcodes-uk" SHORTCODES_VANITY = "shortcodes-vanity" + SIM_SWAP_LOOKUPS = "sim-swap-lookups" + SIP_SECURE_MEDIA = "sip-secure-media" SMALL_GROUP_ROOMS = "small-group-rooms" SMALL_GROUP_ROOMS_DATA_TRACK = "small-group-rooms-data-track" SMALL_GROUP_ROOMS_PARTICIPANT_MINUTES = "small-group-rooms-participant-minutes" @@ -231,13 +419,30 @@ class Category(object): SMS_INBOUND = "sms-inbound" SMS_INBOUND_LONGCODE = "sms-inbound-longcode" SMS_INBOUND_SHORTCODE = "sms-inbound-shortcode" + SMS_INBOUND_TOLLFREE = "sms-inbound-tollfree" SMS_MESSAGES_CARRIERFEES = "sms-messages-carrierfees" SMS_MESSAGES_FEATURES = "sms-messages-features" + SMS_MESSAGES_FEATURES_ENGAGEMENT_SUITE = ( + "sms-messages-features-engagement-suite" + ) + SMS_MESSAGES_FEATURES_MESSAGE_REDACTION = ( + "sms-messages-features-message-redaction" + ) SMS_MESSAGES_FEATURES_SENDERID = "sms-messages-features-senderid" + SMS_MPS = "sms-mps" + SMS_MPS_SHORTCODE = "sms-mps-shortcode" + SMS_MPS_TOLLFREE = "sms-mps-tollfree" + SMS_MPS_TOLLFREE_SETUP = "sms-mps-tollfree-setup" + SMS_NATIONAL_REGULATORY_PROTECTION = "sms-national-regulatory-protection" SMS_OUTBOUND = "sms-outbound" SMS_OUTBOUND_CONTENT_INSPECTION = "sms-outbound-content-inspection" SMS_OUTBOUND_LONGCODE = "sms-outbound-longcode" SMS_OUTBOUND_SHORTCODE = "sms-outbound-shortcode" + SMS_OUTBOUND_TOLLFREE = "sms-outbound-tollfree" + SMS_PUMPING_PROTECTION = "sms-pumping-protection" + SMS_PUMPING_RISK = "sms-pumping-risk" + SMSMESSAGES_BUCKET_ADJUSTMENTS = "smsmessages-bucket-adjustments" + SMSMESSAGES_OUTBOUND_DOMESTIC = "smsmessages-outbound-domestic" SPEECH_RECOGNITION = "speech-recognition" STUDIO_ENGAGEMENTS = "studio-engagements" SYNC = "sync" @@ -267,13 +472,27 @@ class Category(object): TURNMEGABYTES_SINGAPORE = "turnmegabytes-singapore" TURNMEGABYTES_USEAST = "turnmegabytes-useast" TURNMEGABYTES_USWEST = "turnmegabytes-uswest" + TWILIO_FOR_SALESFORCE = "twilio-for-salesforce" + TWILIO_FOR_SALESFORCE_LICENSES = "twilio-for-salesforce-licenses" TWILIO_INTERCONNECT = "twilio-interconnect" + TWIML = "twiml" + USAGE_FLEX_VIDEO = "usage-flex-video" + USAGE_FUNCTIONS = "usage-functions" + USAGE_RCS_BASIC_MESSAGES_OUTBOUND = "usage-rcs-basic-messages-outbound" + USAGE_RCS_MESSAGES = "usage-rcs-messages" + USAGE_RCS_MESSAGES_INBOUND = "usage-rcs-messages-inbound" + USAGE_RCS_MESSAGING_CARRIER_FEES = "usage-rcs-messaging-carrier-fees" + USAGE_RCS_SINGLE_MESSAGES_OUTBOUND = "usage-rcs-single-messages-outbound" + VERIFY_PACKAGE_PLANS = "verify-package-plans" VERIFY_PUSH = "verify-push" + VERIFY_SNA = "verify-sna" VERIFY_TOTP = "verify-totp" + VERIFY_VOICE_SMS = "verify-voice-sms" VERIFY_WHATSAPP_CONVERSATIONS_BUSINESS_INITIATED = ( "verify-whatsapp-conversations-business-initiated" ) VIDEO_RECORDINGS = "video-recordings" + VIDEO_ROOMS_TURN_MEGABYTES = "video-rooms-turn-megabytes" VIRTUAL_AGENT = "virtual-agent" VOICE_INSIGHTS = "voice-insights" VOICE_INSIGHTS_CLIENT_INSIGHTS_ON_DEMAND_MINUTE = ( @@ -289,14 +508,103 @@ class Category(object): "voice-insights-sip-trunking-insights-on-demand-minute" ) VOICE_INTELLIGENCE = "voice-intelligence" - VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + VOICE_INTELLIGENCE_EIP_OPERATORS = "voice-intelligence-eip-operators" VOICE_INTELLIGENCE_OPERATORS = "voice-intelligence-operators" + VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + WDS = "wds" WIRELESS = "wireless" + WIRELESS_DATA = "wireless-data" + WIRELESS_DATA_PAYG = "wireless-data-payg" + WIRELESS_DATA_PAYG_AFRICA = "wireless-data-payg-africa" + WIRELESS_DATA_PAYG_ASIA = "wireless-data-payg-asia" + WIRELESS_DATA_PAYG_CENTRALANDSOUTHAMERICA = ( + "wireless-data-payg-centralandsouthamerica" + ) + WIRELESS_DATA_PAYG_EUROPE = "wireless-data-payg-europe" + WIRELESS_DATA_PAYG_NORTHAMERICA = "wireless-data-payg-northamerica" + WIRELESS_DATA_PAYG_OCEANIA = "wireless-data-payg-oceania" + WIRELESS_DATA_QUOTA1 = "wireless-data-quota1" + WIRELESS_DATA_QUOTA1_AFRICA = "wireless-data-quota1-africa" + WIRELESS_DATA_QUOTA1_ASIA = "wireless-data-quota1-asia" + WIRELESS_DATA_QUOTA1_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota1-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA1_EUROPE = "wireless-data-quota1-europe" + WIRELESS_DATA_QUOTA1_NORTHAMERICA = "wireless-data-quota1-northamerica" + WIRELESS_DATA_QUOTA1_OCEANIA = "wireless-data-quota1-oceania" + WIRELESS_DATA_QUOTA10 = "wireless-data-quota10" + WIRELESS_DATA_QUOTA10_AFRICA = "wireless-data-quota10-africa" + WIRELESS_DATA_QUOTA10_ASIA = "wireless-data-quota10-asia" + WIRELESS_DATA_QUOTA10_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota10-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA10_EUROPE = "wireless-data-quota10-europe" + WIRELESS_DATA_QUOTA10_NORTHAMERICA = "wireless-data-quota10-northamerica" + WIRELESS_DATA_QUOTA10_OCEANIA = "wireless-data-quota10-oceania" + WIRELESS_DATA_QUOTA50 = "wireless-data-quota50" + WIRELESS_DATA_QUOTA50_AFRICA = "wireless-data-quota50-africa" + WIRELESS_DATA_QUOTA50_ASIA = "wireless-data-quota50-asia" + WIRELESS_DATA_QUOTA50_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota50-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA50_EUROPE = "wireless-data-quota50-europe" + WIRELESS_DATA_QUOTA50_NORTHAMERICA = "wireless-data-quota50-northamerica" + WIRELESS_DATA_QUOTA50_OCEANIA = "wireless-data-quota50-oceania" + WIRELESS_DATA_QUOTACUSTOM = "wireless-data-quotacustom" + WIRELESS_DATA_QUOTACUSTOM_AFRICA = "wireless-data-quotacustom-africa" + WIRELESS_DATA_QUOTACUSTOM_ASIA = "wireless-data-quotacustom-asia" + WIRELESS_DATA_QUOTACUSTOM_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quotacustom-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_EUROPE = "wireless-data-quotacustom-europe" + WIRELESS_DATA_QUOTACUSTOM_NORTHAMERICA = ( + "wireless-data-quotacustom-northamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_OCEANIA = "wireless-data-quotacustom-oceania" + WIRELESS_MRC_PAYG = "wireless-mrc-payg" + WIRELESS_MRC_QUOTA1 = "wireless-mrc-quota1" + WIRELESS_MRC_QUOTA10 = "wireless-mrc-quota10" + WIRELESS_MRC_QUOTA50 = "wireless-mrc-quota50" + WIRELESS_MRC_QUOTACUSTOM = "wireless-mrc-quotacustom" WIRELESS_ORDERS = "wireless-orders" WIRELESS_ORDERS_ARTWORK = "wireless-orders-artwork" WIRELESS_ORDERS_BULK = "wireless-orders-bulk" WIRELESS_ORDERS_ESIM = "wireless-orders-esim" WIRELESS_ORDERS_STARTER = "wireless-orders-starter" + WIRELESS_QUOTAS = "wireless-quotas" + WIRELESS_SMS_AFRICA = "wireless-sms-africa" + WIRELESS_SMS_ASIA = "wireless-sms-asia" + WIRELESS_SMS_CENTRALANDSOUTHAMERICA = "wireless-sms-centralandsouthamerica" + WIRELESS_SMS_EUROPE = "wireless-sms-europe" + WIRELESS_SMS_NORTHAMERICA = "wireless-sms-northamerica" + WIRELESS_SMS_OCEANIA = "wireless-sms-oceania" + WIRELESS_SUPER_SIM = "wireless-super-sim" + WIRELESS_SUPER_SIM_DATA = "wireless-super-sim-data" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA_USA = ( + "wireless-super-sim-data-north-america-usa" + ) + WIRELESS_SUPER_SIM_DATA_PAYG = "wireless-super-sim-data-payg" + WIRELESS_SUPER_SIM_DATA_PAYG_EUROPE = "wireless-super-sim-data-payg-europe" + WIRELESS_SUPER_SIM_DATA_PAYG_NORTH_AMERICA = ( + "wireless-super-sim-data-payg-north-america" + ) + WIRELESS_SUPER_SIM_HARDWARE = "wireless-super-sim-hardware" + WIRELESS_SUPER_SIM_HARDWARE_BULK = "wireless-super-sim-hardware-bulk" + WIRELESS_SUPER_SIM_SMSCOMMANDS = "wireless-super-sim-smscommands" + WIRELESS_SUPER_SIM_SMSCOMMANDS_AFRICA = "wireless-super-sim-smscommands-africa" + WIRELESS_SUPER_SIM_SMSCOMMANDS_ASIA = "wireless-super-sim-smscommands-asia" + WIRELESS_SUPER_SIM_SMSCOMMANDS_CENT_AND_SOUTH_AMERICA = ( + "wireless-super-sim-smscommands-cent-and-south-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_EUROPE = "wireless-super-sim-smscommands-europe" + WIRELESS_SUPER_SIM_SMSCOMMANDS_NORTH_AMERICA = ( + "wireless-super-sim-smscommands-north-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_OCEANIA = ( + "wireless-super-sim-smscommands-oceania" + ) + WIRELESS_SUPER_SIM_SUBSCRIPTION = "wireless-super-sim-subscription" + WIRELESS_SUPER_SIM_SUBSCRIPTION_PAYG = "wireless-super-sim-subscription-payg" WIRELESS_USAGE = "wireless-usage" WIRELESS_USAGE_COMMANDS = "wireless-usage-commands" WIRELESS_USAGE_COMMANDS_AFRICA = "wireless-usage-commands-africa" @@ -348,6 +656,184 @@ class Category(object): WIRELESS_USAGE_MRC_SUSPENDED = "wireless-usage-mrc-suspended" WIRELESS_USAGE_SMS = "wireless-usage-sms" WIRELESS_USAGE_VOICE = "wireless-usage-voice" + A2P_FAST_TRACK_ONBOARDING = "a2p-fast-track-onboarding" + ADVISORY_SERVICES = "advisory-services" + ADVISORY_SERVICES_BILLED = "advisory-services-billed" + ADVISORY_SERVICES_CALL_TRACKING = "advisory-services-call-tracking" + ADVISORY_SERVICES_DATA_SERVICES = "advisory-services-data-services" + ADVISORY_SERVICES_EXPENSES = "advisory-services-expenses" + ADVISORY_SERVICES_SIP_TRUNKING = "advisory-services-sip-trunking" + ASSETS_REQUESTS = "assets-requests" + AUDIENCE_MINUTES_VIDEO = "audience-minutes-video" + AUTHY_BUCKET_ADJUSTMENT = "authy-bucket-adjustment" + AUTHY_SOFTWARE = "authy-software" + CALLERIDLOOKUPS_API = "calleridlookups-api" + CALLERIDLOOKUPS_PROGRAMMABLEVOICE = "calleridlookups-programmablevoice" + CALLERIDLOOKUPS_TRUNKING = "calleridlookups-trunking" + CALLS_TRUNKING_INBOUND_TOLLFREE_LOCAL = "calls-trunking-inbound-tollfree-local" + CALLS_TRUNKING_INBOUND_TOLLFREE_MOBILE = ( + "calls-trunking-inbound-tollfree-mobile" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE_1 = "channels-whatsapp-conversation-free-1" + CONFERENCE = "conference" + CONVERSATIONAL_INSIGHTS = "conversational-insights" + CONVERSATIONAL_INSIGHTS_MESSAGES = "conversational-insights-messages" + CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = "conversational-insights-voice-minutes" + DEMO = "demo" + DEMO_UC_SCRIPT_TEST = "demo-uc-script-test" + ELASTIC_SIP_TRUNKING = "elastic-sip-trunking" + ELASTIC_SIP_TRUNKING_CALL_TRANSFERS = "elastic-sip-trunking-call-transfers" + ENTERPRISE_HIPPA = "enterprise-hippa" + FLEX_NAMED_USERS = "flex-named-users" + FLEX_SPINSCI = "flex-spinsci" + FLEX_USERS_1 = "flex-users-1" + FLEX_WFO_PREMIUM_SPEECH_ANALYTICS = "flex-wfo-premium-speech-analytics" + FLEX_XCELERATE = "flex-xcelerate" + FUNCTIONS_ROLLUP = "functions-rollup" + IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING_ADDONS = "ip-messaging-addons" + IVR = "ivr" + IVR_CONVERSATIONAL = "ivr-conversational" + IVR_DTMF = "ivr-dtmf" + IVR_VIRTUALAGENT = "ivr-virtualagent" + LIVE = "live" + LIVE_MEDIA_RECORDING_MINUTES = "live-media-recording-minutes" + LONGCODE_MPS = "longcode-mps" + MARKETPLACE_ANALYTICS_ADDONS = "marketplace-analytics-addons" + MARKETPLACE_ISV_ADDONS = "marketplace-isv-addons" + MARKETPLACE_MESSAGING_ADDONS = "marketplace-messaging-addons" + MARKETPLACE_PHONENUMBERS_ADDONS = "marketplace-phonenumbers-addons" + MARKETPLACE_RECORDING_ADDONS = "marketplace-recording-addons" + MARKETPLACE_VIRTUALAGENT_ADDONS = "marketplace-virtualagent-addons" + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR_1 = ( + "marketplay-pay-addons-shuttle-pay-connector-1" + ) + MARKETPLAY_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplay-pay-addons-stripe-pay-connector" + ) + MMS_INBOUND_LONGCODE_CANADA = "mms-inbound-longcode-canada" + MMS_INBOUND_LONGCODE_UNITEDSTATES = "mms-inbound-longcode-unitedstates" + MMS_OUTBOUND_LONGCODE_CANADA = "mms-outbound-longcode-canada" + MMS_OUTBOUND_LONGCODE_UNITEDSTATES = "mms-outbound-longcode-unitedstates" + MMS_OUTBOUND_TOLL_FREE = "mms-outbound-toll-free" + NOTIFY_CHATAPPSANDOTHERCHANNELS = "notify-chatappsandotherchannels" + NOTIFY_NOTIFYSERVICES = "notify-notifyservices" + NOTIFY_PUSHNOTIFICATIONS = "notify-pushnotifications" + PAYMENT_GATEWAY_CONNECTORS = "payment-gateway-connectors" + PAYMENT_SOLUTIONS = "payment-solutions" + PCHAT_BUCKET_ADJUSTMENT = "pchat-bucket-adjustment" + PHONENUMBERS_NUMBERS = "phonenumbers-numbers" + PROG_VOICE_CLIENT_ANDROID = "prog-voice-client-android" + PROG_VOICE_CLIENT_ANDROID_INBOUND = "prog-voice-client-android-inbound" + PROG_VOICE_CLIENT_ANDROID_OUTBOUND = "prog-voice-client-android-outbound" + PROG_VOICE_CLIENT_IOS = "prog-voice-client-ios" + PROG_VOICE_CLIENT_IOS_INBOUND = "prog-voice-client-ios-inbound" + PROG_VOICE_CLIENT_IOS_OUTBOUND = "prog-voice-client-ios-outbound" + PROG_VOICE_CLIENT_SDK = "prog-voice-client-sdk" + PROG_VOICE_CLIENT_WEB = "prog-voice-client-web" + PROG_VOICE_CLIENT_WEB_INBOUND = "prog-voice-client-web-inbound" + PROG_VOICE_CLIENT_WEB_OUTBOUND = "prog-voice-client-web-outbound" + PROGRAMMABLEVOICECONNECTIVITY_MEDIA_STREAMS = ( + "programmablevoiceconnectivity-media-streams" + ) + PSTNCONNECTIVITY_BYOC = "pstnconnectivity-byoc" + PSTNCONNECTIVITY_EMERGENCY = "pstnconnectivity-emergency" + PSTNCONNECTIVITY_MINUTES = "pstnconnectivity-minutes" + PSTNCONNECTIVITY_MINUTES_1 = "pstnconnectivity-minutes-1" + PSTNCONNECTIVITY_MINUTESINBOUNDLOCAL = "pstnconnectivity-minutesinboundlocal" + PSTNCONNECTIVITY_MINUTESINBOUNDMOBILE = "pstnconnectivity-minutesinboundmobile" + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREE = ( + "pstnconnectivity-minutesinboundtollfree" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREELOCAL = ( + "pstnconnectivity-minutesinboundtollfreelocal" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREEMOBILE = ( + "pstnconnectivity-minutesinboundtollfreemobile" + ) + PV_ROOM_HOURS = "pv-room-hours" + PV_ROOM_SIMULTANEOUS_PARTICIPANT_CONNECTIONS = ( + "pv-room-simultaneous-participant-connections" + ) + PVIDEO_ROOM_HOURS_AU1 = "pvideo-room-hours-au1" + PVIDEO_ROOM_HOURS_BR1 = "pvideo-room-hours-br1" + PVIDEO_ROOM_HOURS_IE1 = "pvideo-room-hours-ie1" + PVIDEO_ROOM_HOURS_JP1 = "pvideo-room-hours-jp1" + PVIDEO_ROOM_HOURS_SG1 = "pvideo-room-hours-sg1" + PVIDEO_ROOM_HOURS_US1 = "pvideo-room-hours-us1" + PVIDEO_ROOM_HOURS_US2 = "pvideo-room-hours-us2" + RECORDINGS_ENCRYPTED = "recordings-encrypted" + SHORT_CODE_SETUP_FEES = "short-code-setup-fees" + SHORTCODES_MESSAGES_INBOUND = "shortcodes-messages-inbound" + SHORTCODES_MESSAGES_OUTBOUND = "shortcodes-messages-outbound" + SMS_MESSAGES_REGISTRATIONFEES = "sms-messages-registrationfees" + SMS_MMS_PENALTY_FEES = "sms-mms-penalty-fees" + SMS_MMS_PENALTY_FEES_1 = "sms-mms-penalty-fees-1" + SMS_PUMPING_PROTECTION_NON_USCA = "sms-pumping-protection-non-usca" + SMS_PUMPING_PROTECTION_USCA = "sms-pumping-protection-usca" + STUDIO = "studio" + STUDIO_MONTHLY_FEES = "studio-monthly-fees" + SUPERSIM = "supersim" + TASK_ROUTER = "task-router" + TASK_ROUTER_WORKERS = "task-router-workers" + TEST_QUOTA_BUCKETS = "test-quota-buckets" + TEST_UC_SCRIPT_1 = "test-uc-script-1" + TEST_UC_SCRIPT_DEMO_2 = "test-uc-script-demo-2" + TEXT_TO_SPEECH = "text-to-speech" + TME = "tme" + TTS_BASIC = "tts-basic" + TWILIO_EDITIONS = "twilio-editions" + TWILIO_INTERCONNECT_CALIFORNIA = "twilio-interconnect-california" + TWILIO_INTERCONNECT_CALIFORNIA_MONTHLY = ( + "twilio-interconnect-california-monthly" + ) + TWILIO_INTERCONNECT_CALIFORNIA_SETUP = "twilio-interconnect-california-setup" + TWILIO_INTERCONNECT_FRANKFURT = "twilio-interconnect-frankfurt" + TWILIO_INTERCONNECT_FRANKFURT_MO = "twilio-interconnect-frankfurt-mo" + TWILIO_INTERCONNECT_FRANKFURT_SETUP = "twilio-interconnect-frankfurt-setup" + TWILIO_INTERCONNECT_LONDON = "twilio-interconnect-london" + TWILIO_INTERCONNECT_LONDON_MO = "twilio-interconnect-london-mo" + TWILIO_INTERCONNECT_LONDON_SETUP = "twilio-interconnect-london-setup" + TWILIO_INTERCONNECT_SAO_PAULO = "twilio-interconnect-sao-paulo" + TWILIO_INTERCONNECT_SAO_PAULO_MONTHLY = "twilio-interconnect-sao-paulo-monthly" + TWILIO_INTERCONNECT_SAO_PAULO_SETUP = "twilio-interconnect-sao-paulo-setup" + TWILIO_INTERCONNECT_SINGAPORE = "twilio-interconnect-singapore" + TWILIO_INTERCONNECT_SINGAPORE_MO = "twilio-interconnect-singapore-mo" + TWILIO_INTERCONNECT_SINGAPORE_SETUP = "twilio-interconnect-singapore-setup" + TWILIO_INTERCONNECT_SYDNEY = "twilio-interconnect-sydney" + TWILIO_INTERCONNECT_SYDNEY_MO = "twilio-interconnect-sydney-mo" + TWILIO_INTERCONNECT_SYDNEY_SETUP = "twilio-interconnect-sydney-setup" + TWILIO_INTERCONNECT_TOKYO = "twilio-interconnect-tokyo" + TWILIO_INTERCONNECT_TOKYO_MO = "twilio-interconnect-tokyo-mo" + TWILIO_INTERCONNECT_TOKYO_SETUP = "twilio-interconnect-tokyo-setup" + TWILIO_INTERCONNECT_VA = "twilio-interconnect-va" + TWILIO_INTERCONNECT_VA_MO = "twilio-interconnect-va-mo" + TWILIO_INTERCONNECT_VA_SETUP = "twilio-interconnect-va-setup" + TWIML_VERBS = "twiml-verbs" + TWIML_VERBS_SAY = "twiml-verbs-say" + USAGE_PROGRAMMABLE_MESSAGING_ENGAGEMENT_SUITE = ( + "usage-programmable-messaging-engagement-suite" + ) + USAGE_PROGRAMMABLE_MESSAGING_FEES_SERVICES = ( + "usage-programmable-messaging-fees-services" + ) + VERIFY_OUTBOUND_EMAIL = "verify-outbound-email" + VERIFY_PACKAGED_PLANS = "verify-packaged-plans" + VERIFY_SILENT_NETWORK_AUTH = "verify-silent-network-auth" + VERIFY_VOICE_AND_SMS = "verify-voice-and-sms" + VOICE_INSIGHTS_CLIENT_INSIGHTS_MONTHY_COMMIT = ( + "voice-insights-client-insights-monthy-commit" + ) + WIRELESS_DATA_PAYG_ASIA_AFG = "wireless-data-payg-asia-afg" + WIRELESS_MULTI_IMSI_SIM_COMMANDS = "wireless-multi-imsi-sim-commands" + WIRELESS_MULTI_IMSI_SIM_COMMANDS_USA = "wireless-multi-imsi-sim-commands-usa" + WIRELESS_MULTI_IMSI_SIM_DATA = "wireless-multi-imsi-sim-data" + WIRELESS_MULTI_IMSI_SIM_DATA_EU28 = "wireless-multi-imsi-sim-data-eu28" + WIRELESS_MULTI_IMSI_SIM_DATA_USA = "wireless-multi-imsi-sim-data-usa" + WIRELESS_MULTI_IMSI_SIM_MONTHLY_FEES = "wireless-multi-imsi-sim-monthly-fees" + WIRELESS_MULTI_IMSI_SIM_USAGE = "wireless-multi-imsi-sim-usage" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA = "wireless-super-sim-data-north-america" + WIRELESS_SUPER_SIM_USAGE = "wireless-super-sim-usage" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. diff --git a/twilio/rest/api/v2010/account/usage/record/yearly.py b/twilio/rest/api/v2010/account/usage/record/yearly.py index 490b317e72..ad9e5a36d8 100644 --- a/twilio/rest/api/v2010/account/usage/record/yearly.py +++ b/twilio/rest/api/v2010/account/usage/record/yearly.py @@ -25,33 +25,101 @@ class YearlyInstance(InstanceResource): class Category(object): + A2P_10DLC_REGISTRATIONFEES_BRANDREGISTRATION = ( + "a2p-10dlc-registrationfees-brandregistration" + ) + A2P_10DLC_REGISTRATIONFEES_BV = "a2p-10dlc-registrationfees-bv" + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNCHARGES = ( + "a2p-10dlc-registrationfees-campaigncharges" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNREGISTRATION = ( + "a2p-10dlc-registrationfees-campaignregistration" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNVETTING = ( + "a2p-10dlc-registrationfees-campaignvetting" + ) + A2P_10DLC_REGISTRATIONFEES_MONTHLY = "a2p-10dlc-registrationfees-monthly" + A2P_10DLC_REGISTRATIONFEES_ONETIME = "a2p-10dlc-registrationfees-onetime" A2P_REGISTRATION_FEES = "a2p-registration-fees" + ACCOUNT_SECURITY = "account-security" AGENT_CONFERENCE = "agent-conference" + AGENT_COPILOT = "agent-copilot" + AGENT_COPILOT_MESSAGES = "agent-copilot-messages" + AGENT_COPILOT_PARTICIPANT_MINUTES = "agent-copilot-participant-minutes" + AI_ASSISTANTS = "ai-assistants" + AI_ASSISTANTS_VOICE = "ai-assistants-voice" AMAZON_POLLY = "amazon-polly" ANSWERING_MACHINE_DETECTION = "answering-machine-detection" + ASSETS = "assets" + AUDIENCE_MINUTES = "audience-minutes" + AUDIENCE_MINUTES_AUDIO = "audience-minutes-audio" AUTHY_AUTHENTICATIONS = "authy-authentications" AUTHY_CALLS_OUTBOUND = "authy-calls-outbound" + AUTHY_EMAIL_AUTHENTICATIONS = "authy-email-authentications" AUTHY_MONTHLY_FEES = "authy-monthly-fees" + AUTHY_OUTBOUND_EMAIL = "authy-outbound-email" AUTHY_PHONE_INTELLIGENCE = "authy-phone-intelligence" AUTHY_PHONE_VERIFICATIONS = "authy-phone-verifications" AUTHY_SMS_OUTBOUND = "authy-sms-outbound" + AUTHY_VERIFY_EMAIL_VERIFICATIONS = "authy-verify-email-verifications" + AUTHY_VERIFY_OUTBOUND_EMAIL = "authy-verify-outbound-email" + AUTOPILOT = "autopilot" + AUTOPILOT_HOME_ASSISTANTS = "autopilot-home-assistants" + AUTOPILOT_MESSAGING = "autopilot-messaging" + AUTOPILOT_OTHER = "autopilot-other" + AUTOPILOT_VOICE = "autopilot-voice" + BASIC_PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( + "basic-peer-to-peer-rooms-participant-minutes" + ) + BRANDED_CALLING = "branded-calling" + BUNDLE_SMS_BUCKET = "bundle-sms-bucket" + BUNDLE_SUBSCRIPTION_FEES = "bundle-subscription-fees" + CALL_FORWARDING_LOOKUPS = "call-forwarding-lookups" CALL_PROGESS_EVENTS = "call-progess-events" CALLERIDLOOKUPS = "calleridlookups" CALLS = "calls" CALLS_CLIENT = "calls-client" + CALLS_EMERGENCY = "calls-emergency" CALLS_GLOBALCONFERENCE = "calls-globalconference" CALLS_INBOUND = "calls-inbound" CALLS_INBOUND_LOCAL = "calls-inbound-local" CALLS_INBOUND_MOBILE = "calls-inbound-mobile" CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree" + CALLS_INBOUND_TOLLFREE_LOCAL = "calls-inbound-tollfree-local" + CALLS_INBOUND_TOLLFREE_MOBILE = "calls-inbound-tollfree-mobile" + CALLS_MEDIA_STREAM_MINUTES = "calls-media-stream-minutes" CALLS_OUTBOUND = "calls-outbound" CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions" CALLS_RECORDINGS = "calls-recordings" CALLS_SIP = "calls-sip" CALLS_SIP_INBOUND = "calls-sip-inbound" CALLS_SIP_OUTBOUND = "calls-sip-outbound" + CALLS_TEXT_TO_SPEECH = "calls-text-to-speech" CALLS_TRANSFERS = "calls-transfers" CARRIER_LOOKUPS = "carrier-lookups" + CATEGORY = "category" + CHANNELS = "channels" + CHANNELS_MESSAGING = "channels-messaging" + CHANNELS_MESSAGING_INBOUND = "channels-messaging-inbound" + CHANNELS_MESSAGING_OUTBOUND = "channels-messaging-outbound" + CHANNELS_WHATSAPP = "channels-whatsapp" + CHANNELS_WHATSAPP_CONVERSATION_AUTHENTICATION = ( + "channels-whatsapp-conversation-authentication" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE = "channels-whatsapp-conversation-free" + CHANNELS_WHATSAPP_CONVERSATION_MARKETING = ( + "channels-whatsapp-conversation-marketing" + ) + CHANNELS_WHATSAPP_CONVERSATION_SERVICE = ( + "channels-whatsapp-conversation-service" + ) + CHANNELS_WHATSAPP_CONVERSATION_UTILITY = ( + "channels-whatsapp-conversation-utility" + ) + CHANNELS_WHATSAPP_INBOUND = "channels-whatsapp-inbound" + CHANNELS_WHATSAPP_OUTBOUND = "channels-whatsapp-outbound" + CHAT_VIRTUAL_AGENT = "chat-virtual-agent" + CONVERSATION_RELAY = "conversation-relay" CONVERSATIONS = "conversations" CONVERSATIONS_API_REQUESTS = "conversations-api-requests" CONVERSATIONS_CONVERSATION_EVENTS = "conversations-conversation-events" @@ -60,8 +128,40 @@ class Category(object): CONVERSATIONS_PARTICIPANT_EVENTS = "conversations-participant-events" CONVERSATIONS_PARTICIPANTS = "conversations-participants" CPS = "cps" + CREDIT_TRANSFER = "credit-transfer" + EMAIL = "email" + EMERGING_TECH = "emerging-tech" + ENGAGEMENT_SUITE_PACKAGED_PLANS = "engagement-suite-packaged-plans" + ENHANCED_LINE_TYPE_LOOKUPS = "enhanced-line-type-lookups" + ENTERPRISE = "enterprise" + EVENTS = "events" + EXPERIMENT_FRANCE_SMS = "experiment-france-sms" + EXPERIMENT_INDIA_SMS = "experiment-india-sms" + EXPERIMENT_UK_SMS = "experiment-uk-sms" + FAILED_MESSAGE_PROCESSING_FEE = "failed-message-processing-fee" + FLEX = "flex" + FLEX_ACTIVE_USER_HOURS = "flex-active-user-hours" + FLEX_CONCURRENT_USERS = "flex-concurrent-users" + FLEX_CONVERSATIONAL_INSIGHTS = "flex-conversational-insights" + FLEX_CONVERSATIONAL_INSIGHTS_MESSAGES = "flex-conversational-insights-messages" + FLEX_CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = ( + "flex-conversational-insights-voice-minutes" + ) + FLEX_EMAIL_USAGE = "flex-email-usage" + FLEX_MESSAGING_USAGE = "flex-messaging-usage" + FLEX_PARTNER_SPINSCI = "flex-partner-spinsci" + FLEX_PARTNER_XCELERATE = "flex-partner-xcelerate" + FLEX_RESELLER_ECOSYSTEM = "flex-reseller-ecosystem" + FLEX_UNIQUE_USER = "flex-unique-user" FLEX_USAGE = "flex-usage" + FLEX_USERS = "flex-users" + FLEX_VOICE_MINUTE = "flex-voice-minute" + FLEX_YTICA = "flex-ytica" FRAUD_LOOKUPS = "fraud-lookups" + FRONTLINE = "frontline" + FRONTLINE_USERS = "frontline-users" + FUNCTIONS = "functions" + GENERIC_PAY_TRANSACTIONS = "generic-pay-transactions" GROUP_ROOMS = "group-rooms" GROUP_ROOMS_DATA_TRACK = "group-rooms-data-track" GROUP_ROOMS_ENCRYPTED_MEDIA_RECORDED = "group-rooms-encrypted-media-recorded" @@ -71,9 +171,17 @@ class Category(object): GROUP_ROOMS_MEDIA_STORED = "group-rooms-media-stored" GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" - IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING = "ip-messaging" + IP_MESSAGING_COMMANDS = "ip-messaging-commands" + IP_MESSAGING_DATA_STORAGE = "ip-messaging-data-storage" + IP_MESSAGING_DATA_TRANSFER = "ip-messaging-data-transfer" + IP_MESSAGING_ENDPOINT_CONNECTIVITY = "ip-messaging-endpoint-connectivity" IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" + LINE_STATUS_LOOKUPS = "line-status-lookups" + LIVE_ACTIVITY_LOOKUPS = "live-activity-lookups" + LOOKUP_BUCKET_ADJUSTMENT = "lookup-bucket-adjustment" + LOOKUP_IDENTITY_MATCH = "lookup-identity-match" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( @@ -84,6 +192,13 @@ class Category(object): MARKETPLACE_CAPIO_SPEECH_TO_TEXT = "marketplace-capio-speech-to-text" MARKETPLACE_CONVRIZA_ABABA = "marketplace-convriza-ababa" MARKETPLACE_DEEPGRAM_PHRASE_DETECTOR = "marketplace-deepgram-phrase-detector" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION = "marketplace-deepgram-transcription" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION_BASE = ( + "marketplace-deepgram-transcription-base" + ) + MARKETPLACE_DEEPGRAM_TRANSSCRIPTION_ENHANCED = ( + "marketplace-deepgram-transscription-enhanced" + ) MARKETPLACE_DIGITAL_SEGMENT_BUSINESS_INFO = ( "marketplace-digital-segment-business-info" ) @@ -109,6 +224,9 @@ class Category(object): "marketplace-keen-io-contact-center-analytics" ) MARKETPLACE_MARCHEX_CLEANCALL = "marketplace-marchex-cleancall" + MARKETPLACE_MARCHEX_RECORDING_ANALYSIS = ( + "marketplace-marchex-recording-analysis" + ) MARKETPLACE_MARCHEX_SENTIMENT_ANALYSIS_FOR_SMS = ( "marketplace-marchex-sentiment-analysis-for-sms" ) @@ -125,14 +243,42 @@ class Category(object): "marketplace-nextcaller-advanced-caller-identification" ) MARKETPLACE_NOMOROBO_SPAM_SCORE = "marketplace-nomorobo-spam-score" + MARKETPLACE_PAY_ADDONS = "marketplace-pay-addons" + MARKETPLACE_PAY_ADDONS_BASECOMMERCE_PAY_CONNECTOR = ( + "marketplace-pay-addons-basecommerce-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_BRAINTREE_PAY_CONNECTOR = ( + "marketplace-pay-addons-braintree-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CARDCONNECT_PAY_CONNECTOR = ( + "marketplace-pay-addons-cardconnect-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CHASE_PAY_CONNECTOR = ( + "marketplace-pay-addons-chase-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplace-pay-addons-shuttle-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplace-pay-addons-stripe-pay-connector" + ) MARKETPLACE_PAYFONE_TCPA_COMPLIANCE = "marketplace-payfone-tcpa-compliance" + MARKETPLACE_POLY_AI_CONNECTOR = "marketplace-poly-ai-connector" + MARKETPLACE_REALPHONEVALIDATION = "marketplace-realphonevalidation" MARKETPLACE_REMEETING_AUTOMATIC_SPEECH_RECOGNITION = ( "marketplace-remeeting-automatic-speech-recognition" ) + MARKETPLACE_SPOKE_PHONE_LICENSE_PRO = "marketplace-spoke-phone-license-pro" + MARKETPLACE_SPOKE_PHONE_LICENSE_STANDARD = ( + "marketplace-spoke-phone-license-standard" + ) MARKETPLACE_TCPA_DEFENSE_SOLUTIONS_BLACKLIST_FEED = ( "marketplace-tcpa-defense-solutions-blacklist-feed" ) MARKETPLACE_TELO_OPENCNAM = "marketplace-telo-opencnam" + MARKETPLACE_TRESTLE_SOLUTIONS_CALLER_IDENTIFICATION = ( + "marketplace-trestle-solutions-caller-identification" + ) MARKETPLACE_TRUECNAM_TRUE_SPAM = "marketplace-truecnam-true-spam" MARKETPLACE_TWILIO_CALLER_NAME_LOOKUP_US = ( "marketplace-twilio-caller-name-lookup-us" @@ -145,6 +291,9 @@ class Category(object): MARKETPLACE_VOICEBASE_TRANSCRIPTION_CUSTOM_VOCABULARY = ( "marketplace-voicebase-transcription-custom-vocabulary" ) + MARKETPLACE_WEB_PURIFY_PROFANITY_FILTER = ( + "marketplace-web-purify-profanity-filter" + ) MARKETPLACE_WHITEPAGES_PRO_CALLER_IDENTIFICATION = ( "marketplace-whitepages-pro-caller-identification" ) @@ -159,15 +308,23 @@ class Category(object): MARKETPLACE_YTICA_CONTACT_CENTER_REPORTING_ANALYTICS = ( "marketplace-ytica-contact-center-reporting-analytics" ) + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplay-pay-addons-shuttle-pay-connector" + ) + MEDIA_COMPOSER_MINUTES = "media-composer-minutes" MEDIASTORAGE = "mediastorage" + MIN_SPEND_ADJUSTMENTS = "min-spend-adjustments" MMS = "mms" MMS_INBOUND = "mms-inbound" MMS_INBOUND_LONGCODE = "mms-inbound-longcode" MMS_INBOUND_SHORTCODE = "mms-inbound-shortcode" + MMS_INBOUND_TOLL_FREE = "mms-inbound-toll-free" MMS_MESSAGES_CARRIERFEES = "mms-messages-carrierfees" MMS_OUTBOUND = "mms-outbound" MMS_OUTBOUND_LONGCODE = "mms-outbound-longcode" MMS_OUTBOUND_SHORTCODE = "mms-outbound-shortcode" + MMS_OUTBOUND_TOLLFREE = "mms-outbound-tollfree" + MONITOR = "monitor" MONITOR_READS = "monitor-reads" MONITOR_STORAGE = "monitor-storage" MONITOR_WRITES = "monitor-writes" @@ -176,6 +333,12 @@ class Category(object): NOTIFY_CHANNELS = "notify-channels" NUMBER_FORMAT_LOOKUPS = "number-format-lookups" PCHAT = "pchat" + PCHAT_ACTIONS = "pchat-actions" + PCHAT_APS = "pchat-aps" + PCHAT_CONV_MED_STORAGE = "pchat-conv-med-storage" + PCHAT_MESSAGES = "pchat-messages" + PCHAT_NOTIFICATIONS = "pchat-notifications" + PCHAT_READS = "pchat-reads" PCHAT_USERS = "pchat-users" PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( "peer-to-peer-rooms-participant-minutes" @@ -185,18 +348,41 @@ class Category(object): PFAX_MINUTES_INBOUND = "pfax-minutes-inbound" PFAX_MINUTES_OUTBOUND = "pfax-minutes-outbound" PFAX_PAGES = "pfax-pages" + PHONE_QUALITY_SCORE_LOOKUPS = "phone-quality-score-lookups" PHONENUMBERS = "phonenumbers" PHONENUMBERS_CPS = "phonenumbers-cps" PHONENUMBERS_EMERGENCY = "phonenumbers-emergency" PHONENUMBERS_LOCAL = "phonenumbers-local" PHONENUMBERS_MOBILE = "phonenumbers-mobile" + PHONENUMBERS_PORTING = "phonenumbers-porting" PHONENUMBERS_SETUPS = "phonenumbers-setups" PHONENUMBERS_TOLLFREE = "phonenumbers-tollfree" PREMIUMSUPPORT = "premiumsupport" + PREMIUMSUPPORT_PERCENTAGE_SPEND = "premiumsupport-percentage-spend" + PROGRAMMABLEVOICE_PLATFORM = "programmablevoice-platform" + PROGRAMMABLEVOICECONN_CLIENTSDK = "programmablevoiceconn-clientsdk" + PROGRAMMABLEVOICECONN_CLIENTSDK_INBOUND = ( + "programmablevoiceconn-clientsdk-inbound" + ) + PROGRAMMABLEVOICECONN_CLIENTSDK_OUTBOUND = ( + "programmablevoiceconn-clientsdk-outbound" + ) + PROGRAMMABLEVOICECONN_ONNET = "programmablevoiceconn-onnet" + PROGRAMMABLEVOICECONN_ONNET_INBOUND = "programmablevoiceconn-onnet-inbound" + PROGRAMMABLEVOICECONN_ONNET_OUTBOUND = "programmablevoiceconn-onnet-outbound" + PROGRAMMABLEVOICECONN_SIP = "programmablevoiceconn-sip" + PROGRAMMABLEVOICECONN_SIP_INBOUND = "programmablevoiceconn-sip-inbound" + PROGRAMMABLEVOICECONN_SIP_OUTBOUND = "programmablevoiceconn-sip-outbound" + PROGRAMMABLEVOICECONNECTIVITY = "programmablevoiceconnectivity" PROXY = "proxy" PROXY_ACTIVE_SESSIONS = "proxy-active-sessions" + PROXY_BUCKET_ADJUSTMENT = "proxy-bucket-adjustment" + PROXY_LICENSES = "proxy-licenses" PSTNCONNECTIVITY = "pstnconnectivity" + PSTNCONNECTIVITY_INBOUND = "pstnconnectivity-inbound" + PSTNCONNECTIVITY_OUTBOUND = "pstnconnectivity-outbound" PV = "pv" + PV_BASIC_ROOMS = "pv-basic-rooms" PV_COMPOSITION_MEDIA_DOWNLOADED = "pv-composition-media-downloaded" PV_COMPOSITION_MEDIA_ENCRYPTED = "pv-composition-media-encrypted" PV_COMPOSITION_MEDIA_STORED = "pv-composition-media-stored" @@ -212,18 +398,20 @@ class Category(object): PV_ROOM_PARTICIPANTS_US2 = "pv-room-participants-us2" PV_ROOMS = "pv-rooms" PV_SIP_ENDPOINT_REGISTRATIONS = "pv-sip-endpoint-registrations" + RCS_MESSAGES = "rcs-messages" + REASSIGNED_NUMBER = "reassigned-number" RECORDINGS = "recordings" RECORDINGSTORAGE = "recordingstorage" - ROOMS_GROUP_BANDWIDTH = "rooms-group-bandwidth" - ROOMS_GROUP_MINUTES = "rooms-group-minutes" - ROOMS_PEER_TO_PEER_MINUTES = "rooms-peer-to-peer-minutes" SHORTCODES = "shortcodes" SHORTCODES_CUSTOMEROWNED = "shortcodes-customerowned" SHORTCODES_MMS_ENABLEMENT = "shortcodes-mms-enablement" SHORTCODES_MPS = "shortcodes-mps" SHORTCODES_RANDOM = "shortcodes-random" + SHORTCODES_SETUP_FEES = "shortcodes-setup-fees" SHORTCODES_UK = "shortcodes-uk" SHORTCODES_VANITY = "shortcodes-vanity" + SIM_SWAP_LOOKUPS = "sim-swap-lookups" + SIP_SECURE_MEDIA = "sip-secure-media" SMALL_GROUP_ROOMS = "small-group-rooms" SMALL_GROUP_ROOMS_DATA_TRACK = "small-group-rooms-data-track" SMALL_GROUP_ROOMS_PARTICIPANT_MINUTES = "small-group-rooms-participant-minutes" @@ -231,13 +419,30 @@ class Category(object): SMS_INBOUND = "sms-inbound" SMS_INBOUND_LONGCODE = "sms-inbound-longcode" SMS_INBOUND_SHORTCODE = "sms-inbound-shortcode" + SMS_INBOUND_TOLLFREE = "sms-inbound-tollfree" SMS_MESSAGES_CARRIERFEES = "sms-messages-carrierfees" SMS_MESSAGES_FEATURES = "sms-messages-features" + SMS_MESSAGES_FEATURES_ENGAGEMENT_SUITE = ( + "sms-messages-features-engagement-suite" + ) + SMS_MESSAGES_FEATURES_MESSAGE_REDACTION = ( + "sms-messages-features-message-redaction" + ) SMS_MESSAGES_FEATURES_SENDERID = "sms-messages-features-senderid" + SMS_MPS = "sms-mps" + SMS_MPS_SHORTCODE = "sms-mps-shortcode" + SMS_MPS_TOLLFREE = "sms-mps-tollfree" + SMS_MPS_TOLLFREE_SETUP = "sms-mps-tollfree-setup" + SMS_NATIONAL_REGULATORY_PROTECTION = "sms-national-regulatory-protection" SMS_OUTBOUND = "sms-outbound" SMS_OUTBOUND_CONTENT_INSPECTION = "sms-outbound-content-inspection" SMS_OUTBOUND_LONGCODE = "sms-outbound-longcode" SMS_OUTBOUND_SHORTCODE = "sms-outbound-shortcode" + SMS_OUTBOUND_TOLLFREE = "sms-outbound-tollfree" + SMS_PUMPING_PROTECTION = "sms-pumping-protection" + SMS_PUMPING_RISK = "sms-pumping-risk" + SMSMESSAGES_BUCKET_ADJUSTMENTS = "smsmessages-bucket-adjustments" + SMSMESSAGES_OUTBOUND_DOMESTIC = "smsmessages-outbound-domestic" SPEECH_RECOGNITION = "speech-recognition" STUDIO_ENGAGEMENTS = "studio-engagements" SYNC = "sync" @@ -267,13 +472,27 @@ class Category(object): TURNMEGABYTES_SINGAPORE = "turnmegabytes-singapore" TURNMEGABYTES_USEAST = "turnmegabytes-useast" TURNMEGABYTES_USWEST = "turnmegabytes-uswest" + TWILIO_FOR_SALESFORCE = "twilio-for-salesforce" + TWILIO_FOR_SALESFORCE_LICENSES = "twilio-for-salesforce-licenses" TWILIO_INTERCONNECT = "twilio-interconnect" + TWIML = "twiml" + USAGE_FLEX_VIDEO = "usage-flex-video" + USAGE_FUNCTIONS = "usage-functions" + USAGE_RCS_BASIC_MESSAGES_OUTBOUND = "usage-rcs-basic-messages-outbound" + USAGE_RCS_MESSAGES = "usage-rcs-messages" + USAGE_RCS_MESSAGES_INBOUND = "usage-rcs-messages-inbound" + USAGE_RCS_MESSAGING_CARRIER_FEES = "usage-rcs-messaging-carrier-fees" + USAGE_RCS_SINGLE_MESSAGES_OUTBOUND = "usage-rcs-single-messages-outbound" + VERIFY_PACKAGE_PLANS = "verify-package-plans" VERIFY_PUSH = "verify-push" + VERIFY_SNA = "verify-sna" VERIFY_TOTP = "verify-totp" + VERIFY_VOICE_SMS = "verify-voice-sms" VERIFY_WHATSAPP_CONVERSATIONS_BUSINESS_INITIATED = ( "verify-whatsapp-conversations-business-initiated" ) VIDEO_RECORDINGS = "video-recordings" + VIDEO_ROOMS_TURN_MEGABYTES = "video-rooms-turn-megabytes" VIRTUAL_AGENT = "virtual-agent" VOICE_INSIGHTS = "voice-insights" VOICE_INSIGHTS_CLIENT_INSIGHTS_ON_DEMAND_MINUTE = ( @@ -289,14 +508,103 @@ class Category(object): "voice-insights-sip-trunking-insights-on-demand-minute" ) VOICE_INTELLIGENCE = "voice-intelligence" - VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + VOICE_INTELLIGENCE_EIP_OPERATORS = "voice-intelligence-eip-operators" VOICE_INTELLIGENCE_OPERATORS = "voice-intelligence-operators" + VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + WDS = "wds" WIRELESS = "wireless" + WIRELESS_DATA = "wireless-data" + WIRELESS_DATA_PAYG = "wireless-data-payg" + WIRELESS_DATA_PAYG_AFRICA = "wireless-data-payg-africa" + WIRELESS_DATA_PAYG_ASIA = "wireless-data-payg-asia" + WIRELESS_DATA_PAYG_CENTRALANDSOUTHAMERICA = ( + "wireless-data-payg-centralandsouthamerica" + ) + WIRELESS_DATA_PAYG_EUROPE = "wireless-data-payg-europe" + WIRELESS_DATA_PAYG_NORTHAMERICA = "wireless-data-payg-northamerica" + WIRELESS_DATA_PAYG_OCEANIA = "wireless-data-payg-oceania" + WIRELESS_DATA_QUOTA1 = "wireless-data-quota1" + WIRELESS_DATA_QUOTA1_AFRICA = "wireless-data-quota1-africa" + WIRELESS_DATA_QUOTA1_ASIA = "wireless-data-quota1-asia" + WIRELESS_DATA_QUOTA1_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota1-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA1_EUROPE = "wireless-data-quota1-europe" + WIRELESS_DATA_QUOTA1_NORTHAMERICA = "wireless-data-quota1-northamerica" + WIRELESS_DATA_QUOTA1_OCEANIA = "wireless-data-quota1-oceania" + WIRELESS_DATA_QUOTA10 = "wireless-data-quota10" + WIRELESS_DATA_QUOTA10_AFRICA = "wireless-data-quota10-africa" + WIRELESS_DATA_QUOTA10_ASIA = "wireless-data-quota10-asia" + WIRELESS_DATA_QUOTA10_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota10-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA10_EUROPE = "wireless-data-quota10-europe" + WIRELESS_DATA_QUOTA10_NORTHAMERICA = "wireless-data-quota10-northamerica" + WIRELESS_DATA_QUOTA10_OCEANIA = "wireless-data-quota10-oceania" + WIRELESS_DATA_QUOTA50 = "wireless-data-quota50" + WIRELESS_DATA_QUOTA50_AFRICA = "wireless-data-quota50-africa" + WIRELESS_DATA_QUOTA50_ASIA = "wireless-data-quota50-asia" + WIRELESS_DATA_QUOTA50_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota50-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA50_EUROPE = "wireless-data-quota50-europe" + WIRELESS_DATA_QUOTA50_NORTHAMERICA = "wireless-data-quota50-northamerica" + WIRELESS_DATA_QUOTA50_OCEANIA = "wireless-data-quota50-oceania" + WIRELESS_DATA_QUOTACUSTOM = "wireless-data-quotacustom" + WIRELESS_DATA_QUOTACUSTOM_AFRICA = "wireless-data-quotacustom-africa" + WIRELESS_DATA_QUOTACUSTOM_ASIA = "wireless-data-quotacustom-asia" + WIRELESS_DATA_QUOTACUSTOM_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quotacustom-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_EUROPE = "wireless-data-quotacustom-europe" + WIRELESS_DATA_QUOTACUSTOM_NORTHAMERICA = ( + "wireless-data-quotacustom-northamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_OCEANIA = "wireless-data-quotacustom-oceania" + WIRELESS_MRC_PAYG = "wireless-mrc-payg" + WIRELESS_MRC_QUOTA1 = "wireless-mrc-quota1" + WIRELESS_MRC_QUOTA10 = "wireless-mrc-quota10" + WIRELESS_MRC_QUOTA50 = "wireless-mrc-quota50" + WIRELESS_MRC_QUOTACUSTOM = "wireless-mrc-quotacustom" WIRELESS_ORDERS = "wireless-orders" WIRELESS_ORDERS_ARTWORK = "wireless-orders-artwork" WIRELESS_ORDERS_BULK = "wireless-orders-bulk" WIRELESS_ORDERS_ESIM = "wireless-orders-esim" WIRELESS_ORDERS_STARTER = "wireless-orders-starter" + WIRELESS_QUOTAS = "wireless-quotas" + WIRELESS_SMS_AFRICA = "wireless-sms-africa" + WIRELESS_SMS_ASIA = "wireless-sms-asia" + WIRELESS_SMS_CENTRALANDSOUTHAMERICA = "wireless-sms-centralandsouthamerica" + WIRELESS_SMS_EUROPE = "wireless-sms-europe" + WIRELESS_SMS_NORTHAMERICA = "wireless-sms-northamerica" + WIRELESS_SMS_OCEANIA = "wireless-sms-oceania" + WIRELESS_SUPER_SIM = "wireless-super-sim" + WIRELESS_SUPER_SIM_DATA = "wireless-super-sim-data" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA_USA = ( + "wireless-super-sim-data-north-america-usa" + ) + WIRELESS_SUPER_SIM_DATA_PAYG = "wireless-super-sim-data-payg" + WIRELESS_SUPER_SIM_DATA_PAYG_EUROPE = "wireless-super-sim-data-payg-europe" + WIRELESS_SUPER_SIM_DATA_PAYG_NORTH_AMERICA = ( + "wireless-super-sim-data-payg-north-america" + ) + WIRELESS_SUPER_SIM_HARDWARE = "wireless-super-sim-hardware" + WIRELESS_SUPER_SIM_HARDWARE_BULK = "wireless-super-sim-hardware-bulk" + WIRELESS_SUPER_SIM_SMSCOMMANDS = "wireless-super-sim-smscommands" + WIRELESS_SUPER_SIM_SMSCOMMANDS_AFRICA = "wireless-super-sim-smscommands-africa" + WIRELESS_SUPER_SIM_SMSCOMMANDS_ASIA = "wireless-super-sim-smscommands-asia" + WIRELESS_SUPER_SIM_SMSCOMMANDS_CENT_AND_SOUTH_AMERICA = ( + "wireless-super-sim-smscommands-cent-and-south-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_EUROPE = "wireless-super-sim-smscommands-europe" + WIRELESS_SUPER_SIM_SMSCOMMANDS_NORTH_AMERICA = ( + "wireless-super-sim-smscommands-north-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_OCEANIA = ( + "wireless-super-sim-smscommands-oceania" + ) + WIRELESS_SUPER_SIM_SUBSCRIPTION = "wireless-super-sim-subscription" + WIRELESS_SUPER_SIM_SUBSCRIPTION_PAYG = "wireless-super-sim-subscription-payg" WIRELESS_USAGE = "wireless-usage" WIRELESS_USAGE_COMMANDS = "wireless-usage-commands" WIRELESS_USAGE_COMMANDS_AFRICA = "wireless-usage-commands-africa" @@ -348,6 +656,184 @@ class Category(object): WIRELESS_USAGE_MRC_SUSPENDED = "wireless-usage-mrc-suspended" WIRELESS_USAGE_SMS = "wireless-usage-sms" WIRELESS_USAGE_VOICE = "wireless-usage-voice" + A2P_FAST_TRACK_ONBOARDING = "a2p-fast-track-onboarding" + ADVISORY_SERVICES = "advisory-services" + ADVISORY_SERVICES_BILLED = "advisory-services-billed" + ADVISORY_SERVICES_CALL_TRACKING = "advisory-services-call-tracking" + ADVISORY_SERVICES_DATA_SERVICES = "advisory-services-data-services" + ADVISORY_SERVICES_EXPENSES = "advisory-services-expenses" + ADVISORY_SERVICES_SIP_TRUNKING = "advisory-services-sip-trunking" + ASSETS_REQUESTS = "assets-requests" + AUDIENCE_MINUTES_VIDEO = "audience-minutes-video" + AUTHY_BUCKET_ADJUSTMENT = "authy-bucket-adjustment" + AUTHY_SOFTWARE = "authy-software" + CALLERIDLOOKUPS_API = "calleridlookups-api" + CALLERIDLOOKUPS_PROGRAMMABLEVOICE = "calleridlookups-programmablevoice" + CALLERIDLOOKUPS_TRUNKING = "calleridlookups-trunking" + CALLS_TRUNKING_INBOUND_TOLLFREE_LOCAL = "calls-trunking-inbound-tollfree-local" + CALLS_TRUNKING_INBOUND_TOLLFREE_MOBILE = ( + "calls-trunking-inbound-tollfree-mobile" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE_1 = "channels-whatsapp-conversation-free-1" + CONFERENCE = "conference" + CONVERSATIONAL_INSIGHTS = "conversational-insights" + CONVERSATIONAL_INSIGHTS_MESSAGES = "conversational-insights-messages" + CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = "conversational-insights-voice-minutes" + DEMO = "demo" + DEMO_UC_SCRIPT_TEST = "demo-uc-script-test" + ELASTIC_SIP_TRUNKING = "elastic-sip-trunking" + ELASTIC_SIP_TRUNKING_CALL_TRANSFERS = "elastic-sip-trunking-call-transfers" + ENTERPRISE_HIPPA = "enterprise-hippa" + FLEX_NAMED_USERS = "flex-named-users" + FLEX_SPINSCI = "flex-spinsci" + FLEX_USERS_1 = "flex-users-1" + FLEX_WFO_PREMIUM_SPEECH_ANALYTICS = "flex-wfo-premium-speech-analytics" + FLEX_XCELERATE = "flex-xcelerate" + FUNCTIONS_ROLLUP = "functions-rollup" + IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING_ADDONS = "ip-messaging-addons" + IVR = "ivr" + IVR_CONVERSATIONAL = "ivr-conversational" + IVR_DTMF = "ivr-dtmf" + IVR_VIRTUALAGENT = "ivr-virtualagent" + LIVE = "live" + LIVE_MEDIA_RECORDING_MINUTES = "live-media-recording-minutes" + LONGCODE_MPS = "longcode-mps" + MARKETPLACE_ANALYTICS_ADDONS = "marketplace-analytics-addons" + MARKETPLACE_ISV_ADDONS = "marketplace-isv-addons" + MARKETPLACE_MESSAGING_ADDONS = "marketplace-messaging-addons" + MARKETPLACE_PHONENUMBERS_ADDONS = "marketplace-phonenumbers-addons" + MARKETPLACE_RECORDING_ADDONS = "marketplace-recording-addons" + MARKETPLACE_VIRTUALAGENT_ADDONS = "marketplace-virtualagent-addons" + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR_1 = ( + "marketplay-pay-addons-shuttle-pay-connector-1" + ) + MARKETPLAY_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplay-pay-addons-stripe-pay-connector" + ) + MMS_INBOUND_LONGCODE_CANADA = "mms-inbound-longcode-canada" + MMS_INBOUND_LONGCODE_UNITEDSTATES = "mms-inbound-longcode-unitedstates" + MMS_OUTBOUND_LONGCODE_CANADA = "mms-outbound-longcode-canada" + MMS_OUTBOUND_LONGCODE_UNITEDSTATES = "mms-outbound-longcode-unitedstates" + MMS_OUTBOUND_TOLL_FREE = "mms-outbound-toll-free" + NOTIFY_CHATAPPSANDOTHERCHANNELS = "notify-chatappsandotherchannels" + NOTIFY_NOTIFYSERVICES = "notify-notifyservices" + NOTIFY_PUSHNOTIFICATIONS = "notify-pushnotifications" + PAYMENT_GATEWAY_CONNECTORS = "payment-gateway-connectors" + PAYMENT_SOLUTIONS = "payment-solutions" + PCHAT_BUCKET_ADJUSTMENT = "pchat-bucket-adjustment" + PHONENUMBERS_NUMBERS = "phonenumbers-numbers" + PROG_VOICE_CLIENT_ANDROID = "prog-voice-client-android" + PROG_VOICE_CLIENT_ANDROID_INBOUND = "prog-voice-client-android-inbound" + PROG_VOICE_CLIENT_ANDROID_OUTBOUND = "prog-voice-client-android-outbound" + PROG_VOICE_CLIENT_IOS = "prog-voice-client-ios" + PROG_VOICE_CLIENT_IOS_INBOUND = "prog-voice-client-ios-inbound" + PROG_VOICE_CLIENT_IOS_OUTBOUND = "prog-voice-client-ios-outbound" + PROG_VOICE_CLIENT_SDK = "prog-voice-client-sdk" + PROG_VOICE_CLIENT_WEB = "prog-voice-client-web" + PROG_VOICE_CLIENT_WEB_INBOUND = "prog-voice-client-web-inbound" + PROG_VOICE_CLIENT_WEB_OUTBOUND = "prog-voice-client-web-outbound" + PROGRAMMABLEVOICECONNECTIVITY_MEDIA_STREAMS = ( + "programmablevoiceconnectivity-media-streams" + ) + PSTNCONNECTIVITY_BYOC = "pstnconnectivity-byoc" + PSTNCONNECTIVITY_EMERGENCY = "pstnconnectivity-emergency" + PSTNCONNECTIVITY_MINUTES = "pstnconnectivity-minutes" + PSTNCONNECTIVITY_MINUTES_1 = "pstnconnectivity-minutes-1" + PSTNCONNECTIVITY_MINUTESINBOUNDLOCAL = "pstnconnectivity-minutesinboundlocal" + PSTNCONNECTIVITY_MINUTESINBOUNDMOBILE = "pstnconnectivity-minutesinboundmobile" + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREE = ( + "pstnconnectivity-minutesinboundtollfree" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREELOCAL = ( + "pstnconnectivity-minutesinboundtollfreelocal" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREEMOBILE = ( + "pstnconnectivity-minutesinboundtollfreemobile" + ) + PV_ROOM_HOURS = "pv-room-hours" + PV_ROOM_SIMULTANEOUS_PARTICIPANT_CONNECTIONS = ( + "pv-room-simultaneous-participant-connections" + ) + PVIDEO_ROOM_HOURS_AU1 = "pvideo-room-hours-au1" + PVIDEO_ROOM_HOURS_BR1 = "pvideo-room-hours-br1" + PVIDEO_ROOM_HOURS_IE1 = "pvideo-room-hours-ie1" + PVIDEO_ROOM_HOURS_JP1 = "pvideo-room-hours-jp1" + PVIDEO_ROOM_HOURS_SG1 = "pvideo-room-hours-sg1" + PVIDEO_ROOM_HOURS_US1 = "pvideo-room-hours-us1" + PVIDEO_ROOM_HOURS_US2 = "pvideo-room-hours-us2" + RECORDINGS_ENCRYPTED = "recordings-encrypted" + SHORT_CODE_SETUP_FEES = "short-code-setup-fees" + SHORTCODES_MESSAGES_INBOUND = "shortcodes-messages-inbound" + SHORTCODES_MESSAGES_OUTBOUND = "shortcodes-messages-outbound" + SMS_MESSAGES_REGISTRATIONFEES = "sms-messages-registrationfees" + SMS_MMS_PENALTY_FEES = "sms-mms-penalty-fees" + SMS_MMS_PENALTY_FEES_1 = "sms-mms-penalty-fees-1" + SMS_PUMPING_PROTECTION_NON_USCA = "sms-pumping-protection-non-usca" + SMS_PUMPING_PROTECTION_USCA = "sms-pumping-protection-usca" + STUDIO = "studio" + STUDIO_MONTHLY_FEES = "studio-monthly-fees" + SUPERSIM = "supersim" + TASK_ROUTER = "task-router" + TASK_ROUTER_WORKERS = "task-router-workers" + TEST_QUOTA_BUCKETS = "test-quota-buckets" + TEST_UC_SCRIPT_1 = "test-uc-script-1" + TEST_UC_SCRIPT_DEMO_2 = "test-uc-script-demo-2" + TEXT_TO_SPEECH = "text-to-speech" + TME = "tme" + TTS_BASIC = "tts-basic" + TWILIO_EDITIONS = "twilio-editions" + TWILIO_INTERCONNECT_CALIFORNIA = "twilio-interconnect-california" + TWILIO_INTERCONNECT_CALIFORNIA_MONTHLY = ( + "twilio-interconnect-california-monthly" + ) + TWILIO_INTERCONNECT_CALIFORNIA_SETUP = "twilio-interconnect-california-setup" + TWILIO_INTERCONNECT_FRANKFURT = "twilio-interconnect-frankfurt" + TWILIO_INTERCONNECT_FRANKFURT_MO = "twilio-interconnect-frankfurt-mo" + TWILIO_INTERCONNECT_FRANKFURT_SETUP = "twilio-interconnect-frankfurt-setup" + TWILIO_INTERCONNECT_LONDON = "twilio-interconnect-london" + TWILIO_INTERCONNECT_LONDON_MO = "twilio-interconnect-london-mo" + TWILIO_INTERCONNECT_LONDON_SETUP = "twilio-interconnect-london-setup" + TWILIO_INTERCONNECT_SAO_PAULO = "twilio-interconnect-sao-paulo" + TWILIO_INTERCONNECT_SAO_PAULO_MONTHLY = "twilio-interconnect-sao-paulo-monthly" + TWILIO_INTERCONNECT_SAO_PAULO_SETUP = "twilio-interconnect-sao-paulo-setup" + TWILIO_INTERCONNECT_SINGAPORE = "twilio-interconnect-singapore" + TWILIO_INTERCONNECT_SINGAPORE_MO = "twilio-interconnect-singapore-mo" + TWILIO_INTERCONNECT_SINGAPORE_SETUP = "twilio-interconnect-singapore-setup" + TWILIO_INTERCONNECT_SYDNEY = "twilio-interconnect-sydney" + TWILIO_INTERCONNECT_SYDNEY_MO = "twilio-interconnect-sydney-mo" + TWILIO_INTERCONNECT_SYDNEY_SETUP = "twilio-interconnect-sydney-setup" + TWILIO_INTERCONNECT_TOKYO = "twilio-interconnect-tokyo" + TWILIO_INTERCONNECT_TOKYO_MO = "twilio-interconnect-tokyo-mo" + TWILIO_INTERCONNECT_TOKYO_SETUP = "twilio-interconnect-tokyo-setup" + TWILIO_INTERCONNECT_VA = "twilio-interconnect-va" + TWILIO_INTERCONNECT_VA_MO = "twilio-interconnect-va-mo" + TWILIO_INTERCONNECT_VA_SETUP = "twilio-interconnect-va-setup" + TWIML_VERBS = "twiml-verbs" + TWIML_VERBS_SAY = "twiml-verbs-say" + USAGE_PROGRAMMABLE_MESSAGING_ENGAGEMENT_SUITE = ( + "usage-programmable-messaging-engagement-suite" + ) + USAGE_PROGRAMMABLE_MESSAGING_FEES_SERVICES = ( + "usage-programmable-messaging-fees-services" + ) + VERIFY_OUTBOUND_EMAIL = "verify-outbound-email" + VERIFY_PACKAGED_PLANS = "verify-packaged-plans" + VERIFY_SILENT_NETWORK_AUTH = "verify-silent-network-auth" + VERIFY_VOICE_AND_SMS = "verify-voice-and-sms" + VOICE_INSIGHTS_CLIENT_INSIGHTS_MONTHY_COMMIT = ( + "voice-insights-client-insights-monthy-commit" + ) + WIRELESS_DATA_PAYG_ASIA_AFG = "wireless-data-payg-asia-afg" + WIRELESS_MULTI_IMSI_SIM_COMMANDS = "wireless-multi-imsi-sim-commands" + WIRELESS_MULTI_IMSI_SIM_COMMANDS_USA = "wireless-multi-imsi-sim-commands-usa" + WIRELESS_MULTI_IMSI_SIM_DATA = "wireless-multi-imsi-sim-data" + WIRELESS_MULTI_IMSI_SIM_DATA_EU28 = "wireless-multi-imsi-sim-data-eu28" + WIRELESS_MULTI_IMSI_SIM_DATA_USA = "wireless-multi-imsi-sim-data-usa" + WIRELESS_MULTI_IMSI_SIM_MONTHLY_FEES = "wireless-multi-imsi-sim-monthly-fees" + WIRELESS_MULTI_IMSI_SIM_USAGE = "wireless-multi-imsi-sim-usage" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA = "wireless-super-sim-data-north-america" + WIRELESS_SUPER_SIM_USAGE = "wireless-super-sim-usage" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. diff --git a/twilio/rest/api/v2010/account/usage/record/yesterday.py b/twilio/rest/api/v2010/account/usage/record/yesterday.py index da5c9dc180..f3aacda8b9 100644 --- a/twilio/rest/api/v2010/account/usage/record/yesterday.py +++ b/twilio/rest/api/v2010/account/usage/record/yesterday.py @@ -25,33 +25,101 @@ class YesterdayInstance(InstanceResource): class Category(object): + A2P_10DLC_REGISTRATIONFEES_BRANDREGISTRATION = ( + "a2p-10dlc-registrationfees-brandregistration" + ) + A2P_10DLC_REGISTRATIONFEES_BV = "a2p-10dlc-registrationfees-bv" + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNCHARGES = ( + "a2p-10dlc-registrationfees-campaigncharges" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNREGISTRATION = ( + "a2p-10dlc-registrationfees-campaignregistration" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNVETTING = ( + "a2p-10dlc-registrationfees-campaignvetting" + ) + A2P_10DLC_REGISTRATIONFEES_MONTHLY = "a2p-10dlc-registrationfees-monthly" + A2P_10DLC_REGISTRATIONFEES_ONETIME = "a2p-10dlc-registrationfees-onetime" A2P_REGISTRATION_FEES = "a2p-registration-fees" + ACCOUNT_SECURITY = "account-security" AGENT_CONFERENCE = "agent-conference" + AGENT_COPILOT = "agent-copilot" + AGENT_COPILOT_MESSAGES = "agent-copilot-messages" + AGENT_COPILOT_PARTICIPANT_MINUTES = "agent-copilot-participant-minutes" + AI_ASSISTANTS = "ai-assistants" + AI_ASSISTANTS_VOICE = "ai-assistants-voice" AMAZON_POLLY = "amazon-polly" ANSWERING_MACHINE_DETECTION = "answering-machine-detection" + ASSETS = "assets" + AUDIENCE_MINUTES = "audience-minutes" + AUDIENCE_MINUTES_AUDIO = "audience-minutes-audio" AUTHY_AUTHENTICATIONS = "authy-authentications" AUTHY_CALLS_OUTBOUND = "authy-calls-outbound" + AUTHY_EMAIL_AUTHENTICATIONS = "authy-email-authentications" AUTHY_MONTHLY_FEES = "authy-monthly-fees" + AUTHY_OUTBOUND_EMAIL = "authy-outbound-email" AUTHY_PHONE_INTELLIGENCE = "authy-phone-intelligence" AUTHY_PHONE_VERIFICATIONS = "authy-phone-verifications" AUTHY_SMS_OUTBOUND = "authy-sms-outbound" + AUTHY_VERIFY_EMAIL_VERIFICATIONS = "authy-verify-email-verifications" + AUTHY_VERIFY_OUTBOUND_EMAIL = "authy-verify-outbound-email" + AUTOPILOT = "autopilot" + AUTOPILOT_HOME_ASSISTANTS = "autopilot-home-assistants" + AUTOPILOT_MESSAGING = "autopilot-messaging" + AUTOPILOT_OTHER = "autopilot-other" + AUTOPILOT_VOICE = "autopilot-voice" + BASIC_PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( + "basic-peer-to-peer-rooms-participant-minutes" + ) + BRANDED_CALLING = "branded-calling" + BUNDLE_SMS_BUCKET = "bundle-sms-bucket" + BUNDLE_SUBSCRIPTION_FEES = "bundle-subscription-fees" + CALL_FORWARDING_LOOKUPS = "call-forwarding-lookups" CALL_PROGESS_EVENTS = "call-progess-events" CALLERIDLOOKUPS = "calleridlookups" CALLS = "calls" CALLS_CLIENT = "calls-client" + CALLS_EMERGENCY = "calls-emergency" CALLS_GLOBALCONFERENCE = "calls-globalconference" CALLS_INBOUND = "calls-inbound" CALLS_INBOUND_LOCAL = "calls-inbound-local" CALLS_INBOUND_MOBILE = "calls-inbound-mobile" CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree" + CALLS_INBOUND_TOLLFREE_LOCAL = "calls-inbound-tollfree-local" + CALLS_INBOUND_TOLLFREE_MOBILE = "calls-inbound-tollfree-mobile" + CALLS_MEDIA_STREAM_MINUTES = "calls-media-stream-minutes" CALLS_OUTBOUND = "calls-outbound" CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions" CALLS_RECORDINGS = "calls-recordings" CALLS_SIP = "calls-sip" CALLS_SIP_INBOUND = "calls-sip-inbound" CALLS_SIP_OUTBOUND = "calls-sip-outbound" + CALLS_TEXT_TO_SPEECH = "calls-text-to-speech" CALLS_TRANSFERS = "calls-transfers" CARRIER_LOOKUPS = "carrier-lookups" + CATEGORY = "category" + CHANNELS = "channels" + CHANNELS_MESSAGING = "channels-messaging" + CHANNELS_MESSAGING_INBOUND = "channels-messaging-inbound" + CHANNELS_MESSAGING_OUTBOUND = "channels-messaging-outbound" + CHANNELS_WHATSAPP = "channels-whatsapp" + CHANNELS_WHATSAPP_CONVERSATION_AUTHENTICATION = ( + "channels-whatsapp-conversation-authentication" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE = "channels-whatsapp-conversation-free" + CHANNELS_WHATSAPP_CONVERSATION_MARKETING = ( + "channels-whatsapp-conversation-marketing" + ) + CHANNELS_WHATSAPP_CONVERSATION_SERVICE = ( + "channels-whatsapp-conversation-service" + ) + CHANNELS_WHATSAPP_CONVERSATION_UTILITY = ( + "channels-whatsapp-conversation-utility" + ) + CHANNELS_WHATSAPP_INBOUND = "channels-whatsapp-inbound" + CHANNELS_WHATSAPP_OUTBOUND = "channels-whatsapp-outbound" + CHAT_VIRTUAL_AGENT = "chat-virtual-agent" + CONVERSATION_RELAY = "conversation-relay" CONVERSATIONS = "conversations" CONVERSATIONS_API_REQUESTS = "conversations-api-requests" CONVERSATIONS_CONVERSATION_EVENTS = "conversations-conversation-events" @@ -60,8 +128,40 @@ class Category(object): CONVERSATIONS_PARTICIPANT_EVENTS = "conversations-participant-events" CONVERSATIONS_PARTICIPANTS = "conversations-participants" CPS = "cps" + CREDIT_TRANSFER = "credit-transfer" + EMAIL = "email" + EMERGING_TECH = "emerging-tech" + ENGAGEMENT_SUITE_PACKAGED_PLANS = "engagement-suite-packaged-plans" + ENHANCED_LINE_TYPE_LOOKUPS = "enhanced-line-type-lookups" + ENTERPRISE = "enterprise" + EVENTS = "events" + EXPERIMENT_FRANCE_SMS = "experiment-france-sms" + EXPERIMENT_INDIA_SMS = "experiment-india-sms" + EXPERIMENT_UK_SMS = "experiment-uk-sms" + FAILED_MESSAGE_PROCESSING_FEE = "failed-message-processing-fee" + FLEX = "flex" + FLEX_ACTIVE_USER_HOURS = "flex-active-user-hours" + FLEX_CONCURRENT_USERS = "flex-concurrent-users" + FLEX_CONVERSATIONAL_INSIGHTS = "flex-conversational-insights" + FLEX_CONVERSATIONAL_INSIGHTS_MESSAGES = "flex-conversational-insights-messages" + FLEX_CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = ( + "flex-conversational-insights-voice-minutes" + ) + FLEX_EMAIL_USAGE = "flex-email-usage" + FLEX_MESSAGING_USAGE = "flex-messaging-usage" + FLEX_PARTNER_SPINSCI = "flex-partner-spinsci" + FLEX_PARTNER_XCELERATE = "flex-partner-xcelerate" + FLEX_RESELLER_ECOSYSTEM = "flex-reseller-ecosystem" + FLEX_UNIQUE_USER = "flex-unique-user" FLEX_USAGE = "flex-usage" + FLEX_USERS = "flex-users" + FLEX_VOICE_MINUTE = "flex-voice-minute" + FLEX_YTICA = "flex-ytica" FRAUD_LOOKUPS = "fraud-lookups" + FRONTLINE = "frontline" + FRONTLINE_USERS = "frontline-users" + FUNCTIONS = "functions" + GENERIC_PAY_TRANSACTIONS = "generic-pay-transactions" GROUP_ROOMS = "group-rooms" GROUP_ROOMS_DATA_TRACK = "group-rooms-data-track" GROUP_ROOMS_ENCRYPTED_MEDIA_RECORDED = "group-rooms-encrypted-media-recorded" @@ -71,9 +171,17 @@ class Category(object): GROUP_ROOMS_MEDIA_STORED = "group-rooms-media-stored" GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" - IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING = "ip-messaging" + IP_MESSAGING_COMMANDS = "ip-messaging-commands" + IP_MESSAGING_DATA_STORAGE = "ip-messaging-data-storage" + IP_MESSAGING_DATA_TRANSFER = "ip-messaging-data-transfer" + IP_MESSAGING_ENDPOINT_CONNECTIVITY = "ip-messaging-endpoint-connectivity" IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" + LINE_STATUS_LOOKUPS = "line-status-lookups" + LIVE_ACTIVITY_LOOKUPS = "live-activity-lookups" + LOOKUP_BUCKET_ADJUSTMENT = "lookup-bucket-adjustment" + LOOKUP_IDENTITY_MATCH = "lookup-identity-match" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( @@ -84,6 +192,13 @@ class Category(object): MARKETPLACE_CAPIO_SPEECH_TO_TEXT = "marketplace-capio-speech-to-text" MARKETPLACE_CONVRIZA_ABABA = "marketplace-convriza-ababa" MARKETPLACE_DEEPGRAM_PHRASE_DETECTOR = "marketplace-deepgram-phrase-detector" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION = "marketplace-deepgram-transcription" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION_BASE = ( + "marketplace-deepgram-transcription-base" + ) + MARKETPLACE_DEEPGRAM_TRANSSCRIPTION_ENHANCED = ( + "marketplace-deepgram-transscription-enhanced" + ) MARKETPLACE_DIGITAL_SEGMENT_BUSINESS_INFO = ( "marketplace-digital-segment-business-info" ) @@ -109,6 +224,9 @@ class Category(object): "marketplace-keen-io-contact-center-analytics" ) MARKETPLACE_MARCHEX_CLEANCALL = "marketplace-marchex-cleancall" + MARKETPLACE_MARCHEX_RECORDING_ANALYSIS = ( + "marketplace-marchex-recording-analysis" + ) MARKETPLACE_MARCHEX_SENTIMENT_ANALYSIS_FOR_SMS = ( "marketplace-marchex-sentiment-analysis-for-sms" ) @@ -125,14 +243,42 @@ class Category(object): "marketplace-nextcaller-advanced-caller-identification" ) MARKETPLACE_NOMOROBO_SPAM_SCORE = "marketplace-nomorobo-spam-score" + MARKETPLACE_PAY_ADDONS = "marketplace-pay-addons" + MARKETPLACE_PAY_ADDONS_BASECOMMERCE_PAY_CONNECTOR = ( + "marketplace-pay-addons-basecommerce-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_BRAINTREE_PAY_CONNECTOR = ( + "marketplace-pay-addons-braintree-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CARDCONNECT_PAY_CONNECTOR = ( + "marketplace-pay-addons-cardconnect-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CHASE_PAY_CONNECTOR = ( + "marketplace-pay-addons-chase-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplace-pay-addons-shuttle-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplace-pay-addons-stripe-pay-connector" + ) MARKETPLACE_PAYFONE_TCPA_COMPLIANCE = "marketplace-payfone-tcpa-compliance" + MARKETPLACE_POLY_AI_CONNECTOR = "marketplace-poly-ai-connector" + MARKETPLACE_REALPHONEVALIDATION = "marketplace-realphonevalidation" MARKETPLACE_REMEETING_AUTOMATIC_SPEECH_RECOGNITION = ( "marketplace-remeeting-automatic-speech-recognition" ) + MARKETPLACE_SPOKE_PHONE_LICENSE_PRO = "marketplace-spoke-phone-license-pro" + MARKETPLACE_SPOKE_PHONE_LICENSE_STANDARD = ( + "marketplace-spoke-phone-license-standard" + ) MARKETPLACE_TCPA_DEFENSE_SOLUTIONS_BLACKLIST_FEED = ( "marketplace-tcpa-defense-solutions-blacklist-feed" ) MARKETPLACE_TELO_OPENCNAM = "marketplace-telo-opencnam" + MARKETPLACE_TRESTLE_SOLUTIONS_CALLER_IDENTIFICATION = ( + "marketplace-trestle-solutions-caller-identification" + ) MARKETPLACE_TRUECNAM_TRUE_SPAM = "marketplace-truecnam-true-spam" MARKETPLACE_TWILIO_CALLER_NAME_LOOKUP_US = ( "marketplace-twilio-caller-name-lookup-us" @@ -145,6 +291,9 @@ class Category(object): MARKETPLACE_VOICEBASE_TRANSCRIPTION_CUSTOM_VOCABULARY = ( "marketplace-voicebase-transcription-custom-vocabulary" ) + MARKETPLACE_WEB_PURIFY_PROFANITY_FILTER = ( + "marketplace-web-purify-profanity-filter" + ) MARKETPLACE_WHITEPAGES_PRO_CALLER_IDENTIFICATION = ( "marketplace-whitepages-pro-caller-identification" ) @@ -159,15 +308,23 @@ class Category(object): MARKETPLACE_YTICA_CONTACT_CENTER_REPORTING_ANALYTICS = ( "marketplace-ytica-contact-center-reporting-analytics" ) + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplay-pay-addons-shuttle-pay-connector" + ) + MEDIA_COMPOSER_MINUTES = "media-composer-minutes" MEDIASTORAGE = "mediastorage" + MIN_SPEND_ADJUSTMENTS = "min-spend-adjustments" MMS = "mms" MMS_INBOUND = "mms-inbound" MMS_INBOUND_LONGCODE = "mms-inbound-longcode" MMS_INBOUND_SHORTCODE = "mms-inbound-shortcode" + MMS_INBOUND_TOLL_FREE = "mms-inbound-toll-free" MMS_MESSAGES_CARRIERFEES = "mms-messages-carrierfees" MMS_OUTBOUND = "mms-outbound" MMS_OUTBOUND_LONGCODE = "mms-outbound-longcode" MMS_OUTBOUND_SHORTCODE = "mms-outbound-shortcode" + MMS_OUTBOUND_TOLLFREE = "mms-outbound-tollfree" + MONITOR = "monitor" MONITOR_READS = "monitor-reads" MONITOR_STORAGE = "monitor-storage" MONITOR_WRITES = "monitor-writes" @@ -176,6 +333,12 @@ class Category(object): NOTIFY_CHANNELS = "notify-channels" NUMBER_FORMAT_LOOKUPS = "number-format-lookups" PCHAT = "pchat" + PCHAT_ACTIONS = "pchat-actions" + PCHAT_APS = "pchat-aps" + PCHAT_CONV_MED_STORAGE = "pchat-conv-med-storage" + PCHAT_MESSAGES = "pchat-messages" + PCHAT_NOTIFICATIONS = "pchat-notifications" + PCHAT_READS = "pchat-reads" PCHAT_USERS = "pchat-users" PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( "peer-to-peer-rooms-participant-minutes" @@ -185,18 +348,41 @@ class Category(object): PFAX_MINUTES_INBOUND = "pfax-minutes-inbound" PFAX_MINUTES_OUTBOUND = "pfax-minutes-outbound" PFAX_PAGES = "pfax-pages" + PHONE_QUALITY_SCORE_LOOKUPS = "phone-quality-score-lookups" PHONENUMBERS = "phonenumbers" PHONENUMBERS_CPS = "phonenumbers-cps" PHONENUMBERS_EMERGENCY = "phonenumbers-emergency" PHONENUMBERS_LOCAL = "phonenumbers-local" PHONENUMBERS_MOBILE = "phonenumbers-mobile" + PHONENUMBERS_PORTING = "phonenumbers-porting" PHONENUMBERS_SETUPS = "phonenumbers-setups" PHONENUMBERS_TOLLFREE = "phonenumbers-tollfree" PREMIUMSUPPORT = "premiumsupport" + PREMIUMSUPPORT_PERCENTAGE_SPEND = "premiumsupport-percentage-spend" + PROGRAMMABLEVOICE_PLATFORM = "programmablevoice-platform" + PROGRAMMABLEVOICECONN_CLIENTSDK = "programmablevoiceconn-clientsdk" + PROGRAMMABLEVOICECONN_CLIENTSDK_INBOUND = ( + "programmablevoiceconn-clientsdk-inbound" + ) + PROGRAMMABLEVOICECONN_CLIENTSDK_OUTBOUND = ( + "programmablevoiceconn-clientsdk-outbound" + ) + PROGRAMMABLEVOICECONN_ONNET = "programmablevoiceconn-onnet" + PROGRAMMABLEVOICECONN_ONNET_INBOUND = "programmablevoiceconn-onnet-inbound" + PROGRAMMABLEVOICECONN_ONNET_OUTBOUND = "programmablevoiceconn-onnet-outbound" + PROGRAMMABLEVOICECONN_SIP = "programmablevoiceconn-sip" + PROGRAMMABLEVOICECONN_SIP_INBOUND = "programmablevoiceconn-sip-inbound" + PROGRAMMABLEVOICECONN_SIP_OUTBOUND = "programmablevoiceconn-sip-outbound" + PROGRAMMABLEVOICECONNECTIVITY = "programmablevoiceconnectivity" PROXY = "proxy" PROXY_ACTIVE_SESSIONS = "proxy-active-sessions" + PROXY_BUCKET_ADJUSTMENT = "proxy-bucket-adjustment" + PROXY_LICENSES = "proxy-licenses" PSTNCONNECTIVITY = "pstnconnectivity" + PSTNCONNECTIVITY_INBOUND = "pstnconnectivity-inbound" + PSTNCONNECTIVITY_OUTBOUND = "pstnconnectivity-outbound" PV = "pv" + PV_BASIC_ROOMS = "pv-basic-rooms" PV_COMPOSITION_MEDIA_DOWNLOADED = "pv-composition-media-downloaded" PV_COMPOSITION_MEDIA_ENCRYPTED = "pv-composition-media-encrypted" PV_COMPOSITION_MEDIA_STORED = "pv-composition-media-stored" @@ -212,18 +398,20 @@ class Category(object): PV_ROOM_PARTICIPANTS_US2 = "pv-room-participants-us2" PV_ROOMS = "pv-rooms" PV_SIP_ENDPOINT_REGISTRATIONS = "pv-sip-endpoint-registrations" + RCS_MESSAGES = "rcs-messages" + REASSIGNED_NUMBER = "reassigned-number" RECORDINGS = "recordings" RECORDINGSTORAGE = "recordingstorage" - ROOMS_GROUP_BANDWIDTH = "rooms-group-bandwidth" - ROOMS_GROUP_MINUTES = "rooms-group-minutes" - ROOMS_PEER_TO_PEER_MINUTES = "rooms-peer-to-peer-minutes" SHORTCODES = "shortcodes" SHORTCODES_CUSTOMEROWNED = "shortcodes-customerowned" SHORTCODES_MMS_ENABLEMENT = "shortcodes-mms-enablement" SHORTCODES_MPS = "shortcodes-mps" SHORTCODES_RANDOM = "shortcodes-random" + SHORTCODES_SETUP_FEES = "shortcodes-setup-fees" SHORTCODES_UK = "shortcodes-uk" SHORTCODES_VANITY = "shortcodes-vanity" + SIM_SWAP_LOOKUPS = "sim-swap-lookups" + SIP_SECURE_MEDIA = "sip-secure-media" SMALL_GROUP_ROOMS = "small-group-rooms" SMALL_GROUP_ROOMS_DATA_TRACK = "small-group-rooms-data-track" SMALL_GROUP_ROOMS_PARTICIPANT_MINUTES = "small-group-rooms-participant-minutes" @@ -231,13 +419,30 @@ class Category(object): SMS_INBOUND = "sms-inbound" SMS_INBOUND_LONGCODE = "sms-inbound-longcode" SMS_INBOUND_SHORTCODE = "sms-inbound-shortcode" + SMS_INBOUND_TOLLFREE = "sms-inbound-tollfree" SMS_MESSAGES_CARRIERFEES = "sms-messages-carrierfees" SMS_MESSAGES_FEATURES = "sms-messages-features" + SMS_MESSAGES_FEATURES_ENGAGEMENT_SUITE = ( + "sms-messages-features-engagement-suite" + ) + SMS_MESSAGES_FEATURES_MESSAGE_REDACTION = ( + "sms-messages-features-message-redaction" + ) SMS_MESSAGES_FEATURES_SENDERID = "sms-messages-features-senderid" + SMS_MPS = "sms-mps" + SMS_MPS_SHORTCODE = "sms-mps-shortcode" + SMS_MPS_TOLLFREE = "sms-mps-tollfree" + SMS_MPS_TOLLFREE_SETUP = "sms-mps-tollfree-setup" + SMS_NATIONAL_REGULATORY_PROTECTION = "sms-national-regulatory-protection" SMS_OUTBOUND = "sms-outbound" SMS_OUTBOUND_CONTENT_INSPECTION = "sms-outbound-content-inspection" SMS_OUTBOUND_LONGCODE = "sms-outbound-longcode" SMS_OUTBOUND_SHORTCODE = "sms-outbound-shortcode" + SMS_OUTBOUND_TOLLFREE = "sms-outbound-tollfree" + SMS_PUMPING_PROTECTION = "sms-pumping-protection" + SMS_PUMPING_RISK = "sms-pumping-risk" + SMSMESSAGES_BUCKET_ADJUSTMENTS = "smsmessages-bucket-adjustments" + SMSMESSAGES_OUTBOUND_DOMESTIC = "smsmessages-outbound-domestic" SPEECH_RECOGNITION = "speech-recognition" STUDIO_ENGAGEMENTS = "studio-engagements" SYNC = "sync" @@ -267,13 +472,27 @@ class Category(object): TURNMEGABYTES_SINGAPORE = "turnmegabytes-singapore" TURNMEGABYTES_USEAST = "turnmegabytes-useast" TURNMEGABYTES_USWEST = "turnmegabytes-uswest" + TWILIO_FOR_SALESFORCE = "twilio-for-salesforce" + TWILIO_FOR_SALESFORCE_LICENSES = "twilio-for-salesforce-licenses" TWILIO_INTERCONNECT = "twilio-interconnect" + TWIML = "twiml" + USAGE_FLEX_VIDEO = "usage-flex-video" + USAGE_FUNCTIONS = "usage-functions" + USAGE_RCS_BASIC_MESSAGES_OUTBOUND = "usage-rcs-basic-messages-outbound" + USAGE_RCS_MESSAGES = "usage-rcs-messages" + USAGE_RCS_MESSAGES_INBOUND = "usage-rcs-messages-inbound" + USAGE_RCS_MESSAGING_CARRIER_FEES = "usage-rcs-messaging-carrier-fees" + USAGE_RCS_SINGLE_MESSAGES_OUTBOUND = "usage-rcs-single-messages-outbound" + VERIFY_PACKAGE_PLANS = "verify-package-plans" VERIFY_PUSH = "verify-push" + VERIFY_SNA = "verify-sna" VERIFY_TOTP = "verify-totp" + VERIFY_VOICE_SMS = "verify-voice-sms" VERIFY_WHATSAPP_CONVERSATIONS_BUSINESS_INITIATED = ( "verify-whatsapp-conversations-business-initiated" ) VIDEO_RECORDINGS = "video-recordings" + VIDEO_ROOMS_TURN_MEGABYTES = "video-rooms-turn-megabytes" VIRTUAL_AGENT = "virtual-agent" VOICE_INSIGHTS = "voice-insights" VOICE_INSIGHTS_CLIENT_INSIGHTS_ON_DEMAND_MINUTE = ( @@ -289,14 +508,103 @@ class Category(object): "voice-insights-sip-trunking-insights-on-demand-minute" ) VOICE_INTELLIGENCE = "voice-intelligence" - VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + VOICE_INTELLIGENCE_EIP_OPERATORS = "voice-intelligence-eip-operators" VOICE_INTELLIGENCE_OPERATORS = "voice-intelligence-operators" + VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + WDS = "wds" WIRELESS = "wireless" + WIRELESS_DATA = "wireless-data" + WIRELESS_DATA_PAYG = "wireless-data-payg" + WIRELESS_DATA_PAYG_AFRICA = "wireless-data-payg-africa" + WIRELESS_DATA_PAYG_ASIA = "wireless-data-payg-asia" + WIRELESS_DATA_PAYG_CENTRALANDSOUTHAMERICA = ( + "wireless-data-payg-centralandsouthamerica" + ) + WIRELESS_DATA_PAYG_EUROPE = "wireless-data-payg-europe" + WIRELESS_DATA_PAYG_NORTHAMERICA = "wireless-data-payg-northamerica" + WIRELESS_DATA_PAYG_OCEANIA = "wireless-data-payg-oceania" + WIRELESS_DATA_QUOTA1 = "wireless-data-quota1" + WIRELESS_DATA_QUOTA1_AFRICA = "wireless-data-quota1-africa" + WIRELESS_DATA_QUOTA1_ASIA = "wireless-data-quota1-asia" + WIRELESS_DATA_QUOTA1_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota1-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA1_EUROPE = "wireless-data-quota1-europe" + WIRELESS_DATA_QUOTA1_NORTHAMERICA = "wireless-data-quota1-northamerica" + WIRELESS_DATA_QUOTA1_OCEANIA = "wireless-data-quota1-oceania" + WIRELESS_DATA_QUOTA10 = "wireless-data-quota10" + WIRELESS_DATA_QUOTA10_AFRICA = "wireless-data-quota10-africa" + WIRELESS_DATA_QUOTA10_ASIA = "wireless-data-quota10-asia" + WIRELESS_DATA_QUOTA10_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota10-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA10_EUROPE = "wireless-data-quota10-europe" + WIRELESS_DATA_QUOTA10_NORTHAMERICA = "wireless-data-quota10-northamerica" + WIRELESS_DATA_QUOTA10_OCEANIA = "wireless-data-quota10-oceania" + WIRELESS_DATA_QUOTA50 = "wireless-data-quota50" + WIRELESS_DATA_QUOTA50_AFRICA = "wireless-data-quota50-africa" + WIRELESS_DATA_QUOTA50_ASIA = "wireless-data-quota50-asia" + WIRELESS_DATA_QUOTA50_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota50-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA50_EUROPE = "wireless-data-quota50-europe" + WIRELESS_DATA_QUOTA50_NORTHAMERICA = "wireless-data-quota50-northamerica" + WIRELESS_DATA_QUOTA50_OCEANIA = "wireless-data-quota50-oceania" + WIRELESS_DATA_QUOTACUSTOM = "wireless-data-quotacustom" + WIRELESS_DATA_QUOTACUSTOM_AFRICA = "wireless-data-quotacustom-africa" + WIRELESS_DATA_QUOTACUSTOM_ASIA = "wireless-data-quotacustom-asia" + WIRELESS_DATA_QUOTACUSTOM_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quotacustom-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_EUROPE = "wireless-data-quotacustom-europe" + WIRELESS_DATA_QUOTACUSTOM_NORTHAMERICA = ( + "wireless-data-quotacustom-northamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_OCEANIA = "wireless-data-quotacustom-oceania" + WIRELESS_MRC_PAYG = "wireless-mrc-payg" + WIRELESS_MRC_QUOTA1 = "wireless-mrc-quota1" + WIRELESS_MRC_QUOTA10 = "wireless-mrc-quota10" + WIRELESS_MRC_QUOTA50 = "wireless-mrc-quota50" + WIRELESS_MRC_QUOTACUSTOM = "wireless-mrc-quotacustom" WIRELESS_ORDERS = "wireless-orders" WIRELESS_ORDERS_ARTWORK = "wireless-orders-artwork" WIRELESS_ORDERS_BULK = "wireless-orders-bulk" WIRELESS_ORDERS_ESIM = "wireless-orders-esim" WIRELESS_ORDERS_STARTER = "wireless-orders-starter" + WIRELESS_QUOTAS = "wireless-quotas" + WIRELESS_SMS_AFRICA = "wireless-sms-africa" + WIRELESS_SMS_ASIA = "wireless-sms-asia" + WIRELESS_SMS_CENTRALANDSOUTHAMERICA = "wireless-sms-centralandsouthamerica" + WIRELESS_SMS_EUROPE = "wireless-sms-europe" + WIRELESS_SMS_NORTHAMERICA = "wireless-sms-northamerica" + WIRELESS_SMS_OCEANIA = "wireless-sms-oceania" + WIRELESS_SUPER_SIM = "wireless-super-sim" + WIRELESS_SUPER_SIM_DATA = "wireless-super-sim-data" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA_USA = ( + "wireless-super-sim-data-north-america-usa" + ) + WIRELESS_SUPER_SIM_DATA_PAYG = "wireless-super-sim-data-payg" + WIRELESS_SUPER_SIM_DATA_PAYG_EUROPE = "wireless-super-sim-data-payg-europe" + WIRELESS_SUPER_SIM_DATA_PAYG_NORTH_AMERICA = ( + "wireless-super-sim-data-payg-north-america" + ) + WIRELESS_SUPER_SIM_HARDWARE = "wireless-super-sim-hardware" + WIRELESS_SUPER_SIM_HARDWARE_BULK = "wireless-super-sim-hardware-bulk" + WIRELESS_SUPER_SIM_SMSCOMMANDS = "wireless-super-sim-smscommands" + WIRELESS_SUPER_SIM_SMSCOMMANDS_AFRICA = "wireless-super-sim-smscommands-africa" + WIRELESS_SUPER_SIM_SMSCOMMANDS_ASIA = "wireless-super-sim-smscommands-asia" + WIRELESS_SUPER_SIM_SMSCOMMANDS_CENT_AND_SOUTH_AMERICA = ( + "wireless-super-sim-smscommands-cent-and-south-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_EUROPE = "wireless-super-sim-smscommands-europe" + WIRELESS_SUPER_SIM_SMSCOMMANDS_NORTH_AMERICA = ( + "wireless-super-sim-smscommands-north-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_OCEANIA = ( + "wireless-super-sim-smscommands-oceania" + ) + WIRELESS_SUPER_SIM_SUBSCRIPTION = "wireless-super-sim-subscription" + WIRELESS_SUPER_SIM_SUBSCRIPTION_PAYG = "wireless-super-sim-subscription-payg" WIRELESS_USAGE = "wireless-usage" WIRELESS_USAGE_COMMANDS = "wireless-usage-commands" WIRELESS_USAGE_COMMANDS_AFRICA = "wireless-usage-commands-africa" @@ -348,6 +656,184 @@ class Category(object): WIRELESS_USAGE_MRC_SUSPENDED = "wireless-usage-mrc-suspended" WIRELESS_USAGE_SMS = "wireless-usage-sms" WIRELESS_USAGE_VOICE = "wireless-usage-voice" + A2P_FAST_TRACK_ONBOARDING = "a2p-fast-track-onboarding" + ADVISORY_SERVICES = "advisory-services" + ADVISORY_SERVICES_BILLED = "advisory-services-billed" + ADVISORY_SERVICES_CALL_TRACKING = "advisory-services-call-tracking" + ADVISORY_SERVICES_DATA_SERVICES = "advisory-services-data-services" + ADVISORY_SERVICES_EXPENSES = "advisory-services-expenses" + ADVISORY_SERVICES_SIP_TRUNKING = "advisory-services-sip-trunking" + ASSETS_REQUESTS = "assets-requests" + AUDIENCE_MINUTES_VIDEO = "audience-minutes-video" + AUTHY_BUCKET_ADJUSTMENT = "authy-bucket-adjustment" + AUTHY_SOFTWARE = "authy-software" + CALLERIDLOOKUPS_API = "calleridlookups-api" + CALLERIDLOOKUPS_PROGRAMMABLEVOICE = "calleridlookups-programmablevoice" + CALLERIDLOOKUPS_TRUNKING = "calleridlookups-trunking" + CALLS_TRUNKING_INBOUND_TOLLFREE_LOCAL = "calls-trunking-inbound-tollfree-local" + CALLS_TRUNKING_INBOUND_TOLLFREE_MOBILE = ( + "calls-trunking-inbound-tollfree-mobile" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE_1 = "channels-whatsapp-conversation-free-1" + CONFERENCE = "conference" + CONVERSATIONAL_INSIGHTS = "conversational-insights" + CONVERSATIONAL_INSIGHTS_MESSAGES = "conversational-insights-messages" + CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = "conversational-insights-voice-minutes" + DEMO = "demo" + DEMO_UC_SCRIPT_TEST = "demo-uc-script-test" + ELASTIC_SIP_TRUNKING = "elastic-sip-trunking" + ELASTIC_SIP_TRUNKING_CALL_TRANSFERS = "elastic-sip-trunking-call-transfers" + ENTERPRISE_HIPPA = "enterprise-hippa" + FLEX_NAMED_USERS = "flex-named-users" + FLEX_SPINSCI = "flex-spinsci" + FLEX_USERS_1 = "flex-users-1" + FLEX_WFO_PREMIUM_SPEECH_ANALYTICS = "flex-wfo-premium-speech-analytics" + FLEX_XCELERATE = "flex-xcelerate" + FUNCTIONS_ROLLUP = "functions-rollup" + IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING_ADDONS = "ip-messaging-addons" + IVR = "ivr" + IVR_CONVERSATIONAL = "ivr-conversational" + IVR_DTMF = "ivr-dtmf" + IVR_VIRTUALAGENT = "ivr-virtualagent" + LIVE = "live" + LIVE_MEDIA_RECORDING_MINUTES = "live-media-recording-minutes" + LONGCODE_MPS = "longcode-mps" + MARKETPLACE_ANALYTICS_ADDONS = "marketplace-analytics-addons" + MARKETPLACE_ISV_ADDONS = "marketplace-isv-addons" + MARKETPLACE_MESSAGING_ADDONS = "marketplace-messaging-addons" + MARKETPLACE_PHONENUMBERS_ADDONS = "marketplace-phonenumbers-addons" + MARKETPLACE_RECORDING_ADDONS = "marketplace-recording-addons" + MARKETPLACE_VIRTUALAGENT_ADDONS = "marketplace-virtualagent-addons" + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR_1 = ( + "marketplay-pay-addons-shuttle-pay-connector-1" + ) + MARKETPLAY_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplay-pay-addons-stripe-pay-connector" + ) + MMS_INBOUND_LONGCODE_CANADA = "mms-inbound-longcode-canada" + MMS_INBOUND_LONGCODE_UNITEDSTATES = "mms-inbound-longcode-unitedstates" + MMS_OUTBOUND_LONGCODE_CANADA = "mms-outbound-longcode-canada" + MMS_OUTBOUND_LONGCODE_UNITEDSTATES = "mms-outbound-longcode-unitedstates" + MMS_OUTBOUND_TOLL_FREE = "mms-outbound-toll-free" + NOTIFY_CHATAPPSANDOTHERCHANNELS = "notify-chatappsandotherchannels" + NOTIFY_NOTIFYSERVICES = "notify-notifyservices" + NOTIFY_PUSHNOTIFICATIONS = "notify-pushnotifications" + PAYMENT_GATEWAY_CONNECTORS = "payment-gateway-connectors" + PAYMENT_SOLUTIONS = "payment-solutions" + PCHAT_BUCKET_ADJUSTMENT = "pchat-bucket-adjustment" + PHONENUMBERS_NUMBERS = "phonenumbers-numbers" + PROG_VOICE_CLIENT_ANDROID = "prog-voice-client-android" + PROG_VOICE_CLIENT_ANDROID_INBOUND = "prog-voice-client-android-inbound" + PROG_VOICE_CLIENT_ANDROID_OUTBOUND = "prog-voice-client-android-outbound" + PROG_VOICE_CLIENT_IOS = "prog-voice-client-ios" + PROG_VOICE_CLIENT_IOS_INBOUND = "prog-voice-client-ios-inbound" + PROG_VOICE_CLIENT_IOS_OUTBOUND = "prog-voice-client-ios-outbound" + PROG_VOICE_CLIENT_SDK = "prog-voice-client-sdk" + PROG_VOICE_CLIENT_WEB = "prog-voice-client-web" + PROG_VOICE_CLIENT_WEB_INBOUND = "prog-voice-client-web-inbound" + PROG_VOICE_CLIENT_WEB_OUTBOUND = "prog-voice-client-web-outbound" + PROGRAMMABLEVOICECONNECTIVITY_MEDIA_STREAMS = ( + "programmablevoiceconnectivity-media-streams" + ) + PSTNCONNECTIVITY_BYOC = "pstnconnectivity-byoc" + PSTNCONNECTIVITY_EMERGENCY = "pstnconnectivity-emergency" + PSTNCONNECTIVITY_MINUTES = "pstnconnectivity-minutes" + PSTNCONNECTIVITY_MINUTES_1 = "pstnconnectivity-minutes-1" + PSTNCONNECTIVITY_MINUTESINBOUNDLOCAL = "pstnconnectivity-minutesinboundlocal" + PSTNCONNECTIVITY_MINUTESINBOUNDMOBILE = "pstnconnectivity-minutesinboundmobile" + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREE = ( + "pstnconnectivity-minutesinboundtollfree" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREELOCAL = ( + "pstnconnectivity-minutesinboundtollfreelocal" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREEMOBILE = ( + "pstnconnectivity-minutesinboundtollfreemobile" + ) + PV_ROOM_HOURS = "pv-room-hours" + PV_ROOM_SIMULTANEOUS_PARTICIPANT_CONNECTIONS = ( + "pv-room-simultaneous-participant-connections" + ) + PVIDEO_ROOM_HOURS_AU1 = "pvideo-room-hours-au1" + PVIDEO_ROOM_HOURS_BR1 = "pvideo-room-hours-br1" + PVIDEO_ROOM_HOURS_IE1 = "pvideo-room-hours-ie1" + PVIDEO_ROOM_HOURS_JP1 = "pvideo-room-hours-jp1" + PVIDEO_ROOM_HOURS_SG1 = "pvideo-room-hours-sg1" + PVIDEO_ROOM_HOURS_US1 = "pvideo-room-hours-us1" + PVIDEO_ROOM_HOURS_US2 = "pvideo-room-hours-us2" + RECORDINGS_ENCRYPTED = "recordings-encrypted" + SHORT_CODE_SETUP_FEES = "short-code-setup-fees" + SHORTCODES_MESSAGES_INBOUND = "shortcodes-messages-inbound" + SHORTCODES_MESSAGES_OUTBOUND = "shortcodes-messages-outbound" + SMS_MESSAGES_REGISTRATIONFEES = "sms-messages-registrationfees" + SMS_MMS_PENALTY_FEES = "sms-mms-penalty-fees" + SMS_MMS_PENALTY_FEES_1 = "sms-mms-penalty-fees-1" + SMS_PUMPING_PROTECTION_NON_USCA = "sms-pumping-protection-non-usca" + SMS_PUMPING_PROTECTION_USCA = "sms-pumping-protection-usca" + STUDIO = "studio" + STUDIO_MONTHLY_FEES = "studio-monthly-fees" + SUPERSIM = "supersim" + TASK_ROUTER = "task-router" + TASK_ROUTER_WORKERS = "task-router-workers" + TEST_QUOTA_BUCKETS = "test-quota-buckets" + TEST_UC_SCRIPT_1 = "test-uc-script-1" + TEST_UC_SCRIPT_DEMO_2 = "test-uc-script-demo-2" + TEXT_TO_SPEECH = "text-to-speech" + TME = "tme" + TTS_BASIC = "tts-basic" + TWILIO_EDITIONS = "twilio-editions" + TWILIO_INTERCONNECT_CALIFORNIA = "twilio-interconnect-california" + TWILIO_INTERCONNECT_CALIFORNIA_MONTHLY = ( + "twilio-interconnect-california-monthly" + ) + TWILIO_INTERCONNECT_CALIFORNIA_SETUP = "twilio-interconnect-california-setup" + TWILIO_INTERCONNECT_FRANKFURT = "twilio-interconnect-frankfurt" + TWILIO_INTERCONNECT_FRANKFURT_MO = "twilio-interconnect-frankfurt-mo" + TWILIO_INTERCONNECT_FRANKFURT_SETUP = "twilio-interconnect-frankfurt-setup" + TWILIO_INTERCONNECT_LONDON = "twilio-interconnect-london" + TWILIO_INTERCONNECT_LONDON_MO = "twilio-interconnect-london-mo" + TWILIO_INTERCONNECT_LONDON_SETUP = "twilio-interconnect-london-setup" + TWILIO_INTERCONNECT_SAO_PAULO = "twilio-interconnect-sao-paulo" + TWILIO_INTERCONNECT_SAO_PAULO_MONTHLY = "twilio-interconnect-sao-paulo-monthly" + TWILIO_INTERCONNECT_SAO_PAULO_SETUP = "twilio-interconnect-sao-paulo-setup" + TWILIO_INTERCONNECT_SINGAPORE = "twilio-interconnect-singapore" + TWILIO_INTERCONNECT_SINGAPORE_MO = "twilio-interconnect-singapore-mo" + TWILIO_INTERCONNECT_SINGAPORE_SETUP = "twilio-interconnect-singapore-setup" + TWILIO_INTERCONNECT_SYDNEY = "twilio-interconnect-sydney" + TWILIO_INTERCONNECT_SYDNEY_MO = "twilio-interconnect-sydney-mo" + TWILIO_INTERCONNECT_SYDNEY_SETUP = "twilio-interconnect-sydney-setup" + TWILIO_INTERCONNECT_TOKYO = "twilio-interconnect-tokyo" + TWILIO_INTERCONNECT_TOKYO_MO = "twilio-interconnect-tokyo-mo" + TWILIO_INTERCONNECT_TOKYO_SETUP = "twilio-interconnect-tokyo-setup" + TWILIO_INTERCONNECT_VA = "twilio-interconnect-va" + TWILIO_INTERCONNECT_VA_MO = "twilio-interconnect-va-mo" + TWILIO_INTERCONNECT_VA_SETUP = "twilio-interconnect-va-setup" + TWIML_VERBS = "twiml-verbs" + TWIML_VERBS_SAY = "twiml-verbs-say" + USAGE_PROGRAMMABLE_MESSAGING_ENGAGEMENT_SUITE = ( + "usage-programmable-messaging-engagement-suite" + ) + USAGE_PROGRAMMABLE_MESSAGING_FEES_SERVICES = ( + "usage-programmable-messaging-fees-services" + ) + VERIFY_OUTBOUND_EMAIL = "verify-outbound-email" + VERIFY_PACKAGED_PLANS = "verify-packaged-plans" + VERIFY_SILENT_NETWORK_AUTH = "verify-silent-network-auth" + VERIFY_VOICE_AND_SMS = "verify-voice-and-sms" + VOICE_INSIGHTS_CLIENT_INSIGHTS_MONTHY_COMMIT = ( + "voice-insights-client-insights-monthy-commit" + ) + WIRELESS_DATA_PAYG_ASIA_AFG = "wireless-data-payg-asia-afg" + WIRELESS_MULTI_IMSI_SIM_COMMANDS = "wireless-multi-imsi-sim-commands" + WIRELESS_MULTI_IMSI_SIM_COMMANDS_USA = "wireless-multi-imsi-sim-commands-usa" + WIRELESS_MULTI_IMSI_SIM_DATA = "wireless-multi-imsi-sim-data" + WIRELESS_MULTI_IMSI_SIM_DATA_EU28 = "wireless-multi-imsi-sim-data-eu28" + WIRELESS_MULTI_IMSI_SIM_DATA_USA = "wireless-multi-imsi-sim-data-usa" + WIRELESS_MULTI_IMSI_SIM_MONTHLY_FEES = "wireless-multi-imsi-sim-monthly-fees" + WIRELESS_MULTI_IMSI_SIM_USAGE = "wireless-multi-imsi-sim-usage" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA = "wireless-super-sim-data-north-america" + WIRELESS_SUPER_SIM_USAGE = "wireless-super-sim-usage" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that accrued the usage. diff --git a/twilio/rest/api/v2010/account/usage/trigger.py b/twilio/rest/api/v2010/account/usage/trigger.py index 08ac52f605..7f182a01b3 100644 --- a/twilio/rest/api/v2010/account/usage/trigger.py +++ b/twilio/rest/api/v2010/account/usage/trigger.py @@ -36,33 +36,101 @@ class TriggerField(object): PRICE = "price" class UsageCategory(object): + A2P_10DLC_REGISTRATIONFEES_BRANDREGISTRATION = ( + "a2p-10dlc-registrationfees-brandregistration" + ) + A2P_10DLC_REGISTRATIONFEES_BV = "a2p-10dlc-registrationfees-bv" + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNCHARGES = ( + "a2p-10dlc-registrationfees-campaigncharges" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNREGISTRATION = ( + "a2p-10dlc-registrationfees-campaignregistration" + ) + A2P_10DLC_REGISTRATIONFEES_CAMPAIGNVETTING = ( + "a2p-10dlc-registrationfees-campaignvetting" + ) + A2P_10DLC_REGISTRATIONFEES_MONTHLY = "a2p-10dlc-registrationfees-monthly" + A2P_10DLC_REGISTRATIONFEES_ONETIME = "a2p-10dlc-registrationfees-onetime" A2P_REGISTRATION_FEES = "a2p-registration-fees" + ACCOUNT_SECURITY = "account-security" AGENT_CONFERENCE = "agent-conference" + AGENT_COPILOT = "agent-copilot" + AGENT_COPILOT_MESSAGES = "agent-copilot-messages" + AGENT_COPILOT_PARTICIPANT_MINUTES = "agent-copilot-participant-minutes" + AI_ASSISTANTS = "ai-assistants" + AI_ASSISTANTS_VOICE = "ai-assistants-voice" AMAZON_POLLY = "amazon-polly" ANSWERING_MACHINE_DETECTION = "answering-machine-detection" + ASSETS = "assets" + AUDIENCE_MINUTES = "audience-minutes" + AUDIENCE_MINUTES_AUDIO = "audience-minutes-audio" AUTHY_AUTHENTICATIONS = "authy-authentications" AUTHY_CALLS_OUTBOUND = "authy-calls-outbound" + AUTHY_EMAIL_AUTHENTICATIONS = "authy-email-authentications" AUTHY_MONTHLY_FEES = "authy-monthly-fees" + AUTHY_OUTBOUND_EMAIL = "authy-outbound-email" AUTHY_PHONE_INTELLIGENCE = "authy-phone-intelligence" AUTHY_PHONE_VERIFICATIONS = "authy-phone-verifications" AUTHY_SMS_OUTBOUND = "authy-sms-outbound" + AUTHY_VERIFY_EMAIL_VERIFICATIONS = "authy-verify-email-verifications" + AUTHY_VERIFY_OUTBOUND_EMAIL = "authy-verify-outbound-email" + AUTOPILOT = "autopilot" + AUTOPILOT_HOME_ASSISTANTS = "autopilot-home-assistants" + AUTOPILOT_MESSAGING = "autopilot-messaging" + AUTOPILOT_OTHER = "autopilot-other" + AUTOPILOT_VOICE = "autopilot-voice" + BASIC_PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( + "basic-peer-to-peer-rooms-participant-minutes" + ) + BRANDED_CALLING = "branded-calling" + BUNDLE_SMS_BUCKET = "bundle-sms-bucket" + BUNDLE_SUBSCRIPTION_FEES = "bundle-subscription-fees" + CALL_FORWARDING_LOOKUPS = "call-forwarding-lookups" CALL_PROGESS_EVENTS = "call-progess-events" CALLERIDLOOKUPS = "calleridlookups" CALLS = "calls" CALLS_CLIENT = "calls-client" + CALLS_EMERGENCY = "calls-emergency" CALLS_GLOBALCONFERENCE = "calls-globalconference" CALLS_INBOUND = "calls-inbound" CALLS_INBOUND_LOCAL = "calls-inbound-local" CALLS_INBOUND_MOBILE = "calls-inbound-mobile" CALLS_INBOUND_TOLLFREE = "calls-inbound-tollfree" + CALLS_INBOUND_TOLLFREE_LOCAL = "calls-inbound-tollfree-local" + CALLS_INBOUND_TOLLFREE_MOBILE = "calls-inbound-tollfree-mobile" + CALLS_MEDIA_STREAM_MINUTES = "calls-media-stream-minutes" CALLS_OUTBOUND = "calls-outbound" CALLS_PAY_VERB_TRANSACTIONS = "calls-pay-verb-transactions" CALLS_RECORDINGS = "calls-recordings" CALLS_SIP = "calls-sip" CALLS_SIP_INBOUND = "calls-sip-inbound" CALLS_SIP_OUTBOUND = "calls-sip-outbound" + CALLS_TEXT_TO_SPEECH = "calls-text-to-speech" CALLS_TRANSFERS = "calls-transfers" CARRIER_LOOKUPS = "carrier-lookups" + CATEGORY = "category" + CHANNELS = "channels" + CHANNELS_MESSAGING = "channels-messaging" + CHANNELS_MESSAGING_INBOUND = "channels-messaging-inbound" + CHANNELS_MESSAGING_OUTBOUND = "channels-messaging-outbound" + CHANNELS_WHATSAPP = "channels-whatsapp" + CHANNELS_WHATSAPP_CONVERSATION_AUTHENTICATION = ( + "channels-whatsapp-conversation-authentication" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE = "channels-whatsapp-conversation-free" + CHANNELS_WHATSAPP_CONVERSATION_MARKETING = ( + "channels-whatsapp-conversation-marketing" + ) + CHANNELS_WHATSAPP_CONVERSATION_SERVICE = ( + "channels-whatsapp-conversation-service" + ) + CHANNELS_WHATSAPP_CONVERSATION_UTILITY = ( + "channels-whatsapp-conversation-utility" + ) + CHANNELS_WHATSAPP_INBOUND = "channels-whatsapp-inbound" + CHANNELS_WHATSAPP_OUTBOUND = "channels-whatsapp-outbound" + CHAT_VIRTUAL_AGENT = "chat-virtual-agent" + CONVERSATION_RELAY = "conversation-relay" CONVERSATIONS = "conversations" CONVERSATIONS_API_REQUESTS = "conversations-api-requests" CONVERSATIONS_CONVERSATION_EVENTS = "conversations-conversation-events" @@ -71,8 +139,40 @@ class UsageCategory(object): CONVERSATIONS_PARTICIPANT_EVENTS = "conversations-participant-events" CONVERSATIONS_PARTICIPANTS = "conversations-participants" CPS = "cps" + CREDIT_TRANSFER = "credit-transfer" + EMAIL = "email" + EMERGING_TECH = "emerging-tech" + ENGAGEMENT_SUITE_PACKAGED_PLANS = "engagement-suite-packaged-plans" + ENHANCED_LINE_TYPE_LOOKUPS = "enhanced-line-type-lookups" + ENTERPRISE = "enterprise" + EVENTS = "events" + EXPERIMENT_FRANCE_SMS = "experiment-france-sms" + EXPERIMENT_INDIA_SMS = "experiment-india-sms" + EXPERIMENT_UK_SMS = "experiment-uk-sms" + FAILED_MESSAGE_PROCESSING_FEE = "failed-message-processing-fee" + FLEX = "flex" + FLEX_ACTIVE_USER_HOURS = "flex-active-user-hours" + FLEX_CONCURRENT_USERS = "flex-concurrent-users" + FLEX_CONVERSATIONAL_INSIGHTS = "flex-conversational-insights" + FLEX_CONVERSATIONAL_INSIGHTS_MESSAGES = "flex-conversational-insights-messages" + FLEX_CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = ( + "flex-conversational-insights-voice-minutes" + ) + FLEX_EMAIL_USAGE = "flex-email-usage" + FLEX_MESSAGING_USAGE = "flex-messaging-usage" + FLEX_PARTNER_SPINSCI = "flex-partner-spinsci" + FLEX_PARTNER_XCELERATE = "flex-partner-xcelerate" + FLEX_RESELLER_ECOSYSTEM = "flex-reseller-ecosystem" + FLEX_UNIQUE_USER = "flex-unique-user" FLEX_USAGE = "flex-usage" + FLEX_USERS = "flex-users" + FLEX_VOICE_MINUTE = "flex-voice-minute" + FLEX_YTICA = "flex-ytica" FRAUD_LOOKUPS = "fraud-lookups" + FRONTLINE = "frontline" + FRONTLINE_USERS = "frontline-users" + FUNCTIONS = "functions" + GENERIC_PAY_TRANSACTIONS = "generic-pay-transactions" GROUP_ROOMS = "group-rooms" GROUP_ROOMS_DATA_TRACK = "group-rooms-data-track" GROUP_ROOMS_ENCRYPTED_MEDIA_RECORDED = "group-rooms-encrypted-media-recorded" @@ -82,9 +182,17 @@ class UsageCategory(object): GROUP_ROOMS_MEDIA_STORED = "group-rooms-media-stored" GROUP_ROOMS_PARTICIPANT_MINUTES = "group-rooms-participant-minutes" GROUP_ROOMS_RECORDED_MINUTES = "group-rooms-recorded-minutes" - IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING = "ip-messaging" + IP_MESSAGING_COMMANDS = "ip-messaging-commands" + IP_MESSAGING_DATA_STORAGE = "ip-messaging-data-storage" + IP_MESSAGING_DATA_TRANSFER = "ip-messaging-data-transfer" + IP_MESSAGING_ENDPOINT_CONNECTIVITY = "ip-messaging-endpoint-connectivity" IVR_VIRTUAL_AGENT_CUSTOM_VOICES = "ivr-virtual-agent-custom-voices" IVR_VIRTUAL_AGENT_GENAI = "ivr-virtual-agent-genai" + LINE_STATUS_LOOKUPS = "line-status-lookups" + LIVE_ACTIVITY_LOOKUPS = "live-activity-lookups" + LOOKUP_BUCKET_ADJUSTMENT = "lookup-bucket-adjustment" + LOOKUP_IDENTITY_MATCH = "lookup-identity-match" LOOKUPS = "lookups" MARKETPLACE = "marketplace" MARKETPLACE_ALGORITHMIA_NAMED_ENTITY_RECOGNITION = ( @@ -95,6 +203,13 @@ class UsageCategory(object): MARKETPLACE_CAPIO_SPEECH_TO_TEXT = "marketplace-capio-speech-to-text" MARKETPLACE_CONVRIZA_ABABA = "marketplace-convriza-ababa" MARKETPLACE_DEEPGRAM_PHRASE_DETECTOR = "marketplace-deepgram-phrase-detector" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION = "marketplace-deepgram-transcription" + MARKETPLACE_DEEPGRAM_TRANSCRIPTION_BASE = ( + "marketplace-deepgram-transcription-base" + ) + MARKETPLACE_DEEPGRAM_TRANSSCRIPTION_ENHANCED = ( + "marketplace-deepgram-transscription-enhanced" + ) MARKETPLACE_DIGITAL_SEGMENT_BUSINESS_INFO = ( "marketplace-digital-segment-business-info" ) @@ -120,6 +235,9 @@ class UsageCategory(object): "marketplace-keen-io-contact-center-analytics" ) MARKETPLACE_MARCHEX_CLEANCALL = "marketplace-marchex-cleancall" + MARKETPLACE_MARCHEX_RECORDING_ANALYSIS = ( + "marketplace-marchex-recording-analysis" + ) MARKETPLACE_MARCHEX_SENTIMENT_ANALYSIS_FOR_SMS = ( "marketplace-marchex-sentiment-analysis-for-sms" ) @@ -136,14 +254,42 @@ class UsageCategory(object): "marketplace-nextcaller-advanced-caller-identification" ) MARKETPLACE_NOMOROBO_SPAM_SCORE = "marketplace-nomorobo-spam-score" + MARKETPLACE_PAY_ADDONS = "marketplace-pay-addons" + MARKETPLACE_PAY_ADDONS_BASECOMMERCE_PAY_CONNECTOR = ( + "marketplace-pay-addons-basecommerce-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_BRAINTREE_PAY_CONNECTOR = ( + "marketplace-pay-addons-braintree-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CARDCONNECT_PAY_CONNECTOR = ( + "marketplace-pay-addons-cardconnect-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_CHASE_PAY_CONNECTOR = ( + "marketplace-pay-addons-chase-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplace-pay-addons-shuttle-pay-connector" + ) + MARKETPLACE_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplace-pay-addons-stripe-pay-connector" + ) MARKETPLACE_PAYFONE_TCPA_COMPLIANCE = "marketplace-payfone-tcpa-compliance" + MARKETPLACE_POLY_AI_CONNECTOR = "marketplace-poly-ai-connector" + MARKETPLACE_REALPHONEVALIDATION = "marketplace-realphonevalidation" MARKETPLACE_REMEETING_AUTOMATIC_SPEECH_RECOGNITION = ( "marketplace-remeeting-automatic-speech-recognition" ) + MARKETPLACE_SPOKE_PHONE_LICENSE_PRO = "marketplace-spoke-phone-license-pro" + MARKETPLACE_SPOKE_PHONE_LICENSE_STANDARD = ( + "marketplace-spoke-phone-license-standard" + ) MARKETPLACE_TCPA_DEFENSE_SOLUTIONS_BLACKLIST_FEED = ( "marketplace-tcpa-defense-solutions-blacklist-feed" ) MARKETPLACE_TELO_OPENCNAM = "marketplace-telo-opencnam" + MARKETPLACE_TRESTLE_SOLUTIONS_CALLER_IDENTIFICATION = ( + "marketplace-trestle-solutions-caller-identification" + ) MARKETPLACE_TRUECNAM_TRUE_SPAM = "marketplace-truecnam-true-spam" MARKETPLACE_TWILIO_CALLER_NAME_LOOKUP_US = ( "marketplace-twilio-caller-name-lookup-us" @@ -156,6 +302,9 @@ class UsageCategory(object): MARKETPLACE_VOICEBASE_TRANSCRIPTION_CUSTOM_VOCABULARY = ( "marketplace-voicebase-transcription-custom-vocabulary" ) + MARKETPLACE_WEB_PURIFY_PROFANITY_FILTER = ( + "marketplace-web-purify-profanity-filter" + ) MARKETPLACE_WHITEPAGES_PRO_CALLER_IDENTIFICATION = ( "marketplace-whitepages-pro-caller-identification" ) @@ -170,15 +319,23 @@ class UsageCategory(object): MARKETPLACE_YTICA_CONTACT_CENTER_REPORTING_ANALYTICS = ( "marketplace-ytica-contact-center-reporting-analytics" ) + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR = ( + "marketplay-pay-addons-shuttle-pay-connector" + ) + MEDIA_COMPOSER_MINUTES = "media-composer-minutes" MEDIASTORAGE = "mediastorage" + MIN_SPEND_ADJUSTMENTS = "min-spend-adjustments" MMS = "mms" MMS_INBOUND = "mms-inbound" MMS_INBOUND_LONGCODE = "mms-inbound-longcode" MMS_INBOUND_SHORTCODE = "mms-inbound-shortcode" + MMS_INBOUND_TOLL_FREE = "mms-inbound-toll-free" MMS_MESSAGES_CARRIERFEES = "mms-messages-carrierfees" MMS_OUTBOUND = "mms-outbound" MMS_OUTBOUND_LONGCODE = "mms-outbound-longcode" MMS_OUTBOUND_SHORTCODE = "mms-outbound-shortcode" + MMS_OUTBOUND_TOLLFREE = "mms-outbound-tollfree" + MONITOR = "monitor" MONITOR_READS = "monitor-reads" MONITOR_STORAGE = "monitor-storage" MONITOR_WRITES = "monitor-writes" @@ -187,6 +344,12 @@ class UsageCategory(object): NOTIFY_CHANNELS = "notify-channels" NUMBER_FORMAT_LOOKUPS = "number-format-lookups" PCHAT = "pchat" + PCHAT_ACTIONS = "pchat-actions" + PCHAT_APS = "pchat-aps" + PCHAT_CONV_MED_STORAGE = "pchat-conv-med-storage" + PCHAT_MESSAGES = "pchat-messages" + PCHAT_NOTIFICATIONS = "pchat-notifications" + PCHAT_READS = "pchat-reads" PCHAT_USERS = "pchat-users" PEER_TO_PEER_ROOMS_PARTICIPANT_MINUTES = ( "peer-to-peer-rooms-participant-minutes" @@ -196,18 +359,41 @@ class UsageCategory(object): PFAX_MINUTES_INBOUND = "pfax-minutes-inbound" PFAX_MINUTES_OUTBOUND = "pfax-minutes-outbound" PFAX_PAGES = "pfax-pages" + PHONE_QUALITY_SCORE_LOOKUPS = "phone-quality-score-lookups" PHONENUMBERS = "phonenumbers" PHONENUMBERS_CPS = "phonenumbers-cps" PHONENUMBERS_EMERGENCY = "phonenumbers-emergency" PHONENUMBERS_LOCAL = "phonenumbers-local" PHONENUMBERS_MOBILE = "phonenumbers-mobile" + PHONENUMBERS_PORTING = "phonenumbers-porting" PHONENUMBERS_SETUPS = "phonenumbers-setups" PHONENUMBERS_TOLLFREE = "phonenumbers-tollfree" PREMIUMSUPPORT = "premiumsupport" + PREMIUMSUPPORT_PERCENTAGE_SPEND = "premiumsupport-percentage-spend" + PROGRAMMABLEVOICE_PLATFORM = "programmablevoice-platform" + PROGRAMMABLEVOICECONN_CLIENTSDK = "programmablevoiceconn-clientsdk" + PROGRAMMABLEVOICECONN_CLIENTSDK_INBOUND = ( + "programmablevoiceconn-clientsdk-inbound" + ) + PROGRAMMABLEVOICECONN_CLIENTSDK_OUTBOUND = ( + "programmablevoiceconn-clientsdk-outbound" + ) + PROGRAMMABLEVOICECONN_ONNET = "programmablevoiceconn-onnet" + PROGRAMMABLEVOICECONN_ONNET_INBOUND = "programmablevoiceconn-onnet-inbound" + PROGRAMMABLEVOICECONN_ONNET_OUTBOUND = "programmablevoiceconn-onnet-outbound" + PROGRAMMABLEVOICECONN_SIP = "programmablevoiceconn-sip" + PROGRAMMABLEVOICECONN_SIP_INBOUND = "programmablevoiceconn-sip-inbound" + PROGRAMMABLEVOICECONN_SIP_OUTBOUND = "programmablevoiceconn-sip-outbound" + PROGRAMMABLEVOICECONNECTIVITY = "programmablevoiceconnectivity" PROXY = "proxy" PROXY_ACTIVE_SESSIONS = "proxy-active-sessions" + PROXY_BUCKET_ADJUSTMENT = "proxy-bucket-adjustment" + PROXY_LICENSES = "proxy-licenses" PSTNCONNECTIVITY = "pstnconnectivity" + PSTNCONNECTIVITY_INBOUND = "pstnconnectivity-inbound" + PSTNCONNECTIVITY_OUTBOUND = "pstnconnectivity-outbound" PV = "pv" + PV_BASIC_ROOMS = "pv-basic-rooms" PV_COMPOSITION_MEDIA_DOWNLOADED = "pv-composition-media-downloaded" PV_COMPOSITION_MEDIA_ENCRYPTED = "pv-composition-media-encrypted" PV_COMPOSITION_MEDIA_STORED = "pv-composition-media-stored" @@ -223,18 +409,20 @@ class UsageCategory(object): PV_ROOM_PARTICIPANTS_US2 = "pv-room-participants-us2" PV_ROOMS = "pv-rooms" PV_SIP_ENDPOINT_REGISTRATIONS = "pv-sip-endpoint-registrations" + RCS_MESSAGES = "rcs-messages" + REASSIGNED_NUMBER = "reassigned-number" RECORDINGS = "recordings" RECORDINGSTORAGE = "recordingstorage" - ROOMS_GROUP_BANDWIDTH = "rooms-group-bandwidth" - ROOMS_GROUP_MINUTES = "rooms-group-minutes" - ROOMS_PEER_TO_PEER_MINUTES = "rooms-peer-to-peer-minutes" SHORTCODES = "shortcodes" SHORTCODES_CUSTOMEROWNED = "shortcodes-customerowned" SHORTCODES_MMS_ENABLEMENT = "shortcodes-mms-enablement" SHORTCODES_MPS = "shortcodes-mps" SHORTCODES_RANDOM = "shortcodes-random" + SHORTCODES_SETUP_FEES = "shortcodes-setup-fees" SHORTCODES_UK = "shortcodes-uk" SHORTCODES_VANITY = "shortcodes-vanity" + SIM_SWAP_LOOKUPS = "sim-swap-lookups" + SIP_SECURE_MEDIA = "sip-secure-media" SMALL_GROUP_ROOMS = "small-group-rooms" SMALL_GROUP_ROOMS_DATA_TRACK = "small-group-rooms-data-track" SMALL_GROUP_ROOMS_PARTICIPANT_MINUTES = "small-group-rooms-participant-minutes" @@ -242,13 +430,30 @@ class UsageCategory(object): SMS_INBOUND = "sms-inbound" SMS_INBOUND_LONGCODE = "sms-inbound-longcode" SMS_INBOUND_SHORTCODE = "sms-inbound-shortcode" + SMS_INBOUND_TOLLFREE = "sms-inbound-tollfree" SMS_MESSAGES_CARRIERFEES = "sms-messages-carrierfees" SMS_MESSAGES_FEATURES = "sms-messages-features" + SMS_MESSAGES_FEATURES_ENGAGEMENT_SUITE = ( + "sms-messages-features-engagement-suite" + ) + SMS_MESSAGES_FEATURES_MESSAGE_REDACTION = ( + "sms-messages-features-message-redaction" + ) SMS_MESSAGES_FEATURES_SENDERID = "sms-messages-features-senderid" + SMS_MPS = "sms-mps" + SMS_MPS_SHORTCODE = "sms-mps-shortcode" + SMS_MPS_TOLLFREE = "sms-mps-tollfree" + SMS_MPS_TOLLFREE_SETUP = "sms-mps-tollfree-setup" + SMS_NATIONAL_REGULATORY_PROTECTION = "sms-national-regulatory-protection" SMS_OUTBOUND = "sms-outbound" SMS_OUTBOUND_CONTENT_INSPECTION = "sms-outbound-content-inspection" SMS_OUTBOUND_LONGCODE = "sms-outbound-longcode" SMS_OUTBOUND_SHORTCODE = "sms-outbound-shortcode" + SMS_OUTBOUND_TOLLFREE = "sms-outbound-tollfree" + SMS_PUMPING_PROTECTION = "sms-pumping-protection" + SMS_PUMPING_RISK = "sms-pumping-risk" + SMSMESSAGES_BUCKET_ADJUSTMENTS = "smsmessages-bucket-adjustments" + SMSMESSAGES_OUTBOUND_DOMESTIC = "smsmessages-outbound-domestic" SPEECH_RECOGNITION = "speech-recognition" STUDIO_ENGAGEMENTS = "studio-engagements" SYNC = "sync" @@ -278,13 +483,27 @@ class UsageCategory(object): TURNMEGABYTES_SINGAPORE = "turnmegabytes-singapore" TURNMEGABYTES_USEAST = "turnmegabytes-useast" TURNMEGABYTES_USWEST = "turnmegabytes-uswest" + TWILIO_FOR_SALESFORCE = "twilio-for-salesforce" + TWILIO_FOR_SALESFORCE_LICENSES = "twilio-for-salesforce-licenses" TWILIO_INTERCONNECT = "twilio-interconnect" + TWIML = "twiml" + USAGE_FLEX_VIDEO = "usage-flex-video" + USAGE_FUNCTIONS = "usage-functions" + USAGE_RCS_BASIC_MESSAGES_OUTBOUND = "usage-rcs-basic-messages-outbound" + USAGE_RCS_MESSAGES = "usage-rcs-messages" + USAGE_RCS_MESSAGES_INBOUND = "usage-rcs-messages-inbound" + USAGE_RCS_MESSAGING_CARRIER_FEES = "usage-rcs-messaging-carrier-fees" + USAGE_RCS_SINGLE_MESSAGES_OUTBOUND = "usage-rcs-single-messages-outbound" + VERIFY_PACKAGE_PLANS = "verify-package-plans" VERIFY_PUSH = "verify-push" + VERIFY_SNA = "verify-sna" VERIFY_TOTP = "verify-totp" + VERIFY_VOICE_SMS = "verify-voice-sms" VERIFY_WHATSAPP_CONVERSATIONS_BUSINESS_INITIATED = ( "verify-whatsapp-conversations-business-initiated" ) VIDEO_RECORDINGS = "video-recordings" + VIDEO_ROOMS_TURN_MEGABYTES = "video-rooms-turn-megabytes" VIRTUAL_AGENT = "virtual-agent" VOICE_INSIGHTS = "voice-insights" VOICE_INSIGHTS_CLIENT_INSIGHTS_ON_DEMAND_MINUTE = ( @@ -300,14 +519,103 @@ class UsageCategory(object): "voice-insights-sip-trunking-insights-on-demand-minute" ) VOICE_INTELLIGENCE = "voice-intelligence" - VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + VOICE_INTELLIGENCE_EIP_OPERATORS = "voice-intelligence-eip-operators" VOICE_INTELLIGENCE_OPERATORS = "voice-intelligence-operators" + VOICE_INTELLIGENCE_TRANSCRIPTION = "voice-intelligence-transcription" + WDS = "wds" WIRELESS = "wireless" + WIRELESS_DATA = "wireless-data" + WIRELESS_DATA_PAYG = "wireless-data-payg" + WIRELESS_DATA_PAYG_AFRICA = "wireless-data-payg-africa" + WIRELESS_DATA_PAYG_ASIA = "wireless-data-payg-asia" + WIRELESS_DATA_PAYG_CENTRALANDSOUTHAMERICA = ( + "wireless-data-payg-centralandsouthamerica" + ) + WIRELESS_DATA_PAYG_EUROPE = "wireless-data-payg-europe" + WIRELESS_DATA_PAYG_NORTHAMERICA = "wireless-data-payg-northamerica" + WIRELESS_DATA_PAYG_OCEANIA = "wireless-data-payg-oceania" + WIRELESS_DATA_QUOTA1 = "wireless-data-quota1" + WIRELESS_DATA_QUOTA1_AFRICA = "wireless-data-quota1-africa" + WIRELESS_DATA_QUOTA1_ASIA = "wireless-data-quota1-asia" + WIRELESS_DATA_QUOTA1_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota1-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA1_EUROPE = "wireless-data-quota1-europe" + WIRELESS_DATA_QUOTA1_NORTHAMERICA = "wireless-data-quota1-northamerica" + WIRELESS_DATA_QUOTA1_OCEANIA = "wireless-data-quota1-oceania" + WIRELESS_DATA_QUOTA10 = "wireless-data-quota10" + WIRELESS_DATA_QUOTA10_AFRICA = "wireless-data-quota10-africa" + WIRELESS_DATA_QUOTA10_ASIA = "wireless-data-quota10-asia" + WIRELESS_DATA_QUOTA10_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota10-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA10_EUROPE = "wireless-data-quota10-europe" + WIRELESS_DATA_QUOTA10_NORTHAMERICA = "wireless-data-quota10-northamerica" + WIRELESS_DATA_QUOTA10_OCEANIA = "wireless-data-quota10-oceania" + WIRELESS_DATA_QUOTA50 = "wireless-data-quota50" + WIRELESS_DATA_QUOTA50_AFRICA = "wireless-data-quota50-africa" + WIRELESS_DATA_QUOTA50_ASIA = "wireless-data-quota50-asia" + WIRELESS_DATA_QUOTA50_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quota50-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTA50_EUROPE = "wireless-data-quota50-europe" + WIRELESS_DATA_QUOTA50_NORTHAMERICA = "wireless-data-quota50-northamerica" + WIRELESS_DATA_QUOTA50_OCEANIA = "wireless-data-quota50-oceania" + WIRELESS_DATA_QUOTACUSTOM = "wireless-data-quotacustom" + WIRELESS_DATA_QUOTACUSTOM_AFRICA = "wireless-data-quotacustom-africa" + WIRELESS_DATA_QUOTACUSTOM_ASIA = "wireless-data-quotacustom-asia" + WIRELESS_DATA_QUOTACUSTOM_CENTRALANDSOUTHAMERICA = ( + "wireless-data-quotacustom-centralandsouthamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_EUROPE = "wireless-data-quotacustom-europe" + WIRELESS_DATA_QUOTACUSTOM_NORTHAMERICA = ( + "wireless-data-quotacustom-northamerica" + ) + WIRELESS_DATA_QUOTACUSTOM_OCEANIA = "wireless-data-quotacustom-oceania" + WIRELESS_MRC_PAYG = "wireless-mrc-payg" + WIRELESS_MRC_QUOTA1 = "wireless-mrc-quota1" + WIRELESS_MRC_QUOTA10 = "wireless-mrc-quota10" + WIRELESS_MRC_QUOTA50 = "wireless-mrc-quota50" + WIRELESS_MRC_QUOTACUSTOM = "wireless-mrc-quotacustom" WIRELESS_ORDERS = "wireless-orders" WIRELESS_ORDERS_ARTWORK = "wireless-orders-artwork" WIRELESS_ORDERS_BULK = "wireless-orders-bulk" WIRELESS_ORDERS_ESIM = "wireless-orders-esim" WIRELESS_ORDERS_STARTER = "wireless-orders-starter" + WIRELESS_QUOTAS = "wireless-quotas" + WIRELESS_SMS_AFRICA = "wireless-sms-africa" + WIRELESS_SMS_ASIA = "wireless-sms-asia" + WIRELESS_SMS_CENTRALANDSOUTHAMERICA = "wireless-sms-centralandsouthamerica" + WIRELESS_SMS_EUROPE = "wireless-sms-europe" + WIRELESS_SMS_NORTHAMERICA = "wireless-sms-northamerica" + WIRELESS_SMS_OCEANIA = "wireless-sms-oceania" + WIRELESS_SUPER_SIM = "wireless-super-sim" + WIRELESS_SUPER_SIM_DATA = "wireless-super-sim-data" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA_USA = ( + "wireless-super-sim-data-north-america-usa" + ) + WIRELESS_SUPER_SIM_DATA_PAYG = "wireless-super-sim-data-payg" + WIRELESS_SUPER_SIM_DATA_PAYG_EUROPE = "wireless-super-sim-data-payg-europe" + WIRELESS_SUPER_SIM_DATA_PAYG_NORTH_AMERICA = ( + "wireless-super-sim-data-payg-north-america" + ) + WIRELESS_SUPER_SIM_HARDWARE = "wireless-super-sim-hardware" + WIRELESS_SUPER_SIM_HARDWARE_BULK = "wireless-super-sim-hardware-bulk" + WIRELESS_SUPER_SIM_SMSCOMMANDS = "wireless-super-sim-smscommands" + WIRELESS_SUPER_SIM_SMSCOMMANDS_AFRICA = "wireless-super-sim-smscommands-africa" + WIRELESS_SUPER_SIM_SMSCOMMANDS_ASIA = "wireless-super-sim-smscommands-asia" + WIRELESS_SUPER_SIM_SMSCOMMANDS_CENT_AND_SOUTH_AMERICA = ( + "wireless-super-sim-smscommands-cent-and-south-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_EUROPE = "wireless-super-sim-smscommands-europe" + WIRELESS_SUPER_SIM_SMSCOMMANDS_NORTH_AMERICA = ( + "wireless-super-sim-smscommands-north-america" + ) + WIRELESS_SUPER_SIM_SMSCOMMANDS_OCEANIA = ( + "wireless-super-sim-smscommands-oceania" + ) + WIRELESS_SUPER_SIM_SUBSCRIPTION = "wireless-super-sim-subscription" + WIRELESS_SUPER_SIM_SUBSCRIPTION_PAYG = "wireless-super-sim-subscription-payg" WIRELESS_USAGE = "wireless-usage" WIRELESS_USAGE_COMMANDS = "wireless-usage-commands" WIRELESS_USAGE_COMMANDS_AFRICA = "wireless-usage-commands-africa" @@ -359,6 +667,184 @@ class UsageCategory(object): WIRELESS_USAGE_MRC_SUSPENDED = "wireless-usage-mrc-suspended" WIRELESS_USAGE_SMS = "wireless-usage-sms" WIRELESS_USAGE_VOICE = "wireless-usage-voice" + A2P_FAST_TRACK_ONBOARDING = "a2p-fast-track-onboarding" + ADVISORY_SERVICES = "advisory-services" + ADVISORY_SERVICES_BILLED = "advisory-services-billed" + ADVISORY_SERVICES_CALL_TRACKING = "advisory-services-call-tracking" + ADVISORY_SERVICES_DATA_SERVICES = "advisory-services-data-services" + ADVISORY_SERVICES_EXPENSES = "advisory-services-expenses" + ADVISORY_SERVICES_SIP_TRUNKING = "advisory-services-sip-trunking" + ASSETS_REQUESTS = "assets-requests" + AUDIENCE_MINUTES_VIDEO = "audience-minutes-video" + AUTHY_BUCKET_ADJUSTMENT = "authy-bucket-adjustment" + AUTHY_SOFTWARE = "authy-software" + CALLERIDLOOKUPS_API = "calleridlookups-api" + CALLERIDLOOKUPS_PROGRAMMABLEVOICE = "calleridlookups-programmablevoice" + CALLERIDLOOKUPS_TRUNKING = "calleridlookups-trunking" + CALLS_TRUNKING_INBOUND_TOLLFREE_LOCAL = "calls-trunking-inbound-tollfree-local" + CALLS_TRUNKING_INBOUND_TOLLFREE_MOBILE = ( + "calls-trunking-inbound-tollfree-mobile" + ) + CHANNELS_WHATSAPP_CONVERSATION_FREE_1 = "channels-whatsapp-conversation-free-1" + CONFERENCE = "conference" + CONVERSATIONAL_INSIGHTS = "conversational-insights" + CONVERSATIONAL_INSIGHTS_MESSAGES = "conversational-insights-messages" + CONVERSATIONAL_INSIGHTS_VOICE_MINUTES = "conversational-insights-voice-minutes" + DEMO = "demo" + DEMO_UC_SCRIPT_TEST = "demo-uc-script-test" + ELASTIC_SIP_TRUNKING = "elastic-sip-trunking" + ELASTIC_SIP_TRUNKING_CALL_TRANSFERS = "elastic-sip-trunking-call-transfers" + ENTERPRISE_HIPPA = "enterprise-hippa" + FLEX_NAMED_USERS = "flex-named-users" + FLEX_SPINSCI = "flex-spinsci" + FLEX_USERS_1 = "flex-users-1" + FLEX_WFO_PREMIUM_SPEECH_ANALYTICS = "flex-wfo-premium-speech-analytics" + FLEX_XCELERATE = "flex-xcelerate" + FUNCTIONS_ROLLUP = "functions-rollup" + IMP_V1_USAGE = "imp-v1-usage" + IP_MESSAGING_ADDONS = "ip-messaging-addons" + IVR = "ivr" + IVR_CONVERSATIONAL = "ivr-conversational" + IVR_DTMF = "ivr-dtmf" + IVR_VIRTUALAGENT = "ivr-virtualagent" + LIVE = "live" + LIVE_MEDIA_RECORDING_MINUTES = "live-media-recording-minutes" + LONGCODE_MPS = "longcode-mps" + MARKETPLACE_ANALYTICS_ADDONS = "marketplace-analytics-addons" + MARKETPLACE_ISV_ADDONS = "marketplace-isv-addons" + MARKETPLACE_MESSAGING_ADDONS = "marketplace-messaging-addons" + MARKETPLACE_PHONENUMBERS_ADDONS = "marketplace-phonenumbers-addons" + MARKETPLACE_RECORDING_ADDONS = "marketplace-recording-addons" + MARKETPLACE_VIRTUALAGENT_ADDONS = "marketplace-virtualagent-addons" + MARKETPLAY_PAY_ADDONS_SHUTTLE_PAY_CONNECTOR_1 = ( + "marketplay-pay-addons-shuttle-pay-connector-1" + ) + MARKETPLAY_PAY_ADDONS_STRIPE_PAY_CONNECTOR = ( + "marketplay-pay-addons-stripe-pay-connector" + ) + MMS_INBOUND_LONGCODE_CANADA = "mms-inbound-longcode-canada" + MMS_INBOUND_LONGCODE_UNITEDSTATES = "mms-inbound-longcode-unitedstates" + MMS_OUTBOUND_LONGCODE_CANADA = "mms-outbound-longcode-canada" + MMS_OUTBOUND_LONGCODE_UNITEDSTATES = "mms-outbound-longcode-unitedstates" + MMS_OUTBOUND_TOLL_FREE = "mms-outbound-toll-free" + NOTIFY_CHATAPPSANDOTHERCHANNELS = "notify-chatappsandotherchannels" + NOTIFY_NOTIFYSERVICES = "notify-notifyservices" + NOTIFY_PUSHNOTIFICATIONS = "notify-pushnotifications" + PAYMENT_GATEWAY_CONNECTORS = "payment-gateway-connectors" + PAYMENT_SOLUTIONS = "payment-solutions" + PCHAT_BUCKET_ADJUSTMENT = "pchat-bucket-adjustment" + PHONENUMBERS_NUMBERS = "phonenumbers-numbers" + PROG_VOICE_CLIENT_ANDROID = "prog-voice-client-android" + PROG_VOICE_CLIENT_ANDROID_INBOUND = "prog-voice-client-android-inbound" + PROG_VOICE_CLIENT_ANDROID_OUTBOUND = "prog-voice-client-android-outbound" + PROG_VOICE_CLIENT_IOS = "prog-voice-client-ios" + PROG_VOICE_CLIENT_IOS_INBOUND = "prog-voice-client-ios-inbound" + PROG_VOICE_CLIENT_IOS_OUTBOUND = "prog-voice-client-ios-outbound" + PROG_VOICE_CLIENT_SDK = "prog-voice-client-sdk" + PROG_VOICE_CLIENT_WEB = "prog-voice-client-web" + PROG_VOICE_CLIENT_WEB_INBOUND = "prog-voice-client-web-inbound" + PROG_VOICE_CLIENT_WEB_OUTBOUND = "prog-voice-client-web-outbound" + PROGRAMMABLEVOICECONNECTIVITY_MEDIA_STREAMS = ( + "programmablevoiceconnectivity-media-streams" + ) + PSTNCONNECTIVITY_BYOC = "pstnconnectivity-byoc" + PSTNCONNECTIVITY_EMERGENCY = "pstnconnectivity-emergency" + PSTNCONNECTIVITY_MINUTES = "pstnconnectivity-minutes" + PSTNCONNECTIVITY_MINUTES_1 = "pstnconnectivity-minutes-1" + PSTNCONNECTIVITY_MINUTESINBOUNDLOCAL = "pstnconnectivity-minutesinboundlocal" + PSTNCONNECTIVITY_MINUTESINBOUNDMOBILE = "pstnconnectivity-minutesinboundmobile" + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREE = ( + "pstnconnectivity-minutesinboundtollfree" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREELOCAL = ( + "pstnconnectivity-minutesinboundtollfreelocal" + ) + PSTNCONNECTIVITY_MINUTESINBOUNDTOLLFREEMOBILE = ( + "pstnconnectivity-minutesinboundtollfreemobile" + ) + PV_ROOM_HOURS = "pv-room-hours" + PV_ROOM_SIMULTANEOUS_PARTICIPANT_CONNECTIONS = ( + "pv-room-simultaneous-participant-connections" + ) + PVIDEO_ROOM_HOURS_AU1 = "pvideo-room-hours-au1" + PVIDEO_ROOM_HOURS_BR1 = "pvideo-room-hours-br1" + PVIDEO_ROOM_HOURS_IE1 = "pvideo-room-hours-ie1" + PVIDEO_ROOM_HOURS_JP1 = "pvideo-room-hours-jp1" + PVIDEO_ROOM_HOURS_SG1 = "pvideo-room-hours-sg1" + PVIDEO_ROOM_HOURS_US1 = "pvideo-room-hours-us1" + PVIDEO_ROOM_HOURS_US2 = "pvideo-room-hours-us2" + RECORDINGS_ENCRYPTED = "recordings-encrypted" + SHORT_CODE_SETUP_FEES = "short-code-setup-fees" + SHORTCODES_MESSAGES_INBOUND = "shortcodes-messages-inbound" + SHORTCODES_MESSAGES_OUTBOUND = "shortcodes-messages-outbound" + SMS_MESSAGES_REGISTRATIONFEES = "sms-messages-registrationfees" + SMS_MMS_PENALTY_FEES = "sms-mms-penalty-fees" + SMS_MMS_PENALTY_FEES_1 = "sms-mms-penalty-fees-1" + SMS_PUMPING_PROTECTION_NON_USCA = "sms-pumping-protection-non-usca" + SMS_PUMPING_PROTECTION_USCA = "sms-pumping-protection-usca" + STUDIO = "studio" + STUDIO_MONTHLY_FEES = "studio-monthly-fees" + SUPERSIM = "supersim" + TASK_ROUTER = "task-router" + TASK_ROUTER_WORKERS = "task-router-workers" + TEST_QUOTA_BUCKETS = "test-quota-buckets" + TEST_UC_SCRIPT_1 = "test-uc-script-1" + TEST_UC_SCRIPT_DEMO_2 = "test-uc-script-demo-2" + TEXT_TO_SPEECH = "text-to-speech" + TME = "tme" + TTS_BASIC = "tts-basic" + TWILIO_EDITIONS = "twilio-editions" + TWILIO_INTERCONNECT_CALIFORNIA = "twilio-interconnect-california" + TWILIO_INTERCONNECT_CALIFORNIA_MONTHLY = ( + "twilio-interconnect-california-monthly" + ) + TWILIO_INTERCONNECT_CALIFORNIA_SETUP = "twilio-interconnect-california-setup" + TWILIO_INTERCONNECT_FRANKFURT = "twilio-interconnect-frankfurt" + TWILIO_INTERCONNECT_FRANKFURT_MO = "twilio-interconnect-frankfurt-mo" + TWILIO_INTERCONNECT_FRANKFURT_SETUP = "twilio-interconnect-frankfurt-setup" + TWILIO_INTERCONNECT_LONDON = "twilio-interconnect-london" + TWILIO_INTERCONNECT_LONDON_MO = "twilio-interconnect-london-mo" + TWILIO_INTERCONNECT_LONDON_SETUP = "twilio-interconnect-london-setup" + TWILIO_INTERCONNECT_SAO_PAULO = "twilio-interconnect-sao-paulo" + TWILIO_INTERCONNECT_SAO_PAULO_MONTHLY = "twilio-interconnect-sao-paulo-monthly" + TWILIO_INTERCONNECT_SAO_PAULO_SETUP = "twilio-interconnect-sao-paulo-setup" + TWILIO_INTERCONNECT_SINGAPORE = "twilio-interconnect-singapore" + TWILIO_INTERCONNECT_SINGAPORE_MO = "twilio-interconnect-singapore-mo" + TWILIO_INTERCONNECT_SINGAPORE_SETUP = "twilio-interconnect-singapore-setup" + TWILIO_INTERCONNECT_SYDNEY = "twilio-interconnect-sydney" + TWILIO_INTERCONNECT_SYDNEY_MO = "twilio-interconnect-sydney-mo" + TWILIO_INTERCONNECT_SYDNEY_SETUP = "twilio-interconnect-sydney-setup" + TWILIO_INTERCONNECT_TOKYO = "twilio-interconnect-tokyo" + TWILIO_INTERCONNECT_TOKYO_MO = "twilio-interconnect-tokyo-mo" + TWILIO_INTERCONNECT_TOKYO_SETUP = "twilio-interconnect-tokyo-setup" + TWILIO_INTERCONNECT_VA = "twilio-interconnect-va" + TWILIO_INTERCONNECT_VA_MO = "twilio-interconnect-va-mo" + TWILIO_INTERCONNECT_VA_SETUP = "twilio-interconnect-va-setup" + TWIML_VERBS = "twiml-verbs" + TWIML_VERBS_SAY = "twiml-verbs-say" + USAGE_PROGRAMMABLE_MESSAGING_ENGAGEMENT_SUITE = ( + "usage-programmable-messaging-engagement-suite" + ) + USAGE_PROGRAMMABLE_MESSAGING_FEES_SERVICES = ( + "usage-programmable-messaging-fees-services" + ) + VERIFY_OUTBOUND_EMAIL = "verify-outbound-email" + VERIFY_PACKAGED_PLANS = "verify-packaged-plans" + VERIFY_SILENT_NETWORK_AUTH = "verify-silent-network-auth" + VERIFY_VOICE_AND_SMS = "verify-voice-and-sms" + VOICE_INSIGHTS_CLIENT_INSIGHTS_MONTHY_COMMIT = ( + "voice-insights-client-insights-monthy-commit" + ) + WIRELESS_DATA_PAYG_ASIA_AFG = "wireless-data-payg-asia-afg" + WIRELESS_MULTI_IMSI_SIM_COMMANDS = "wireless-multi-imsi-sim-commands" + WIRELESS_MULTI_IMSI_SIM_COMMANDS_USA = "wireless-multi-imsi-sim-commands-usa" + WIRELESS_MULTI_IMSI_SIM_DATA = "wireless-multi-imsi-sim-data" + WIRELESS_MULTI_IMSI_SIM_DATA_EU28 = "wireless-multi-imsi-sim-data-eu28" + WIRELESS_MULTI_IMSI_SIM_DATA_USA = "wireless-multi-imsi-sim-data-usa" + WIRELESS_MULTI_IMSI_SIM_MONTHLY_FEES = "wireless-multi-imsi-sim-monthly-fees" + WIRELESS_MULTI_IMSI_SIM_USAGE = "wireless-multi-imsi-sim-usage" + WIRELESS_SUPER_SIM_DATA_NORTH_AMERICA = "wireless-super-sim-data-north-america" + WIRELESS_SUPER_SIM_USAGE = "wireless-super-sim-usage" """ :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that the trigger monitors. diff --git a/twilio/rest/messaging/v2/channels_sender.py b/twilio/rest/messaging/v2/channels_sender.py index 53fa2e6e1e..a6e4252dc0 100644 --- a/twilio/rest/messaging/v2/channels_sender.py +++ b/twilio/rest/messaging/v2/channels_sender.py @@ -68,14 +68,10 @@ def __init__(self, payload: Dict[str, Any]): self.about: Optional[str] = payload.get("about") self.address: Optional[str] = payload.get("address") self.description: Optional[str] = payload.get("description") - self.emails: Optional[ - List[ChannelsSenderList.MessagingV2ChannelsSenderProfileEmails] - ] = payload.get("emails") + self.emails: Optional[Dict[str, object]] = payload.get("emails") self.logo_url: Optional[str] = payload.get("logo_url") self.vertical: Optional[str] = payload.get("vertical") - self.websites: Optional[ - List[ChannelsSenderList.MessagingV2ChannelsSenderProfileWebsites] - ] = payload.get("websites") + self.websites: Optional[Dict[str, object]] = payload.get("websites") def to_dict(self): return { @@ -83,52 +79,10 @@ def to_dict(self): "about": self.about, "address": self.address, "description": self.description, - "emails": ( - [emails.to_dict() for emails in self.emails] - if self.emails is not None - else None - ), + "emails": self.emails, "logo_url": self.logo_url, "vertical": self.vertical, - "websites": ( - [websites.to_dict() for websites in self.websites] - if self.websites is not None - else None - ), - } - - class MessagingV2ChannelsSenderProfileEmails(object): - """ - :ivar email: The email of the sender. - :ivar label: The label of the sender. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.email: Optional[str] = payload.get("email") - self.label: Optional[str] = payload.get("label") - - def to_dict(self): - return { - "email": self.email, - "label": self.label, - } - - class MessagingV2ChannelsSenderProfileWebsites(object): - """ - :ivar label: The label of the sender. - :ivar website: The website of the sender. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.label: Optional[str] = payload.get("label") - self.website: Optional[str] = payload.get("website") - - def to_dict(self): - return { - "label": self.label, - "website": self.website, + "websites": self.websites, } class MessagingV2ChannelsSenderRequestsCreate(object): @@ -412,14 +366,10 @@ def __init__(self, payload: Dict[str, Any]): self.about: Optional[str] = payload.get("about") self.address: Optional[str] = payload.get("address") self.description: Optional[str] = payload.get("description") - self.emails: Optional[ - List[ChannelsSenderList.MessagingV2ChannelsSenderProfileEmails] - ] = payload.get("emails") + self.emails: Optional[Dict[str, object]] = payload.get("emails") self.logo_url: Optional[str] = payload.get("logo_url") self.vertical: Optional[str] = payload.get("vertical") - self.websites: Optional[ - List[ChannelsSenderList.MessagingV2ChannelsSenderProfileWebsites] - ] = payload.get("websites") + self.websites: Optional[Dict[str, object]] = payload.get("websites") def to_dict(self): return { @@ -427,52 +377,10 @@ def to_dict(self): "about": self.about, "address": self.address, "description": self.description, - "emails": ( - [emails.to_dict() for emails in self.emails] - if self.emails is not None - else None - ), + "emails": self.emails, "logo_url": self.logo_url, "vertical": self.vertical, - "websites": ( - [websites.to_dict() for websites in self.websites] - if self.websites is not None - else None - ), - } - - class MessagingV2ChannelsSenderProfileEmails(object): - """ - :ivar email: The email of the sender. - :ivar label: The label of the sender. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.email: Optional[str] = payload.get("email") - self.label: Optional[str] = payload.get("label") - - def to_dict(self): - return { - "email": self.email, - "label": self.label, - } - - class MessagingV2ChannelsSenderProfileWebsites(object): - """ - :ivar label: The label of the sender. - :ivar website: The website of the sender. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.label: Optional[str] = payload.get("label") - self.website: Optional[str] = payload.get("website") - - def to_dict(self): - return { - "label": self.label, - "website": self.website, + "websites": self.websites, } class MessagingV2ChannelsSenderRequestsCreate(object): @@ -786,14 +694,10 @@ def __init__(self, payload: Dict[str, Any]): self.about: Optional[str] = payload.get("about") self.address: Optional[str] = payload.get("address") self.description: Optional[str] = payload.get("description") - self.emails: Optional[ - List[ChannelsSenderList.MessagingV2ChannelsSenderProfileEmails] - ] = payload.get("emails") + self.emails: Optional[Dict[str, object]] = payload.get("emails") self.logo_url: Optional[str] = payload.get("logo_url") self.vertical: Optional[str] = payload.get("vertical") - self.websites: Optional[ - List[ChannelsSenderList.MessagingV2ChannelsSenderProfileWebsites] - ] = payload.get("websites") + self.websites: Optional[Dict[str, object]] = payload.get("websites") def to_dict(self): return { @@ -801,52 +705,10 @@ def to_dict(self): "about": self.about, "address": self.address, "description": self.description, - "emails": ( - [emails.to_dict() for emails in self.emails] - if self.emails is not None - else None - ), + "emails": self.emails, "logo_url": self.logo_url, "vertical": self.vertical, - "websites": ( - [websites.to_dict() for websites in self.websites] - if self.websites is not None - else None - ), - } - - class MessagingV2ChannelsSenderProfileEmails(object): - """ - :ivar email: The email of the sender. - :ivar label: The label of the sender. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.email: Optional[str] = payload.get("email") - self.label: Optional[str] = payload.get("label") - - def to_dict(self): - return { - "email": self.email, - "label": self.label, - } - - class MessagingV2ChannelsSenderProfileWebsites(object): - """ - :ivar label: The label of the sender. - :ivar website: The website of the sender. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.label: Optional[str] = payload.get("label") - self.website: Optional[str] = payload.get("website") - - def to_dict(self): - return { - "label": self.label, - "website": self.website, + "websites": self.websites, } class MessagingV2ChannelsSenderRequestsCreate(object): diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 043364c3d5..68f078a88d 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,12 +28,10 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) -from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( - PortingWebhookConfigurationFetchList, -) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) +from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -58,12 +56,10 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None - self._porting_webhook_configuration_fetch: Optional[ - PortingWebhookConfigurationFetchList - ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None + self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -111,22 +107,18 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete - @property - def porting_webhook_configuration_fetch( - self, - ) -> PortingWebhookConfigurationFetchList: - if self._porting_webhook_configuration_fetch is None: - self._porting_webhook_configuration_fetch = ( - PortingWebhookConfigurationFetchList(self) - ) - return self._porting_webhook_configuration_fetch - @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations + @property + def webhook(self) -> WebhookList: + if self._webhook is None: + self._webhook = WebhookList(self) + return self._webhook + def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/porting_port_in.py b/twilio/rest/numbers/v1/porting_port_in.py index bfca5762e0..3df2c15462 100644 --- a/twilio/rest/numbers/v1/porting_port_in.py +++ b/twilio/rest/numbers/v1/porting_port_in.py @@ -27,9 +27,9 @@ class PortingPortInInstance(InstanceResource): :ivar url: The URL of this Port In request :ivar account_sid: Account Sid or subaccount where the phone number(s) will be Ported :ivar notification_emails: Additional emails to send a copy of the signed LOA to. - :ivar target_port_in_date: Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. (This value is only available for custom porting customers.) - :ivar target_port_in_time_range_start: The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. (This value is only available for custom porting customers.) - :ivar target_port_in_time_range_end: The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. (This value is only available for custom porting customers.) + :ivar target_port_in_date: Target date to port the number. We cannot guarantee that this date will be honored by the other carriers, please work with Ops to get a confirmation of the firm order commitment (FOC) date. Expected format is ISO Local Date, example: ‘2011-12-03`. This date must be at least 7 days in the future for US ports and 10 days in the future for Japanese ports. We can't guarantee the exact date and time, as this depends on the losing carrier + :ivar target_port_in_time_range_start: The earliest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier + :ivar target_port_in_time_range_end: The latest time that the port should occur on the target port in date. Expected format is ISO Offset Time, example: ‘10:15:00-08:00'. We can't guarantee the exact date and time, as this depends on the losing carrier :ivar port_in_request_status: The status of the port in request. The possible values are: In progress, Completed, Expired, In review, Waiting for Signature, Action Required, and Canceled. :ivar losing_carrier_information: Details regarding the customer’s information with the losing carrier. These values will be used to generate the letter of authorization and should match the losing carrier’s data as closely as possible to ensure the port is accepted. :ivar phone_numbers: diff --git a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py b/twilio/rest/numbers/v1/webhook.py similarity index 78% rename from twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py rename to twilio/rest/numbers/v1/webhook.py index 5d381768c7..69bd556326 100644 --- a/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py +++ b/twilio/rest/numbers/v1/webhook.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class PortingWebhookConfigurationFetchInstance(InstanceResource): +class WebhookInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class PortingWebhookConfigurationFetchList(ListResource): +class WebhookList(ListResource): def __init__(self, version: Version): """ - Initialize the PortingWebhookConfigurationFetchList + Initialize the WebhookList :param version: Version that contains the resource @@ -68,12 +68,12 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> PortingWebhookConfigurationFetchInstance: + def fetch(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -81,14 +81,14 @@ def fetch(self) -> PortingWebhookConfigurationFetchInstance: payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) - async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: + async def fetch_async(self) -> WebhookInstance: """ - Asynchronously fetch the PortingWebhookConfigurationFetchInstance + Asynchronously fetch the WebhookInstance - :returns: The fetched PortingWebhookConfigurationFetchInstance + :returns: The fetched WebhookInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -98,7 +98,7 @@ async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: method="GET", uri=self._uri, headers=headers ) - return PortingWebhookConfigurationFetchInstance(self._version, payload) + return WebhookInstance(self._version, payload) def __repr__(self) -> str: """ @@ -106,4 +106,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/verify/v2/service/__init__.py b/twilio/rest/verify/v2/service/__init__.py index 207e8e7b53..a64ab7a552 100644 --- a/twilio/rest/verify/v2/service/__init__.py +++ b/twilio/rest/verify/v2/service/__init__.py @@ -35,7 +35,7 @@ class ServiceInstance(InstanceResource): """ :ivar sid: The unique string that we created to identify the Service resource. :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Service resource. - :ivar friendly_name: The name that appears in the body of your verification messages. It can be up to 30 characters long and can include letters, numbers, spaces, dashes, underscores. Phone numbers, special characters or links are NOT allowed. **This value should not contain PII.** + :ivar friendly_name: The name that appears in the body of your verification messages. It can be up to 30 characters long and can include letters, numbers, spaces, dashes, underscores. Phone numbers, special characters or links are NOT allowed. It cannot contain more than 4 (consecutive or non-consecutive) digits. **This value should not contain PII.** :ivar code_length: The length of the verification code to generate. :ivar lookup_enabled: Whether to perform a lookup with each verification started and return info about the phone number. :ivar psd2_enabled: Whether to pass PSD2 transaction parameters when starting a verification. From dc1044282abc5169aaebbd09149c1f8aa12e308b Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 29 May 2025 12:18:02 +0000 Subject: [PATCH 107/113] Release 9.6.2 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 61757fd57d..df6db04653 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.6.1", + version="9.6.2", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 67f6744da9..686194fe35 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "6", "1") +__version_info__ = ("9", "6", "2") __version__ = ".".join(__version_info__) From 109efef440cb486425bea9c07f13988a701fbc38 Mon Sep 17 00:00:00 2001 From: krishnakalluri Date: Wed, 11 Jun 2025 23:13:21 -0500 Subject: [PATCH 108/113] Remove knowledge files (#869) --- twilio/rest/__init__.py | 15 - twilio/rest/knowledge/KnowledgeBase.py | 44 - twilio/rest/knowledge/v1/__init__.py | 43 - .../rest/knowledge/v1/knowledge/__init__.py | 935 ------------------ twilio/rest/knowledge/v1/knowledge/chunk.py | 297 ------ .../v1/knowledge/knowledge_status.py | 196 ---- 6 files changed, 1530 deletions(-) delete mode 100644 twilio/rest/knowledge/KnowledgeBase.py delete mode 100644 twilio/rest/knowledge/v1/__init__.py delete mode 100644 twilio/rest/knowledge/v1/knowledge/__init__.py delete mode 100644 twilio/rest/knowledge/v1/knowledge/chunk.py delete mode 100644 twilio/rest/knowledge/v1/knowledge/knowledge_status.py diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index dc7741180b..5838363c52 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -29,7 +29,6 @@ from twilio.rest.insights import Insights from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging - from twilio.rest.knowledge import Knowledge from twilio.rest.lookups import Lookups from twilio.rest.marketplace import Marketplace from twilio.rest.messaging import Messaging @@ -143,7 +142,6 @@ def __init__( self._insights: Optional["Insights"] = None self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None - self._knowledge: Optional["Knowledge"] = None self._lookups: Optional["Lookups"] = None self._marketplace: Optional["Marketplace"] = None self._messaging: Optional["Messaging"] = None @@ -363,19 +361,6 @@ def ip_messaging(self) -> "IpMessaging": self._ip_messaging = IpMessaging(self) return self._ip_messaging - @property - def knowledge(self) -> "Knowledge": - """ - Access the Knowledge Twilio Domain - - :returns: Knowledge Twilio Domain - """ - if self._knowledge is None: - from twilio.rest.knowledge import Knowledge - - self._knowledge = Knowledge(self) - return self._knowledge - @property def lookups(self) -> "Lookups": """ diff --git a/twilio/rest/knowledge/KnowledgeBase.py b/twilio/rest/knowledge/KnowledgeBase.py deleted file mode 100644 index 902f0e8b96..0000000000 --- a/twilio/rest/knowledge/KnowledgeBase.py +++ /dev/null @@ -1,44 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional - -from twilio.base.domain import Domain -from twilio.rest import Client -from twilio.rest.knowledge.v1 import V1 - - -class KnowledgeBase(Domain): - - def __init__(self, twilio: Client): - """ - Initialize the Knowledge Domain - - :returns: Domain for Knowledge - """ - super().__init__(twilio, "https://knowledge.twilio.com") - self._v1: Optional[V1] = None - - @property - def v1(self) -> V1: - """ - :returns: Versions v1 of Knowledge - """ - if self._v1 is None: - self._v1 = V1(self) - return self._v1 - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/knowledge/v1/__init__.py b/twilio/rest/knowledge/v1/__init__.py deleted file mode 100644 index 9609bff951..0000000000 --- a/twilio/rest/knowledge/v1/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Knowledge - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.knowledge.v1.knowledge import KnowledgeList - - -class V1(Version): - - def __init__(self, domain: Domain): - """ - Initialize the V1 version of Knowledge - - :param domain: The Twilio.knowledge domain - """ - super().__init__(domain, "v1") - self._knowledge: Optional[KnowledgeList] = None - - @property - def knowledge(self) -> KnowledgeList: - if self._knowledge is None: - self._knowledge = KnowledgeList(self) - return self._knowledge - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/knowledge/v1/knowledge/__init__.py b/twilio/rest/knowledge/v1/knowledge/__init__.py deleted file mode 100644 index 8ba6b2c481..0000000000 --- a/twilio/rest/knowledge/v1/knowledge/__init__.py +++ /dev/null @@ -1,935 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Knowledge - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.knowledge.v1.knowledge.chunk import ChunkList -from twilio.rest.knowledge.v1.knowledge.knowledge_status import KnowledgeStatusList - - -class KnowledgeInstance(InstanceResource): - - class KnowledgeV1ServiceCreateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the tool. - :ivar policy: - :ivar type: The type of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - class KnowledgeV1ServiceCreatePolicyRequest(object): - """ - :ivar description: The description of the policy. - :ivar id: The Policy ID. - :ivar name: The name of the policy. - :ivar policy_details: - :ivar type: The description of the policy. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.id: Optional[str] = payload.get("id") - self.name: Optional[str] = payload.get("name") - self.policy_details: Optional[Dict[str, object]] = payload.get( - "policy_details" - ) - self.type: Optional[str] = payload.get("type") - - def to_dict(self): - return { - "description": self.description, - "id": self.id, - "name": self.name, - "policy_details": self.policy_details, - "type": self.type, - } - - class KnowledgeV1ServiceUpdateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the knowledge source. - :ivar policy: - :ivar type: The description of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - """ - :ivar description: The type of knowledge source. - :ivar id: The description of knowledge. - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the knowledge source. - :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') - :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') - :ivar url: The url of the knowledge resource. - :ivar embedding_model: The embedding model to be used for the knowledge source. - :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], id: Optional[str] = None - ): - super().__init__(version) - - self.description: Optional[str] = payload.get("description") - self.id: Optional[str] = payload.get("id") - self.account_sid: Optional[str] = payload.get("account_sid") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.status: Optional[str] = payload.get("status") - self.type: Optional[str] = payload.get("type") - self.url: Optional[str] = payload.get("url") - self.embedding_model: Optional[str] = payload.get("embedding_model") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - - self._solution = { - "id": id or self.id, - } - self._context: Optional[KnowledgeContext] = None - - @property - def _proxy(self) -> "KnowledgeContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: KnowledgeContext for this KnowledgeInstance - """ - if self._context is None: - self._context = KnowledgeContext( - self._version, - id=self._solution["id"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the KnowledgeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the KnowledgeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "KnowledgeInstance": - """ - Fetch the KnowledgeInstance - - - :returns: The fetched KnowledgeInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "KnowledgeInstance": - """ - Asynchronous coroutine to fetch the KnowledgeInstance - - - :returns: The fetched KnowledgeInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - knowledge_v1_service_update_knowledge_request: Union[ - KnowledgeV1ServiceUpdateKnowledgeRequest, object - ] = values.unset, - ) -> "KnowledgeInstance": - """ - Update the KnowledgeInstance - - :param knowledge_v1_service_update_knowledge_request: - - :returns: The updated KnowledgeInstance - """ - return self._proxy.update( - knowledge_v1_service_update_knowledge_request=knowledge_v1_service_update_knowledge_request, - ) - - async def update_async( - self, - knowledge_v1_service_update_knowledge_request: Union[ - KnowledgeV1ServiceUpdateKnowledgeRequest, object - ] = values.unset, - ) -> "KnowledgeInstance": - """ - Asynchronous coroutine to update the KnowledgeInstance - - :param knowledge_v1_service_update_knowledge_request: - - :returns: The updated KnowledgeInstance - """ - return await self._proxy.update_async( - knowledge_v1_service_update_knowledge_request=knowledge_v1_service_update_knowledge_request, - ) - - @property - def chunks(self) -> ChunkList: - """ - Access the chunks - """ - return self._proxy.chunks - - @property - def knowledge_status(self) -> KnowledgeStatusList: - """ - Access the knowledge_status - """ - return self._proxy.knowledge_status - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class KnowledgeContext(InstanceContext): - - class KnowledgeV1ServiceCreateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the tool. - :ivar policy: - :ivar type: The type of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - class KnowledgeV1ServiceCreatePolicyRequest(object): - """ - :ivar description: The description of the policy. - :ivar id: The Policy ID. - :ivar name: The name of the policy. - :ivar policy_details: - :ivar type: The description of the policy. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.id: Optional[str] = payload.get("id") - self.name: Optional[str] = payload.get("name") - self.policy_details: Optional[Dict[str, object]] = payload.get( - "policy_details" - ) - self.type: Optional[str] = payload.get("type") - - def to_dict(self): - return { - "description": self.description, - "id": self.id, - "name": self.name, - "policy_details": self.policy_details, - "type": self.type, - } - - class KnowledgeV1ServiceUpdateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the knowledge source. - :ivar policy: - :ivar type: The description of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - def __init__(self, version: Version, id: str): - """ - Initialize the KnowledgeContext - - :param version: Version that contains the resource - :param id: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "id": id, - } - self._uri = "/Knowledge/{id}".format(**self._solution) - - self._chunks: Optional[ChunkList] = None - self._knowledge_status: Optional[KnowledgeStatusList] = None - - def delete(self) -> bool: - """ - Deletes the KnowledgeInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the KnowledgeInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> KnowledgeInstance: - """ - Fetch the KnowledgeInstance - - - :returns: The fetched KnowledgeInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return KnowledgeInstance( - self._version, - payload, - id=self._solution["id"], - ) - - async def fetch_async(self) -> KnowledgeInstance: - """ - Asynchronous coroutine to fetch the KnowledgeInstance - - - :returns: The fetched KnowledgeInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return KnowledgeInstance( - self._version, - payload, - id=self._solution["id"], - ) - - def update( - self, - knowledge_v1_service_update_knowledge_request: Union[ - KnowledgeV1ServiceUpdateKnowledgeRequest, object - ] = values.unset, - ) -> KnowledgeInstance: - """ - Update the KnowledgeInstance - - :param knowledge_v1_service_update_knowledge_request: - - :returns: The updated KnowledgeInstance - """ - data = knowledge_v1_service_update_knowledge_request.to_dict() - - headers = values.of({}) - - headers["Content-Type"] = "application/json" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="PUT", uri=self._uri, data=data, headers=headers - ) - - return KnowledgeInstance(self._version, payload, id=self._solution["id"]) - - async def update_async( - self, - knowledge_v1_service_update_knowledge_request: Union[ - KnowledgeV1ServiceUpdateKnowledgeRequest, object - ] = values.unset, - ) -> KnowledgeInstance: - """ - Asynchronous coroutine to update the KnowledgeInstance - - :param knowledge_v1_service_update_knowledge_request: - - :returns: The updated KnowledgeInstance - """ - data = knowledge_v1_service_update_knowledge_request.to_dict() - - headers = values.of({}) - - headers["Content-Type"] = "application/json" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="PUT", uri=self._uri, data=data, headers=headers - ) - - return KnowledgeInstance(self._version, payload, id=self._solution["id"]) - - @property - def chunks(self) -> ChunkList: - """ - Access the chunks - """ - if self._chunks is None: - self._chunks = ChunkList( - self._version, - self._solution["id"], - ) - return self._chunks - - @property - def knowledge_status(self) -> KnowledgeStatusList: - """ - Access the knowledge_status - """ - if self._knowledge_status is None: - self._knowledge_status = KnowledgeStatusList( - self._version, - self._solution["id"], - ) - return self._knowledge_status - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class KnowledgePage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> KnowledgeInstance: - """ - Build an instance of KnowledgeInstance - - :param payload: Payload response from the API - """ - return KnowledgeInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class KnowledgeList(ListResource): - - class KnowledgeV1ServiceCreateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the tool. - :ivar policy: - :ivar type: The type of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - class KnowledgeV1ServiceCreatePolicyRequest(object): - """ - :ivar description: The description of the policy. - :ivar id: The Policy ID. - :ivar name: The name of the policy. - :ivar policy_details: - :ivar type: The description of the policy. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.id: Optional[str] = payload.get("id") - self.name: Optional[str] = payload.get("name") - self.policy_details: Optional[Dict[str, object]] = payload.get( - "policy_details" - ) - self.type: Optional[str] = payload.get("type") - - def to_dict(self): - return { - "description": self.description, - "id": self.id, - "name": self.name, - "policy_details": self.policy_details, - "type": self.type, - } - - class KnowledgeV1ServiceUpdateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the knowledge source. - :ivar policy: - :ivar type: The description of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - def __init__(self, version: Version): - """ - Initialize the KnowledgeList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Knowledge" - - def create( - self, - knowledge_v1_service_create_knowledge_request: KnowledgeV1ServiceCreateKnowledgeRequest, - ) -> KnowledgeInstance: - """ - Create the KnowledgeInstance - - :param knowledge_v1_service_create_knowledge_request: - - :returns: The created KnowledgeInstance - """ - data = knowledge_v1_service_create_knowledge_request.to_dict() - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/json" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return KnowledgeInstance(self._version, payload) - - async def create_async( - self, - knowledge_v1_service_create_knowledge_request: KnowledgeV1ServiceCreateKnowledgeRequest, - ) -> KnowledgeInstance: - """ - Asynchronously create the KnowledgeInstance - - :param knowledge_v1_service_create_knowledge_request: - - :returns: The created KnowledgeInstance - """ - data = knowledge_v1_service_create_knowledge_request.to_dict() - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/json" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return KnowledgeInstance(self._version, payload) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[KnowledgeInstance]: - """ - Streams KnowledgeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[KnowledgeInstance]: - """ - Asynchronously streams KnowledgeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[KnowledgeInstance]: - """ - Lists KnowledgeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[KnowledgeInstance]: - """ - Asynchronously lists KnowledgeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> KnowledgePage: - """ - Retrieve a single page of KnowledgeInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of KnowledgeInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return KnowledgePage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> KnowledgePage: - """ - Asynchronously retrieve a single page of KnowledgeInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of KnowledgeInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return KnowledgePage(self._version, response) - - def get_page(self, target_url: str) -> KnowledgePage: - """ - Retrieve a specific page of KnowledgeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of KnowledgeInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return KnowledgePage(self._version, response) - - async def get_page_async(self, target_url: str) -> KnowledgePage: - """ - Asynchronously retrieve a specific page of KnowledgeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of KnowledgeInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return KnowledgePage(self._version, response) - - def get(self, id: str) -> KnowledgeContext: - """ - Constructs a KnowledgeContext - - :param id: - """ - return KnowledgeContext(self._version, id=id) - - def __call__(self, id: str) -> KnowledgeContext: - """ - Constructs a KnowledgeContext - - :param id: - """ - return KnowledgeContext(self._version, id=id) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/knowledge/v1/knowledge/chunk.py b/twilio/rest/knowledge/v1/knowledge/chunk.py deleted file mode 100644 index 55c0b1be1a..0000000000 --- a/twilio/rest/knowledge/v1/knowledge/chunk.py +++ /dev/null @@ -1,297 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Knowledge - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values - -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class ChunkInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. - :ivar content: The chunk content. - :ivar metadata: The metadata of the chunk. - :ivar date_created: The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar date_updated: The date and time in GMT when the Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - """ - - def __init__(self, version: Version, payload: Dict[str, Any], id: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.content: Optional[str] = payload.get("content") - self.metadata: Optional[Dict[str, object]] = payload.get("metadata") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - - self._solution = { - "id": id, - } - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class ChunkPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> ChunkInstance: - """ - Build an instance of ChunkInstance - - :param payload: Payload response from the API - """ - return ChunkInstance(self._version, payload, id=self._solution["id"]) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class ChunkList(ListResource): - - def __init__(self, version: Version, id: str): - """ - Initialize the ChunkList - - :param version: Version that contains the resource - :param id: The knowledge ID. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "id": id, - } - self._uri = "/Knowledge/{id}/Chunks".format(**self._solution) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[ChunkInstance]: - """ - Streams ChunkInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[ChunkInstance]: - """ - Asynchronously streams ChunkInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ChunkInstance]: - """ - Lists ChunkInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ChunkInstance]: - """ - Asynchronously lists ChunkInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ChunkPage: - """ - Retrieve a single page of ChunkInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of ChunkInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return ChunkPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ChunkPage: - """ - Asynchronously retrieve a single page of ChunkInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of ChunkInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return ChunkPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> ChunkPage: - """ - Retrieve a specific page of ChunkInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ChunkInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return ChunkPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> ChunkPage: - """ - Asynchronously retrieve a specific page of ChunkInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ChunkInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return ChunkPage(self._version, response, self._solution) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/knowledge/v1/knowledge/knowledge_status.py b/twilio/rest/knowledge/v1/knowledge/knowledge_status.py deleted file mode 100644 index 984c577aac..0000000000 --- a/twilio/rest/knowledge/v1/knowledge/knowledge_status.py +++ /dev/null @@ -1,196 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Knowledge - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, Optional -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class KnowledgeStatusInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. - :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') - :ivar last_status: The last status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') - :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - """ - - def __init__(self, version: Version, payload: Dict[str, Any], id: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.status: Optional[str] = payload.get("status") - self.last_status: Optional[str] = payload.get("last_status") - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - - self._solution = { - "id": id, - } - self._context: Optional[KnowledgeStatusContext] = None - - @property - def _proxy(self) -> "KnowledgeStatusContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: KnowledgeStatusContext for this KnowledgeStatusInstance - """ - if self._context is None: - self._context = KnowledgeStatusContext( - self._version, - id=self._solution["id"], - ) - return self._context - - def fetch(self) -> "KnowledgeStatusInstance": - """ - Fetch the KnowledgeStatusInstance - - - :returns: The fetched KnowledgeStatusInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "KnowledgeStatusInstance": - """ - Asynchronous coroutine to fetch the KnowledgeStatusInstance - - - :returns: The fetched KnowledgeStatusInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class KnowledgeStatusContext(InstanceContext): - - def __init__(self, version: Version, id: str): - """ - Initialize the KnowledgeStatusContext - - :param version: Version that contains the resource - :param id: the Knowledge ID. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "id": id, - } - self._uri = "/Knowledge/{id}/Status".format(**self._solution) - - def fetch(self) -> KnowledgeStatusInstance: - """ - Fetch the KnowledgeStatusInstance - - - :returns: The fetched KnowledgeStatusInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return KnowledgeStatusInstance( - self._version, - payload, - id=self._solution["id"], - ) - - async def fetch_async(self) -> KnowledgeStatusInstance: - """ - Asynchronous coroutine to fetch the KnowledgeStatusInstance - - - :returns: The fetched KnowledgeStatusInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return KnowledgeStatusInstance( - self._version, - payload, - id=self._solution["id"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class KnowledgeStatusList(ListResource): - - def __init__(self, version: Version, id: str): - """ - Initialize the KnowledgeStatusList - - :param version: Version that contains the resource - :param id: the Knowledge ID. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "id": id, - } - - def get(self) -> KnowledgeStatusContext: - """ - Constructs a KnowledgeStatusContext - - """ - return KnowledgeStatusContext(self._version, id=self._solution["id"]) - - def __call__(self) -> KnowledgeStatusContext: - """ - Constructs a KnowledgeStatusContext - - """ - return KnowledgeStatusContext(self._version, id=self._solution["id"]) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" From 439e4ad5a71e9a85d3b8033806dd32d7bddb31c3 Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 12 Jun 2025 10:28:25 +0000 Subject: [PATCH 109/113] [Librarian] Regenerated @ 330069c1eddda7f148dbcd8b26aaeec9c22b3409 3864ec4513c70a35c048caafc16ee3a36f3b2ed7 --- CHANGES.md | 20 + twilio/rest/__init__.py | 15 + .../account/address/dependent_phone_number.py | 15 +- .../api/v2010/account/recording/__init__.py | 2 +- twilio/rest/knowledge/KnowledgeBase.py | 44 + twilio/rest/knowledge/v1/__init__.py | 43 + .../rest/knowledge/v1/knowledge/__init__.py | 951 ++++++++++++++++++ twilio/rest/knowledge/v1/knowledge/chunk.py | 297 ++++++ .../v1/knowledge/knowledge_status.py | 196 ++++ .../v1/service/destination_alpha_sender.py | 24 +- twilio/rest/numbers/v1/__init__.py | 24 +- ...=> porting_webhook_configuration_fetch.py} | 26 +- twilio/rest/verify/v2/verification_attempt.py | 2 + 13 files changed, 1630 insertions(+), 29 deletions(-) create mode 100644 twilio/rest/knowledge/KnowledgeBase.py create mode 100644 twilio/rest/knowledge/v1/__init__.py create mode 100644 twilio/rest/knowledge/v1/knowledge/__init__.py create mode 100644 twilio/rest/knowledge/v1/knowledge/chunk.py create mode 100644 twilio/rest/knowledge/v1/knowledge/knowledge_status.py rename twilio/rest/numbers/v1/{webhook.py => porting_webhook_configuration_fetch.py} (78%) diff --git a/CHANGES.md b/CHANGES.md index 90d906f1ea..37c7984d2f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -3,6 +3,26 @@ twilio-python Changelog Here you can see the full list of changes between each twilio-python release. +[2025-06-12] Version 9.6.3 +-------------------------- +**Library - Chore** +- [PR #869](https://github.com/twilio/twilio-python/pull/869): Remove knowledge files. Thanks to [@krishnakalluri](https://github.com/krishnakalluri)! + +**Api** +- Change DependentPhoneNumber `capabilities` type `object` and `date_created`, `date_updated` to `date_time` +- Updated the `Default` value from 0 to 1 in the Recordings Resource `channels` property + +**Serverless** +- Update `ienum` type level in Logs api + +**Verify** +- Update Channel list in Verify Attempst API +- Update `ienum` type for Conversion_Status in Verify Attempts API + +**Twiml** +- Add `us2` to the list of supported values for the region attribute in the `` TwiML noun. + + [2025-05-29] Version 9.6.2 -------------------------- **Library - Chore** diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 5838363c52..dc7741180b 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -29,6 +29,7 @@ from twilio.rest.insights import Insights from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging + from twilio.rest.knowledge import Knowledge from twilio.rest.lookups import Lookups from twilio.rest.marketplace import Marketplace from twilio.rest.messaging import Messaging @@ -142,6 +143,7 @@ def __init__( self._insights: Optional["Insights"] = None self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None + self._knowledge: Optional["Knowledge"] = None self._lookups: Optional["Lookups"] = None self._marketplace: Optional["Marketplace"] = None self._messaging: Optional["Messaging"] = None @@ -361,6 +363,19 @@ def ip_messaging(self) -> "IpMessaging": self._ip_messaging = IpMessaging(self) return self._ip_messaging + @property + def knowledge(self) -> "Knowledge": + """ + Access the Knowledge Twilio Domain + + :returns: Knowledge Twilio Domain + """ + if self._knowledge is None: + from twilio.rest.knowledge import Knowledge + + self._knowledge = Knowledge(self) + return self._knowledge + @property def lookups(self) -> "Lookups": """ diff --git a/twilio/rest/api/v2010/account/address/dependent_phone_number.py b/twilio/rest/api/v2010/account/address/dependent_phone_number.py index 10d1ad306f..504e69bc92 100644 --- a/twilio/rest/api/v2010/account/address/dependent_phone_number.py +++ b/twilio/rest/api/v2010/account/address/dependent_phone_number.py @@ -12,8 +12,9 @@ Do not edit the class manually. """ +from datetime import datetime from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import values +from twilio.base import deserialize, values from twilio.base.instance_resource import InstanceResource from twilio.base.list_resource import ListResource @@ -50,7 +51,7 @@ class EmergencyStatus(object): :ivar sms_method: The HTTP method we use to call `sms_url`. Can be: `GET` or `POST`. :ivar sms_url: The URL we call when the phone number receives an incoming SMS message. :ivar address_requirements: - :ivar capabilities: + :ivar capabilities: The set of Boolean properties that indicates whether a phone number can receive calls or messages. Capabilities are `Voice`, `SMS`, and `MMS` and each capability can be: `true` or `false`. :ivar status_callback: The URL we call using the `status_callback_method` to send status information to your application. :ivar status_callback_method: The HTTP method we use to call `status_callback`. Can be: `GET` or `POST`. :ivar api_version: The API version used to start a new TwiML session. @@ -82,8 +83,12 @@ def __init__( self.voice_caller_id_lookup: Optional[bool] = payload.get( "voice_caller_id_lookup" ) - self.date_created: Optional[str] = payload.get("date_created") - self.date_updated: Optional[str] = payload.get("date_updated") + self.date_created: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.rfc2822_datetime( + payload.get("date_updated") + ) self.sms_fallback_method: Optional[str] = payload.get("sms_fallback_method") self.sms_fallback_url: Optional[str] = payload.get("sms_fallback_url") self.sms_method: Optional[str] = payload.get("sms_method") @@ -91,7 +96,7 @@ def __init__( self.address_requirements: Optional[ "DependentPhoneNumberInstance.AddressRequirement" ] = payload.get("address_requirements") - self.capabilities: Optional[str] = payload.get("capabilities") + self.capabilities: Optional[Dict[str, object]] = payload.get("capabilities") self.status_callback: Optional[str] = payload.get("status_callback") self.status_callback_method: Optional[str] = payload.get( "status_callback_method" diff --git a/twilio/rest/api/v2010/account/recording/__init__.py b/twilio/rest/api/v2010/account/recording/__init__.py index ab5c1c8b7b..807fb3ca6e 100644 --- a/twilio/rest/api/v2010/account/recording/__init__.py +++ b/twilio/rest/api/v2010/account/recording/__init__.py @@ -57,7 +57,7 @@ class Status(object): :ivar price: The one-time cost of creating the recording in the `price_unit` currency. :ivar price_unit: The currency used in the `price` property. Example: `USD`. :ivar status: - :ivar channels: The number of channels in the final recording file. Can be: `1` or `2`. + :ivar channels: The number of channels in the final recording file. Can be: `1` or `2`. Default: `1`. :ivar source: :ivar error_code: The error code that describes why the recording is `absent`. The error code is described in our [Error Dictionary](https://www.twilio.com/docs/api/errors). This value is null if the recording `status` is not `absent`. :ivar uri: The URI of the resource, relative to `https://api.twilio.com`. diff --git a/twilio/rest/knowledge/KnowledgeBase.py b/twilio/rest/knowledge/KnowledgeBase.py new file mode 100644 index 0000000000..902f0e8b96 --- /dev/null +++ b/twilio/rest/knowledge/KnowledgeBase.py @@ -0,0 +1,44 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional + +from twilio.base.domain import Domain +from twilio.rest import Client +from twilio.rest.knowledge.v1 import V1 + + +class KnowledgeBase(Domain): + + def __init__(self, twilio: Client): + """ + Initialize the Knowledge Domain + + :returns: Domain for Knowledge + """ + super().__init__(twilio, "https://knowledge.twilio.com") + self._v1: Optional[V1] = None + + @property + def v1(self) -> V1: + """ + :returns: Versions v1 of Knowledge + """ + if self._v1 is None: + self._v1 = V1(self) + return self._v1 + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/knowledge/v1/__init__.py b/twilio/rest/knowledge/v1/__init__.py new file mode 100644 index 0000000000..9609bff951 --- /dev/null +++ b/twilio/rest/knowledge/v1/__init__.py @@ -0,0 +1,43 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Knowledge + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from typing import Optional +from twilio.base.version import Version +from twilio.base.domain import Domain +from twilio.rest.knowledge.v1.knowledge import KnowledgeList + + +class V1(Version): + + def __init__(self, domain: Domain): + """ + Initialize the V1 version of Knowledge + + :param domain: The Twilio.knowledge domain + """ + super().__init__(domain, "v1") + self._knowledge: Optional[KnowledgeList] = None + + @property + def knowledge(self) -> KnowledgeList: + if self._knowledge is None: + self._knowledge = KnowledgeList(self) + return self._knowledge + + def __repr__(self) -> str: + """ + Provide a friendly representation + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/knowledge/v1/knowledge/__init__.py b/twilio/rest/knowledge/v1/knowledge/__init__.py new file mode 100644 index 0000000000..17e6f1d4ad --- /dev/null +++ b/twilio/rest/knowledge/v1/knowledge/__init__.py @@ -0,0 +1,951 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Knowledge + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page +from twilio.rest.knowledge.v1.knowledge.chunk import ChunkList +from twilio.rest.knowledge.v1.knowledge.knowledge_status import KnowledgeStatusList + + +class KnowledgeInstance(InstanceResource): + + class KnowledgeV1ServiceCreateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + class KnowledgeV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class KnowledgeV1ServiceUpdateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar policy: + :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + """ + :ivar description: The type of knowledge source. + :ivar id: The description of knowledge. + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') + :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') + :ivar url: The url of the knowledge resource. + :ivar embedding_model: The embedding model to be used for the knowledge source. + :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__( + self, version: Version, payload: Dict[str, Any], id: Optional[str] = None + ): + super().__init__(version) + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.account_sid: Optional[str] = payload.get("account_sid") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.status: Optional[str] = payload.get("status") + self.type: Optional[str] = payload.get("type") + self.url: Optional[str] = payload.get("url") + self.embedding_model: Optional[str] = payload.get("embedding_model") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id or self.id, + } + self._context: Optional[KnowledgeContext] = None + + @property + def _proxy(self) -> "KnowledgeContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: KnowledgeContext for this KnowledgeInstance + """ + if self._context is None: + self._context = KnowledgeContext( + self._version, + id=self._solution["id"], + ) + return self._context + + def delete(self) -> bool: + """ + Deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return self._proxy.delete() + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + return await self._proxy.delete_async() + + def fetch(self) -> "KnowledgeInstance": + """ + Fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "KnowledgeInstance": + """ + Asynchronous coroutine to fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + return await self._proxy.fetch_async() + + def update( + self, + knowledge_v1_service_update_knowledge_request: Union[ + KnowledgeV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> "KnowledgeInstance": + """ + Update the KnowledgeInstance + + :param knowledge_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + return self._proxy.update( + knowledge_v1_service_update_knowledge_request=knowledge_v1_service_update_knowledge_request, + ) + + async def update_async( + self, + knowledge_v1_service_update_knowledge_request: Union[ + KnowledgeV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> "KnowledgeInstance": + """ + Asynchronous coroutine to update the KnowledgeInstance + + :param knowledge_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + return await self._proxy.update_async( + knowledge_v1_service_update_knowledge_request=knowledge_v1_service_update_knowledge_request, + ) + + @property + def chunks(self) -> ChunkList: + """ + Access the chunks + """ + return self._proxy.chunks + + @property + def knowledge_status(self) -> KnowledgeStatusList: + """ + Access the knowledge_status + """ + return self._proxy.knowledge_status + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgeContext(InstanceContext): + + class KnowledgeV1ServiceCreateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + class KnowledgeV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class KnowledgeV1ServiceUpdateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar policy: + :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + def __init__(self, version: Version, id: str): + """ + Initialize the KnowledgeContext + + :param version: Version that contains the resource + :param id: + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Knowledge/{id}".format(**self._solution) + + self._chunks: Optional[ChunkList] = None + self._knowledge_status: Optional[KnowledgeStatusList] = None + + def delete(self) -> bool: + """ + Deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + return self._version.delete(method="DELETE", uri=self._uri, headers=headers) + + async def delete_async(self) -> bool: + """ + Asynchronous coroutine that deletes the KnowledgeInstance + + + :returns: True if delete succeeds, False otherwise + """ + + headers = values.of({}) + + return await self._version.delete_async( + method="DELETE", uri=self._uri, headers=headers + ) + + def fetch(self) -> KnowledgeInstance: + """ + Fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return KnowledgeInstance( + self._version, + payload, + id=self._solution["id"], + ) + + async def fetch_async(self) -> KnowledgeInstance: + """ + Asynchronous coroutine to fetch the KnowledgeInstance + + + :returns: The fetched KnowledgeInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return KnowledgeInstance( + self._version, + payload, + id=self._solution["id"], + ) + + def update( + self, + knowledge_v1_service_update_knowledge_request: Union[ + KnowledgeV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> KnowledgeInstance: + """ + Update the KnowledgeInstance + + :param knowledge_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + data = knowledge_v1_service_update_knowledge_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = self._version.update( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload, id=self._solution["id"]) + + async def update_async( + self, + knowledge_v1_service_update_knowledge_request: Union[ + KnowledgeV1ServiceUpdateKnowledgeRequest, object + ] = values.unset, + ) -> KnowledgeInstance: + """ + Asynchronous coroutine to update the KnowledgeInstance + + :param knowledge_v1_service_update_knowledge_request: + + :returns: The updated KnowledgeInstance + """ + data = knowledge_v1_service_update_knowledge_request.to_dict() + + headers = values.of({}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = await self._version.update_async( + method="PUT", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload, id=self._solution["id"]) + + @property + def chunks(self) -> ChunkList: + """ + Access the chunks + """ + if self._chunks is None: + self._chunks = ChunkList( + self._version, + self._solution["id"], + ) + return self._chunks + + @property + def knowledge_status(self) -> KnowledgeStatusList: + """ + Access the knowledge_status + """ + if self._knowledge_status is None: + self._knowledge_status = KnowledgeStatusList( + self._version, + self._solution["id"], + ) + return self._knowledge_status + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgePage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> KnowledgeInstance: + """ + Build an instance of KnowledgeInstance + + :param payload: Payload response from the API + """ + return KnowledgeInstance(self._version, payload) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class KnowledgeList(ListResource): + + class KnowledgeV1ServiceCreateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the tool. + :ivar policy: + :ivar type: The type of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + class KnowledgeV1ServiceCreatePolicyRequest(object): + """ + :ivar description: The description of the policy. + :ivar id: The Policy ID. + :ivar name: The name of the policy. + :ivar policy_details: + :ivar type: The description of the policy. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.id: Optional[str] = payload.get("id") + self.name: Optional[str] = payload.get("name") + self.policy_details: Optional[Dict[str, object]] = payload.get( + "policy_details" + ) + self.type: Optional[str] = payload.get("type") + + def to_dict(self): + return { + "description": self.description, + "id": self.id, + "name": self.name, + "policy_details": self.policy_details, + "type": self.type, + } + + class KnowledgeV1ServiceUpdateKnowledgeRequest(object): + """ + :ivar description: The description of the knowledge source. + :ivar knowledge_source_details: The details of the knowledge source based on the type. + :ivar name: The name of the knowledge source. + :ivar policy: + :ivar type: The description of the knowledge source. + :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. + """ + + def __init__(self, payload: Dict[str, Any]): + + self.description: Optional[str] = payload.get("description") + self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( + "knowledge_source_details" + ) + self.name: Optional[str] = payload.get("name") + self.policy: Optional[ + KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest + ] = payload.get("policy") + self.type: Optional[str] = payload.get("type") + self.embedding_model: Optional[str] = payload.get("embedding_model") + + def to_dict(self): + return { + "description": self.description, + "knowledge_source_details": self.knowledge_source_details, + "name": self.name, + "policy": self.policy.to_dict() if self.policy is not None else None, + "type": self.type, + "embedding_model": self.embedding_model, + } + + def __init__(self, version: Version): + """ + Initialize the KnowledgeList + + :param version: Version that contains the resource + + """ + super().__init__(version) + + self._uri = "/Knowledge" + + def create( + self, + knowledge_v1_service_create_knowledge_request: KnowledgeV1ServiceCreateKnowledgeRequest, + ) -> KnowledgeInstance: + """ + Create the KnowledgeInstance + + :param knowledge_v1_service_create_knowledge_request: + + :returns: The created KnowledgeInstance + """ + data = knowledge_v1_service_create_knowledge_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = self._version.create( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload) + + async def create_async( + self, + knowledge_v1_service_create_knowledge_request: KnowledgeV1ServiceCreateKnowledgeRequest, + ) -> KnowledgeInstance: + """ + Asynchronously create the KnowledgeInstance + + :param knowledge_v1_service_create_knowledge_request: + + :returns: The created KnowledgeInstance + """ + data = knowledge_v1_service_create_knowledge_request.to_dict() + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Content-Type"] = "application/json" + + headers["Accept"] = "application/json" + + payload = await self._version.create_async( + method="POST", uri=self._uri, data=data, headers=headers + ) + + return KnowledgeInstance(self._version, payload) + + def stream( + self, + tags: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[KnowledgeInstance]: + """ + Streams KnowledgeInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str tags: Json array of tag and value pairs for tag filtering. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(tags=tags, page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + tags: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[KnowledgeInstance]: + """ + Asynchronously streams KnowledgeInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param str tags: Json array of tag and value pairs for tag filtering. + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(tags=tags, page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + tags: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[KnowledgeInstance]: + """ + Lists KnowledgeInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str tags: Json array of tag and value pairs for tag filtering. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + tags=tags, + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + tags: Union[str, object] = values.unset, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[KnowledgeInstance]: + """ + Asynchronously lists KnowledgeInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param str tags: Json array of tag and value pairs for tag filtering. + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + tags=tags, + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + tags: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> KnowledgePage: + """ + Retrieve a single page of KnowledgeInstance records from the API. + Request is executed immediately + + :param tags: Json array of tag and value pairs for tag filtering. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of KnowledgeInstance + """ + data = values.of( + { + "Tags": tags, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return KnowledgePage(self._version, response) + + async def page_async( + self, + tags: Union[str, object] = values.unset, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> KnowledgePage: + """ + Asynchronously retrieve a single page of KnowledgeInstance records from the API. + Request is executed immediately + + :param tags: Json array of tag and value pairs for tag filtering. + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of KnowledgeInstance + """ + data = values.of( + { + "Tags": tags, + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return KnowledgePage(self._version, response) + + def get_page(self, target_url: str) -> KnowledgePage: + """ + Retrieve a specific page of KnowledgeInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of KnowledgeInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return KnowledgePage(self._version, response) + + async def get_page_async(self, target_url: str) -> KnowledgePage: + """ + Asynchronously retrieve a specific page of KnowledgeInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of KnowledgeInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return KnowledgePage(self._version, response) + + def get(self, id: str) -> KnowledgeContext: + """ + Constructs a KnowledgeContext + + :param id: + """ + return KnowledgeContext(self._version, id=id) + + def __call__(self, id: str) -> KnowledgeContext: + """ + Constructs a KnowledgeContext + + :param id: + """ + return KnowledgeContext(self._version, id=id) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/knowledge/v1/knowledge/chunk.py b/twilio/rest/knowledge/v1/knowledge/chunk.py new file mode 100644 index 0000000000..55c0b1be1a --- /dev/null +++ b/twilio/rest/knowledge/v1/knowledge/chunk.py @@ -0,0 +1,297 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Knowledge + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator +from twilio.base import deserialize, values + +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version +from twilio.base.page import Page + + +class ChunkInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. + :ivar content: The chunk content. + :ivar metadata: The metadata of the chunk. + :ivar date_created: The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + :ivar date_updated: The date and time in GMT when the Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], id: str): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.content: Optional[str] = payload.get("content") + self.metadata: Optional[Dict[str, object]] = payload.get("metadata") + self.date_created: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_created") + ) + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id, + } + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class ChunkPage(Page): + + def get_instance(self, payload: Dict[str, Any]) -> ChunkInstance: + """ + Build an instance of ChunkInstance + + :param payload: Payload response from the API + """ + return ChunkInstance(self._version, payload, id=self._solution["id"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" + + +class ChunkList(ListResource): + + def __init__(self, version: Version, id: str): + """ + Initialize the ChunkList + + :param version: Version that contains the resource + :param id: The knowledge ID. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Knowledge/{id}/Chunks".format(**self._solution) + + def stream( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> Iterator[ChunkInstance]: + """ + Streams ChunkInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = self.page(page_size=limits["page_size"]) + + return self._version.stream(page, limits["limit"]) + + async def stream_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> AsyncIterator[ChunkInstance]: + """ + Asynchronously streams ChunkInstance records from the API as a generator stream. + This operation lazily loads records as efficiently as possible until the limit + is reached. + The results are returned as a generator, so this operation is memory efficient. + + :param limit: Upper limit for the number of records to return. stream() + guarantees to never return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, stream() will attempt to read the + limit with the most efficient page size, i.e. min(limit, 1000) + + :returns: Generator that will yield up to limit results + """ + limits = self._version.read_limits(limit, page_size) + page = await self.page_async(page_size=limits["page_size"]) + + return self._version.stream_async(page, limits["limit"]) + + def list( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ChunkInstance]: + """ + Lists ChunkInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return list( + self.stream( + limit=limit, + page_size=page_size, + ) + ) + + async def list_async( + self, + limit: Optional[int] = None, + page_size: Optional[int] = None, + ) -> List[ChunkInstance]: + """ + Asynchronously lists ChunkInstance records from the API as a list. + Unlike stream(), this operation is eager and will load `limit` records into + memory before returning. + + :param limit: Upper limit for the number of records to return. list() guarantees + never to return more than limit. Default is no limit + :param page_size: Number of records to fetch per request, when not set will use + the default value of 50 records. If no page_size is defined + but a limit is defined, list() will attempt to read the limit + with the most efficient page size, i.e. min(limit, 1000) + + :returns: list that will contain up to limit results + """ + return [ + record + async for record in await self.stream_async( + limit=limit, + page_size=page_size, + ) + ] + + def page( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ChunkPage: + """ + Retrieve a single page of ChunkInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ChunkInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = self._version.page( + method="GET", uri=self._uri, params=data, headers=headers + ) + return ChunkPage(self._version, response, self._solution) + + async def page_async( + self, + page_token: Union[str, object] = values.unset, + page_number: Union[int, object] = values.unset, + page_size: Union[int, object] = values.unset, + ) -> ChunkPage: + """ + Asynchronously retrieve a single page of ChunkInstance records from the API. + Request is executed immediately + + :param page_token: PageToken provided by the API + :param page_number: Page Number, this value is simply for client state + :param page_size: Number of records to return, defaults to 50 + + :returns: Page of ChunkInstance + """ + data = values.of( + { + "PageToken": page_token, + "Page": page_number, + "PageSize": page_size, + } + ) + + headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) + + headers["Accept"] = "application/json" + + response = await self._version.page_async( + method="GET", uri=self._uri, params=data, headers=headers + ) + return ChunkPage(self._version, response, self._solution) + + def get_page(self, target_url: str) -> ChunkPage: + """ + Retrieve a specific page of ChunkInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ChunkInstance + """ + response = self._version.domain.twilio.request("GET", target_url) + return ChunkPage(self._version, response, self._solution) + + async def get_page_async(self, target_url: str) -> ChunkPage: + """ + Asynchronously retrieve a specific page of ChunkInstance records from the API. + Request is executed immediately + + :param target_url: API-generated URL for the requested results page + + :returns: Page of ChunkInstance + """ + response = await self._version.domain.twilio.request_async("GET", target_url) + return ChunkPage(self._version, response, self._solution) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/knowledge/v1/knowledge/knowledge_status.py b/twilio/rest/knowledge/v1/knowledge/knowledge_status.py new file mode 100644 index 0000000000..984c577aac --- /dev/null +++ b/twilio/rest/knowledge/v1/knowledge/knowledge_status.py @@ -0,0 +1,196 @@ +r""" + This code was generated by + ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ + | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ + | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ + + Twilio - Knowledge + This is the public Twilio REST API. + + NOTE: This class is auto generated by OpenAPI Generator. + https://openapi-generator.tech + Do not edit the class manually. +""" + +from datetime import datetime +from typing import Any, Dict, Optional +from twilio.base import deserialize, values +from twilio.base.instance_context import InstanceContext +from twilio.base.instance_resource import InstanceResource +from twilio.base.list_resource import ListResource +from twilio.base.version import Version + + +class KnowledgeStatusInstance(InstanceResource): + """ + :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. + :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') + :ivar last_status: The last status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') + :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + """ + + def __init__(self, version: Version, payload: Dict[str, Any], id: str): + super().__init__(version) + + self.account_sid: Optional[str] = payload.get("account_sid") + self.status: Optional[str] = payload.get("status") + self.last_status: Optional[str] = payload.get("last_status") + self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( + payload.get("date_updated") + ) + + self._solution = { + "id": id, + } + self._context: Optional[KnowledgeStatusContext] = None + + @property + def _proxy(self) -> "KnowledgeStatusContext": + """ + Generate an instance context for the instance, the context is capable of + performing various actions. All instance actions are proxied to the context + + :returns: KnowledgeStatusContext for this KnowledgeStatusInstance + """ + if self._context is None: + self._context = KnowledgeStatusContext( + self._version, + id=self._solution["id"], + ) + return self._context + + def fetch(self) -> "KnowledgeStatusInstance": + """ + Fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + return self._proxy.fetch() + + async def fetch_async(self) -> "KnowledgeStatusInstance": + """ + Asynchronous coroutine to fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + return await self._proxy.fetch_async() + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgeStatusContext(InstanceContext): + + def __init__(self, version: Version, id: str): + """ + Initialize the KnowledgeStatusContext + + :param version: Version that contains the resource + :param id: the Knowledge ID. + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + self._uri = "/Knowledge/{id}/Status".format(**self._solution) + + def fetch(self) -> KnowledgeStatusInstance: + """ + Fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) + + return KnowledgeStatusInstance( + self._version, + payload, + id=self._solution["id"], + ) + + async def fetch_async(self) -> KnowledgeStatusInstance: + """ + Asynchronous coroutine to fetch the KnowledgeStatusInstance + + + :returns: The fetched KnowledgeStatusInstance + """ + + headers = values.of({}) + + headers["Accept"] = "application/json" + + payload = await self._version.fetch_async( + method="GET", uri=self._uri, headers=headers + ) + + return KnowledgeStatusInstance( + self._version, + payload, + id=self._solution["id"], + ) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) + return "".format(context) + + +class KnowledgeStatusList(ListResource): + + def __init__(self, version: Version, id: str): + """ + Initialize the KnowledgeStatusList + + :param version: Version that contains the resource + :param id: the Knowledge ID. + + """ + super().__init__(version) + + # Path Solution + self._solution = { + "id": id, + } + + def get(self) -> KnowledgeStatusContext: + """ + Constructs a KnowledgeStatusContext + + """ + return KnowledgeStatusContext(self._version, id=self._solution["id"]) + + def __call__(self) -> KnowledgeStatusContext: + """ + Constructs a KnowledgeStatusContext + + """ + return KnowledgeStatusContext(self._version, id=self._solution["id"]) + + def __repr__(self) -> str: + """ + Provide a friendly representation + + :returns: Machine friendly representation + """ + return "" diff --git a/twilio/rest/messaging/v1/service/destination_alpha_sender.py b/twilio/rest/messaging/v1/service/destination_alpha_sender.py index ffe1700929..244d906cae 100644 --- a/twilio/rest/messaging/v1/service/destination_alpha_sender.py +++ b/twilio/rest/messaging/v1/service/destination_alpha_sender.py @@ -334,6 +334,7 @@ async def create_async( def stream( self, + iso_country_code: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> Iterator[DestinationAlphaSenderInstance]: @@ -343,6 +344,7 @@ def stream( is reached. The results are returned as a generator, so this operation is memory efficient. + :param str iso_country_code: Optional filter to return only alphanumeric sender IDs associated with the specified two-character ISO country code. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -353,12 +355,15 @@ def stream( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) + page = self.page( + iso_country_code=iso_country_code, page_size=limits["page_size"] + ) return self._version.stream(page, limits["limit"]) async def stream_async( self, + iso_country_code: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> AsyncIterator[DestinationAlphaSenderInstance]: @@ -368,6 +373,7 @@ async def stream_async( is reached. The results are returned as a generator, so this operation is memory efficient. + :param str iso_country_code: Optional filter to return only alphanumeric sender IDs associated with the specified two-character ISO country code. :param limit: Upper limit for the number of records to return. stream() guarantees to never return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -378,12 +384,15 @@ async def stream_async( :returns: Generator that will yield up to limit results """ limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) + page = await self.page_async( + iso_country_code=iso_country_code, page_size=limits["page_size"] + ) return self._version.stream_async(page, limits["limit"]) def list( self, + iso_country_code: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[DestinationAlphaSenderInstance]: @@ -392,6 +401,7 @@ def list( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param str iso_country_code: Optional filter to return only alphanumeric sender IDs associated with the specified two-character ISO country code. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -403,6 +413,7 @@ def list( """ return list( self.stream( + iso_country_code=iso_country_code, limit=limit, page_size=page_size, ) @@ -410,6 +421,7 @@ def list( async def list_async( self, + iso_country_code: Union[str, object] = values.unset, limit: Optional[int] = None, page_size: Optional[int] = None, ) -> List[DestinationAlphaSenderInstance]: @@ -418,6 +430,7 @@ async def list_async( Unlike stream(), this operation is eager and will load `limit` records into memory before returning. + :param str iso_country_code: Optional filter to return only alphanumeric sender IDs associated with the specified two-character ISO country code. :param limit: Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit :param page_size: Number of records to fetch per request, when not set will use @@ -430,6 +443,7 @@ async def list_async( return [ record async for record in await self.stream_async( + iso_country_code=iso_country_code, limit=limit, page_size=page_size, ) @@ -437,6 +451,7 @@ async def list_async( def page( self, + iso_country_code: Union[str, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -445,6 +460,7 @@ def page( Retrieve a single page of DestinationAlphaSenderInstance records from the API. Request is executed immediately + :param iso_country_code: Optional filter to return only alphanumeric sender IDs associated with the specified two-character ISO country code. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -453,6 +469,7 @@ def page( """ data = values.of( { + "IsoCountryCode": iso_country_code, "PageToken": page_token, "Page": page_number, "PageSize": page_size, @@ -470,6 +487,7 @@ def page( async def page_async( self, + iso_country_code: Union[str, object] = values.unset, page_token: Union[str, object] = values.unset, page_number: Union[int, object] = values.unset, page_size: Union[int, object] = values.unset, @@ -478,6 +496,7 @@ async def page_async( Asynchronously retrieve a single page of DestinationAlphaSenderInstance records from the API. Request is executed immediately + :param iso_country_code: Optional filter to return only alphanumeric sender IDs associated with the specified two-character ISO country code. :param page_token: PageToken provided by the API :param page_number: Page Number, this value is simply for client state :param page_size: Number of records to return, defaults to 50 @@ -486,6 +505,7 @@ async def page_async( """ data = values.of( { + "IsoCountryCode": iso_country_code, "PageToken": page_token, "Page": page_number, "PageSize": page_size, diff --git a/twilio/rest/numbers/v1/__init__.py b/twilio/rest/numbers/v1/__init__.py index 68f078a88d..043364c3d5 100644 --- a/twilio/rest/numbers/v1/__init__.py +++ b/twilio/rest/numbers/v1/__init__.py @@ -28,10 +28,12 @@ from twilio.rest.numbers.v1.porting_webhook_configuration_delete import ( PortingWebhookConfigurationDeleteList, ) +from twilio.rest.numbers.v1.porting_webhook_configuration_fetch import ( + PortingWebhookConfigurationFetchList, +) from twilio.rest.numbers.v1.signing_request_configuration import ( SigningRequestConfigurationList, ) -from twilio.rest.numbers.v1.webhook import WebhookList class V1(Version): @@ -56,10 +58,12 @@ def __init__(self, domain: Domain): self._porting_webhook_configurations_delete: Optional[ PortingWebhookConfigurationDeleteList ] = None + self._porting_webhook_configuration_fetch: Optional[ + PortingWebhookConfigurationFetchList + ] = None self._signing_request_configurations: Optional[ SigningRequestConfigurationList ] = None - self._webhook: Optional[WebhookList] = None @property def bulk_eligibilities(self) -> BulkEligibilityList: @@ -107,18 +111,22 @@ def porting_webhook_configurations_delete( ) return self._porting_webhook_configurations_delete + @property + def porting_webhook_configuration_fetch( + self, + ) -> PortingWebhookConfigurationFetchList: + if self._porting_webhook_configuration_fetch is None: + self._porting_webhook_configuration_fetch = ( + PortingWebhookConfigurationFetchList(self) + ) + return self._porting_webhook_configuration_fetch + @property def signing_request_configurations(self) -> SigningRequestConfigurationList: if self._signing_request_configurations is None: self._signing_request_configurations = SigningRequestConfigurationList(self) return self._signing_request_configurations - @property - def webhook(self) -> WebhookList: - if self._webhook is None: - self._webhook = WebhookList(self) - return self._webhook - def __repr__(self) -> str: """ Provide a friendly representation diff --git a/twilio/rest/numbers/v1/webhook.py b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py similarity index 78% rename from twilio/rest/numbers/v1/webhook.py rename to twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py index 69bd556326..5d381768c7 100644 --- a/twilio/rest/numbers/v1/webhook.py +++ b/twilio/rest/numbers/v1/porting_webhook_configuration_fetch.py @@ -21,7 +21,7 @@ from twilio.base.version import Version -class WebhookInstance(InstanceResource): +class PortingWebhookConfigurationFetchInstance(InstanceResource): """ :ivar url: The URL of the webhook configuration request :ivar port_in_target_url: The complete webhook url that will be called when a notification event for port in request or port in phone number happens @@ -52,14 +52,14 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" -class WebhookList(ListResource): +class PortingWebhookConfigurationFetchList(ListResource): def __init__(self, version: Version): """ - Initialize the WebhookList + Initialize the PortingWebhookConfigurationFetchList :param version: Version that contains the resource @@ -68,12 +68,12 @@ def __init__(self, version: Version): self._uri = "/Porting/Configuration/Webhook" - def fetch(self) -> WebhookInstance: + def fetch(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -81,14 +81,14 @@ def fetch(self) -> WebhookInstance: payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) - async def fetch_async(self) -> WebhookInstance: + async def fetch_async(self) -> PortingWebhookConfigurationFetchInstance: """ - Asynchronously fetch the WebhookInstance + Asynchronously fetch the PortingWebhookConfigurationFetchInstance - :returns: The fetched WebhookInstance + :returns: The fetched PortingWebhookConfigurationFetchInstance """ headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) @@ -98,7 +98,7 @@ async def fetch_async(self) -> WebhookInstance: method="GET", uri=self._uri, headers=headers ) - return WebhookInstance(self._version, payload) + return PortingWebhookConfigurationFetchInstance(self._version, payload) def __repr__(self) -> str: """ @@ -106,4 +106,4 @@ def __repr__(self) -> str: :returns: Machine friendly representation """ - return "" + return "" diff --git a/twilio/rest/verify/v2/verification_attempt.py b/twilio/rest/verify/v2/verification_attempt.py index 5c6989348a..129a65a5fb 100644 --- a/twilio/rest/verify/v2/verification_attempt.py +++ b/twilio/rest/verify/v2/verification_attempt.py @@ -29,6 +29,8 @@ class Channels(object): CALL = "call" EMAIL = "email" WHATSAPP = "whatsapp" + RBM = "rbm" + SNA = "sna" class ConversionStatus(object): CONVERTED = "converted" From a86b2e34169b6e031d6373250a9a69f0aecc9cfb Mon Sep 17 00:00:00 2001 From: Twilio Date: Thu, 12 Jun 2025 10:33:37 +0000 Subject: [PATCH 110/113] Release 9.6.3 --- setup.py | 2 +- twilio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index df6db04653..fc1072b943 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ setup( name="twilio", - version="9.6.2", + version="9.6.3", description="Twilio API client and TwiML generator", author="Twilio", help_center="https://www.twilio.com/help/contact", diff --git a/twilio/__init__.py b/twilio/__init__.py index 686194fe35..5ce3ed13d0 100644 --- a/twilio/__init__.py +++ b/twilio/__init__.py @@ -1,2 +1,2 @@ -__version_info__ = ("9", "6", "2") +__version_info__ = ("9", "6", "3") __version__ = ".".join(__version_info__) From 2f3de8feaf656b03c1f05d983f7b9fec8b4f8d4b Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 12 Jun 2025 17:09:36 +0530 Subject: [PATCH 111/113] chore: remove knowledge domain (#870) --- twilio/rest/__init__.py | 15 - twilio/rest/knowledge/KnowledgeBase.py | 44 - twilio/rest/knowledge/v1/__init__.py | 43 - .../rest/knowledge/v1/knowledge/__init__.py | 951 ------------------ twilio/rest/knowledge/v1/knowledge/chunk.py | 297 ------ .../v1/knowledge/knowledge_status.py | 196 ---- 6 files changed, 1546 deletions(-) delete mode 100644 twilio/rest/knowledge/KnowledgeBase.py delete mode 100644 twilio/rest/knowledge/v1/__init__.py delete mode 100644 twilio/rest/knowledge/v1/knowledge/__init__.py delete mode 100644 twilio/rest/knowledge/v1/knowledge/chunk.py delete mode 100644 twilio/rest/knowledge/v1/knowledge/knowledge_status.py diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index dc7741180b..5838363c52 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -29,7 +29,6 @@ from twilio.rest.insights import Insights from twilio.rest.intelligence import Intelligence from twilio.rest.ip_messaging import IpMessaging - from twilio.rest.knowledge import Knowledge from twilio.rest.lookups import Lookups from twilio.rest.marketplace import Marketplace from twilio.rest.messaging import Messaging @@ -143,7 +142,6 @@ def __init__( self._insights: Optional["Insights"] = None self._intelligence: Optional["Intelligence"] = None self._ip_messaging: Optional["IpMessaging"] = None - self._knowledge: Optional["Knowledge"] = None self._lookups: Optional["Lookups"] = None self._marketplace: Optional["Marketplace"] = None self._messaging: Optional["Messaging"] = None @@ -363,19 +361,6 @@ def ip_messaging(self) -> "IpMessaging": self._ip_messaging = IpMessaging(self) return self._ip_messaging - @property - def knowledge(self) -> "Knowledge": - """ - Access the Knowledge Twilio Domain - - :returns: Knowledge Twilio Domain - """ - if self._knowledge is None: - from twilio.rest.knowledge import Knowledge - - self._knowledge = Knowledge(self) - return self._knowledge - @property def lookups(self) -> "Lookups": """ diff --git a/twilio/rest/knowledge/KnowledgeBase.py b/twilio/rest/knowledge/KnowledgeBase.py deleted file mode 100644 index 902f0e8b96..0000000000 --- a/twilio/rest/knowledge/KnowledgeBase.py +++ /dev/null @@ -1,44 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional - -from twilio.base.domain import Domain -from twilio.rest import Client -from twilio.rest.knowledge.v1 import V1 - - -class KnowledgeBase(Domain): - - def __init__(self, twilio: Client): - """ - Initialize the Knowledge Domain - - :returns: Domain for Knowledge - """ - super().__init__(twilio, "https://knowledge.twilio.com") - self._v1: Optional[V1] = None - - @property - def v1(self) -> V1: - """ - :returns: Versions v1 of Knowledge - """ - if self._v1 is None: - self._v1 = V1(self) - return self._v1 - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/knowledge/v1/__init__.py b/twilio/rest/knowledge/v1/__init__.py deleted file mode 100644 index 9609bff951..0000000000 --- a/twilio/rest/knowledge/v1/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Knowledge - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.knowledge.v1.knowledge import KnowledgeList - - -class V1(Version): - - def __init__(self, domain: Domain): - """ - Initialize the V1 version of Knowledge - - :param domain: The Twilio.knowledge domain - """ - super().__init__(domain, "v1") - self._knowledge: Optional[KnowledgeList] = None - - @property - def knowledge(self) -> KnowledgeList: - if self._knowledge is None: - self._knowledge = KnowledgeList(self) - return self._knowledge - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/knowledge/v1/knowledge/__init__.py b/twilio/rest/knowledge/v1/knowledge/__init__.py deleted file mode 100644 index 17e6f1d4ad..0000000000 --- a/twilio/rest/knowledge/v1/knowledge/__init__.py +++ /dev/null @@ -1,951 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Knowledge - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.knowledge.v1.knowledge.chunk import ChunkList -from twilio.rest.knowledge.v1.knowledge.knowledge_status import KnowledgeStatusList - - -class KnowledgeInstance(InstanceResource): - - class KnowledgeV1ServiceCreateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the tool. - :ivar policy: - :ivar type: The type of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - class KnowledgeV1ServiceCreatePolicyRequest(object): - """ - :ivar description: The description of the policy. - :ivar id: The Policy ID. - :ivar name: The name of the policy. - :ivar policy_details: - :ivar type: The description of the policy. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.id: Optional[str] = payload.get("id") - self.name: Optional[str] = payload.get("name") - self.policy_details: Optional[Dict[str, object]] = payload.get( - "policy_details" - ) - self.type: Optional[str] = payload.get("type") - - def to_dict(self): - return { - "description": self.description, - "id": self.id, - "name": self.name, - "policy_details": self.policy_details, - "type": self.type, - } - - class KnowledgeV1ServiceUpdateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the knowledge source. - :ivar policy: - :ivar type: The description of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - """ - :ivar description: The type of knowledge source. - :ivar id: The description of knowledge. - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the knowledge source. - :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') - :ivar type: The type of knowledge source ('Web', 'Database', 'Text', 'File') - :ivar url: The url of the knowledge resource. - :ivar embedding_model: The embedding model to be used for the knowledge source. - :ivar date_created: The date and time in GMT when the Knowledge was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], id: Optional[str] = None - ): - super().__init__(version) - - self.description: Optional[str] = payload.get("description") - self.id: Optional[str] = payload.get("id") - self.account_sid: Optional[str] = payload.get("account_sid") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.status: Optional[str] = payload.get("status") - self.type: Optional[str] = payload.get("type") - self.url: Optional[str] = payload.get("url") - self.embedding_model: Optional[str] = payload.get("embedding_model") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - - self._solution = { - "id": id or self.id, - } - self._context: Optional[KnowledgeContext] = None - - @property - def _proxy(self) -> "KnowledgeContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: KnowledgeContext for this KnowledgeInstance - """ - if self._context is None: - self._context = KnowledgeContext( - self._version, - id=self._solution["id"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the KnowledgeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the KnowledgeInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "KnowledgeInstance": - """ - Fetch the KnowledgeInstance - - - :returns: The fetched KnowledgeInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "KnowledgeInstance": - """ - Asynchronous coroutine to fetch the KnowledgeInstance - - - :returns: The fetched KnowledgeInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - knowledge_v1_service_update_knowledge_request: Union[ - KnowledgeV1ServiceUpdateKnowledgeRequest, object - ] = values.unset, - ) -> "KnowledgeInstance": - """ - Update the KnowledgeInstance - - :param knowledge_v1_service_update_knowledge_request: - - :returns: The updated KnowledgeInstance - """ - return self._proxy.update( - knowledge_v1_service_update_knowledge_request=knowledge_v1_service_update_knowledge_request, - ) - - async def update_async( - self, - knowledge_v1_service_update_knowledge_request: Union[ - KnowledgeV1ServiceUpdateKnowledgeRequest, object - ] = values.unset, - ) -> "KnowledgeInstance": - """ - Asynchronous coroutine to update the KnowledgeInstance - - :param knowledge_v1_service_update_knowledge_request: - - :returns: The updated KnowledgeInstance - """ - return await self._proxy.update_async( - knowledge_v1_service_update_knowledge_request=knowledge_v1_service_update_knowledge_request, - ) - - @property - def chunks(self) -> ChunkList: - """ - Access the chunks - """ - return self._proxy.chunks - - @property - def knowledge_status(self) -> KnowledgeStatusList: - """ - Access the knowledge_status - """ - return self._proxy.knowledge_status - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class KnowledgeContext(InstanceContext): - - class KnowledgeV1ServiceCreateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the tool. - :ivar policy: - :ivar type: The type of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - class KnowledgeV1ServiceCreatePolicyRequest(object): - """ - :ivar description: The description of the policy. - :ivar id: The Policy ID. - :ivar name: The name of the policy. - :ivar policy_details: - :ivar type: The description of the policy. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.id: Optional[str] = payload.get("id") - self.name: Optional[str] = payload.get("name") - self.policy_details: Optional[Dict[str, object]] = payload.get( - "policy_details" - ) - self.type: Optional[str] = payload.get("type") - - def to_dict(self): - return { - "description": self.description, - "id": self.id, - "name": self.name, - "policy_details": self.policy_details, - "type": self.type, - } - - class KnowledgeV1ServiceUpdateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the knowledge source. - :ivar policy: - :ivar type: The description of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - def __init__(self, version: Version, id: str): - """ - Initialize the KnowledgeContext - - :param version: Version that contains the resource - :param id: - """ - super().__init__(version) - - # Path Solution - self._solution = { - "id": id, - } - self._uri = "/Knowledge/{id}".format(**self._solution) - - self._chunks: Optional[ChunkList] = None - self._knowledge_status: Optional[KnowledgeStatusList] = None - - def delete(self) -> bool: - """ - Deletes the KnowledgeInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the KnowledgeInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> KnowledgeInstance: - """ - Fetch the KnowledgeInstance - - - :returns: The fetched KnowledgeInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return KnowledgeInstance( - self._version, - payload, - id=self._solution["id"], - ) - - async def fetch_async(self) -> KnowledgeInstance: - """ - Asynchronous coroutine to fetch the KnowledgeInstance - - - :returns: The fetched KnowledgeInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return KnowledgeInstance( - self._version, - payload, - id=self._solution["id"], - ) - - def update( - self, - knowledge_v1_service_update_knowledge_request: Union[ - KnowledgeV1ServiceUpdateKnowledgeRequest, object - ] = values.unset, - ) -> KnowledgeInstance: - """ - Update the KnowledgeInstance - - :param knowledge_v1_service_update_knowledge_request: - - :returns: The updated KnowledgeInstance - """ - data = knowledge_v1_service_update_knowledge_request.to_dict() - - headers = values.of({}) - - headers["Content-Type"] = "application/json" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="PUT", uri=self._uri, data=data, headers=headers - ) - - return KnowledgeInstance(self._version, payload, id=self._solution["id"]) - - async def update_async( - self, - knowledge_v1_service_update_knowledge_request: Union[ - KnowledgeV1ServiceUpdateKnowledgeRequest, object - ] = values.unset, - ) -> KnowledgeInstance: - """ - Asynchronous coroutine to update the KnowledgeInstance - - :param knowledge_v1_service_update_knowledge_request: - - :returns: The updated KnowledgeInstance - """ - data = knowledge_v1_service_update_knowledge_request.to_dict() - - headers = values.of({}) - - headers["Content-Type"] = "application/json" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="PUT", uri=self._uri, data=data, headers=headers - ) - - return KnowledgeInstance(self._version, payload, id=self._solution["id"]) - - @property - def chunks(self) -> ChunkList: - """ - Access the chunks - """ - if self._chunks is None: - self._chunks = ChunkList( - self._version, - self._solution["id"], - ) - return self._chunks - - @property - def knowledge_status(self) -> KnowledgeStatusList: - """ - Access the knowledge_status - """ - if self._knowledge_status is None: - self._knowledge_status = KnowledgeStatusList( - self._version, - self._solution["id"], - ) - return self._knowledge_status - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class KnowledgePage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> KnowledgeInstance: - """ - Build an instance of KnowledgeInstance - - :param payload: Payload response from the API - """ - return KnowledgeInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class KnowledgeList(ListResource): - - class KnowledgeV1ServiceCreateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the tool. - :ivar policy: - :ivar type: The type of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's required for 'Database' type but disallowed for other types. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - class KnowledgeV1ServiceCreatePolicyRequest(object): - """ - :ivar description: The description of the policy. - :ivar id: The Policy ID. - :ivar name: The name of the policy. - :ivar policy_details: - :ivar type: The description of the policy. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.id: Optional[str] = payload.get("id") - self.name: Optional[str] = payload.get("name") - self.policy_details: Optional[Dict[str, object]] = payload.get( - "policy_details" - ) - self.type: Optional[str] = payload.get("type") - - def to_dict(self): - return { - "description": self.description, - "id": self.id, - "name": self.name, - "policy_details": self.policy_details, - "type": self.type, - } - - class KnowledgeV1ServiceUpdateKnowledgeRequest(object): - """ - :ivar description: The description of the knowledge source. - :ivar knowledge_source_details: The details of the knowledge source based on the type. - :ivar name: The name of the knowledge source. - :ivar policy: - :ivar type: The description of the knowledge source. - :ivar embedding_model: The embedding model to be used for the knowledge source. It's only applicable to 'Database' type. - """ - - def __init__(self, payload: Dict[str, Any]): - - self.description: Optional[str] = payload.get("description") - self.knowledge_source_details: Optional[Dict[str, object]] = payload.get( - "knowledge_source_details" - ) - self.name: Optional[str] = payload.get("name") - self.policy: Optional[ - KnowledgeList.KnowledgeV1ServiceCreatePolicyRequest - ] = payload.get("policy") - self.type: Optional[str] = payload.get("type") - self.embedding_model: Optional[str] = payload.get("embedding_model") - - def to_dict(self): - return { - "description": self.description, - "knowledge_source_details": self.knowledge_source_details, - "name": self.name, - "policy": self.policy.to_dict() if self.policy is not None else None, - "type": self.type, - "embedding_model": self.embedding_model, - } - - def __init__(self, version: Version): - """ - Initialize the KnowledgeList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Knowledge" - - def create( - self, - knowledge_v1_service_create_knowledge_request: KnowledgeV1ServiceCreateKnowledgeRequest, - ) -> KnowledgeInstance: - """ - Create the KnowledgeInstance - - :param knowledge_v1_service_create_knowledge_request: - - :returns: The created KnowledgeInstance - """ - data = knowledge_v1_service_create_knowledge_request.to_dict() - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/json" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return KnowledgeInstance(self._version, payload) - - async def create_async( - self, - knowledge_v1_service_create_knowledge_request: KnowledgeV1ServiceCreateKnowledgeRequest, - ) -> KnowledgeInstance: - """ - Asynchronously create the KnowledgeInstance - - :param knowledge_v1_service_create_knowledge_request: - - :returns: The created KnowledgeInstance - """ - data = knowledge_v1_service_create_knowledge_request.to_dict() - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/json" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return KnowledgeInstance(self._version, payload) - - def stream( - self, - tags: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[KnowledgeInstance]: - """ - Streams KnowledgeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str tags: Json array of tag and value pairs for tag filtering. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(tags=tags, page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - tags: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[KnowledgeInstance]: - """ - Asynchronously streams KnowledgeInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param str tags: Json array of tag and value pairs for tag filtering. - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(tags=tags, page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - tags: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[KnowledgeInstance]: - """ - Lists KnowledgeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str tags: Json array of tag and value pairs for tag filtering. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - tags=tags, - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - tags: Union[str, object] = values.unset, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[KnowledgeInstance]: - """ - Asynchronously lists KnowledgeInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param str tags: Json array of tag and value pairs for tag filtering. - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - tags=tags, - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - tags: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> KnowledgePage: - """ - Retrieve a single page of KnowledgeInstance records from the API. - Request is executed immediately - - :param tags: Json array of tag and value pairs for tag filtering. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of KnowledgeInstance - """ - data = values.of( - { - "Tags": tags, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return KnowledgePage(self._version, response) - - async def page_async( - self, - tags: Union[str, object] = values.unset, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> KnowledgePage: - """ - Asynchronously retrieve a single page of KnowledgeInstance records from the API. - Request is executed immediately - - :param tags: Json array of tag and value pairs for tag filtering. - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of KnowledgeInstance - """ - data = values.of( - { - "Tags": tags, - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return KnowledgePage(self._version, response) - - def get_page(self, target_url: str) -> KnowledgePage: - """ - Retrieve a specific page of KnowledgeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of KnowledgeInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return KnowledgePage(self._version, response) - - async def get_page_async(self, target_url: str) -> KnowledgePage: - """ - Asynchronously retrieve a specific page of KnowledgeInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of KnowledgeInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return KnowledgePage(self._version, response) - - def get(self, id: str) -> KnowledgeContext: - """ - Constructs a KnowledgeContext - - :param id: - """ - return KnowledgeContext(self._version, id=id) - - def __call__(self, id: str) -> KnowledgeContext: - """ - Constructs a KnowledgeContext - - :param id: - """ - return KnowledgeContext(self._version, id=id) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/knowledge/v1/knowledge/chunk.py b/twilio/rest/knowledge/v1/knowledge/chunk.py deleted file mode 100644 index 55c0b1be1a..0000000000 --- a/twilio/rest/knowledge/v1/knowledge/chunk.py +++ /dev/null @@ -1,297 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Knowledge - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values - -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class ChunkInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. - :ivar content: The chunk content. - :ivar metadata: The metadata of the chunk. - :ivar date_created: The date and time in GMT when the Chunk was created specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar date_updated: The date and time in GMT when the Chunk was updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - """ - - def __init__(self, version: Version, payload: Dict[str, Any], id: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.content: Optional[str] = payload.get("content") - self.metadata: Optional[Dict[str, object]] = payload.get("metadata") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - - self._solution = { - "id": id, - } - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class ChunkPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> ChunkInstance: - """ - Build an instance of ChunkInstance - - :param payload: Payload response from the API - """ - return ChunkInstance(self._version, payload, id=self._solution["id"]) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class ChunkList(ListResource): - - def __init__(self, version: Version, id: str): - """ - Initialize the ChunkList - - :param version: Version that contains the resource - :param id: The knowledge ID. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "id": id, - } - self._uri = "/Knowledge/{id}/Chunks".format(**self._solution) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[ChunkInstance]: - """ - Streams ChunkInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[ChunkInstance]: - """ - Asynchronously streams ChunkInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ChunkInstance]: - """ - Lists ChunkInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[ChunkInstance]: - """ - Asynchronously lists ChunkInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ChunkPage: - """ - Retrieve a single page of ChunkInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of ChunkInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return ChunkPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> ChunkPage: - """ - Asynchronously retrieve a single page of ChunkInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of ChunkInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return ChunkPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> ChunkPage: - """ - Retrieve a specific page of ChunkInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ChunkInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return ChunkPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> ChunkPage: - """ - Asynchronously retrieve a specific page of ChunkInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of ChunkInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return ChunkPage(self._version, response, self._solution) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/knowledge/v1/knowledge/knowledge_status.py b/twilio/rest/knowledge/v1/knowledge/knowledge_status.py deleted file mode 100644 index 984c577aac..0000000000 --- a/twilio/rest/knowledge/v1/knowledge/knowledge_status.py +++ /dev/null @@ -1,196 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Knowledge - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, Optional -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class KnowledgeStatusInstance(InstanceResource): - """ - :ivar account_sid: The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the Knowledge resource. - :ivar status: The status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') - :ivar last_status: The last status of processing the knowledge source ('QUEUED', 'PROCESSING', 'COMPLETED', 'FAILED') - :ivar date_updated: The date and time in GMT when the Knowledge was last updated specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - """ - - def __init__(self, version: Version, payload: Dict[str, Any], id: str): - super().__init__(version) - - self.account_sid: Optional[str] = payload.get("account_sid") - self.status: Optional[str] = payload.get("status") - self.last_status: Optional[str] = payload.get("last_status") - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - - self._solution = { - "id": id, - } - self._context: Optional[KnowledgeStatusContext] = None - - @property - def _proxy(self) -> "KnowledgeStatusContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: KnowledgeStatusContext for this KnowledgeStatusInstance - """ - if self._context is None: - self._context = KnowledgeStatusContext( - self._version, - id=self._solution["id"], - ) - return self._context - - def fetch(self) -> "KnowledgeStatusInstance": - """ - Fetch the KnowledgeStatusInstance - - - :returns: The fetched KnowledgeStatusInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "KnowledgeStatusInstance": - """ - Asynchronous coroutine to fetch the KnowledgeStatusInstance - - - :returns: The fetched KnowledgeStatusInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class KnowledgeStatusContext(InstanceContext): - - def __init__(self, version: Version, id: str): - """ - Initialize the KnowledgeStatusContext - - :param version: Version that contains the resource - :param id: the Knowledge ID. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "id": id, - } - self._uri = "/Knowledge/{id}/Status".format(**self._solution) - - def fetch(self) -> KnowledgeStatusInstance: - """ - Fetch the KnowledgeStatusInstance - - - :returns: The fetched KnowledgeStatusInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return KnowledgeStatusInstance( - self._version, - payload, - id=self._solution["id"], - ) - - async def fetch_async(self) -> KnowledgeStatusInstance: - """ - Asynchronous coroutine to fetch the KnowledgeStatusInstance - - - :returns: The fetched KnowledgeStatusInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return KnowledgeStatusInstance( - self._version, - payload, - id=self._solution["id"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class KnowledgeStatusList(ListResource): - - def __init__(self, version: Version, id: str): - """ - Initialize the KnowledgeStatusList - - :param version: Version that contains the resource - :param id: the Knowledge ID. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "id": id, - } - - def get(self) -> KnowledgeStatusContext: - """ - Constructs a KnowledgeStatusContext - - """ - return KnowledgeStatusContext(self._version, id=self._solution["id"]) - - def __call__(self) -> KnowledgeStatusContext: - """ - Constructs a KnowledgeStatusContext - - """ - return KnowledgeStatusContext(self._version, id=self._solution["id"]) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" From 6543c4a0a7aa2efe73c5bd5a8488ac7e16c90bff Mon Sep 17 00:00:00 2001 From: Shubham Date: Mon, 16 Jun 2025 13:04:39 +0530 Subject: [PATCH 112/113] chore: support Python 3.13 (#872) --- .github/workflows/test-and-deploy.yml | 2 +- README.md | 2 ++ setup.py | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index db745daca2..f5bd133256 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -17,7 +17,7 @@ jobs: timeout-minutes: 20 strategy: matrix: - python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12' ] + python-version: [ '3.8', '3.9', '3.10', '3.11', '3.12', '3.13' ] steps: - name: Checkout twilio-python uses: actions/checkout@v3 diff --git a/README.md b/README.md index e6382a5242..ed277788d1 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,8 @@ This library supports the following Python implementations: - Python 3.9 - Python 3.10 - Python 3.11 +- Python 3.12 +- Python 3.13 ## Installation diff --git a/setup.py b/setup.py index fc1072b943..97004e4a02 100644 --- a/setup.py +++ b/setup.py @@ -39,6 +39,8 @@ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Libraries :: Python Modules", "Topic :: Communications :: Telephony", From ee0714ccb52582db6fd853450546fda4c014d15e Mon Sep 17 00:00:00 2001 From: Ankit Khani <42815139+akhani18@users.noreply.github.com> Date: Tue, 17 Jun 2025 22:53:10 -0700 Subject: [PATCH 113/113] chore: Remove references to microvisor (#865) * Deprecate microvisor * Update __init__.py --- twilio/rest/__init__.py | 15 - twilio/rest/microvisor/MicrovisorBase.py | 44 -- twilio/rest/microvisor/__init__.py | 43 -- twilio/rest/microvisor/v1/__init__.py | 67 -- twilio/rest/microvisor/v1/account_config.py | 585 ---------------- twilio/rest/microvisor/v1/account_secret.py | 583 ---------------- twilio/rest/microvisor/v1/app/__init__.py | 485 -------------- twilio/rest/microvisor/v1/app/app_manifest.py | 193 ------ twilio/rest/microvisor/v1/device/__init__.py | 588 ----------------- .../microvisor/v1/device/device_config.py | 622 ------------------ .../microvisor/v1/device/device_secret.py | 620 ----------------- 11 files changed, 3845 deletions(-) delete mode 100644 twilio/rest/microvisor/MicrovisorBase.py delete mode 100644 twilio/rest/microvisor/__init__.py delete mode 100644 twilio/rest/microvisor/v1/__init__.py delete mode 100644 twilio/rest/microvisor/v1/account_config.py delete mode 100644 twilio/rest/microvisor/v1/account_secret.py delete mode 100644 twilio/rest/microvisor/v1/app/__init__.py delete mode 100644 twilio/rest/microvisor/v1/app/app_manifest.py delete mode 100644 twilio/rest/microvisor/v1/device/__init__.py delete mode 100644 twilio/rest/microvisor/v1/device/device_config.py delete mode 100644 twilio/rest/microvisor/v1/device/device_secret.py diff --git a/twilio/rest/__init__.py b/twilio/rest/__init__.py index 5838363c52..823cbbfaa0 100644 --- a/twilio/rest/__init__.py +++ b/twilio/rest/__init__.py @@ -32,7 +32,6 @@ from twilio.rest.lookups import Lookups from twilio.rest.marketplace import Marketplace from twilio.rest.messaging import Messaging - from twilio.rest.microvisor import Microvisor from twilio.rest.monitor import Monitor from twilio.rest.notify import Notify from twilio.rest.numbers import Numbers @@ -145,7 +144,6 @@ def __init__( self._lookups: Optional["Lookups"] = None self._marketplace: Optional["Marketplace"] = None self._messaging: Optional["Messaging"] = None - self._microvisor: Optional["Microvisor"] = None self._monitor: Optional["Monitor"] = None self._notify: Optional["Notify"] = None self._numbers: Optional["Numbers"] = None @@ -400,19 +398,6 @@ def messaging(self) -> "Messaging": self._messaging = Messaging(self) return self._messaging - @property - def microvisor(self) -> "Microvisor": - """ - Access the Microvisor Twilio Domain - - :returns: Microvisor Twilio Domain - """ - if self._microvisor is None: - from twilio.rest.microvisor import Microvisor - - self._microvisor = Microvisor(self) - return self._microvisor - @property def monitor(self) -> "Monitor": """ diff --git a/twilio/rest/microvisor/MicrovisorBase.py b/twilio/rest/microvisor/MicrovisorBase.py deleted file mode 100644 index e8c874b920..0000000000 --- a/twilio/rest/microvisor/MicrovisorBase.py +++ /dev/null @@ -1,44 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional - -from twilio.base.domain import Domain -from twilio.rest import Client -from twilio.rest.microvisor.v1 import V1 - - -class MicrovisorBase(Domain): - - def __init__(self, twilio: Client): - """ - Initialize the Microvisor Domain - - :returns: Domain for Microvisor - """ - super().__init__(twilio, "https://microvisor.twilio.com") - self._v1: Optional[V1] = None - - @property - def v1(self) -> V1: - """ - :returns: Versions v1 of Microvisor - """ - if self._v1 is None: - self._v1 = V1(self) - return self._v1 - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/microvisor/__init__.py b/twilio/rest/microvisor/__init__.py deleted file mode 100644 index 6bf448b29c..0000000000 --- a/twilio/rest/microvisor/__init__.py +++ /dev/null @@ -1,43 +0,0 @@ -from warnings import warn - -from twilio.rest.microvisor.MicrovisorBase import MicrovisorBase -from twilio.rest.microvisor.v1.account_config import AccountConfigList -from twilio.rest.microvisor.v1.account_secret import AccountSecretList -from twilio.rest.microvisor.v1.app import AppList -from twilio.rest.microvisor.v1.device import DeviceList - - -class Microvisor(MicrovisorBase): - @property - def account_configs(self) -> AccountConfigList: - warn( - "account_configs is deprecated. Use v1.account_configs instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.account_configs - - @property - def account_secrets(self) -> AccountSecretList: - warn( - "account_secrets is deprecated. Use v1.account_secrets instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.account_secrets - - @property - def apps(self) -> AppList: - warn( - "apps is deprecated. Use v1.apps instead.", DeprecationWarning, stacklevel=2 - ) - return self.v1.apps - - @property - def devices(self) -> DeviceList: - warn( - "devices is deprecated. Use v1.devices instead.", - DeprecationWarning, - stacklevel=2, - ) - return self.v1.devices diff --git a/twilio/rest/microvisor/v1/__init__.py b/twilio/rest/microvisor/v1/__init__.py deleted file mode 100644 index 22010d62e5..0000000000 --- a/twilio/rest/microvisor/v1/__init__.py +++ /dev/null @@ -1,67 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Microvisor - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Optional -from twilio.base.version import Version -from twilio.base.domain import Domain -from twilio.rest.microvisor.v1.account_config import AccountConfigList -from twilio.rest.microvisor.v1.account_secret import AccountSecretList -from twilio.rest.microvisor.v1.app import AppList -from twilio.rest.microvisor.v1.device import DeviceList - - -class V1(Version): - - def __init__(self, domain: Domain): - """ - Initialize the V1 version of Microvisor - - :param domain: The Twilio.microvisor domain - """ - super().__init__(domain, "v1") - self._account_configs: Optional[AccountConfigList] = None - self._account_secrets: Optional[AccountSecretList] = None - self._apps: Optional[AppList] = None - self._devices: Optional[DeviceList] = None - - @property - def account_configs(self) -> AccountConfigList: - if self._account_configs is None: - self._account_configs = AccountConfigList(self) - return self._account_configs - - @property - def account_secrets(self) -> AccountSecretList: - if self._account_secrets is None: - self._account_secrets = AccountSecretList(self) - return self._account_secrets - - @property - def apps(self) -> AppList: - if self._apps is None: - self._apps = AppList(self) - return self._apps - - @property - def devices(self) -> DeviceList: - if self._devices is None: - self._devices = DeviceList(self) - return self._devices - - def __repr__(self) -> str: - """ - Provide a friendly representation - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/microvisor/v1/account_config.py b/twilio/rest/microvisor/v1/account_config.py deleted file mode 100644 index 7faba8acb1..0000000000 --- a/twilio/rest/microvisor/v1/account_config.py +++ /dev/null @@ -1,585 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Microvisor - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class AccountConfigInstance(InstanceResource): - """ - :ivar key: The config key; up to 100 characters. - :ivar date_updated: - :ivar value: The config value; up to 4096 characters. - :ivar url: The absolute URL of the Config. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], key: Optional[str] = None - ): - super().__init__(version) - - self.key: Optional[str] = payload.get("key") - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.value: Optional[str] = payload.get("value") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "key": key or self.key, - } - self._context: Optional[AccountConfigContext] = None - - @property - def _proxy(self) -> "AccountConfigContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AccountConfigContext for this AccountConfigInstance - """ - if self._context is None: - self._context = AccountConfigContext( - self._version, - key=self._solution["key"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the AccountConfigInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AccountConfigInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "AccountConfigInstance": - """ - Fetch the AccountConfigInstance - - - :returns: The fetched AccountConfigInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AccountConfigInstance": - """ - Asynchronous coroutine to fetch the AccountConfigInstance - - - :returns: The fetched AccountConfigInstance - """ - return await self._proxy.fetch_async() - - def update(self, value: str) -> "AccountConfigInstance": - """ - Update the AccountConfigInstance - - :param value: The config value; up to 4096 characters. - - :returns: The updated AccountConfigInstance - """ - return self._proxy.update( - value=value, - ) - - async def update_async(self, value: str) -> "AccountConfigInstance": - """ - Asynchronous coroutine to update the AccountConfigInstance - - :param value: The config value; up to 4096 characters. - - :returns: The updated AccountConfigInstance - """ - return await self._proxy.update_async( - value=value, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AccountConfigContext(InstanceContext): - - def __init__(self, version: Version, key: str): - """ - Initialize the AccountConfigContext - - :param version: Version that contains the resource - :param key: The config key; up to 100 characters. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "key": key, - } - self._uri = "/Configs/{key}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the AccountConfigInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AccountConfigInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> AccountConfigInstance: - """ - Fetch the AccountConfigInstance - - - :returns: The fetched AccountConfigInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return AccountConfigInstance( - self._version, - payload, - key=self._solution["key"], - ) - - async def fetch_async(self) -> AccountConfigInstance: - """ - Asynchronous coroutine to fetch the AccountConfigInstance - - - :returns: The fetched AccountConfigInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return AccountConfigInstance( - self._version, - payload, - key=self._solution["key"], - ) - - def update(self, value: str) -> AccountConfigInstance: - """ - Update the AccountConfigInstance - - :param value: The config value; up to 4096 characters. - - :returns: The updated AccountConfigInstance - """ - - data = values.of( - { - "Value": value, - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return AccountConfigInstance(self._version, payload, key=self._solution["key"]) - - async def update_async(self, value: str) -> AccountConfigInstance: - """ - Asynchronous coroutine to update the AccountConfigInstance - - :param value: The config value; up to 4096 characters. - - :returns: The updated AccountConfigInstance - """ - - data = values.of( - { - "Value": value, - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return AccountConfigInstance(self._version, payload, key=self._solution["key"]) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AccountConfigPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> AccountConfigInstance: - """ - Build an instance of AccountConfigInstance - - :param payload: Payload response from the API - """ - return AccountConfigInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class AccountConfigList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the AccountConfigList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Configs" - - def create(self, key: str, value: str) -> AccountConfigInstance: - """ - Create the AccountConfigInstance - - :param key: The config key; up to 100 characters. - :param value: The config value; up to 4096 characters. - - :returns: The created AccountConfigInstance - """ - - data = values.of( - { - "Key": key, - "Value": value, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return AccountConfigInstance(self._version, payload) - - async def create_async(self, key: str, value: str) -> AccountConfigInstance: - """ - Asynchronously create the AccountConfigInstance - - :param key: The config key; up to 100 characters. - :param value: The config value; up to 4096 characters. - - :returns: The created AccountConfigInstance - """ - - data = values.of( - { - "Key": key, - "Value": value, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return AccountConfigInstance(self._version, payload) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[AccountConfigInstance]: - """ - Streams AccountConfigInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[AccountConfigInstance]: - """ - Asynchronously streams AccountConfigInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AccountConfigInstance]: - """ - Lists AccountConfigInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AccountConfigInstance]: - """ - Asynchronously lists AccountConfigInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AccountConfigPage: - """ - Retrieve a single page of AccountConfigInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AccountConfigInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return AccountConfigPage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AccountConfigPage: - """ - Asynchronously retrieve a single page of AccountConfigInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AccountConfigInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return AccountConfigPage(self._version, response) - - def get_page(self, target_url: str) -> AccountConfigPage: - """ - Retrieve a specific page of AccountConfigInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AccountConfigInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return AccountConfigPage(self._version, response) - - async def get_page_async(self, target_url: str) -> AccountConfigPage: - """ - Asynchronously retrieve a specific page of AccountConfigInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AccountConfigInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return AccountConfigPage(self._version, response) - - def get(self, key: str) -> AccountConfigContext: - """ - Constructs a AccountConfigContext - - :param key: The config key; up to 100 characters. - """ - return AccountConfigContext(self._version, key=key) - - def __call__(self, key: str) -> AccountConfigContext: - """ - Constructs a AccountConfigContext - - :param key: The config key; up to 100 characters. - """ - return AccountConfigContext(self._version, key=key) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/microvisor/v1/account_secret.py b/twilio/rest/microvisor/v1/account_secret.py deleted file mode 100644 index 13ca961e61..0000000000 --- a/twilio/rest/microvisor/v1/account_secret.py +++ /dev/null @@ -1,583 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Microvisor - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class AccountSecretInstance(InstanceResource): - """ - :ivar key: The secret key; up to 100 characters. - :ivar date_rotated: - :ivar url: The absolute URL of the Secret. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], key: Optional[str] = None - ): - super().__init__(version) - - self.key: Optional[str] = payload.get("key") - self.date_rotated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_rotated") - ) - self.url: Optional[str] = payload.get("url") - - self._solution = { - "key": key or self.key, - } - self._context: Optional[AccountSecretContext] = None - - @property - def _proxy(self) -> "AccountSecretContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AccountSecretContext for this AccountSecretInstance - """ - if self._context is None: - self._context = AccountSecretContext( - self._version, - key=self._solution["key"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the AccountSecretInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AccountSecretInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "AccountSecretInstance": - """ - Fetch the AccountSecretInstance - - - :returns: The fetched AccountSecretInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AccountSecretInstance": - """ - Asynchronous coroutine to fetch the AccountSecretInstance - - - :returns: The fetched AccountSecretInstance - """ - return await self._proxy.fetch_async() - - def update(self, value: str) -> "AccountSecretInstance": - """ - Update the AccountSecretInstance - - :param value: The secret value; up to 4096 characters. - - :returns: The updated AccountSecretInstance - """ - return self._proxy.update( - value=value, - ) - - async def update_async(self, value: str) -> "AccountSecretInstance": - """ - Asynchronous coroutine to update the AccountSecretInstance - - :param value: The secret value; up to 4096 characters. - - :returns: The updated AccountSecretInstance - """ - return await self._proxy.update_async( - value=value, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AccountSecretContext(InstanceContext): - - def __init__(self, version: Version, key: str): - """ - Initialize the AccountSecretContext - - :param version: Version that contains the resource - :param key: The secret key; up to 100 characters. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "key": key, - } - self._uri = "/Secrets/{key}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the AccountSecretInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AccountSecretInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> AccountSecretInstance: - """ - Fetch the AccountSecretInstance - - - :returns: The fetched AccountSecretInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return AccountSecretInstance( - self._version, - payload, - key=self._solution["key"], - ) - - async def fetch_async(self) -> AccountSecretInstance: - """ - Asynchronous coroutine to fetch the AccountSecretInstance - - - :returns: The fetched AccountSecretInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return AccountSecretInstance( - self._version, - payload, - key=self._solution["key"], - ) - - def update(self, value: str) -> AccountSecretInstance: - """ - Update the AccountSecretInstance - - :param value: The secret value; up to 4096 characters. - - :returns: The updated AccountSecretInstance - """ - - data = values.of( - { - "Value": value, - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return AccountSecretInstance(self._version, payload, key=self._solution["key"]) - - async def update_async(self, value: str) -> AccountSecretInstance: - """ - Asynchronous coroutine to update the AccountSecretInstance - - :param value: The secret value; up to 4096 characters. - - :returns: The updated AccountSecretInstance - """ - - data = values.of( - { - "Value": value, - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return AccountSecretInstance(self._version, payload, key=self._solution["key"]) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AccountSecretPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> AccountSecretInstance: - """ - Build an instance of AccountSecretInstance - - :param payload: Payload response from the API - """ - return AccountSecretInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class AccountSecretList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the AccountSecretList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Secrets" - - def create(self, key: str, value: str) -> AccountSecretInstance: - """ - Create the AccountSecretInstance - - :param key: The secret key; up to 100 characters. - :param value: The secret value; up to 4096 characters. - - :returns: The created AccountSecretInstance - """ - - data = values.of( - { - "Key": key, - "Value": value, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return AccountSecretInstance(self._version, payload) - - async def create_async(self, key: str, value: str) -> AccountSecretInstance: - """ - Asynchronously create the AccountSecretInstance - - :param key: The secret key; up to 100 characters. - :param value: The secret value; up to 4096 characters. - - :returns: The created AccountSecretInstance - """ - - data = values.of( - { - "Key": key, - "Value": value, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return AccountSecretInstance(self._version, payload) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[AccountSecretInstance]: - """ - Streams AccountSecretInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[AccountSecretInstance]: - """ - Asynchronously streams AccountSecretInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AccountSecretInstance]: - """ - Lists AccountSecretInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AccountSecretInstance]: - """ - Asynchronously lists AccountSecretInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AccountSecretPage: - """ - Retrieve a single page of AccountSecretInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AccountSecretInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return AccountSecretPage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AccountSecretPage: - """ - Asynchronously retrieve a single page of AccountSecretInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AccountSecretInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return AccountSecretPage(self._version, response) - - def get_page(self, target_url: str) -> AccountSecretPage: - """ - Retrieve a specific page of AccountSecretInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AccountSecretInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return AccountSecretPage(self._version, response) - - async def get_page_async(self, target_url: str) -> AccountSecretPage: - """ - Asynchronously retrieve a specific page of AccountSecretInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AccountSecretInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return AccountSecretPage(self._version, response) - - def get(self, key: str) -> AccountSecretContext: - """ - Constructs a AccountSecretContext - - :param key: The secret key; up to 100 characters. - """ - return AccountSecretContext(self._version, key=key) - - def __call__(self, key: str) -> AccountSecretContext: - """ - Constructs a AccountSecretContext - - :param key: The secret key; up to 100 characters. - """ - return AccountSecretContext(self._version, key=key) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/microvisor/v1/app/__init__.py b/twilio/rest/microvisor/v1/app/__init__.py deleted file mode 100644 index 8cfbbe68df..0000000000 --- a/twilio/rest/microvisor/v1/app/__init__.py +++ /dev/null @@ -1,485 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Microvisor - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.microvisor.v1.app.app_manifest import AppManifestList - - -class AppInstance(InstanceResource): - """ - :ivar sid: A 34-character string that uniquely identifies this App. - :ivar account_sid: The unique SID identifier of the Account. - :ivar hash: App manifest hash represented as `hash_algorithm:hash_value`. - :ivar unique_name: A developer-defined string that uniquely identifies the App. This value must be unique for all Apps on this Account. The `unique_name` value may be used as an alternative to the `sid` in the URL path to address the resource. - :ivar date_created: The date that this App was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar date_updated: The date that this App was last updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar url: The URL of this resource. - :ivar links: - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.account_sid: Optional[str] = payload.get("account_sid") - self.hash: Optional[str] = payload.get("hash") - self.unique_name: Optional[str] = payload.get("unique_name") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.url: Optional[str] = payload.get("url") - self.links: Optional[Dict[str, object]] = payload.get("links") - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[AppContext] = None - - @property - def _proxy(self) -> "AppContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AppContext for this AppInstance - """ - if self._context is None: - self._context = AppContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the AppInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AppInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "AppInstance": - """ - Fetch the AppInstance - - - :returns: The fetched AppInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AppInstance": - """ - Asynchronous coroutine to fetch the AppInstance - - - :returns: The fetched AppInstance - """ - return await self._proxy.fetch_async() - - @property - def app_manifests(self) -> AppManifestList: - """ - Access the app_manifests - """ - return self._proxy.app_manifests - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AppContext(InstanceContext): - - def __init__(self, version: Version, sid: str): - """ - Initialize the AppContext - - :param version: Version that contains the resource - :param sid: A 34-character string that uniquely identifies this App. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/Apps/{sid}".format(**self._solution) - - self._app_manifests: Optional[AppManifestList] = None - - def delete(self) -> bool: - """ - Deletes the AppInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the AppInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> AppInstance: - """ - Fetch the AppInstance - - - :returns: The fetched AppInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return AppInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> AppInstance: - """ - Asynchronous coroutine to fetch the AppInstance - - - :returns: The fetched AppInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return AppInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - @property - def app_manifests(self) -> AppManifestList: - """ - Access the app_manifests - """ - if self._app_manifests is None: - self._app_manifests = AppManifestList( - self._version, - self._solution["sid"], - ) - return self._app_manifests - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AppPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> AppInstance: - """ - Build an instance of AppInstance - - :param payload: Payload response from the API - """ - return AppInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class AppList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the AppList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Apps" - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[AppInstance]: - """ - Streams AppInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[AppInstance]: - """ - Asynchronously streams AppInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AppInstance]: - """ - Lists AppInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[AppInstance]: - """ - Asynchronously lists AppInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AppPage: - """ - Retrieve a single page of AppInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AppInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return AppPage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> AppPage: - """ - Asynchronously retrieve a single page of AppInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of AppInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return AppPage(self._version, response) - - def get_page(self, target_url: str) -> AppPage: - """ - Retrieve a specific page of AppInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AppInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return AppPage(self._version, response) - - async def get_page_async(self, target_url: str) -> AppPage: - """ - Asynchronously retrieve a specific page of AppInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of AppInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return AppPage(self._version, response) - - def get(self, sid: str) -> AppContext: - """ - Constructs a AppContext - - :param sid: A 34-character string that uniquely identifies this App. - """ - return AppContext(self._version, sid=sid) - - def __call__(self, sid: str) -> AppContext: - """ - Constructs a AppContext - - :param sid: A 34-character string that uniquely identifies this App. - """ - return AppContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/microvisor/v1/app/app_manifest.py b/twilio/rest/microvisor/v1/app/app_manifest.py deleted file mode 100644 index 0412cadcc1..0000000000 --- a/twilio/rest/microvisor/v1/app/app_manifest.py +++ /dev/null @@ -1,193 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Microvisor - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from typing import Any, Dict, Optional -from twilio.base import values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version - - -class AppManifestInstance(InstanceResource): - """ - :ivar app_sid: A 34-character string that uniquely identifies this App. - :ivar hash: App manifest hash represented as `hash_algorithm:hash_value`. - :ivar encoded_bytes: The base-64 encoded manifest - :ivar url: The absolute URL of this Manifest. - """ - - def __init__(self, version: Version, payload: Dict[str, Any], app_sid: str): - super().__init__(version) - - self.app_sid: Optional[str] = payload.get("app_sid") - self.hash: Optional[str] = payload.get("hash") - self.encoded_bytes: Optional[str] = payload.get("encoded_bytes") - self.url: Optional[str] = payload.get("url") - - self._solution = { - "app_sid": app_sid, - } - self._context: Optional[AppManifestContext] = None - - @property - def _proxy(self) -> "AppManifestContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: AppManifestContext for this AppManifestInstance - """ - if self._context is None: - self._context = AppManifestContext( - self._version, - app_sid=self._solution["app_sid"], - ) - return self._context - - def fetch(self) -> "AppManifestInstance": - """ - Fetch the AppManifestInstance - - - :returns: The fetched AppManifestInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "AppManifestInstance": - """ - Asynchronous coroutine to fetch the AppManifestInstance - - - :returns: The fetched AppManifestInstance - """ - return await self._proxy.fetch_async() - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AppManifestContext(InstanceContext): - - def __init__(self, version: Version, app_sid: str): - """ - Initialize the AppManifestContext - - :param version: Version that contains the resource - :param app_sid: A 34-character string that uniquely identifies this App. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "app_sid": app_sid, - } - self._uri = "/Apps/{app_sid}/Manifest".format(**self._solution) - - def fetch(self) -> AppManifestInstance: - """ - Fetch the AppManifestInstance - - - :returns: The fetched AppManifestInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return AppManifestInstance( - self._version, - payload, - app_sid=self._solution["app_sid"], - ) - - async def fetch_async(self) -> AppManifestInstance: - """ - Asynchronous coroutine to fetch the AppManifestInstance - - - :returns: The fetched AppManifestInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return AppManifestInstance( - self._version, - payload, - app_sid=self._solution["app_sid"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class AppManifestList(ListResource): - - def __init__(self, version: Version, app_sid: str): - """ - Initialize the AppManifestList - - :param version: Version that contains the resource - :param app_sid: A 34-character string that uniquely identifies this App. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "app_sid": app_sid, - } - - def get(self) -> AppManifestContext: - """ - Constructs a AppManifestContext - - """ - return AppManifestContext(self._version, app_sid=self._solution["app_sid"]) - - def __call__(self) -> AppManifestContext: - """ - Constructs a AppManifestContext - - """ - return AppManifestContext(self._version, app_sid=self._solution["app_sid"]) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/microvisor/v1/device/__init__.py b/twilio/rest/microvisor/v1/device/__init__.py deleted file mode 100644 index a3b3089162..0000000000 --- a/twilio/rest/microvisor/v1/device/__init__.py +++ /dev/null @@ -1,588 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Microvisor - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, serialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page -from twilio.rest.microvisor.v1.device.device_config import DeviceConfigList -from twilio.rest.microvisor.v1.device.device_secret import DeviceSecretList - - -class DeviceInstance(InstanceResource): - """ - :ivar sid: A 34-character string that uniquely identifies this Device. - :ivar unique_name: A developer-defined string that uniquely identifies the Device. This value must be unique for all Devices on this Account. The `unique_name` value may be used as an alternative to the `sid` in the URL path to address the resource. - :ivar account_sid: The unique SID identifier of the Account. - :ivar app: Information about the target App and the App reported by this Device. Contains the properties `target_sid`, `date_targeted`, `update_status` (one of `up-to-date`, `pending` and `error`), `update_error_code`, `reported_sid` and `date_reported`. - :ivar logging: Object specifying whether application logging is enabled for this Device. Contains the properties `enabled` and `date_expires`. - :ivar date_created: The date that this Device was created, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar date_updated: The date that this Device was last updated, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. - :ivar url: The URL of this resource. - :ivar links: The absolute URLs of related resources. - """ - - def __init__( - self, version: Version, payload: Dict[str, Any], sid: Optional[str] = None - ): - super().__init__(version) - - self.sid: Optional[str] = payload.get("sid") - self.unique_name: Optional[str] = payload.get("unique_name") - self.account_sid: Optional[str] = payload.get("account_sid") - self.app: Optional[Dict[str, object]] = payload.get("app") - self.logging: Optional[Dict[str, object]] = payload.get("logging") - self.date_created: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_created") - ) - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.url: Optional[str] = payload.get("url") - self.links: Optional[Dict[str, object]] = payload.get("links") - - self._solution = { - "sid": sid or self.sid, - } - self._context: Optional[DeviceContext] = None - - @property - def _proxy(self) -> "DeviceContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DeviceContext for this DeviceInstance - """ - if self._context is None: - self._context = DeviceContext( - self._version, - sid=self._solution["sid"], - ) - return self._context - - def fetch(self) -> "DeviceInstance": - """ - Fetch the DeviceInstance - - - :returns: The fetched DeviceInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DeviceInstance": - """ - Asynchronous coroutine to fetch the DeviceInstance - - - :returns: The fetched DeviceInstance - """ - return await self._proxy.fetch_async() - - def update( - self, - unique_name: Union[str, object] = values.unset, - target_app: Union[str, object] = values.unset, - logging_enabled: Union[bool, object] = values.unset, - restart_app: Union[bool, object] = values.unset, - ) -> "DeviceInstance": - """ - Update the DeviceInstance - - :param unique_name: A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. - :param target_app: The SID or unique name of the App to be targeted to the Device. - :param logging_enabled: A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. - :param restart_app: Set to true to restart the App running on the Device. - - :returns: The updated DeviceInstance - """ - return self._proxy.update( - unique_name=unique_name, - target_app=target_app, - logging_enabled=logging_enabled, - restart_app=restart_app, - ) - - async def update_async( - self, - unique_name: Union[str, object] = values.unset, - target_app: Union[str, object] = values.unset, - logging_enabled: Union[bool, object] = values.unset, - restart_app: Union[bool, object] = values.unset, - ) -> "DeviceInstance": - """ - Asynchronous coroutine to update the DeviceInstance - - :param unique_name: A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. - :param target_app: The SID or unique name of the App to be targeted to the Device. - :param logging_enabled: A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. - :param restart_app: Set to true to restart the App running on the Device. - - :returns: The updated DeviceInstance - """ - return await self._proxy.update_async( - unique_name=unique_name, - target_app=target_app, - logging_enabled=logging_enabled, - restart_app=restart_app, - ) - - @property - def device_configs(self) -> DeviceConfigList: - """ - Access the device_configs - """ - return self._proxy.device_configs - - @property - def device_secrets(self) -> DeviceSecretList: - """ - Access the device_secrets - """ - return self._proxy.device_secrets - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DeviceContext(InstanceContext): - - def __init__(self, version: Version, sid: str): - """ - Initialize the DeviceContext - - :param version: Version that contains the resource - :param sid: A 34-character string that uniquely identifies this Device. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "sid": sid, - } - self._uri = "/Devices/{sid}".format(**self._solution) - - self._device_configs: Optional[DeviceConfigList] = None - self._device_secrets: Optional[DeviceSecretList] = None - - def fetch(self) -> DeviceInstance: - """ - Fetch the DeviceInstance - - - :returns: The fetched DeviceInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return DeviceInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - async def fetch_async(self) -> DeviceInstance: - """ - Asynchronous coroutine to fetch the DeviceInstance - - - :returns: The fetched DeviceInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return DeviceInstance( - self._version, - payload, - sid=self._solution["sid"], - ) - - def update( - self, - unique_name: Union[str, object] = values.unset, - target_app: Union[str, object] = values.unset, - logging_enabled: Union[bool, object] = values.unset, - restart_app: Union[bool, object] = values.unset, - ) -> DeviceInstance: - """ - Update the DeviceInstance - - :param unique_name: A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. - :param target_app: The SID or unique name of the App to be targeted to the Device. - :param logging_enabled: A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. - :param restart_app: Set to true to restart the App running on the Device. - - :returns: The updated DeviceInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "TargetApp": target_app, - "LoggingEnabled": serialize.boolean_to_string(logging_enabled), - "RestartApp": serialize.boolean_to_string(restart_app), - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceInstance(self._version, payload, sid=self._solution["sid"]) - - async def update_async( - self, - unique_name: Union[str, object] = values.unset, - target_app: Union[str, object] = values.unset, - logging_enabled: Union[bool, object] = values.unset, - restart_app: Union[bool, object] = values.unset, - ) -> DeviceInstance: - """ - Asynchronous coroutine to update the DeviceInstance - - :param unique_name: A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. - :param target_app: The SID or unique name of the App to be targeted to the Device. - :param logging_enabled: A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. - :param restart_app: Set to true to restart the App running on the Device. - - :returns: The updated DeviceInstance - """ - - data = values.of( - { - "UniqueName": unique_name, - "TargetApp": target_app, - "LoggingEnabled": serialize.boolean_to_string(logging_enabled), - "RestartApp": serialize.boolean_to_string(restart_app), - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceInstance(self._version, payload, sid=self._solution["sid"]) - - @property - def device_configs(self) -> DeviceConfigList: - """ - Access the device_configs - """ - if self._device_configs is None: - self._device_configs = DeviceConfigList( - self._version, - self._solution["sid"], - ) - return self._device_configs - - @property - def device_secrets(self) -> DeviceSecretList: - """ - Access the device_secrets - """ - if self._device_secrets is None: - self._device_secrets = DeviceSecretList( - self._version, - self._solution["sid"], - ) - return self._device_secrets - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DevicePage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> DeviceInstance: - """ - Build an instance of DeviceInstance - - :param payload: Payload response from the API - """ - return DeviceInstance(self._version, payload) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class DeviceList(ListResource): - - def __init__(self, version: Version): - """ - Initialize the DeviceList - - :param version: Version that contains the resource - - """ - super().__init__(version) - - self._uri = "/Devices" - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[DeviceInstance]: - """ - Streams DeviceInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[DeviceInstance]: - """ - Asynchronously streams DeviceInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DeviceInstance]: - """ - Lists DeviceInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DeviceInstance]: - """ - Asynchronously lists DeviceInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DevicePage: - """ - Retrieve a single page of DeviceInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DeviceInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return DevicePage(self._version, response) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DevicePage: - """ - Asynchronously retrieve a single page of DeviceInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DeviceInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return DevicePage(self._version, response) - - def get_page(self, target_url: str) -> DevicePage: - """ - Retrieve a specific page of DeviceInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DeviceInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return DevicePage(self._version, response) - - async def get_page_async(self, target_url: str) -> DevicePage: - """ - Asynchronously retrieve a specific page of DeviceInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DeviceInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return DevicePage(self._version, response) - - def get(self, sid: str) -> DeviceContext: - """ - Constructs a DeviceContext - - :param sid: A 34-character string that uniquely identifies this Device. - """ - return DeviceContext(self._version, sid=sid) - - def __call__(self, sid: str) -> DeviceContext: - """ - Constructs a DeviceContext - - :param sid: A 34-character string that uniquely identifies this Device. - """ - return DeviceContext(self._version, sid=sid) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/microvisor/v1/device/device_config.py b/twilio/rest/microvisor/v1/device/device_config.py deleted file mode 100644 index b87063f53f..0000000000 --- a/twilio/rest/microvisor/v1/device/device_config.py +++ /dev/null @@ -1,622 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Microvisor - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class DeviceConfigInstance(InstanceResource): - """ - :ivar device_sid: A 34-character string that uniquely identifies the parent Device. - :ivar key: The config key; up to 100 characters. - :ivar value: The config value; up to 4096 characters. - :ivar date_updated: - :ivar url: The absolute URL of the Config. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - device_sid: str, - key: Optional[str] = None, - ): - super().__init__(version) - - self.device_sid: Optional[str] = payload.get("device_sid") - self.key: Optional[str] = payload.get("key") - self.value: Optional[str] = payload.get("value") - self.date_updated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_updated") - ) - self.url: Optional[str] = payload.get("url") - - self._solution = { - "device_sid": device_sid, - "key": key or self.key, - } - self._context: Optional[DeviceConfigContext] = None - - @property - def _proxy(self) -> "DeviceConfigContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DeviceConfigContext for this DeviceConfigInstance - """ - if self._context is None: - self._context = DeviceConfigContext( - self._version, - device_sid=self._solution["device_sid"], - key=self._solution["key"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the DeviceConfigInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DeviceConfigInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "DeviceConfigInstance": - """ - Fetch the DeviceConfigInstance - - - :returns: The fetched DeviceConfigInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DeviceConfigInstance": - """ - Asynchronous coroutine to fetch the DeviceConfigInstance - - - :returns: The fetched DeviceConfigInstance - """ - return await self._proxy.fetch_async() - - def update(self, value: str) -> "DeviceConfigInstance": - """ - Update the DeviceConfigInstance - - :param value: The config value; up to 4096 characters. - - :returns: The updated DeviceConfigInstance - """ - return self._proxy.update( - value=value, - ) - - async def update_async(self, value: str) -> "DeviceConfigInstance": - """ - Asynchronous coroutine to update the DeviceConfigInstance - - :param value: The config value; up to 4096 characters. - - :returns: The updated DeviceConfigInstance - """ - return await self._proxy.update_async( - value=value, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DeviceConfigContext(InstanceContext): - - def __init__(self, version: Version, device_sid: str, key: str): - """ - Initialize the DeviceConfigContext - - :param version: Version that contains the resource - :param device_sid: A 34-character string that uniquely identifies the Device. - :param key: The config key; up to 100 characters. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "device_sid": device_sid, - "key": key, - } - self._uri = "/Devices/{device_sid}/Configs/{key}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the DeviceConfigInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DeviceConfigInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> DeviceConfigInstance: - """ - Fetch the DeviceConfigInstance - - - :returns: The fetched DeviceConfigInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return DeviceConfigInstance( - self._version, - payload, - device_sid=self._solution["device_sid"], - key=self._solution["key"], - ) - - async def fetch_async(self) -> DeviceConfigInstance: - """ - Asynchronous coroutine to fetch the DeviceConfigInstance - - - :returns: The fetched DeviceConfigInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return DeviceConfigInstance( - self._version, - payload, - device_sid=self._solution["device_sid"], - key=self._solution["key"], - ) - - def update(self, value: str) -> DeviceConfigInstance: - """ - Update the DeviceConfigInstance - - :param value: The config value; up to 4096 characters. - - :returns: The updated DeviceConfigInstance - """ - - data = values.of( - { - "Value": value, - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceConfigInstance( - self._version, - payload, - device_sid=self._solution["device_sid"], - key=self._solution["key"], - ) - - async def update_async(self, value: str) -> DeviceConfigInstance: - """ - Asynchronous coroutine to update the DeviceConfigInstance - - :param value: The config value; up to 4096 characters. - - :returns: The updated DeviceConfigInstance - """ - - data = values.of( - { - "Value": value, - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceConfigInstance( - self._version, - payload, - device_sid=self._solution["device_sid"], - key=self._solution["key"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DeviceConfigPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> DeviceConfigInstance: - """ - Build an instance of DeviceConfigInstance - - :param payload: Payload response from the API - """ - return DeviceConfigInstance( - self._version, payload, device_sid=self._solution["device_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class DeviceConfigList(ListResource): - - def __init__(self, version: Version, device_sid: str): - """ - Initialize the DeviceConfigList - - :param version: Version that contains the resource - :param device_sid: A 34-character string that uniquely identifies the Device. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "device_sid": device_sid, - } - self._uri = "/Devices/{device_sid}/Configs".format(**self._solution) - - def create(self, key: str, value: str) -> DeviceConfigInstance: - """ - Create the DeviceConfigInstance - - :param key: The config key; up to 100 characters. - :param value: The config value; up to 4096 characters. - - :returns: The created DeviceConfigInstance - """ - - data = values.of( - { - "Key": key, - "Value": value, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceConfigInstance( - self._version, payload, device_sid=self._solution["device_sid"] - ) - - async def create_async(self, key: str, value: str) -> DeviceConfigInstance: - """ - Asynchronously create the DeviceConfigInstance - - :param key: The config key; up to 100 characters. - :param value: The config value; up to 4096 characters. - - :returns: The created DeviceConfigInstance - """ - - data = values.of( - { - "Key": key, - "Value": value, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceConfigInstance( - self._version, payload, device_sid=self._solution["device_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[DeviceConfigInstance]: - """ - Streams DeviceConfigInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[DeviceConfigInstance]: - """ - Asynchronously streams DeviceConfigInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DeviceConfigInstance]: - """ - Lists DeviceConfigInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DeviceConfigInstance]: - """ - Asynchronously lists DeviceConfigInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DeviceConfigPage: - """ - Retrieve a single page of DeviceConfigInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DeviceConfigInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return DeviceConfigPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DeviceConfigPage: - """ - Asynchronously retrieve a single page of DeviceConfigInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DeviceConfigInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return DeviceConfigPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> DeviceConfigPage: - """ - Retrieve a specific page of DeviceConfigInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DeviceConfigInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return DeviceConfigPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> DeviceConfigPage: - """ - Asynchronously retrieve a specific page of DeviceConfigInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DeviceConfigInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return DeviceConfigPage(self._version, response, self._solution) - - def get(self, key: str) -> DeviceConfigContext: - """ - Constructs a DeviceConfigContext - - :param key: The config key; up to 100 characters. - """ - return DeviceConfigContext( - self._version, device_sid=self._solution["device_sid"], key=key - ) - - def __call__(self, key: str) -> DeviceConfigContext: - """ - Constructs a DeviceConfigContext - - :param key: The config key; up to 100 characters. - """ - return DeviceConfigContext( - self._version, device_sid=self._solution["device_sid"], key=key - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" diff --git a/twilio/rest/microvisor/v1/device/device_secret.py b/twilio/rest/microvisor/v1/device/device_secret.py deleted file mode 100644 index 30b805ea6b..0000000000 --- a/twilio/rest/microvisor/v1/device/device_secret.py +++ /dev/null @@ -1,620 +0,0 @@ -r""" - This code was generated by - ___ _ _ _ _ _ _ ____ ____ ____ _ ____ ____ _ _ ____ ____ ____ ___ __ __ - | | | | | | | | | __ | | |__| | __ | __ |___ |\ | |___ |__/ |__| | | | |__/ - | |_|_| | |___ | |__| |__| | | | |__] |___ | \| |___ | \ | | | |__| | \ - - Twilio - Microvisor - This is the public Twilio REST API. - - NOTE: This class is auto generated by OpenAPI Generator. - https://openapi-generator.tech - Do not edit the class manually. -""" - -from datetime import datetime -from typing import Any, Dict, List, Optional, Union, Iterator, AsyncIterator -from twilio.base import deserialize, values -from twilio.base.instance_context import InstanceContext -from twilio.base.instance_resource import InstanceResource -from twilio.base.list_resource import ListResource -from twilio.base.version import Version -from twilio.base.page import Page - - -class DeviceSecretInstance(InstanceResource): - """ - :ivar device_sid: A 34-character string that uniquely identifies the parent Device. - :ivar key: The secret key; up to 100 characters. - :ivar date_rotated: - :ivar url: The absolute URL of the Secret. - """ - - def __init__( - self, - version: Version, - payload: Dict[str, Any], - device_sid: str, - key: Optional[str] = None, - ): - super().__init__(version) - - self.device_sid: Optional[str] = payload.get("device_sid") - self.key: Optional[str] = payload.get("key") - self.date_rotated: Optional[datetime] = deserialize.iso8601_datetime( - payload.get("date_rotated") - ) - self.url: Optional[str] = payload.get("url") - - self._solution = { - "device_sid": device_sid, - "key": key or self.key, - } - self._context: Optional[DeviceSecretContext] = None - - @property - def _proxy(self) -> "DeviceSecretContext": - """ - Generate an instance context for the instance, the context is capable of - performing various actions. All instance actions are proxied to the context - - :returns: DeviceSecretContext for this DeviceSecretInstance - """ - if self._context is None: - self._context = DeviceSecretContext( - self._version, - device_sid=self._solution["device_sid"], - key=self._solution["key"], - ) - return self._context - - def delete(self) -> bool: - """ - Deletes the DeviceSecretInstance - - - :returns: True if delete succeeds, False otherwise - """ - return self._proxy.delete() - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DeviceSecretInstance - - - :returns: True if delete succeeds, False otherwise - """ - return await self._proxy.delete_async() - - def fetch(self) -> "DeviceSecretInstance": - """ - Fetch the DeviceSecretInstance - - - :returns: The fetched DeviceSecretInstance - """ - return self._proxy.fetch() - - async def fetch_async(self) -> "DeviceSecretInstance": - """ - Asynchronous coroutine to fetch the DeviceSecretInstance - - - :returns: The fetched DeviceSecretInstance - """ - return await self._proxy.fetch_async() - - def update(self, value: str) -> "DeviceSecretInstance": - """ - Update the DeviceSecretInstance - - :param value: The secret value; up to 4096 characters. - - :returns: The updated DeviceSecretInstance - """ - return self._proxy.update( - value=value, - ) - - async def update_async(self, value: str) -> "DeviceSecretInstance": - """ - Asynchronous coroutine to update the DeviceSecretInstance - - :param value: The secret value; up to 4096 characters. - - :returns: The updated DeviceSecretInstance - """ - return await self._proxy.update_async( - value=value, - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DeviceSecretContext(InstanceContext): - - def __init__(self, version: Version, device_sid: str, key: str): - """ - Initialize the DeviceSecretContext - - :param version: Version that contains the resource - :param device_sid: A 34-character string that uniquely identifies the Device. - :param key: The secret key; up to 100 characters. - """ - super().__init__(version) - - # Path Solution - self._solution = { - "device_sid": device_sid, - "key": key, - } - self._uri = "/Devices/{device_sid}/Secrets/{key}".format(**self._solution) - - def delete(self) -> bool: - """ - Deletes the DeviceSecretInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return self._version.delete(method="DELETE", uri=self._uri, headers=headers) - - async def delete_async(self) -> bool: - """ - Asynchronous coroutine that deletes the DeviceSecretInstance - - - :returns: True if delete succeeds, False otherwise - """ - - headers = values.of({}) - - return await self._version.delete_async( - method="DELETE", uri=self._uri, headers=headers - ) - - def fetch(self) -> DeviceSecretInstance: - """ - Fetch the DeviceSecretInstance - - - :returns: The fetched DeviceSecretInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = self._version.fetch(method="GET", uri=self._uri, headers=headers) - - return DeviceSecretInstance( - self._version, - payload, - device_sid=self._solution["device_sid"], - key=self._solution["key"], - ) - - async def fetch_async(self) -> DeviceSecretInstance: - """ - Asynchronous coroutine to fetch the DeviceSecretInstance - - - :returns: The fetched DeviceSecretInstance - """ - - headers = values.of({}) - - headers["Accept"] = "application/json" - - payload = await self._version.fetch_async( - method="GET", uri=self._uri, headers=headers - ) - - return DeviceSecretInstance( - self._version, - payload, - device_sid=self._solution["device_sid"], - key=self._solution["key"], - ) - - def update(self, value: str) -> DeviceSecretInstance: - """ - Update the DeviceSecretInstance - - :param value: The secret value; up to 4096 characters. - - :returns: The updated DeviceSecretInstance - """ - - data = values.of( - { - "Value": value, - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.update( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceSecretInstance( - self._version, - payload, - device_sid=self._solution["device_sid"], - key=self._solution["key"], - ) - - async def update_async(self, value: str) -> DeviceSecretInstance: - """ - Asynchronous coroutine to update the DeviceSecretInstance - - :param value: The secret value; up to 4096 characters. - - :returns: The updated DeviceSecretInstance - """ - - data = values.of( - { - "Value": value, - } - ) - headers = values.of({}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.update_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceSecretInstance( - self._version, - payload, - device_sid=self._solution["device_sid"], - key=self._solution["key"], - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - context = " ".join("{}={}".format(k, v) for k, v in self._solution.items()) - return "".format(context) - - -class DeviceSecretPage(Page): - - def get_instance(self, payload: Dict[str, Any]) -> DeviceSecretInstance: - """ - Build an instance of DeviceSecretInstance - - :param payload: Payload response from the API - """ - return DeviceSecretInstance( - self._version, payload, device_sid=self._solution["device_sid"] - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return "" - - -class DeviceSecretList(ListResource): - - def __init__(self, version: Version, device_sid: str): - """ - Initialize the DeviceSecretList - - :param version: Version that contains the resource - :param device_sid: A 34-character string that uniquely identifies the Device. - - """ - super().__init__(version) - - # Path Solution - self._solution = { - "device_sid": device_sid, - } - self._uri = "/Devices/{device_sid}/Secrets".format(**self._solution) - - def create(self, key: str, value: str) -> DeviceSecretInstance: - """ - Create the DeviceSecretInstance - - :param key: The secret key; up to 100 characters. - :param value: The secret value; up to 4096 characters. - - :returns: The created DeviceSecretInstance - """ - - data = values.of( - { - "Key": key, - "Value": value, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = self._version.create( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceSecretInstance( - self._version, payload, device_sid=self._solution["device_sid"] - ) - - async def create_async(self, key: str, value: str) -> DeviceSecretInstance: - """ - Asynchronously create the DeviceSecretInstance - - :param key: The secret key; up to 100 characters. - :param value: The secret value; up to 4096 characters. - - :returns: The created DeviceSecretInstance - """ - - data = values.of( - { - "Key": key, - "Value": value, - } - ) - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Content-Type"] = "application/x-www-form-urlencoded" - - headers["Accept"] = "application/json" - - payload = await self._version.create_async( - method="POST", uri=self._uri, data=data, headers=headers - ) - - return DeviceSecretInstance( - self._version, payload, device_sid=self._solution["device_sid"] - ) - - def stream( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> Iterator[DeviceSecretInstance]: - """ - Streams DeviceSecretInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = self.page(page_size=limits["page_size"]) - - return self._version.stream(page, limits["limit"]) - - async def stream_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> AsyncIterator[DeviceSecretInstance]: - """ - Asynchronously streams DeviceSecretInstance records from the API as a generator stream. - This operation lazily loads records as efficiently as possible until the limit - is reached. - The results are returned as a generator, so this operation is memory efficient. - - :param limit: Upper limit for the number of records to return. stream() - guarantees to never return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, stream() will attempt to read the - limit with the most efficient page size, i.e. min(limit, 1000) - - :returns: Generator that will yield up to limit results - """ - limits = self._version.read_limits(limit, page_size) - page = await self.page_async(page_size=limits["page_size"]) - - return self._version.stream_async(page, limits["limit"]) - - def list( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DeviceSecretInstance]: - """ - Lists DeviceSecretInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return list( - self.stream( - limit=limit, - page_size=page_size, - ) - ) - - async def list_async( - self, - limit: Optional[int] = None, - page_size: Optional[int] = None, - ) -> List[DeviceSecretInstance]: - """ - Asynchronously lists DeviceSecretInstance records from the API as a list. - Unlike stream(), this operation is eager and will load `limit` records into - memory before returning. - - :param limit: Upper limit for the number of records to return. list() guarantees - never to return more than limit. Default is no limit - :param page_size: Number of records to fetch per request, when not set will use - the default value of 50 records. If no page_size is defined - but a limit is defined, list() will attempt to read the limit - with the most efficient page size, i.e. min(limit, 1000) - - :returns: list that will contain up to limit results - """ - return [ - record - async for record in await self.stream_async( - limit=limit, - page_size=page_size, - ) - ] - - def page( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DeviceSecretPage: - """ - Retrieve a single page of DeviceSecretInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DeviceSecretInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = self._version.page( - method="GET", uri=self._uri, params=data, headers=headers - ) - return DeviceSecretPage(self._version, response, self._solution) - - async def page_async( - self, - page_token: Union[str, object] = values.unset, - page_number: Union[int, object] = values.unset, - page_size: Union[int, object] = values.unset, - ) -> DeviceSecretPage: - """ - Asynchronously retrieve a single page of DeviceSecretInstance records from the API. - Request is executed immediately - - :param page_token: PageToken provided by the API - :param page_number: Page Number, this value is simply for client state - :param page_size: Number of records to return, defaults to 50 - - :returns: Page of DeviceSecretInstance - """ - data = values.of( - { - "PageToken": page_token, - "Page": page_number, - "PageSize": page_size, - } - ) - - headers = values.of({"Content-Type": "application/x-www-form-urlencoded"}) - - headers["Accept"] = "application/json" - - response = await self._version.page_async( - method="GET", uri=self._uri, params=data, headers=headers - ) - return DeviceSecretPage(self._version, response, self._solution) - - def get_page(self, target_url: str) -> DeviceSecretPage: - """ - Retrieve a specific page of DeviceSecretInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DeviceSecretInstance - """ - response = self._version.domain.twilio.request("GET", target_url) - return DeviceSecretPage(self._version, response, self._solution) - - async def get_page_async(self, target_url: str) -> DeviceSecretPage: - """ - Asynchronously retrieve a specific page of DeviceSecretInstance records from the API. - Request is executed immediately - - :param target_url: API-generated URL for the requested results page - - :returns: Page of DeviceSecretInstance - """ - response = await self._version.domain.twilio.request_async("GET", target_url) - return DeviceSecretPage(self._version, response, self._solution) - - def get(self, key: str) -> DeviceSecretContext: - """ - Constructs a DeviceSecretContext - - :param key: The secret key; up to 100 characters. - """ - return DeviceSecretContext( - self._version, device_sid=self._solution["device_sid"], key=key - ) - - def __call__(self, key: str) -> DeviceSecretContext: - """ - Constructs a DeviceSecretContext - - :param key: The secret key; up to 100 characters. - """ - return DeviceSecretContext( - self._version, device_sid=self._solution["device_sid"], key=key - ) - - def __repr__(self) -> str: - """ - Provide a friendly representation - - :returns: Machine friendly representation - """ - return ""