twilio-ruby 5.0.0.rc26 → 5.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +21 -0
- data/.rubocop_todo.yml +187 -0
- data/.travis.yml +13 -0
- data/CHANGES.md +4 -0
- data/Gemfile +2 -2
- data/Makefile +8 -1
- data/Rakefile +3 -7
- data/examples/examples.rb +12 -10
- data/examples/{print-call-log.rb → print_call_log.rb} +4 -4
- data/lib/rack/twilio_webhook_authentication.rb +2 -3
- data/lib/twilio-ruby/framework/domain.rb +2 -6
- data/lib/twilio-ruby/framework/error.rb +0 -1
- data/lib/twilio-ruby/framework/helper.rb +1 -1
- data/lib/twilio-ruby/framework/page.rb +23 -25
- data/lib/twilio-ruby/framework/resource.rb +2 -2
- data/lib/twilio-ruby/framework/serialize.rb +5 -12
- data/lib/twilio-ruby/framework/twilio_response.rb +1 -1
- data/lib/twilio-ruby/framework/values.rb +2 -2
- data/lib/twilio-ruby/framework/version.rb +19 -37
- data/lib/twilio-ruby/http/http_client.rb +5 -6
- data/lib/twilio-ruby/jwt/access_token.rb +27 -41
- data/lib/twilio-ruby/jwt/client_capability.rb +11 -16
- data/lib/twilio-ruby/jwt/jwt.rb +7 -13
- data/lib/twilio-ruby/jwt/task_router.rb +40 -38
- data/lib/twilio-ruby/rest/accounts.rb +2 -0
- data/lib/twilio-ruby/rest/accounts/v1.rb +2 -0
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +2 -2
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +12 -7
- data/lib/twilio-ruby/rest/api.rb +96 -0
- data/lib/twilio-ruby/rest/api/v2010.rb +5 -0
- data/lib/twilio-ruby/rest/api/v2010/account.rb +66 -56
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +30 -13
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +22 -8
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +40 -11
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +20 -9
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +16 -15
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +26 -28
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +26 -28
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +26 -28
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +64 -34
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +12 -4
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +28 -3
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +37 -16
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +25 -15
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +28 -27
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +28 -19
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +22 -9
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +62 -58
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +52 -12
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +52 -12
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +52 -12
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +8 -9
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +47 -20
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +12 -2
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +17 -17
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +10 -2
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +10 -2
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +37 -16
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +14 -13
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +20 -10
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +10 -10
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +37 -21
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +22 -13
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +22 -13
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +26 -9
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +24 -13
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +8 -9
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +8 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +16 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +14 -9
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +36 -13
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +14 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +14 -10
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +16 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +16 -9
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +14 -2
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +26 -9
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +4 -6
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +44 -33
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +28 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +32 -15
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +10 -1
- data/lib/twilio-ruby/rest/chat.rb +8 -0
- data/lib/twilio-ruby/rest/chat/v1.rb +8 -0
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +16 -7
- data/lib/twilio-ruby/rest/chat/v1/service.rb +48 -13
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +34 -15
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +20 -10
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +22 -10
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +26 -10
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +18 -8
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +30 -10
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +16 -8
- data/lib/twilio-ruby/rest/chat/v2.rb +8 -0
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +16 -7
- data/lib/twilio-ruby/rest/chat/v2/service.rb +46 -13
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +34 -15
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +20 -10
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +22 -10
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +26 -10
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +18 -8
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +30 -10
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +16 -8
- data/lib/twilio-ruby/rest/client.rb +94 -45
- data/lib/twilio-ruby/rest/ip_messaging.rb +8 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +8 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +16 -7
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +48 -13
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +34 -15
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +20 -10
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +22 -10
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +26 -10
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +18 -8
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +30 -10
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +16 -8
- data/lib/twilio-ruby/rest/ip_messaging/v2.rb +8 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +16 -7
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +46 -13
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +34 -15
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +20 -10
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +22 -10
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +26 -10
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +18 -8
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +30 -10
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +16 -8
- data/lib/twilio-ruby/rest/lookups.rb +4 -0
- data/lib/twilio-ruby/rest/lookups/v1.rb +9 -5
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +14 -1
- data/lib/twilio-ruby/rest/monitor.rb +8 -0
- data/lib/twilio-ruby/rest/monitor/v1.rb +8 -0
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +34 -10
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +28 -13
- data/lib/twilio-ruby/rest/pricing.rb +6 -0
- data/lib/twilio-ruby/rest/pricing/v1.rb +6 -0
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +8 -2
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +12 -7
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +8 -2
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +10 -7
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +10 -4
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +12 -7
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +14 -1
- data/lib/twilio-ruby/rest/taskrouter.rb +4 -0
- data/lib/twilio-ruby/rest/taskrouter/v1.rb +4 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +46 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +16 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +30 -17
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +42 -19
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +22 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +16 -8
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +34 -15
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +12 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +10 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +34 -23
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +22 -10
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +28 -9
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +10 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +10 -2
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +28 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +12 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +10 -2
- data/lib/twilio-ruby/rest/trunking.rb +4 -0
- data/lib/twilio-ruby/rest/trunking/v1.rb +4 -0
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +36 -15
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +14 -8
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +14 -8
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +22 -8
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +52 -8
- data/lib/twilio-ruby/rest/video.rb +8 -0
- data/lib/twilio-ruby/rest/video/v1.rb +8 -0
- data/lib/twilio-ruby/rest/video/v1/recording.rb +26 -12
- data/lib/twilio-ruby/rest/video/v1/room.rb +34 -13
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +28 -12
- data/lib/twilio-ruby/security/request_validator.rb +1 -2
- data/lib/twilio-ruby/twiml/messaging_response.rb +7 -19
- data/lib/twilio-ruby/twiml/twiml.rb +8 -14
- data/lib/twilio-ruby/twiml/voice_response.rb +157 -169
- data/lib/twilio-ruby/util.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/serialize_spec.rb +17 -30
- data/spec/holodeck/holodeck.rb +6 -6
- data/spec/jwt/access_token_spec.rb +0 -6
- data/spec/jwt/client_capability_spec.rb +3 -3
- data/spec/jwt/task_router_spec.rb +16 -21
- data/spec/rack/twilio_webhook_authentication_spec.rb +12 -16
- data/spec/spec_helper.rb +2 -2
- data/spec/support/fakeweb.rb +1 -1
- data/spec/twiml/voice_response_spec.rb +33 -20
- data/twilio-ruby.gemspec +7 -3
- metadata +21 -193
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +0 -420
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +0 -345
- data/lib/twilio-ruby/rest/fax.rb +0 -40
- data/lib/twilio-ruby/rest/fax/v1.rb +0 -37
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -520
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +0 -321
- data/lib/twilio-ruby/rest/messaging.rb +0 -40
- data/lib/twilio-ruby/rest/messaging/v1.rb +0 -37
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -604
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +0 -344
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +0 -349
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +0 -349
- data/lib/twilio-ruby/rest/notify.rb +0 -44
- data/lib/twilio-ruby/rest/notify/v1.rb +0 -48
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +0 -394
- data/lib/twilio-ruby/rest/notify/v1/service.rb +0 -611
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +0 -414
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +0 -249
- data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +0 -219
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +0 -437
- data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +0 -247
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +0 -418
- data/lib/twilio-ruby/rest/preview.rb +0 -107
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +0 -48
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +0 -198
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +0 -209
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +0 -232
- data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +0 -37
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +0 -539
- data/lib/twilio-ruby/rest/preview/marketplace.rb +0 -48
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +0 -326
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +0 -297
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +0 -427
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +0 -335
- data/lib/twilio-ruby/rest/preview/proxy.rb +0 -37
- data/lib/twilio-ruby/rest/preview/proxy/service.rb +0 -489
- data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +0 -349
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +0 -525
- data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +0 -406
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +0 -495
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +0 -422
- data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +0 -349
- data/lib/twilio-ruby/rest/preview/sync.rb +0 -37
- data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -491
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -431
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -390
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -426
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -422
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -390
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -426
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -424
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -390
- data/lib/twilio-ruby/rest/preview/wireless.rb +0 -59
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +0 -371
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +0 -414
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +0 -512
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +0 -220
- data/lib/twilio-ruby/rest/sync.rb +0 -40
- data/lib/twilio-ruby/rest/sync/v1.rb +0 -37
- data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -491
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +0 -431
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +0 -390
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +0 -426
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +0 -422
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +0 -390
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +0 -426
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +0 -424
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +0 -390
- data/lib/twilio-ruby/rest/wireless.rb +0 -48
- data/lib/twilio-ruby/rest/wireless/v1.rb +0 -59
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +0 -357
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +0 -427
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +0 -516
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +0 -235
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +0 -135
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +0 -223
- data/spec/integration/fax/v1/fax/fax_media_spec.rb +0 -126
- data/spec/integration/fax/v1/fax_spec.rb +0 -272
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +0 -170
- data/spec/integration/messaging/v1/service/phone_number_spec.rb +0 -201
- data/spec/integration/messaging/v1/service/short_code_spec.rb +0 -173
- data/spec/integration/messaging/v1/service_spec.rb +0 -263
- data/spec/integration/notify/v1/credential_spec.rb +0 -223
- data/spec/integration/notify/v1/service/binding_spec.rb +0 -227
- data/spec/integration/notify/v1/service/notification_spec.rb +0 -97
- data/spec/integration/notify/v1/service/segment_spec.rb +0 -84
- data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +0 -118
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +0 -269
- data/spec/integration/notify/v1/service/user_spec.rb +0 -213
- data/spec/integration/notify/v1/service_spec.rb +0 -280
- data/spec/integration/preview/bulk_exports/export/day_spec.rb +0 -56
- data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +0 -79
- data/spec/integration/preview/bulk_exports/export_spec.rb +0 -43
- data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +0 -276
- data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +0 -121
- data/spec/integration/preview/marketplace/available_add_on_spec.rb +0 -142
- data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +0 -164
- data/spec/integration/preview/marketplace/installed_add_on_spec.rb +0 -252
- data/spec/integration/preview/proxy/service/phone_number_spec.rb +0 -173
- data/spec/integration/preview/proxy/service/session/interaction_spec.rb +0 -104
- data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +0 -164
- data/spec/integration/preview/proxy/service/session/participant_spec.rb +0 -226
- data/spec/integration/preview/proxy/service/session_spec.rb +0 -216
- data/spec/integration/preview/proxy/service/short_code_spec.rb +0 -173
- data/spec/integration/preview/proxy/service_spec.rb +0 -200
- data/spec/integration/preview/sync/service/document/document_permission_spec.rb +0 -206
- data/spec/integration/preview/sync/service/document_spec.rb +0 -254
- data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +0 -256
- data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +0 -206
- data/spec/integration/preview/sync/service/sync_list_spec.rb +0 -207
- data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +0 -257
- data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +0 -206
- data/spec/integration/preview/sync/service/sync_map_spec.rb +0 -207
- data/spec/integration/preview/sync/service_spec.rb +0 -244
- data/spec/integration/preview/wireless/command_spec.rb +0 -169
- data/spec/integration/preview/wireless/rate_plan_spec.rb +0 -260
- data/spec/integration/preview/wireless/sim/usage_spec.rb +0 -49
- data/spec/integration/preview/wireless/sim_spec.rb +0 -208
- data/spec/integration/sync/v1/service/document/document_permission_spec.rb +0 -206
- data/spec/integration/sync/v1/service/document_spec.rb +0 -254
- data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +0 -256
- data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +0 -206
- data/spec/integration/sync/v1/service/sync_list_spec.rb +0 -207
- data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +0 -257
- data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +0 -206
- data/spec/integration/sync/v1/service/sync_map_spec.rb +0 -207
- data/spec/integration/sync/v1/service_spec.rb +0 -244
- data/spec/integration/wireless/v1/command_spec.rb +0 -166
- data/spec/integration/wireless/v1/rate_plan_spec.rb +0 -268
- data/spec/integration/wireless/v1/sim/usage_record_spec.rb +0 -65
- data/spec/integration/wireless/v1/sim_spec.rb +0 -208
@@ -84,16 +84,6 @@ module Twilio
|
|
84
84
|
# When passed a block, yields RoomRecordingInstance records from the API.
|
85
85
|
# This operation lazily loads records as efficiently as possible until the limit
|
86
86
|
# is reached.
|
87
|
-
# @param [room_recording.Status] status The status
|
88
|
-
# @param [String] source_sid The source_sid
|
89
|
-
# @param [Time] date_created_after The date_created_after
|
90
|
-
# @param [Time] date_created_before The date_created_before
|
91
|
-
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
92
|
-
# guarantees to never return more than limit. Default is no limit
|
93
|
-
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
94
|
-
# the default value of 50 records. If no page_size is defined
|
95
|
-
# but a limit is defined, stream() will attempt to read the
|
96
|
-
# limit with the most efficient page size, i.e. min(limit, 1000)
|
97
87
|
def each
|
98
88
|
limits = @version.read_limits
|
99
89
|
|
@@ -161,7 +151,6 @@ module Twilio
|
|
161
151
|
# @param [Version] version Version that contains the resource
|
162
152
|
# @param [Response] response Response from the API
|
163
153
|
# @param [Hash] solution Path solution for the resource
|
164
|
-
# @param [String] room_sid The room_sid
|
165
154
|
# @return [RoomRecordingPage] RoomRecordingPage
|
166
155
|
def initialize(version, response, solution)
|
167
156
|
super(version, response)
|
@@ -275,7 +264,6 @@ module Twilio
|
|
275
264
|
##
|
276
265
|
# Generate an instance context for the instance, the context is capable of
|
277
266
|
# performing various actions. All instance actions are proxied to the context
|
278
|
-
# @param [Version] version Version that contains the resource
|
279
267
|
# @return [RoomRecordingContext] RoomRecordingContext for this RoomRecordingInstance
|
280
268
|
def context
|
281
269
|
unless @instance_context
|
@@ -288,58 +276,86 @@ module Twilio
|
|
288
276
|
@instance_context
|
289
277
|
end
|
290
278
|
|
279
|
+
##
|
280
|
+
# @return [String] The account_sid
|
291
281
|
def account_sid
|
292
282
|
@properties['account_sid']
|
293
283
|
end
|
294
284
|
|
285
|
+
##
|
286
|
+
# @return [room_recording.Status] The status
|
295
287
|
def status
|
296
288
|
@properties['status']
|
297
289
|
end
|
298
290
|
|
291
|
+
##
|
292
|
+
# @return [Time] The date_created
|
299
293
|
def date_created
|
300
294
|
@properties['date_created']
|
301
295
|
end
|
302
296
|
|
297
|
+
##
|
298
|
+
# @return [String] The sid
|
303
299
|
def sid
|
304
300
|
@properties['sid']
|
305
301
|
end
|
306
302
|
|
303
|
+
##
|
304
|
+
# @return [String] The source_sid
|
307
305
|
def source_sid
|
308
306
|
@properties['source_sid']
|
309
307
|
end
|
310
308
|
|
309
|
+
##
|
310
|
+
# @return [String] The size
|
311
311
|
def size
|
312
312
|
@properties['size']
|
313
313
|
end
|
314
314
|
|
315
|
+
##
|
316
|
+
# @return [room_recording.Type] The type
|
315
317
|
def type
|
316
318
|
@properties['type']
|
317
319
|
end
|
318
320
|
|
321
|
+
##
|
322
|
+
# @return [String] The duration
|
319
323
|
def duration
|
320
324
|
@properties['duration']
|
321
325
|
end
|
322
326
|
|
327
|
+
##
|
328
|
+
# @return [room_recording.Format] The container_format
|
323
329
|
def container_format
|
324
330
|
@properties['container_format']
|
325
331
|
end
|
326
332
|
|
333
|
+
##
|
334
|
+
# @return [room_recording.Codec] The codec
|
327
335
|
def codec
|
328
336
|
@properties['codec']
|
329
337
|
end
|
330
338
|
|
339
|
+
##
|
340
|
+
# @return [Hash] The grouping_sids
|
331
341
|
def grouping_sids
|
332
342
|
@properties['grouping_sids']
|
333
343
|
end
|
334
344
|
|
345
|
+
##
|
346
|
+
# @return [String] The room_sid
|
335
347
|
def room_sid
|
336
348
|
@properties['room_sid']
|
337
349
|
end
|
338
350
|
|
351
|
+
##
|
352
|
+
# @return [String] The url
|
339
353
|
def url
|
340
354
|
@properties['url']
|
341
355
|
end
|
342
356
|
|
357
|
+
##
|
358
|
+
# @return [String] The links
|
343
359
|
def links
|
344
360
|
@properties['links']
|
345
361
|
end
|
@@ -1,7 +1,6 @@
|
|
1
1
|
module Twilio
|
2
2
|
module Security
|
3
3
|
class RequestValidator
|
4
|
-
|
5
4
|
def initialize(auth_token = nil)
|
6
5
|
@auth_token = auth_token || Twilio.auth_token
|
7
6
|
raise ArgumentError, 'Auth token is required' if @auth_token.nil?
|
@@ -31,7 +30,7 @@ module Twilio
|
|
31
30
|
|
32
31
|
res = 0
|
33
32
|
b.each_byte { |byte| res |= byte ^ l.shift }
|
34
|
-
res
|
33
|
+
res.zero?
|
35
34
|
end
|
36
35
|
|
37
36
|
# `ActionController::Parameters` no longer, as of Rails 5, inherits
|
@@ -1,10 +1,9 @@
|
|
1
1
|
module Twilio
|
2
2
|
module TwiML
|
3
|
-
|
4
3
|
# Messaging TwiML Response
|
5
4
|
class MessagingResponse < TwiML
|
6
5
|
# Create a new <Response>
|
7
|
-
def initialize
|
6
|
+
def initialize
|
8
7
|
super()
|
9
8
|
self.name = 'Response'
|
10
9
|
yield(self) if block_given?
|
@@ -23,15 +22,7 @@ module Twilio
|
|
23
22
|
#
|
24
23
|
# == Returns:
|
25
24
|
# A <Response> element with a <Message> child element
|
26
|
-
def message(
|
27
|
-
body: nil,
|
28
|
-
to: nil,
|
29
|
-
from: nil,
|
30
|
-
method: nil,
|
31
|
-
action: nil,
|
32
|
-
status_callback: nil,
|
33
|
-
**keyword_args)
|
34
|
-
|
25
|
+
def message(body: nil, to: nil, from: nil, method: nil, action: nil, status_callback: nil, **keyword_args)
|
35
26
|
message = Message.new(
|
36
27
|
body: body,
|
37
28
|
to: to,
|
@@ -43,8 +34,7 @@ module Twilio
|
|
43
34
|
)
|
44
35
|
|
45
36
|
yield(message) if block_given?
|
46
|
-
|
47
|
-
self.append(message)
|
37
|
+
append(message)
|
48
38
|
end
|
49
39
|
|
50
40
|
# Create an <Redirect> element
|
@@ -57,7 +47,7 @@ module Twilio
|
|
57
47
|
# == Returns:
|
58
48
|
# A <Response> element with an <Redirect> child element
|
59
49
|
def redirect(url, method: nil, **keyword_args)
|
60
|
-
|
50
|
+
append(Redirect.new(url, method: method, **keyword_args))
|
61
51
|
end
|
62
52
|
end
|
63
53
|
|
@@ -73,9 +63,7 @@ module Twilio
|
|
73
63
|
# A <Message> element
|
74
64
|
def initialize(body: nil, **keyword_args)
|
75
65
|
super(**keyword_args)
|
76
|
-
|
77
|
-
@value = body
|
78
|
-
end
|
66
|
+
@value = body unless body.nil?
|
79
67
|
yield(self) if block_given?
|
80
68
|
end
|
81
69
|
|
@@ -88,7 +76,7 @@ module Twilio
|
|
88
76
|
# == Returns:
|
89
77
|
# A <Message> element with a <Body> child element
|
90
78
|
def body(body)
|
91
|
-
|
79
|
+
append(Body.new(body))
|
92
80
|
end
|
93
81
|
|
94
82
|
# Create a <Media> element
|
@@ -100,7 +88,7 @@ module Twilio
|
|
100
88
|
# == Returns:
|
101
89
|
# A <Message> element with a <Media> child element
|
102
90
|
def media(url)
|
103
|
-
|
91
|
+
append(Media.new(url))
|
104
92
|
end
|
105
93
|
end
|
106
94
|
|
@@ -5,12 +5,13 @@ module Twilio
|
|
5
5
|
class TwiMLError < StandardError
|
6
6
|
end
|
7
7
|
|
8
|
+
# TwiML Base Class
|
8
9
|
class TwiML
|
9
10
|
# Generate getter/setter methods
|
10
11
|
attr_accessor :name
|
11
12
|
attr_accessor :indent
|
12
13
|
|
13
|
-
|
14
|
+
alias to_xml to_s
|
14
15
|
|
15
16
|
def initialize(indent: false, **keyword_args)
|
16
17
|
@name = self.class.name.split('::').last
|
@@ -20,9 +21,7 @@ module Twilio
|
|
20
21
|
@attrs = {}
|
21
22
|
|
22
23
|
keyword_args.each do |key, val|
|
23
|
-
|
24
|
-
@attrs[TwiML.to_lower_camel_case(key)] = val
|
25
|
-
end
|
24
|
+
@attrs[TwiML.to_lower_camel_case(key)] = val unless val.nil?
|
26
25
|
end
|
27
26
|
end
|
28
27
|
|
@@ -33,13 +32,13 @@ module Twilio
|
|
33
32
|
end
|
34
33
|
|
35
34
|
def to_s(xml_declaration = true)
|
36
|
-
xml = self.xml.to_s(:
|
35
|
+
xml = self.xml.to_s(indent: indent)
|
37
36
|
|
38
37
|
return ('<?xml version="1.0" encoding="UTF-8"?>' + xml) if xml_declaration
|
39
38
|
xml
|
40
39
|
end
|
41
40
|
|
42
|
-
def xml
|
41
|
+
def xml
|
43
42
|
# create XML element
|
44
43
|
elem = LibXML::XML::Node.new(@name, @value)
|
45
44
|
|
@@ -48,11 +47,8 @@ module Twilio
|
|
48
47
|
keys.each do |key|
|
49
48
|
value = @attrs[key]
|
50
49
|
|
51
|
-
|
52
|
-
|
53
|
-
else
|
54
|
-
elem[key] = value.to_s
|
55
|
-
end
|
50
|
+
value_is_boolean = value.is_a?(TrueClass) || value.is_a?(FalseClass)
|
51
|
+
elem[key] = value_is_boolean ? value.to_s.downcase : value.to_s
|
56
52
|
end
|
57
53
|
|
58
54
|
@verbs.each do |verb|
|
@@ -63,9 +59,7 @@ module Twilio
|
|
63
59
|
end
|
64
60
|
|
65
61
|
def append(verb)
|
66
|
-
|
67
|
-
raise TwiMLError.new "Only appending of TwiML is allowed"
|
68
|
-
end
|
62
|
+
raise TwiMLError, 'Only appending of TwiML is allowed' unless verb.is_a?(TwiML)
|
69
63
|
|
70
64
|
@verbs << verb
|
71
65
|
self
|
@@ -1,12 +1,11 @@
|
|
1
1
|
module Twilio
|
2
2
|
module TwiML
|
3
|
-
|
4
3
|
# Voice TwiML Response
|
5
4
|
class VoiceResponse < TwiML
|
6
5
|
# Create a new <Response>
|
7
|
-
def initialize
|
6
|
+
def initialize
|
8
7
|
super()
|
9
|
-
|
8
|
+
@name = 'Response'
|
10
9
|
yield(self) if block_given?
|
11
10
|
end
|
12
11
|
|
@@ -29,37 +28,37 @@ module Twilio
|
|
29
28
|
# == Returns:
|
30
29
|
# A <Response> element with a <Dial> child element
|
31
30
|
def dial(
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
31
|
+
number: nil,
|
32
|
+
action: nil,
|
33
|
+
method: nil,
|
34
|
+
timeout: nil,
|
35
|
+
hangup_on_star: nil,
|
36
|
+
time_limit: nil,
|
37
|
+
caller_id: nil,
|
38
|
+
record: nil,
|
39
|
+
trim: nil,
|
40
|
+
recording_status_callback: nil,
|
41
|
+
recording_status_callback_method: nil,
|
42
|
+
**keyword_args
|
43
|
+
)
|
44
44
|
|
45
45
|
dial = Dial.new(
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
46
|
+
number: number,
|
47
|
+
action: action,
|
48
|
+
method: method,
|
49
|
+
timeout: timeout,
|
50
|
+
hangup_on_star: hangup_on_star,
|
51
|
+
time_limit: time_limit,
|
52
|
+
caller_id: caller_id,
|
53
|
+
record: record,
|
54
|
+
trim: trim,
|
55
|
+
recording_status_callback: recording_status_callback,
|
56
|
+
recording_status_callback_method: recording_status_callback_method,
|
57
|
+
**keyword_args
|
58
58
|
)
|
59
59
|
|
60
60
|
yield(dial) if block_given?
|
61
|
-
|
62
|
-
self.append(dial)
|
61
|
+
append(dial)
|
63
62
|
end
|
64
63
|
|
65
64
|
# Create an <Echo> element
|
@@ -70,7 +69,7 @@ module Twilio
|
|
70
69
|
# == Returns:
|
71
70
|
# A <Response> element with an <Echo> child element
|
72
71
|
def echo(**keyword_args)
|
73
|
-
|
72
|
+
append(Echo.new(**keyword_args))
|
74
73
|
end
|
75
74
|
|
76
75
|
# Create an <Enqueue> element
|
@@ -93,7 +92,8 @@ module Twilio
|
|
93
92
|
wait_url: nil,
|
94
93
|
wait_url_method: nil,
|
95
94
|
workflow_sid: nil,
|
96
|
-
**keyword_args
|
95
|
+
**keyword_args
|
96
|
+
)
|
97
97
|
|
98
98
|
enqueue = Enqueue.new(
|
99
99
|
name,
|
@@ -106,8 +106,7 @@ module Twilio
|
|
106
106
|
)
|
107
107
|
|
108
108
|
yield(enqueue) if block_given?
|
109
|
-
|
110
|
-
self.append(enqueue)
|
109
|
+
append(enqueue)
|
111
110
|
end
|
112
111
|
|
113
112
|
# Create a <Gather> element
|
@@ -140,7 +139,8 @@ module Twilio
|
|
140
139
|
hints: nil,
|
141
140
|
barge_in: nil,
|
142
141
|
acknowledge_sound_url: nil,
|
143
|
-
**keyword_args
|
142
|
+
**keyword_args
|
143
|
+
)
|
144
144
|
|
145
145
|
gather = Gather.new(
|
146
146
|
action: action,
|
@@ -158,24 +158,23 @@ module Twilio
|
|
158
158
|
)
|
159
159
|
|
160
160
|
yield(gather) if block_given?
|
161
|
-
|
162
|
-
self.append(gather)
|
161
|
+
append(gather)
|
163
162
|
end
|
164
163
|
|
165
164
|
# Create a <Hangup> element
|
166
165
|
#
|
167
166
|
# == Returns:
|
168
167
|
# A <Response> element with a <Hangup> child element
|
169
|
-
def hangup
|
170
|
-
|
168
|
+
def hangup
|
169
|
+
append(Hangup.new)
|
171
170
|
end
|
172
171
|
|
173
172
|
# Create a <Leave> element
|
174
173
|
#
|
175
174
|
# == Returns:
|
176
175
|
# A <Response> element with a <Leave> child element
|
177
|
-
def leave
|
178
|
-
|
176
|
+
def leave
|
177
|
+
append(Leave.new)
|
179
178
|
end
|
180
179
|
|
181
180
|
# Create a <Pause> element
|
@@ -186,7 +185,7 @@ module Twilio
|
|
186
185
|
# == Returns:
|
187
186
|
# A <Response> element with a <Pause> child element
|
188
187
|
def pause(length: nil)
|
189
|
-
|
188
|
+
append(Pause.new(length: length))
|
190
189
|
end
|
191
190
|
|
192
191
|
# Create a <Play> element
|
@@ -200,11 +199,11 @@ module Twilio
|
|
200
199
|
# == Returns:
|
201
200
|
# A <Response> element with a <Play> child element
|
202
201
|
def play(url: nil, loop: nil, digits: nil, **keyword_args)
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
202
|
+
append(Play.new(
|
203
|
+
url: url,
|
204
|
+
loop: loop,
|
205
|
+
digits: digits,
|
206
|
+
**keyword_args
|
208
207
|
))
|
209
208
|
end
|
210
209
|
|
@@ -238,20 +237,21 @@ module Twilio
|
|
238
237
|
recording_status_callback_method: nil,
|
239
238
|
transcribe: nil,
|
240
239
|
transcribe_callback: nil,
|
241
|
-
**keyword_args
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
240
|
+
**keyword_args
|
241
|
+
)
|
242
|
+
append(Record.new(
|
243
|
+
action: action,
|
244
|
+
method: method,
|
245
|
+
timeout: timeout,
|
246
|
+
finish_on_key: finish_on_key,
|
247
|
+
max_length: max_length,
|
248
|
+
play_beep: play_beep,
|
249
|
+
trim: trim,
|
250
|
+
recording_status_callback: recording_status_callback,
|
251
|
+
recording_status_callback_method: recording_status_callback_method,
|
252
|
+
transcribe: transcribe,
|
253
|
+
transcribe_callback: transcribe_callback,
|
254
|
+
**keyword_args
|
255
255
|
))
|
256
256
|
end
|
257
257
|
|
@@ -265,7 +265,7 @@ module Twilio
|
|
265
265
|
# == Returns:
|
266
266
|
# A <Response> element with a <Redirect> child element
|
267
267
|
def redirect(url, method: nil, **keyword_args)
|
268
|
-
|
268
|
+
append(Redirect.new(url, method: method, **keyword_args))
|
269
269
|
end
|
270
270
|
|
271
271
|
# Create a <Reject> element
|
@@ -277,7 +277,7 @@ module Twilio
|
|
277
277
|
# == Returns:
|
278
278
|
# A <Response> element with a <Reject> child element
|
279
279
|
def reject(reason: nil, **keyword_args)
|
280
|
-
|
280
|
+
append(Reject.new(reason: reason, **keyword_args))
|
281
281
|
end
|
282
282
|
|
283
283
|
# Create a <Say> element
|
@@ -292,12 +292,12 @@ module Twilio
|
|
292
292
|
# == Returns:
|
293
293
|
# A <Response> element with a <Say> child element
|
294
294
|
def say(body, loop: nil, language: nil, voice: nil, **keyword_args)
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
295
|
+
append(Say.new(
|
296
|
+
body,
|
297
|
+
loop: loop,
|
298
|
+
language: language,
|
299
|
+
voice: voice,
|
300
|
+
**keyword_args
|
301
301
|
))
|
302
302
|
end
|
303
303
|
|
@@ -314,22 +314,15 @@ module Twilio
|
|
314
314
|
#
|
315
315
|
# == Returns:
|
316
316
|
# A <Response> element with a <Sms> child element
|
317
|
-
def sms(
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
body,
|
327
|
-
to: to,
|
328
|
-
from: from,
|
329
|
-
method: method,
|
330
|
-
action: action,
|
331
|
-
status_callback: status_callback,
|
332
|
-
**keyword_args
|
317
|
+
def sms(body, to: nil, from: nil, method: nil, action: nil, status_callback: nil, **keyword_args)
|
318
|
+
append(Sms.new(
|
319
|
+
body,
|
320
|
+
to: to,
|
321
|
+
from: from,
|
322
|
+
method: method,
|
323
|
+
action: action,
|
324
|
+
status_callback: status_callback,
|
325
|
+
**keyword_args
|
333
326
|
))
|
334
327
|
end
|
335
328
|
end
|
@@ -346,9 +339,7 @@ module Twilio
|
|
346
339
|
# A <Dial> element
|
347
340
|
def initialize(number: nil, **keyword_args)
|
348
341
|
super(**keyword_args)
|
349
|
-
|
350
|
-
@value = number
|
351
|
-
end
|
342
|
+
@value = number unless number.nil?
|
352
343
|
yield(self) if block_given?
|
353
344
|
end
|
354
345
|
|
@@ -372,15 +363,16 @@ module Twilio
|
|
372
363
|
status_callback_event: nil,
|
373
364
|
status_callback_method: nil,
|
374
365
|
status_callback: nil,
|
375
|
-
**keyword_args
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
366
|
+
**keyword_args
|
367
|
+
)
|
368
|
+
append(Client.new(
|
369
|
+
name,
|
370
|
+
method: method,
|
371
|
+
url: url,
|
372
|
+
status_callback_event: status_callback_event,
|
373
|
+
status_callback_method: status_callback_method,
|
374
|
+
status_callback: status_callback,
|
375
|
+
**keyword_args
|
384
376
|
))
|
385
377
|
end
|
386
378
|
|
@@ -424,25 +416,26 @@ module Twilio
|
|
424
416
|
status_callback_method: nil,
|
425
417
|
recording_status_callback: nil,
|
426
418
|
recording_status_callback_method: nil,
|
427
|
-
**keyword_args
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
419
|
+
**keyword_args
|
420
|
+
)
|
421
|
+
append(Conference.new(
|
422
|
+
name,
|
423
|
+
muted: muted,
|
424
|
+
start_conference_on_enter: start_conference_on_enter,
|
425
|
+
end_conference_on_exit: end_conference_on_exit,
|
426
|
+
max_participants: max_participants,
|
427
|
+
beep: beep,
|
428
|
+
record: record,
|
429
|
+
trim: trim,
|
430
|
+
wait_url: wait_url,
|
431
|
+
wait_method: wait_method,
|
432
|
+
event_callback_url: event_callback_url,
|
433
|
+
status_callback: status_callback,
|
434
|
+
status_callback_event: status_callback_event,
|
435
|
+
status_callback_method: status_callback_method,
|
436
|
+
recording_status_callback: recording_status_callback,
|
437
|
+
recording_status_callback_method: recording_status_callback_method,
|
438
|
+
**keyword_args
|
446
439
|
))
|
447
440
|
end
|
448
441
|
|
@@ -468,16 +461,17 @@ module Twilio
|
|
468
461
|
status_callback: nil,
|
469
462
|
status_callback_event: nil,
|
470
463
|
status_callback_method: nil,
|
471
|
-
**keyword_args
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
464
|
+
**keyword_args
|
465
|
+
)
|
466
|
+
append(Number.new(
|
467
|
+
number,
|
468
|
+
send_digits: send_digits,
|
469
|
+
url: url,
|
470
|
+
method: method,
|
471
|
+
status_callback: status_callback,
|
472
|
+
status_callback_event: status_callback_event,
|
473
|
+
status_callback_method: status_callback_method,
|
474
|
+
**keyword_args
|
481
475
|
))
|
482
476
|
end
|
483
477
|
|
@@ -499,14 +493,15 @@ module Twilio
|
|
499
493
|
method: nil,
|
500
494
|
reservation_sid: nil,
|
501
495
|
post_work_activity_sid: nil,
|
502
|
-
**keyword_args
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
496
|
+
**keyword_args
|
497
|
+
)
|
498
|
+
append(Queue.new(
|
499
|
+
queue_name,
|
500
|
+
url: url,
|
501
|
+
method: method,
|
502
|
+
reservation_sid: reservation_sid,
|
503
|
+
post_work_activity_sid: post_work_activity_sid,
|
504
|
+
**keyword_args
|
510
505
|
))
|
511
506
|
end
|
512
507
|
|
@@ -519,7 +514,7 @@ module Twilio
|
|
519
514
|
# == Returns:
|
520
515
|
# A <Dial> element with a <Sim> child element
|
521
516
|
def sim(sid, **keyword_args)
|
522
|
-
|
517
|
+
append(Sim.new(sid, **keyword_args))
|
523
518
|
end
|
524
519
|
|
525
520
|
# Create a <Sip> element
|
@@ -546,17 +541,18 @@ module Twilio
|
|
546
541
|
status_callback: nil,
|
547
542
|
status_callback_event: nil,
|
548
543
|
status_callback_method: nil,
|
549
|
-
**keyword_args
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
544
|
+
**keyword_args
|
545
|
+
)
|
546
|
+
append(Sip.new(
|
547
|
+
uri,
|
548
|
+
username: username,
|
549
|
+
password: password,
|
550
|
+
url: url,
|
551
|
+
method: method,
|
552
|
+
status_callback: status_callback,
|
553
|
+
status_callback_event: status_callback_event,
|
554
|
+
status_callback_method: status_callback_method,
|
555
|
+
**keyword_args
|
560
556
|
))
|
561
557
|
end
|
562
558
|
end
|
@@ -640,6 +636,7 @@ module Twilio
|
|
640
636
|
@value = sid
|
641
637
|
end
|
642
638
|
end
|
639
|
+
|
643
640
|
# <Sip> element
|
644
641
|
class Sip < TwiML
|
645
642
|
# Create a <Sip> element
|
@@ -695,7 +692,7 @@ module Twilio
|
|
695
692
|
# == Returns:
|
696
693
|
# An <Enqueue> element with a <Task> child element
|
697
694
|
def task(attributes, **keyword_args)
|
698
|
-
|
695
|
+
append(Task.new(attributes, **keyword_args))
|
699
696
|
end
|
700
697
|
end
|
701
698
|
|
@@ -711,11 +708,7 @@ module Twilio
|
|
711
708
|
# A <Task> element
|
712
709
|
def initialize(attributes, **keyword_args)
|
713
710
|
super(**keyword_args)
|
714
|
-
|
715
|
-
@value = attributes
|
716
|
-
else
|
717
|
-
@value = JSON.generate(attributes)
|
718
|
-
end
|
711
|
+
@value = attributes.is_a?(String) ? attributes : JSON.generate(attributes)
|
719
712
|
end
|
720
713
|
end
|
721
714
|
|
@@ -745,18 +738,13 @@ module Twilio
|
|
745
738
|
#
|
746
739
|
# == Returns:
|
747
740
|
# A <Gather> element with a <Say> child element
|
748
|
-
def say(
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
body,
|
756
|
-
loop: loop,
|
757
|
-
language: language,
|
758
|
-
voice: voice,
|
759
|
-
**keyword_args
|
741
|
+
def say(body, loop: nil, language: nil, voice: nil, **keyword_args)
|
742
|
+
append(Say.new(
|
743
|
+
body,
|
744
|
+
loop: loop,
|
745
|
+
language: language,
|
746
|
+
voice: voice,
|
747
|
+
**keyword_args
|
760
748
|
))
|
761
749
|
end
|
762
750
|
|
@@ -771,11 +759,11 @@ module Twilio
|
|
771
759
|
# == Returns:
|
772
760
|
# A <Gather> element with a <Play> child element
|
773
761
|
def play(url: nil, loop: nil, digits: nil, **keyword_args)
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
762
|
+
append(Play.new(
|
763
|
+
url: url,
|
764
|
+
loop: loop,
|
765
|
+
digits: digits,
|
766
|
+
**keyword_args
|
779
767
|
))
|
780
768
|
end
|
781
769
|
|
@@ -787,7 +775,7 @@ module Twilio
|
|
787
775
|
# == Returns:
|
788
776
|
# A <Gather> element with a <Pause> child element
|
789
777
|
def pause(length: nil)
|
790
|
-
|
778
|
+
append(Pause.new(length: length))
|
791
779
|
end
|
792
780
|
end
|
793
781
|
|