twilio-ruby 7.10.7 → 7.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test-and-deploy.yml +43 -67
- data/.gitignore +0 -1
- data/CHANGES.md +267 -0
- data/Gemfile +2 -0
- data/Gemfile.lock +154 -0
- data/README.md +3 -3
- data/Rakefile +1 -1
- data/lib/rack/twilio_webhook_authentication.rb +45 -2
- data/lib/twilio-ruby/rest/accounts/v1/auth_token_promotion.rb +25 -65
- data/lib/twilio-ruby/rest/accounts/v1/bulk_consents.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/bulk_contacts.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/messaging_geopermissions.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/safelist.rb +0 -59
- data/lib/twilio-ruby/rest/accounts/v1/secondary_auth_token.rb +48 -71
- data/lib/twilio-ruby/rest/api/v2010/account/balance.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/payment.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/siprec.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/stream.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/transcription.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call/user_defined_message_subscription.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +6 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +56 -2
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +6 -0
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload/data.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_calls.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types/auth_type_registrations.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/auth_types.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +0 -59
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +0 -59
- data/lib/twilio-ruby/rest/bulkexports/v1/export/job.rb +0 -59
- data/lib/twilio-ruby/rest/bulkexports/v1/export.rb +0 -59
- data/lib/twilio-ruby/rest/bulkexports/v1/export_configuration.rb +0 -59
- data/lib/twilio-ruby/rest/chat/v3/channel.rb +0 -59
- data/lib/twilio-ruby/rest/client.rb +0 -5
- data/lib/twilio-ruby/rest/content/v1/content/approval_create.rb +11 -60
- data/lib/twilio-ruby/rest/content/v1/content/approval_fetch.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/configuration/webhook.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/configuration.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/conversation/message.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v1/conversation_with_participants.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/notification.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration/webhook.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/service/configuration.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation/message.rb +10 -10
- data/lib/twilio-ruby/rest/conversations/v1/service/conversation_with_participants.rb +0 -59
- data/lib/twilio-ruby/rest/conversations/v2/action.rb +2 -61
- data/lib/twilio-ruby/rest/conversations/v2/communication.rb +43 -21
- data/lib/twilio-ruby/rest/conversations/v2/configuration.rb +584 -21
- data/lib/twilio-ruby/rest/conversations/v2/conversation.rb +28 -28
- data/lib/twilio-ruby/rest/conversations/v2/operation.rb +10 -69
- data/lib/twilio-ruby/rest/conversations/v2/participant.rb +58 -58
- data/lib/twilio-ruby/rest/conversations/v2.rb +55 -49
- data/lib/twilio-ruby/rest/events/v1/schema.rb +0 -59
- data/lib/twilio-ruby/rest/events/v1/sink/sink_test.rb +0 -59
- data/lib/twilio-ruby/rest/events/v1/sink/sink_validate.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/assessments.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/configuration.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/insights_assessments_comment.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/insights_conversations.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_category.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/insights_questionnaires_question.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/insights_segments.rb +12 -14
- data/lib/twilio-ruby/rest/flex_api/v1/insights_session.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_answer_sets.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/insights_settings_comment.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/insights_user_roles.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/interaction/interaction_channel/interaction_transfer.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/interaction.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/plugin/plugin_versions.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/plugin.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_archive.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration/configured_plugin.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_configuration_archive.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_release.rb +2 -4
- data/lib/twilio-ruby/rest/flex_api/v1/plugin_version_archive.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v1/provisioning_status.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v2/flex_user.rb +0 -59
- data/lib/twilio-ruby/rest/flex_api/v2/web_channels.rb +0 -59
- data/lib/twilio-ruby/rest/frontline_api/v1/user.rb +0 -59
- data/lib/twilio-ruby/rest/iam/v1/api_key.rb +0 -59
- data/lib/twilio-ruby/rest/iam/v1/new_api_key.rb +2 -61
- data/lib/twilio-ruby/rest/iam/v1/o_auth_app.rb +15 -61
- data/lib/twilio-ruby/rest/iam/v1/token.rb +0 -59
- data/lib/twilio-ruby/rest/iam_base.rb +6 -1
- data/lib/twilio-ruby/rest/insights/v1/call/annotation.rb +0 -59
- data/lib/twilio-ruby/rest/insights/v1/call/call_summary.rb +7 -59
- data/lib/twilio-ruby/rest/insights/v1/call/event.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/call.rb +0 -59
- data/lib/twilio-ruby/rest/insights/v1/call_summaries.rb +7 -0
- data/lib/twilio-ruby/rest/insights/v1/setting.rb +0 -59
- data/lib/twilio-ruby/rest/insights/v2/inbound.rb +2 -261
- data/lib/twilio-ruby/rest/insights/v2/inbound_report.rb +258 -0
- data/lib/twilio-ruby/rest/insights/v2/outbound.rb +18 -299
- data/lib/twilio-ruby/rest/insights/v2/outbound_report.rb +258 -0
- data/lib/twilio-ruby/rest/insights/v2/report.rb +27 -184
- data/lib/twilio-ruby/rest/insights/v2.rb +14 -4
- data/lib/twilio-ruby/rest/insights/v3/metadata.rb +1 -60
- data/lib/twilio-ruby/rest/insights/v3/query.rb +1 -60
- data/lib/twilio-ruby/rest/insights/v3/query_job.rb +654 -0
- data/lib/twilio-ruby/rest/insights/v3/result.rb +195 -0
- data/lib/twilio-ruby/rest/insights/v3.rb +17 -1
- data/lib/twilio-ruby/rest/intelligence/v2/operator_attachment.rb +0 -59
- data/lib/twilio-ruby/rest/intelligence/v2/operator_attachments.rb +0 -59
- data/lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_operator_results.rb +0 -59
- data/lib/twilio-ruby/rest/intelligence/v2/transcript/encrypted_sentences.rb +0 -59
- data/lib/twilio-ruby/rest/intelligence/v2/transcript/media.rb +0 -59
- data/lib/twilio-ruby/rest/intelligence/v3/conversation.rb +8 -8
- data/lib/twilio-ruby/rest/intelligence/v3/rule_execution.rb +443 -0
- data/lib/twilio-ruby/rest/intelligence/v3.rb +6 -0
- data/lib/twilio-ruby/rest/knowledge/v1/knowledge/knowledge_status.rb +0 -59
- data/lib/twilio-ruby/rest/knowledge/v2/chunk.rb +28 -0
- data/lib/twilio-ruby/rest/knowledge/v2/knowledge.rb +38 -0
- data/lib/twilio-ruby/rest/knowledge/v2/operation.rb +0 -59
- data/lib/twilio-ruby/rest/knowledge/v2/search.rb +8 -176
- data/lib/twilio-ruby/rest/knowledge/v2.rb +1 -2
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v2/bucket.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v2/lookup_override.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v2/phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v2/query.rb +0 -59
- data/lib/twilio-ruby/rest/lookups/v2/rate_limit.rb +0 -59
- data/lib/twilio-ruby/rest/marketplace/v1/installed_add_on/installed_add_on_usage.rb +0 -59
- data/lib/twilio-ruby/rest/marketplace/v1/module_data.rb +0 -59
- data/lib/twilio-ruby/rest/marketplace/v1/module_data_management.rb +0 -59
- data/lib/twilio-ruby/rest/marketplace/v1/referral_conversion.rb +0 -59
- data/lib/twilio-ruby/rest/memory/v1/bulk.rb +9 -177
- data/lib/twilio-ruby/rest/memory/v1/conversation_summary.rb +15 -9
- data/lib/twilio-ruby/rest/memory/v1/data_mapping.rb +6 -12
- data/lib/twilio-ruby/rest/memory/v1/identifier.rb +1 -81
- data/lib/twilio-ruby/rest/memory/v1/identity_resolution_setting.rb +11 -191
- data/lib/twilio-ruby/rest/memory/v1/import.rb +28 -5
- data/lib/twilio-ruby/rest/memory/v1/lookup.rb +1 -60
- data/lib/twilio-ruby/rest/memory/v1/observation.rb +72 -22
- data/lib/twilio-ruby/rest/memory/v1/operation.rb +1 -60
- data/lib/twilio-ruby/rest/memory/v1/profile.rb +2 -2
- data/lib/twilio-ruby/rest/memory/v1/recall.rb +1 -60
- data/lib/twilio-ruby/rest/memory/v1/revision.rb +3 -5
- data/lib/twilio-ruby/rest/memory/v1/store.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/trait.rb +1 -1
- data/lib/twilio-ruby/rest/memory/v1/trait_group.rb +56 -6
- data/lib/twilio-ruby/rest/memory/v1.rb +3 -46
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration/brand_registration_otp.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/brand_registration.rb +0 -18
- data/lib/twilio-ruby/rest/messaging/v1/deactivations.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/domain_certs.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/domain_config.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/domain_config_messaging_service.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/domain_validate_dn.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/external_campaign.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/linkshortening_messaging_service_domain_association.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/request_managed_cert.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person.rb +2 -4
- data/lib/twilio-ruby/rest/messaging/v1/service/us_app_to_person_usecase.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v1/usecase.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v2/channels_sender.rb +23 -4
- data/lib/twilio-ruby/rest/messaging/v2/domain_certs.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v2/typing_indicator.rb +0 -59
- data/lib/twilio-ruby/rest/messaging/v3/typing_indicator.rb +4 -63
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/bulk_eligibility.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/eligibility.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/embedded_session.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/porting_port_in_phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/porting_portability.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/porting_webhook_configuration_delete.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/sender_id_registration.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification.rb +172 -0
- data/lib/twilio-ruby/rest/numbers/v1/sms_verification_check.rb +179 -0
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification.rb +186 -0
- data/lib/twilio-ruby/rest/numbers/v1/voice_verification_check.rb +165 -0
- data/lib/twilio-ruby/rest/numbers/v1/webhook.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v1.rb +24 -0
- data/lib/twilio-ruby/rest/numbers/v2/bulk_hosted_number_order.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v2/bundle_clone.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance/bundle/replace_items.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v2/regulatory_compliance.rb +0 -59
- data/lib/twilio-ruby/rest/numbers/v3/hosted_number_order.rb +0 -59
- data/lib/twilio-ruby/rest/oauth/v1/authorize.rb +0 -59
- data/lib/twilio-ruby/rest/oauth/v1/token.rb +0 -59
- data/lib/twilio-ruby/rest/oauth/v2/authorize.rb +14 -61
- data/lib/twilio-ruby/rest/oauth/v2/oauth_authorization_server.rb +200 -0
- data/lib/twilio-ruby/rest/oauth/v2/token.rb +10 -63
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +0 -59
- data/lib/twilio-ruby/rest/preview_iam/v1/authorize.rb +0 -59
- data/lib/twilio-ruby/rest/preview_iam/v1/token.rb +0 -59
- data/lib/twilio-ruby/rest/preview_iam/versionless/organization.rb +0 -78
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v2/number.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v2/voice/number.rb +0 -59
- data/lib/twilio-ruby/rest/pricing/v2/voice.rb +0 -59
- data/lib/twilio-ruby/rest/routes/v2/phone_number.rb +0 -59
- data/lib/twilio-ruby/rest/routes/v2/sip_domain.rb +0 -59
- data/lib/twilio-ruby/rest/routes/v2/trunk.rb +0 -59
- data/lib/twilio-ruby/rest/routes/v3/phone_number.rb +406 -0
- data/lib/twilio-ruby/rest/routes/v3.rb +50 -0
- data/lib/twilio-ruby/rest/routes_base.rb +6 -1
- data/lib/twilio-ruby/rest/serverless/v1/service/build/build_status.rb +0 -59
- data/lib/twilio-ruby/rest/serverless/v1/service/function/function_version/function_version_content.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v1/flow/engagement/engagement_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v1/flow/engagement/step/step_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v1/flow/execution/execution_step/execution_step_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v2/flow/execution/execution_step/execution_step_context.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v2/flow/flow_test_user.rb +0 -59
- data/lib/twilio-ruby/rest/studio/v2/flow_validate.rb +0 -59
- data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_bulk_real_time_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +0 -59
- data/lib/twilio-ruby/rest/trunking/v1/trunk/recording.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration.rb +271 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_brand_registration_embedded_session.rb +174 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration.rb +262 -0
- data/lib/twilio-ruby/rest/trusthub/v1/a2p_campaign_registration_embedded_session.rb +174 -0
- data/lib/twilio-ruby/rest/trusthub/v1/compliance_inquiries.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/compliance_registration_inquiries.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/compliance_tollfree_inquiries.rb +0 -59
- data/lib/twilio-ruby/rest/trusthub/v1/customer_profiles_provisional_copy.rb +386 -0
- data/lib/twilio-ruby/rest/trusthub/v1/trust_products_provisional_copy.rb +386 -0
- data/lib/twilio-ruby/rest/trusthub/v1.rb +74 -0
- data/lib/twilio-ruby/rest/verify/v2/form.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/safelist.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/access_token.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/approve_challenge.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/entity/challenge/notification.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/entity/new_factor.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/new_challenge.rb +3 -62
- data/lib/twilio-ruby/rest/verify/v2/service/new_factor.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/new_verify_factor.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +8 -61
- data/lib/twilio-ruby/rest/verify/v2/service/verification_check.rb +0 -59
- data/lib/twilio-ruby/rest/verify/v2/verification_attempts_summary.rb +0 -59
- data/lib/twilio-ruby/rest/video/v1/composition_settings.rb +0 -59
- data/lib/twilio-ruby/rest/video/v1/recording_settings.rb +0 -59
- data/lib/twilio-ruby/rest/video/v1/room/participant/anonymize.rb +0 -59
- data/lib/twilio-ruby/rest/video/v1/room/participant/subscribe_rules.rb +0 -59
- data/lib/twilio-ruby/rest/video/v1/room/recording_rules.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v1/archived_call.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/bulk_country_update.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions/settings.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v1/dialing_permissions.rb +0 -59
- data/lib/twilio-ruby/rest/voice/v2/account_default_configuration.rb +497 -0
- data/lib/twilio-ruby/rest/voice/v2/configuration/default.rb +297 -0
- data/lib/twilio-ruby/rest/voice/v2/configuration.rb +353 -0
- data/lib/twilio-ruby/rest/voice/v2/recording.rb +557 -0
- data/lib/twilio-ruby/rest/voice/v2/transcription.rb +532 -0
- data/lib/twilio-ruby/rest/voice/v2/type.rb +459 -0
- data/lib/twilio-ruby/rest/voice/v2.rb +141 -0
- data/lib/twilio-ruby/rest/voice/v3/transcription.rb +259 -50
- data/lib/twilio-ruby/rest/voice_base.rb +5 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +6 -68
- data/lib/twilio-ruby/version.rb +1 -1
- data/twilio-ruby.gemspec +1 -1
- metadata +36 -22
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_knowledge.rb +0 -558
- data/lib/twilio-ruby/rest/assistants/v1/assistant/assistants_tool.rb +0 -558
- data/lib/twilio-ruby/rest/assistants/v1/assistant/feedback.rb +0 -431
- data/lib/twilio-ruby/rest/assistants/v1/assistant/message.rb +0 -296
- data/lib/twilio-ruby/rest/assistants/v1/assistant.rb +0 -927
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/chunk.rb +0 -325
- data/lib/twilio-ruby/rest/assistants/v1/knowledge/knowledge_status.rb +0 -349
- data/lib/twilio-ruby/rest/assistants/v1/knowledge.rb +0 -871
- data/lib/twilio-ruby/rest/assistants/v1/policy.rb +0 -364
- data/lib/twilio-ruby/rest/assistants/v1/session/message.rb +0 -360
- data/lib/twilio-ruby/rest/assistants/v1/session.rb +0 -501
- data/lib/twilio-ruby/rest/assistants/v1/tool.rb +0 -847
- data/lib/twilio-ruby/rest/assistants/v1.rb +0 -104
- data/lib/twilio-ruby/rest/assistants.rb +0 -6
- data/lib/twilio-ruby/rest/assistants_base.rb +0 -38
- data/lib/twilio-ruby/rest/memory/v1/event.rb +0 -320
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require 'rack/media_type'
|
|
4
|
+
require 'rack/utils'
|
|
4
5
|
|
|
5
6
|
module Rack
|
|
6
7
|
# Middleware that authenticates webhooks from Twilio using the request
|
|
@@ -33,7 +34,7 @@ module Rack
|
|
|
33
34
|
end
|
|
34
35
|
|
|
35
36
|
def call(env)
|
|
36
|
-
return @app.call(env) unless env['PATH_INFO']
|
|
37
|
+
return @app.call(env) unless protected_path?(env['PATH_INFO'])
|
|
37
38
|
request = Rack::Request.new(env)
|
|
38
39
|
original_url = request.url
|
|
39
40
|
params = extract_params!(request)
|
|
@@ -51,6 +52,48 @@ module Rack
|
|
|
51
52
|
end
|
|
52
53
|
end
|
|
53
54
|
|
|
55
|
+
# Decide whether a request path needs its signature validated.
|
|
56
|
+
#
|
|
57
|
+
# PATH_INFO arrives percent-encoded, but the routers we sit in front of
|
|
58
|
+
# (Rails, Sinatra) decode and normalize the path before matching it against
|
|
59
|
+
# their routes. Comparing the configured patterns against the raw PATH_INFO
|
|
60
|
+
# alone therefore lets a request like `/%76oice` slip past this middleware
|
|
61
|
+
# unvalidated and still reach the `/voice` action.
|
|
62
|
+
#
|
|
63
|
+
# We compare against every form the path could take downstream and validate
|
|
64
|
+
# if any of them matches. Erring towards validating means a path we can't
|
|
65
|
+
# make sense of is still checked rather than waved through.
|
|
66
|
+
def protected_path?(path)
|
|
67
|
+
path = path.to_s
|
|
68
|
+
candidates = [path, decode(path)]
|
|
69
|
+
candidates << remove_dot_segments(candidates.last)
|
|
70
|
+
candidates.uniq.any? { |candidate| candidate.match(@path_regex) }
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# Percent-decode a path the way a downstream router would. `unescape_path`
|
|
74
|
+
# (rather than `unescape`) leaves `+` alone, since a plus is a literal plus
|
|
75
|
+
# in a path and only means a space in a query string. Undecodable bytes are
|
|
76
|
+
# scrubbed, as matching a Regexp against invalid UTF-8 raises.
|
|
77
|
+
def decode(path)
|
|
78
|
+
decoded = Rack::Utils.unescape_path(path)
|
|
79
|
+
decoded.valid_encoding? ? decoded : decoded.scrub
|
|
80
|
+
rescue ArgumentError
|
|
81
|
+
path
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
# Collapse `.`, `..` and repeated slashes, so an anchored pattern such as
|
|
85
|
+
# %r{\A/voice\z} still recognizes `/sms/../voice`.
|
|
86
|
+
def remove_dot_segments(path)
|
|
87
|
+
segments = path.split('/').each_with_object([]) do |segment, resolved|
|
|
88
|
+
case segment
|
|
89
|
+
when '', '.' then next
|
|
90
|
+
when '..' then resolved.pop
|
|
91
|
+
else resolved << segment
|
|
92
|
+
end
|
|
93
|
+
end
|
|
94
|
+
"/#{segments.join('/')}"
|
|
95
|
+
end
|
|
96
|
+
|
|
54
97
|
# Extract the params from the the request that we can use to determine the
|
|
55
98
|
# signature. This _may_ modify the passed in request since it may read/rewind
|
|
56
99
|
# the body.
|
|
@@ -67,6 +110,6 @@ module Rack
|
|
|
67
110
|
end
|
|
68
111
|
end
|
|
69
112
|
|
|
70
|
-
private :extract_params
|
|
113
|
+
private :extract_params!, :protected_path?, :decode, :remove_dot_segments
|
|
71
114
|
end
|
|
72
115
|
end
|
|
@@ -58,8 +58,15 @@ module Twilio
|
|
|
58
58
|
end
|
|
59
59
|
##
|
|
60
60
|
# Update the AuthTokenPromotionInstance
|
|
61
|
+
# @param [Boolean] suppress_email_notification Whether to suppress the email notification that Twilio sends to the owners and administrators of the account about this Auth Token change. Defaults to `false`, so Twilio sends the email. Set to `true` when rotating Auth Tokens across many subaccounts.
|
|
61
62
|
# @return [AuthTokenPromotionInstance] Updated AuthTokenPromotionInstance
|
|
62
|
-
def update
|
|
63
|
+
def update(
|
|
64
|
+
suppress_email_notification: :unset
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
data = Twilio::Values.of({
|
|
68
|
+
'SuppressEmailNotification' => suppress_email_notification,
|
|
69
|
+
})
|
|
63
70
|
|
|
64
71
|
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
65
72
|
|
|
@@ -67,7 +74,7 @@ module Twilio
|
|
|
67
74
|
|
|
68
75
|
|
|
69
76
|
|
|
70
|
-
payload = @version.update('POST', @uri, headers: headers)
|
|
77
|
+
payload = @version.update('POST', @uri, data: data, headers: headers)
|
|
71
78
|
AuthTokenPromotionInstance.new(
|
|
72
79
|
@version,
|
|
73
80
|
payload,
|
|
@@ -76,8 +83,15 @@ module Twilio
|
|
|
76
83
|
|
|
77
84
|
##
|
|
78
85
|
# Update the AuthTokenPromotionInstanceMetadata
|
|
86
|
+
# @param [Boolean] suppress_email_notification Whether to suppress the email notification that Twilio sends to the owners and administrators of the account about this Auth Token change. Defaults to `false`, so Twilio sends the email. Set to `true` when rotating Auth Tokens across many subaccounts.
|
|
79
87
|
# @return [AuthTokenPromotionInstance] Updated AuthTokenPromotionInstance
|
|
80
|
-
def update_with_metadata
|
|
88
|
+
def update_with_metadata(
|
|
89
|
+
suppress_email_notification: :unset
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
data = Twilio::Values.of({
|
|
93
|
+
'SuppressEmailNotification' => suppress_email_notification,
|
|
94
|
+
})
|
|
81
95
|
|
|
82
96
|
headers = Twilio::Values.of({'Content-Type' => 'application/x-www-form-urlencoded', })
|
|
83
97
|
|
|
@@ -85,7 +99,7 @@ module Twilio
|
|
|
85
99
|
|
|
86
100
|
|
|
87
101
|
|
|
88
|
-
response = @version.update_with_metadata('POST', @uri, headers: headers)
|
|
102
|
+
response = @version.update_with_metadata('POST', @uri, data: data, headers: headers)
|
|
89
103
|
auth_token_promotion_instance = AuthTokenPromotionInstance.new(
|
|
90
104
|
@version,
|
|
91
105
|
response.body,
|
|
@@ -191,65 +205,6 @@ module Twilio
|
|
|
191
205
|
end
|
|
192
206
|
end
|
|
193
207
|
|
|
194
|
-
class AuthTokenPromotionPageMetadata < PageMetadata
|
|
195
|
-
attr_reader :auth_token_promotion_page
|
|
196
|
-
|
|
197
|
-
def initialize(version, response, solution, limit)
|
|
198
|
-
super(version, response)
|
|
199
|
-
@auth_token_promotion_page = []
|
|
200
|
-
@limit = limit
|
|
201
|
-
key = get_key(response.body)
|
|
202
|
-
records = 0
|
|
203
|
-
while( limit != :unset && records < limit )
|
|
204
|
-
@auth_token_promotion_page << AuthTokenPromotionListResponse.new(version, @payload, key, limit - records)
|
|
205
|
-
@payload = self.next_page
|
|
206
|
-
break unless @payload
|
|
207
|
-
records += (@payload.body[key] || []).size
|
|
208
|
-
end
|
|
209
|
-
# Path Solution
|
|
210
|
-
@solution = solution
|
|
211
|
-
end
|
|
212
|
-
|
|
213
|
-
def each
|
|
214
|
-
@auth_token_promotion_page.each do |record|
|
|
215
|
-
yield record
|
|
216
|
-
end
|
|
217
|
-
end
|
|
218
|
-
|
|
219
|
-
def to_s
|
|
220
|
-
'<Twilio::REST::Accounts::V1PageMetadata>';
|
|
221
|
-
end
|
|
222
|
-
end
|
|
223
|
-
class AuthTokenPromotionListResponse < InstanceListResource
|
|
224
|
-
|
|
225
|
-
# @param [Array<AuthTokenPromotionInstance>] instance
|
|
226
|
-
# @param [Hash{String => Object}] headers
|
|
227
|
-
# @param [Integer] status_code
|
|
228
|
-
def initialize(version, payload, key, limit = :unset)
|
|
229
|
-
data_list = payload.body[key] || []
|
|
230
|
-
if limit != :unset
|
|
231
|
-
data_list = data_list[0, limit]
|
|
232
|
-
end
|
|
233
|
-
@auth_token_promotion = data_list.map do |data|
|
|
234
|
-
AuthTokenPromotionInstance.new(version, data)
|
|
235
|
-
end
|
|
236
|
-
@headers = payload.headers
|
|
237
|
-
@status_code = payload.status_code
|
|
238
|
-
end
|
|
239
|
-
|
|
240
|
-
def auth_token_promotion
|
|
241
|
-
@auth_token_promotion
|
|
242
|
-
end
|
|
243
|
-
|
|
244
|
-
def headers
|
|
245
|
-
@headers
|
|
246
|
-
end
|
|
247
|
-
|
|
248
|
-
def status_code
|
|
249
|
-
@status_code
|
|
250
|
-
end
|
|
251
|
-
end
|
|
252
|
-
|
|
253
208
|
class AuthTokenPromotionInstance < InstanceResource
|
|
254
209
|
##
|
|
255
210
|
# Initialize the AuthTokenPromotionInstance
|
|
@@ -321,10 +276,15 @@ module Twilio
|
|
|
321
276
|
|
|
322
277
|
##
|
|
323
278
|
# Update the AuthTokenPromotionInstance
|
|
279
|
+
# @param [Boolean] suppress_email_notification Whether to suppress the email notification that Twilio sends to the owners and administrators of the account about this Auth Token change. Defaults to `false`, so Twilio sends the email. Set to `true` when rotating Auth Tokens across many subaccounts.
|
|
324
280
|
# @return [AuthTokenPromotionInstance] Updated AuthTokenPromotionInstance
|
|
325
|
-
def update
|
|
281
|
+
def update(
|
|
282
|
+
suppress_email_notification: :unset
|
|
283
|
+
)
|
|
326
284
|
|
|
327
|
-
context.update
|
|
285
|
+
context.update(
|
|
286
|
+
suppress_email_notification: suppress_email_notification,
|
|
287
|
+
)
|
|
328
288
|
end
|
|
329
289
|
|
|
330
290
|
##
|
|
@@ -126,65 +126,6 @@ module Twilio
|
|
|
126
126
|
end
|
|
127
127
|
end
|
|
128
128
|
|
|
129
|
-
class BulkConsentsPageMetadata < PageMetadata
|
|
130
|
-
attr_reader :bulk_consents_page
|
|
131
|
-
|
|
132
|
-
def initialize(version, response, solution, limit)
|
|
133
|
-
super(version, response)
|
|
134
|
-
@bulk_consents_page = []
|
|
135
|
-
@limit = limit
|
|
136
|
-
key = get_key(response.body)
|
|
137
|
-
records = 0
|
|
138
|
-
while( limit != :unset && records < limit )
|
|
139
|
-
@bulk_consents_page << BulkConsentsListResponse.new(version, @payload, key, limit - records)
|
|
140
|
-
@payload = self.next_page
|
|
141
|
-
break unless @payload
|
|
142
|
-
records += (@payload.body[key] || []).size
|
|
143
|
-
end
|
|
144
|
-
# Path Solution
|
|
145
|
-
@solution = solution
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
def each
|
|
149
|
-
@bulk_consents_page.each do |record|
|
|
150
|
-
yield record
|
|
151
|
-
end
|
|
152
|
-
end
|
|
153
|
-
|
|
154
|
-
def to_s
|
|
155
|
-
'<Twilio::REST::Accounts::V1PageMetadata>';
|
|
156
|
-
end
|
|
157
|
-
end
|
|
158
|
-
class BulkConsentsListResponse < InstanceListResource
|
|
159
|
-
|
|
160
|
-
# @param [Array<BulkConsentsInstance>] instance
|
|
161
|
-
# @param [Hash{String => Object}] headers
|
|
162
|
-
# @param [Integer] status_code
|
|
163
|
-
def initialize(version, payload, key, limit = :unset)
|
|
164
|
-
data_list = payload.body[key] || []
|
|
165
|
-
if limit != :unset
|
|
166
|
-
data_list = data_list[0, limit]
|
|
167
|
-
end
|
|
168
|
-
@bulk_consents = data_list.map do |data|
|
|
169
|
-
BulkConsentsInstance.new(version, data)
|
|
170
|
-
end
|
|
171
|
-
@headers = payload.headers
|
|
172
|
-
@status_code = payload.status_code
|
|
173
|
-
end
|
|
174
|
-
|
|
175
|
-
def bulk_consents
|
|
176
|
-
@bulk_consents
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
def headers
|
|
180
|
-
@headers
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
def status_code
|
|
184
|
-
@status_code
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
129
|
class BulkConsentsInstance < InstanceResource
|
|
189
130
|
##
|
|
190
131
|
# Initialize the BulkConsentsInstance
|
|
@@ -126,65 +126,6 @@ module Twilio
|
|
|
126
126
|
end
|
|
127
127
|
end
|
|
128
128
|
|
|
129
|
-
class BulkContactsPageMetadata < PageMetadata
|
|
130
|
-
attr_reader :bulk_contacts_page
|
|
131
|
-
|
|
132
|
-
def initialize(version, response, solution, limit)
|
|
133
|
-
super(version, response)
|
|
134
|
-
@bulk_contacts_page = []
|
|
135
|
-
@limit = limit
|
|
136
|
-
key = get_key(response.body)
|
|
137
|
-
records = 0
|
|
138
|
-
while( limit != :unset && records < limit )
|
|
139
|
-
@bulk_contacts_page << BulkContactsListResponse.new(version, @payload, key, limit - records)
|
|
140
|
-
@payload = self.next_page
|
|
141
|
-
break unless @payload
|
|
142
|
-
records += (@payload.body[key] || []).size
|
|
143
|
-
end
|
|
144
|
-
# Path Solution
|
|
145
|
-
@solution = solution
|
|
146
|
-
end
|
|
147
|
-
|
|
148
|
-
def each
|
|
149
|
-
@bulk_contacts_page.each do |record|
|
|
150
|
-
yield record
|
|
151
|
-
end
|
|
152
|
-
end
|
|
153
|
-
|
|
154
|
-
def to_s
|
|
155
|
-
'<Twilio::REST::Accounts::V1PageMetadata>';
|
|
156
|
-
end
|
|
157
|
-
end
|
|
158
|
-
class BulkContactsListResponse < InstanceListResource
|
|
159
|
-
|
|
160
|
-
# @param [Array<BulkContactsInstance>] instance
|
|
161
|
-
# @param [Hash{String => Object}] headers
|
|
162
|
-
# @param [Integer] status_code
|
|
163
|
-
def initialize(version, payload, key, limit = :unset)
|
|
164
|
-
data_list = payload.body[key] || []
|
|
165
|
-
if limit != :unset
|
|
166
|
-
data_list = data_list[0, limit]
|
|
167
|
-
end
|
|
168
|
-
@bulk_contacts = data_list.map do |data|
|
|
169
|
-
BulkContactsInstance.new(version, data)
|
|
170
|
-
end
|
|
171
|
-
@headers = payload.headers
|
|
172
|
-
@status_code = payload.status_code
|
|
173
|
-
end
|
|
174
|
-
|
|
175
|
-
def bulk_contacts
|
|
176
|
-
@bulk_contacts
|
|
177
|
-
end
|
|
178
|
-
|
|
179
|
-
def headers
|
|
180
|
-
@headers
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
def status_code
|
|
184
|
-
@status_code
|
|
185
|
-
end
|
|
186
|
-
end
|
|
187
|
-
|
|
188
129
|
class BulkContactsInstance < InstanceResource
|
|
189
130
|
##
|
|
190
131
|
# Initialize the BulkContactsInstance
|
|
@@ -98,65 +98,6 @@ module Twilio
|
|
|
98
98
|
end
|
|
99
99
|
end
|
|
100
100
|
|
|
101
|
-
class CredentialPageMetadata < PageMetadata
|
|
102
|
-
attr_reader :credential_page
|
|
103
|
-
|
|
104
|
-
def initialize(version, response, solution, limit)
|
|
105
|
-
super(version, response)
|
|
106
|
-
@credential_page = []
|
|
107
|
-
@limit = limit
|
|
108
|
-
key = get_key(response.body)
|
|
109
|
-
records = 0
|
|
110
|
-
while( limit != :unset && records < limit )
|
|
111
|
-
@credential_page << CredentialListResponse.new(version, @payload, key, limit - records)
|
|
112
|
-
@payload = self.next_page
|
|
113
|
-
break unless @payload
|
|
114
|
-
records += (@payload.body[key] || []).size
|
|
115
|
-
end
|
|
116
|
-
# Path Solution
|
|
117
|
-
@solution = solution
|
|
118
|
-
end
|
|
119
|
-
|
|
120
|
-
def each
|
|
121
|
-
@credential_page.each do |record|
|
|
122
|
-
yield record
|
|
123
|
-
end
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
def to_s
|
|
127
|
-
'<Twilio::REST::Accounts::V1PageMetadata>';
|
|
128
|
-
end
|
|
129
|
-
end
|
|
130
|
-
class CredentialListResponse < InstanceListResource
|
|
131
|
-
|
|
132
|
-
# @param [Array<CredentialInstance>] instance
|
|
133
|
-
# @param [Hash{String => Object}] headers
|
|
134
|
-
# @param [Integer] status_code
|
|
135
|
-
def initialize(version, payload, key, limit = :unset)
|
|
136
|
-
data_list = payload.body[key] || []
|
|
137
|
-
if limit != :unset
|
|
138
|
-
data_list = data_list[0, limit]
|
|
139
|
-
end
|
|
140
|
-
@credential = data_list.map do |data|
|
|
141
|
-
CredentialInstance.new(version, data)
|
|
142
|
-
end
|
|
143
|
-
@headers = payload.headers
|
|
144
|
-
@status_code = payload.status_code
|
|
145
|
-
end
|
|
146
|
-
|
|
147
|
-
def credential
|
|
148
|
-
@credential
|
|
149
|
-
end
|
|
150
|
-
|
|
151
|
-
def headers
|
|
152
|
-
@headers
|
|
153
|
-
end
|
|
154
|
-
|
|
155
|
-
def status_code
|
|
156
|
-
@status_code
|
|
157
|
-
end
|
|
158
|
-
end
|
|
159
|
-
|
|
160
101
|
class CredentialInstance < InstanceResource
|
|
161
102
|
##
|
|
162
103
|
# Initialize the CredentialInstance
|
|
@@ -180,65 +180,6 @@ module Twilio
|
|
|
180
180
|
end
|
|
181
181
|
end
|
|
182
182
|
|
|
183
|
-
class MessagingGeopermissionsPageMetadata < PageMetadata
|
|
184
|
-
attr_reader :messaging_geopermissions_page
|
|
185
|
-
|
|
186
|
-
def initialize(version, response, solution, limit)
|
|
187
|
-
super(version, response)
|
|
188
|
-
@messaging_geopermissions_page = []
|
|
189
|
-
@limit = limit
|
|
190
|
-
key = get_key(response.body)
|
|
191
|
-
records = 0
|
|
192
|
-
while( limit != :unset && records < limit )
|
|
193
|
-
@messaging_geopermissions_page << MessagingGeopermissionsListResponse.new(version, @payload, key, limit - records)
|
|
194
|
-
@payload = self.next_page
|
|
195
|
-
break unless @payload
|
|
196
|
-
records += (@payload.body[key] || []).size
|
|
197
|
-
end
|
|
198
|
-
# Path Solution
|
|
199
|
-
@solution = solution
|
|
200
|
-
end
|
|
201
|
-
|
|
202
|
-
def each
|
|
203
|
-
@messaging_geopermissions_page.each do |record|
|
|
204
|
-
yield record
|
|
205
|
-
end
|
|
206
|
-
end
|
|
207
|
-
|
|
208
|
-
def to_s
|
|
209
|
-
'<Twilio::REST::Accounts::V1PageMetadata>';
|
|
210
|
-
end
|
|
211
|
-
end
|
|
212
|
-
class MessagingGeopermissionsListResponse < InstanceListResource
|
|
213
|
-
|
|
214
|
-
# @param [Array<MessagingGeopermissionsInstance>] instance
|
|
215
|
-
# @param [Hash{String => Object}] headers
|
|
216
|
-
# @param [Integer] status_code
|
|
217
|
-
def initialize(version, payload, key, limit = :unset)
|
|
218
|
-
data_list = payload.body[key] || []
|
|
219
|
-
if limit != :unset
|
|
220
|
-
data_list = data_list[0, limit]
|
|
221
|
-
end
|
|
222
|
-
@messaging_geopermissions = data_list.map do |data|
|
|
223
|
-
MessagingGeopermissionsInstance.new(version, data)
|
|
224
|
-
end
|
|
225
|
-
@headers = payload.headers
|
|
226
|
-
@status_code = payload.status_code
|
|
227
|
-
end
|
|
228
|
-
|
|
229
|
-
def messaging_geopermissions
|
|
230
|
-
@messaging_geopermissions
|
|
231
|
-
end
|
|
232
|
-
|
|
233
|
-
def headers
|
|
234
|
-
@headers
|
|
235
|
-
end
|
|
236
|
-
|
|
237
|
-
def status_code
|
|
238
|
-
@status_code
|
|
239
|
-
end
|
|
240
|
-
end
|
|
241
|
-
|
|
242
183
|
class MessagingGeopermissionsInstance < InstanceResource
|
|
243
184
|
##
|
|
244
185
|
# Initialize the MessagingGeopermissionsInstance
|
|
@@ -224,65 +224,6 @@ module Twilio
|
|
|
224
224
|
end
|
|
225
225
|
end
|
|
226
226
|
|
|
227
|
-
class SafelistPageMetadata < PageMetadata
|
|
228
|
-
attr_reader :safelist_page
|
|
229
|
-
|
|
230
|
-
def initialize(version, response, solution, limit)
|
|
231
|
-
super(version, response)
|
|
232
|
-
@safelist_page = []
|
|
233
|
-
@limit = limit
|
|
234
|
-
key = get_key(response.body)
|
|
235
|
-
records = 0
|
|
236
|
-
while( limit != :unset && records < limit )
|
|
237
|
-
@safelist_page << SafelistListResponse.new(version, @payload, key, limit - records)
|
|
238
|
-
@payload = self.next_page
|
|
239
|
-
break unless @payload
|
|
240
|
-
records += (@payload.body[key] || []).size
|
|
241
|
-
end
|
|
242
|
-
# Path Solution
|
|
243
|
-
@solution = solution
|
|
244
|
-
end
|
|
245
|
-
|
|
246
|
-
def each
|
|
247
|
-
@safelist_page.each do |record|
|
|
248
|
-
yield record
|
|
249
|
-
end
|
|
250
|
-
end
|
|
251
|
-
|
|
252
|
-
def to_s
|
|
253
|
-
'<Twilio::REST::Accounts::V1PageMetadata>';
|
|
254
|
-
end
|
|
255
|
-
end
|
|
256
|
-
class SafelistListResponse < InstanceListResource
|
|
257
|
-
|
|
258
|
-
# @param [Array<SafelistInstance>] instance
|
|
259
|
-
# @param [Hash{String => Object}] headers
|
|
260
|
-
# @param [Integer] status_code
|
|
261
|
-
def initialize(version, payload, key, limit = :unset)
|
|
262
|
-
data_list = payload.body[key] || []
|
|
263
|
-
if limit != :unset
|
|
264
|
-
data_list = data_list[0, limit]
|
|
265
|
-
end
|
|
266
|
-
@safelist = data_list.map do |data|
|
|
267
|
-
SafelistInstance.new(version, data)
|
|
268
|
-
end
|
|
269
|
-
@headers = payload.headers
|
|
270
|
-
@status_code = payload.status_code
|
|
271
|
-
end
|
|
272
|
-
|
|
273
|
-
def safelist
|
|
274
|
-
@safelist
|
|
275
|
-
end
|
|
276
|
-
|
|
277
|
-
def headers
|
|
278
|
-
@headers
|
|
279
|
-
end
|
|
280
|
-
|
|
281
|
-
def status_code
|
|
282
|
-
@status_code
|
|
283
|
-
end
|
|
284
|
-
end
|
|
285
|
-
|
|
286
227
|
class SafelistInstance < InstanceResource
|
|
287
228
|
##
|
|
288
229
|
# Initialize the SafelistInstance
|