twilio-ruby 5.0.0.rc18 → 5.0.0.rc19
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/CHANGES.md +9 -0
- data/lib/twilio-ruby/jwt/access_token.rb +25 -0
- data/lib/twilio-ruby/rest/accounts.rb +40 -0
- data/lib/twilio-ruby/rest/accounts/v1.rb +35 -0
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +102 -0
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +352 -0
- data/lib/twilio-ruby/rest/api.rb +30 -34
- data/lib/twilio-ruby/rest/api/v2010.rb +28 -32
- data/lib/twilio-ruby/rest/api/v2010/account.rb +132 -150
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +71 -55
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +29 -29
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +58 -58
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +37 -37
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +45 -45
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +39 -39
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +39 -39
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +39 -39
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +102 -123
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +33 -33
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +38 -38
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +52 -52
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +42 -37
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +83 -40
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +131 -43
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +42 -42
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +172 -96
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +404 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +332 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +62 -57
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +62 -57
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +62 -57
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +37 -37
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +78 -85
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +19 -19
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +47 -57
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +18 -18
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +18 -18
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +46 -46
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +40 -40
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +50 -50
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +36 -36
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +101 -68
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +372 -0
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +356 -0
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +42 -42
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +43 -43
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +37 -37
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +27 -16
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +48 -48
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +43 -43
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +65 -60
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +43 -38
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +43 -38
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +48 -48
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +44 -44
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +20 -20
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +42 -42
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +13 -13
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +78 -82
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +45 -73
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +45 -73
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +45 -73
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +45 -73
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +45 -73
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +45 -73
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +45 -73
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +45 -73
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +52 -52
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +18 -18
- data/lib/twilio-ruby/rest/chat.rb +16 -9
- data/lib/twilio-ruby/rest/chat/v1.rb +4 -4
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +53 -47
- data/lib/twilio-ruby/rest/chat/v1/service.rb +446 -69
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +114 -69
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +363 -0
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +99 -44
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +76 -54
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +45 -45
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +101 -46
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +223 -0
- data/lib/twilio-ruby/rest/chat/v2.rb +44 -0
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +381 -0
- data/lib/twilio-ruby/rest/chat/v2/service.rb +633 -0
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +513 -0
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +363 -0
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +406 -0
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +418 -0
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +373 -0
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +433 -0
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +223 -0
- data/lib/twilio-ruby/rest/client.rb +91 -75
- data/lib/twilio-ruby/rest/fax.rb +40 -0
- data/lib/twilio-ruby/rest/fax/v1.rb +35 -0
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +397 -0
- data/lib/twilio-ruby/rest/ip_messaging.rb +16 -9
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +4 -4
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +53 -47
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +446 -69
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +114 -69
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +363 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +99 -44
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +76 -54
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +45 -45
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +101 -46
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +223 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2.rb +44 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +381 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +633 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +513 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +363 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +406 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +418 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +373 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +433 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +223 -0
- data/lib/twilio-ruby/rest/lookups.rb +6 -6
- data/lib/twilio-ruby/rest/lookups/v1.rb +3 -3
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +30 -25
- data/lib/twilio-ruby/rest/messaging.rb +40 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +35 -0
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +524 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +331 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +336 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +336 -0
- data/lib/twilio-ruby/rest/monitor.rb +7 -7
- data/lib/twilio-ruby/rest/monitor/v1.rb +4 -4
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +57 -85
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +63 -81
- data/lib/twilio-ruby/rest/notify.rb +7 -7
- data/lib/twilio-ruby/rest/notify/v1.rb +4 -4
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +53 -47
- data/lib/twilio-ruby/rest/notify/v1/service.rb +148 -60
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +70 -86
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +47 -33
- data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +206 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +418 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +247 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +405 -0
- data/lib/twilio-ruby/rest/preview.rb +34 -19
- data/lib/twilio-ruby/rest/preview/marketplace.rb +44 -0
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +310 -0
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +284 -0
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +411 -0
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +322 -0
- data/lib/twilio-ruby/rest/preview/sync.rb +3 -3
- data/lib/twilio-ruby/rest/preview/sync/service.rb +72 -61
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +85 -46
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +377 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +79 -47
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +46 -46
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +377 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +79 -47
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +46 -46
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +377 -0
- data/lib/twilio-ruby/rest/preview/wireless.rb +12 -12
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +68 -45
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +137 -73
- data/lib/twilio-ruby/rest/preview/wireless/{device.rb → sim.rb} +127 -150
- data/lib/twilio-ruby/rest/preview/wireless/{device → sim}/usage.rb +49 -49
- data/lib/twilio-ruby/rest/pricing.rb +8 -8
- data/lib/twilio-ruby/rest/pricing/v1.rb +5 -5
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +16 -16
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +33 -33
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +16 -16
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +33 -38
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +18 -18
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +33 -33
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +26 -26
- data/lib/twilio-ruby/rest/taskrouter.rb +6 -6
- data/lib/twilio-ruby/rest/taskrouter/v1.rb +3 -3
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +103 -82
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +48 -43
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +42 -42
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +114 -75
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +50 -40
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +35 -35
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +110 -78
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +31 -30
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +24 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +71 -61
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +50 -40
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +45 -45
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +28 -23
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +28 -23
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +60 -50
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +29 -24
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +34 -29
- data/lib/twilio-ruby/rest/trunking.rb +6 -6
- data/lib/twilio-ruby/rest/trunking/v1.rb +3 -3
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +67 -67
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +39 -39
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +39 -39
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +47 -47
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +58 -58
- data/lib/twilio-ruby/rest/video.rb +44 -0
- data/lib/twilio-ruby/rest/video/v1.rb +44 -0
- data/lib/twilio-ruby/rest/video/v1/recording.rb +341 -0
- data/lib/twilio-ruby/rest/video/v1/room.rb +411 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/accounts/v1/credential/public_key_spec.rb +226 -0
- data/spec/integration/accounts/v1/credential_spec.rb +10 -0
- data/spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb +7 -7
- data/spec/integration/api/v2010/account/address_spec.rb +32 -24
- data/spec/integration/api/v2010/account/application_spec.rb +24 -24
- data/spec/integration/api/v2010/account/authorized_connect_app_spec.rb +11 -11
- data/spec/integration/api/v2010/account/available_phone_number/local_spec.rb +7 -7
- data/spec/integration/api/v2010/account/available_phone_number/mobile_spec.rb +7 -7
- data/spec/integration/api/v2010/account/available_phone_number/toll_free_spec.rb +7 -7
- data/spec/integration/api/v2010/account/available_phone_number_spec.rb +11 -11
- data/spec/integration/api/v2010/account/call/feedback_spec.rb +14 -14
- data/spec/integration/api/v2010/account/call/feedback_summary_spec.rb +14 -14
- data/spec/integration/api/v2010/account/call/notification_spec.rb +15 -15
- data/spec/integration/api/v2010/account/call/recording_spec.rb +15 -15
- data/spec/integration/api/v2010/account/call_spec.rb +24 -24
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +97 -25
- data/spec/integration/api/v2010/account/conference_spec.rb +56 -17
- data/spec/integration/api/v2010/account/connect_app_spec.rb +15 -15
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +135 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +223 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +12 -12
- data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +12 -12
- data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +12 -12
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +32 -24
- data/spec/integration/api/v2010/account/key_spec.rb +19 -19
- data/spec/integration/api/v2010/account/message/feedback_spec.rb +25 -3
- data/spec/integration/api/v2010/account/message/media_spec.rb +15 -15
- data/spec/integration/api/v2010/account/message_spec.rb +34 -27
- data/spec/integration/api/v2010/account/new_key_spec.rb +5 -5
- data/spec/integration/api/v2010/account/new_signing_key_spec.rb +5 -5
- data/spec/integration/api/v2010/account/notification_spec.rb +15 -15
- data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +19 -19
- data/spec/integration/api/v2010/account/queue/member_spec.rb +15 -15
- data/spec/integration/api/v2010/account/queue_spec.rb +30 -27
- data/spec/integration/api/v2010/account/recording/add_on_result/payload_spec.rb +175 -0
- data/spec/integration/api/v2010/account/recording/add_on_result_spec.rb +166 -0
- data/spec/integration/api/v2010/account/recording/transcription_spec.rb +15 -15
- data/spec/integration/api/v2010/account/recording_spec.rb +16 -16
- data/spec/integration/api/v2010/account/short_code_spec.rb +15 -15
- data/spec/integration/api/v2010/account/signing_key_spec.rb +19 -19
- data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +24 -24
- data/spec/integration/api/v2010/account/sip/credential_list_spec.rb +24 -24
- data/spec/integration/api/v2010/account/sip/domain/credential_list_mapping_spec.rb +20 -20
- data/spec/integration/api/v2010/account/sip/domain/ip_access_control_list_mapping_spec.rb +20 -20
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +24 -24
- data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +24 -24
- data/spec/integration/api/v2010/account/sip/ip_access_control_list_spec.rb +24 -24
- data/spec/integration/api/v2010/account/sip_spec.rb +1 -1
- data/spec/integration/api/v2010/account/token_spec.rb +6 -6
- data/spec/integration/api/v2010/account/transcription_spec.rb +15 -15
- data/spec/integration/api/v2010/account/usage/record/all_time_spec.rb +7 -7
- data/spec/integration/api/v2010/account/usage/record/daily_spec.rb +7 -7
- data/spec/integration/api/v2010/account/usage/record/last_month_spec.rb +7 -7
- data/spec/integration/api/v2010/account/usage/record/monthly_spec.rb +7 -7
- data/spec/integration/api/v2010/account/usage/record/this_month_spec.rb +7 -7
- data/spec/integration/api/v2010/account/usage/record/today_spec.rb +7 -7
- data/spec/integration/api/v2010/account/usage/record/yearly_spec.rb +7 -7
- data/spec/integration/api/v2010/account/usage/record/yesterday_spec.rb +7 -7
- data/spec/integration/api/v2010/account/usage/record_spec.rb +7 -7
- data/spec/integration/api/v2010/account/usage/trigger_spec.rb +27 -27
- data/spec/integration/api/v2010/account/usage_spec.rb +1 -1
- data/spec/integration/api/v2010/account/validation_request_spec.rb +23 -3
- data/spec/integration/api/v2010/account_spec.rb +20 -24
- data/spec/integration/chat/v1/credential_spec.rb +31 -31
- data/spec/integration/chat/v1/service/channel/invite_spec.rb +210 -0
- data/spec/integration/chat/v1/service/channel/member_spec.rb +102 -31
- data/spec/integration/chat/v1/service/channel/message_spec.rb +210 -16
- data/spec/integration/chat/v1/service/channel_spec.rb +71 -55
- data/spec/integration/chat/v1/service/role_spec.rb +33 -33
- data/spec/integration/chat/v1/service/user/user_channel_spec.rb +92 -0
- data/spec/integration/chat/v1/service/user_spec.rb +57 -33
- data/spec/integration/chat/v1/service_spec.rb +142 -106
- data/spec/integration/chat/v2/credential_spec.rb +223 -0
- data/spec/integration/chat/v2/service/channel/invite_spec.rb +210 -0
- data/spec/integration/chat/v2/service/channel/member_spec.rb +284 -0
- data/spec/integration/chat/v2/service/channel/message_spec.rb +294 -0
- data/spec/integration/chat/v2/service/channel_spec.rb +275 -0
- data/spec/integration/chat/v2/service/role_spec.rb +263 -0
- data/spec/integration/chat/v2/service/user/user_channel_spec.rb +92 -0
- data/spec/integration/chat/v2/service/user_spec.rb +266 -0
- data/spec/integration/chat/v2/service_spec.rb +325 -0
- data/spec/integration/fax/v1/fax_spec.rb +231 -0
- data/spec/integration/ip_messaging/v1/credential_spec.rb +31 -31
- data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +210 -0
- data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +102 -31
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +210 -16
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +71 -55
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +33 -33
- data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +92 -0
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +57 -33
- data/spec/integration/ip_messaging/v1/service_spec.rb +142 -106
- data/spec/integration/ip_messaging/v2/credential_spec.rb +223 -0
- data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +210 -0
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +284 -0
- data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +294 -0
- data/spec/integration/ip_messaging/v2/service/channel_spec.rb +275 -0
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +263 -0
- data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +92 -0
- data/spec/integration/ip_messaging/v2/service/user_spec.rb +266 -0
- data/spec/integration/ip_messaging/v2/service_spec.rb +325 -0
- data/spec/integration/lookups/v1/phone_number_spec.rb +5 -5
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +170 -0
- data/spec/integration/messaging/v1/service/phone_number_spec.rb +173 -0
- data/spec/integration/messaging/v1/service/short_code_spec.rb +173 -0
- data/spec/integration/messaging/v1/service_spec.rb +243 -0
- data/spec/integration/monitor/v1/alert_spec.rb +57 -57
- data/spec/integration/monitor/v1/event_spec.rb +11 -11
- data/spec/integration/notify/v1/credential_spec.rb +23 -23
- data/spec/integration/notify/v1/service/binding_spec.rb +88 -71
- data/spec/integration/notify/v1/service/notification_spec.rb +7 -5
- data/spec/integration/notify/v1/service/segment_spec.rb +84 -0
- data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +118 -0
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +235 -0
- data/spec/integration/notify/v1/service/user_spec.rb +213 -0
- data/spec/integration/notify/v1/service_spec.rb +50 -30
- data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +121 -0
- data/spec/integration/preview/marketplace/available_add_on_spec.rb +142 -0
- data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +164 -0
- data/spec/integration/preview/marketplace/installed_add_on_spec.rb +252 -0
- data/spec/integration/preview/sync/service/document/document_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/document_spec.rb +179 -17
- data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +167 -11
- data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/sync_list_spec.rb +143 -9
- data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +167 -11
- data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/sync_map_spec.rb +143 -9
- data/spec/integration/preview/sync/service_spec.rb +171 -11
- data/spec/integration/preview/wireless/command_spec.rb +120 -9
- data/spec/integration/preview/wireless/rate_plan_spec.rb +228 -7
- data/spec/integration/preview/wireless/sim/usage_spec.rb +49 -0
- data/spec/integration/preview/wireless/sim_spec.rb +184 -0
- data/spec/integration/pricing/v1/messaging/country_spec.rb +101 -5
- data/spec/integration/pricing/v1/messaging_spec.rb +1 -1
- data/spec/integration/pricing/v1/phone_number/country_spec.rb +11 -11
- data/spec/integration/pricing/v1/phone_number_spec.rb +1 -1
- data/spec/integration/pricing/v1/voice/country_spec.rb +11 -11
- data/spec/integration/pricing/v1/voice/number_spec.rb +5 -5
- data/spec/integration/pricing/v1/voice_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/activity_spec.rb +29 -33
- data/spec/integration/taskrouter/v1/workspace/event_spec.rb +11 -11
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +15 -15
- data/spec/integration/taskrouter/v1/workspace/task_channel_spec.rb +11 -11
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_statistics_spec.rb +12 -10
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queues_statistics_spec.rb +17 -16
- data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +52 -36
- data/spec/integration/taskrouter/v1/workspace/task_spec.rb +101 -46
- data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +15 -15
- data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +15 -15
- data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +6 -5
- data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +6 -5
- data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +39 -27
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_statistics_spec.rb +13 -11
- data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +47 -35
- data/spec/integration/taskrouter/v1/workspace/workspace_statistics_spec.rb +10 -8
- data/spec/integration/taskrouter/v1/workspace_spec.rb +28 -24
- data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +20 -20
- data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +62 -62
- data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +23 -23
- data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +19 -19
- data/spec/integration/trunking/v1/trunk_spec.rb +23 -23
- data/spec/integration/video/v1/recording_spec.rb +120 -0
- data/spec/integration/video/v1/room_spec.rb +225 -0
- data/spec/jwt/access_token_spec.rb +22 -0
- metadata +158 -12
- data/lib/twilio-ruby/rest/api/v2010/account/sandbox.rb +0 -287
- data/spec/integration/api/v2010/account/sandbox_spec.rb +0 -99
- data/spec/integration/preview/wireless/device/usage_spec.rb +0 -25
- data/spec/integration/preview/wireless/device_spec.rb +0 -72
@@ -2,7 +2,7 @@
|
|
2
2
|
# This code was generated by
|
3
3
|
# \ / _ _ _| _ _
|
4
4
|
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
-
# / /
|
5
|
+
# / /
|
6
6
|
|
7
7
|
module Twilio
|
8
8
|
module REST
|
@@ -11,25 +11,25 @@ module Twilio
|
|
11
11
|
# Initialize the Lookups Domain
|
12
12
|
def initialize(twilio)
|
13
13
|
super
|
14
|
-
|
14
|
+
|
15
15
|
@base_url = 'https://lookups.twilio.com'
|
16
16
|
@host = 'lookups.twilio.com'
|
17
17
|
@port = 443
|
18
|
-
|
18
|
+
|
19
19
|
# Versions
|
20
20
|
@v1 = nil
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
##
|
24
24
|
# Version v1 of lookups
|
25
25
|
def v1
|
26
26
|
@v1 ||= V1.new self
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
def phone_numbers
|
30
30
|
self.v1.phone_numbers
|
31
31
|
end
|
32
|
-
|
32
|
+
|
33
33
|
##
|
34
34
|
# Provide a user friendly representation
|
35
35
|
def to_s
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# This code was generated by
|
3
3
|
# \ / _ _ _| _ _
|
4
4
|
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
-
# / /
|
5
|
+
# / /
|
6
6
|
|
7
7
|
module Twilio
|
8
8
|
module REST
|
@@ -15,7 +15,7 @@ module Twilio
|
|
15
15
|
@version = 'v1'
|
16
16
|
@phone_numbers = nil
|
17
17
|
end
|
18
|
-
|
18
|
+
|
19
19
|
def phone_numbers(sid=:unset)
|
20
20
|
if sid == :unset
|
21
21
|
@phone_numbers ||= PhoneNumberList.new self
|
@@ -23,7 +23,7 @@ module Twilio
|
|
23
23
|
PhoneNumberContext.new(self, sid)
|
24
24
|
end
|
25
25
|
end
|
26
|
-
|
26
|
+
|
27
27
|
##
|
28
28
|
# Provide a user friendly representation
|
29
29
|
def to_s
|
@@ -2,7 +2,7 @@
|
|
2
2
|
# This code was generated by
|
3
3
|
# \ / _ _ _| _ _
|
4
4
|
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
-
# / /
|
5
|
+
# / /
|
6
6
|
|
7
7
|
module Twilio
|
8
8
|
module REST
|
@@ -15,18 +15,18 @@ module Twilio
|
|
15
15
|
# @return [PhoneNumberList] PhoneNumberList
|
16
16
|
def initialize(version)
|
17
17
|
super(version)
|
18
|
-
|
18
|
+
|
19
19
|
# Path Solution
|
20
20
|
@solution = {}
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
##
|
24
24
|
# Provide a user friendly representation
|
25
25
|
def to_s
|
26
26
|
'#<Twilio.Lookups.V1.PhoneNumberList>'
|
27
27
|
end
|
28
28
|
end
|
29
|
-
|
29
|
+
|
30
30
|
class PhoneNumberPage < Page
|
31
31
|
##
|
32
32
|
# Initialize the PhoneNumberPage
|
@@ -36,11 +36,11 @@ module Twilio
|
|
36
36
|
# @return [PhoneNumberPage] PhoneNumberPage
|
37
37
|
def initialize(version, response, solution)
|
38
38
|
super(version, response)
|
39
|
-
|
39
|
+
|
40
40
|
# Path Solution
|
41
41
|
@solution = solution
|
42
42
|
end
|
43
|
-
|
43
|
+
|
44
44
|
##
|
45
45
|
# Build an instance of PhoneNumberInstance
|
46
46
|
# @param [Hash] payload Payload response from the API
|
@@ -51,14 +51,14 @@ module Twilio
|
|
51
51
|
payload,
|
52
52
|
)
|
53
53
|
end
|
54
|
-
|
54
|
+
|
55
55
|
##
|
56
56
|
# Provide a user friendly representation
|
57
57
|
def to_s
|
58
58
|
'<Twilio.Lookups.V1.PhoneNumberPage>'
|
59
59
|
end
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
class PhoneNumberContext < InstanceContext
|
63
63
|
##
|
64
64
|
# Initialize the PhoneNumberContext
|
@@ -67,14 +67,14 @@ module Twilio
|
|
67
67
|
# @return [PhoneNumberContext] PhoneNumberContext
|
68
68
|
def initialize(version, phone_number)
|
69
69
|
super(version)
|
70
|
-
|
70
|
+
|
71
71
|
# Path Solution
|
72
72
|
@solution = {
|
73
73
|
phone_number: phone_number,
|
74
74
|
}
|
75
75
|
@uri = "/PhoneNumbers/#{@solution[:phone_number]}"
|
76
76
|
end
|
77
|
-
|
77
|
+
|
78
78
|
##
|
79
79
|
# Fetch a PhoneNumberInstance
|
80
80
|
# @param [String] country_code The country_code
|
@@ -88,21 +88,21 @@ module Twilio
|
|
88
88
|
'Type' => type,
|
89
89
|
'AddOns' => add_ons,
|
90
90
|
}
|
91
|
-
|
91
|
+
|
92
92
|
params.merge!(Twilio.prefixed_collapsible_map(add_ons_data, 'AddOns'))
|
93
93
|
payload = @version.fetch(
|
94
94
|
'GET',
|
95
95
|
@uri,
|
96
96
|
params,
|
97
97
|
)
|
98
|
-
|
98
|
+
|
99
99
|
return PhoneNumberInstance.new(
|
100
100
|
@version,
|
101
101
|
payload,
|
102
102
|
phone_number: @solution[:phone_number],
|
103
103
|
)
|
104
104
|
end
|
105
|
-
|
105
|
+
|
106
106
|
##
|
107
107
|
# Provide a user friendly representation
|
108
108
|
def to_s
|
@@ -110,7 +110,7 @@ module Twilio
|
|
110
110
|
"#<Twilio.Lookups.V1.PhoneNumberContext #{context}>"
|
111
111
|
end
|
112
112
|
end
|
113
|
-
|
113
|
+
|
114
114
|
class PhoneNumberInstance < InstanceResource
|
115
115
|
##
|
116
116
|
# Initialize the PhoneNumberInstance
|
@@ -120,7 +120,7 @@ module Twilio
|
|
120
120
|
# @return [PhoneNumberInstance] PhoneNumberInstance
|
121
121
|
def initialize(version, payload, phone_number: nil)
|
122
122
|
super(version)
|
123
|
-
|
123
|
+
|
124
124
|
# Marshaled Properties
|
125
125
|
@properties = {
|
126
126
|
'caller_name' => payload['caller_name'],
|
@@ -129,15 +129,16 @@ module Twilio
|
|
129
129
|
'national_format' => payload['national_format'],
|
130
130
|
'carrier' => payload['carrier'],
|
131
131
|
'add_ons' => payload['add_ons'],
|
132
|
+
'url' => payload['url'],
|
132
133
|
}
|
133
|
-
|
134
|
+
|
134
135
|
# Context
|
135
136
|
@instance_context = nil
|
136
137
|
@params = {
|
137
138
|
'phone_number' => phone_number || @properties['phone_number'],
|
138
139
|
}
|
139
140
|
end
|
140
|
-
|
141
|
+
|
141
142
|
##
|
142
143
|
# Generate an instance context for the instance, the context is capable of
|
143
144
|
# performing various actions. All instance actions are proxied to the context
|
@@ -152,31 +153,35 @@ module Twilio
|
|
152
153
|
end
|
153
154
|
@instance_context
|
154
155
|
end
|
155
|
-
|
156
|
+
|
156
157
|
def caller_name
|
157
158
|
@properties['caller_name']
|
158
159
|
end
|
159
|
-
|
160
|
+
|
160
161
|
def country_code
|
161
162
|
@properties['country_code']
|
162
163
|
end
|
163
|
-
|
164
|
+
|
164
165
|
def phone_number
|
165
166
|
@properties['phone_number']
|
166
167
|
end
|
167
|
-
|
168
|
+
|
168
169
|
def national_format
|
169
170
|
@properties['national_format']
|
170
171
|
end
|
171
|
-
|
172
|
+
|
172
173
|
def carrier
|
173
174
|
@properties['carrier']
|
174
175
|
end
|
175
|
-
|
176
|
+
|
176
177
|
def add_ons
|
177
178
|
@properties['add_ons']
|
178
179
|
end
|
179
|
-
|
180
|
+
|
181
|
+
def url
|
182
|
+
@properties['url']
|
183
|
+
end
|
184
|
+
|
180
185
|
##
|
181
186
|
# Fetch a PhoneNumberInstance
|
182
187
|
# @param [String] country_code The country_code
|
@@ -192,7 +197,7 @@ module Twilio
|
|
192
197
|
add_ons_data: add_ons_data,
|
193
198
|
)
|
194
199
|
end
|
195
|
-
|
200
|
+
|
196
201
|
##
|
197
202
|
# Provide a user friendly representation
|
198
203
|
def to_s
|
@@ -0,0 +1,40 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Messaging < Domain
|
10
|
+
##
|
11
|
+
# Initialize the Messaging Domain
|
12
|
+
def initialize(twilio)
|
13
|
+
super
|
14
|
+
|
15
|
+
@base_url = 'https://messaging.twilio.com'
|
16
|
+
@host = 'messaging.twilio.com'
|
17
|
+
@port = 443
|
18
|
+
|
19
|
+
# Versions
|
20
|
+
@v1 = nil
|
21
|
+
end
|
22
|
+
|
23
|
+
##
|
24
|
+
# Version v1 of messaging
|
25
|
+
def v1
|
26
|
+
@v1 ||= V1.new self
|
27
|
+
end
|
28
|
+
|
29
|
+
def services
|
30
|
+
self.v1.services
|
31
|
+
end
|
32
|
+
|
33
|
+
##
|
34
|
+
# Provide a user friendly representation
|
35
|
+
def to_s
|
36
|
+
'#<Twilio::REST::Messaging>'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,35 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Messaging
|
10
|
+
class V1 < Version
|
11
|
+
##
|
12
|
+
# Initialize the V1 version of Messaging
|
13
|
+
def initialize(domain)
|
14
|
+
super
|
15
|
+
@version = 'v1'
|
16
|
+
@services = nil
|
17
|
+
end
|
18
|
+
|
19
|
+
def services(sid=:unset)
|
20
|
+
if sid == :unset
|
21
|
+
@services ||= ServiceList.new self
|
22
|
+
else
|
23
|
+
ServiceContext.new(self, sid)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Provide a user friendly representation
|
29
|
+
def to_s
|
30
|
+
'<Twilio::REST::Messaging::V1>'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,524 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Messaging < Domain
|
10
|
+
class V1 < Version
|
11
|
+
class ServiceList < ListResource
|
12
|
+
##
|
13
|
+
# Initialize the ServiceList
|
14
|
+
# @param [Version] version Version that contains the resource
|
15
|
+
# @return [ServiceList] ServiceList
|
16
|
+
def initialize(version)
|
17
|
+
super(version)
|
18
|
+
|
19
|
+
# Path Solution
|
20
|
+
@solution = {}
|
21
|
+
@uri = "/Services"
|
22
|
+
end
|
23
|
+
|
24
|
+
##
|
25
|
+
# Retrieve a single page of ServiceInstance records from the API.
|
26
|
+
# Request is executed immediately.
|
27
|
+
# @param [String] friendly_name The friendly_name
|
28
|
+
# @param [String] inbound_request_url The inbound_request_url
|
29
|
+
# @param [String] inbound_method The inbound_method
|
30
|
+
# @param [String] fallback_url The fallback_url
|
31
|
+
# @param [String] fallback_method The fallback_method
|
32
|
+
# @param [String] status_callback The status_callback
|
33
|
+
# @param [Boolean] sticky_sender The sticky_sender
|
34
|
+
# @param [Boolean] mms_converter The mms_converter
|
35
|
+
# @param [Boolean] smart_encoding The smart_encoding
|
36
|
+
# @return [ServiceInstance] Newly created ServiceInstance
|
37
|
+
def create(friendly_name: nil, inbound_request_url: nil, inbound_method: nil, fallback_url: nil, fallback_method: nil, status_callback: nil, sticky_sender: nil, mms_converter: nil, smart_encoding: nil)
|
38
|
+
data = {
|
39
|
+
'FriendlyName' => friendly_name,
|
40
|
+
'InboundRequestUrl' => inbound_request_url,
|
41
|
+
'InboundMethod' => inbound_method,
|
42
|
+
'FallbackUrl' => fallback_url,
|
43
|
+
'FallbackMethod' => fallback_method,
|
44
|
+
'StatusCallback' => status_callback,
|
45
|
+
'StickySender' => sticky_sender,
|
46
|
+
'MmsConverter' => mms_converter,
|
47
|
+
'SmartEncoding' => smart_encoding,
|
48
|
+
}
|
49
|
+
|
50
|
+
payload = @version.create(
|
51
|
+
'POST',
|
52
|
+
@uri,
|
53
|
+
data: data
|
54
|
+
)
|
55
|
+
|
56
|
+
return ServiceInstance.new(
|
57
|
+
@version,
|
58
|
+
payload,
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
##
|
63
|
+
# Lists ServiceInstance records from the API as a list.
|
64
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
65
|
+
# memory before returning.
|
66
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
67
|
+
# guarantees to never return more than limit. Default is no limit
|
68
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
69
|
+
# the default value of 50 records. If no page_size is defined
|
70
|
+
# but a limit is defined, stream() will attempt to read the
|
71
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
72
|
+
# @return [Array] Array of up to limit results
|
73
|
+
def list(limit: nil, page_size: nil)
|
74
|
+
self.stream(
|
75
|
+
limit: limit,
|
76
|
+
page_size: page_size
|
77
|
+
).entries
|
78
|
+
end
|
79
|
+
|
80
|
+
##
|
81
|
+
# Streams ServiceInstance records from the API as an Enumerable.
|
82
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
83
|
+
# is reached.
|
84
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
85
|
+
# guarantees to never return more than limit. Default is no limit
|
86
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
87
|
+
# the default value of 50 records. If no page_size is defined
|
88
|
+
# but a limit is defined, stream() will attempt to read the
|
89
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
90
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
91
|
+
def stream(limit: nil, page_size: nil)
|
92
|
+
limits = @version.read_limits(limit, page_size)
|
93
|
+
|
94
|
+
page = self.page(
|
95
|
+
page_size: limits[:page_size],
|
96
|
+
)
|
97
|
+
|
98
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# When passed a block, yields ServiceInstance records from the API.
|
103
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
104
|
+
# is reached.
|
105
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
106
|
+
# guarantees to never return more than limit. Default is no limit
|
107
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
108
|
+
# the default value of 50 records. If no page_size is defined
|
109
|
+
# but a limit is defined, stream() will attempt to read the
|
110
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
111
|
+
def each
|
112
|
+
limits = @version.read_limits
|
113
|
+
|
114
|
+
page = self.page(
|
115
|
+
page_size: limits[:page_size],
|
116
|
+
)
|
117
|
+
|
118
|
+
@version.stream(page,
|
119
|
+
limit: limits[:limit],
|
120
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
121
|
+
end
|
122
|
+
|
123
|
+
##
|
124
|
+
# Retrieve a single page of ServiceInstance records from the API.
|
125
|
+
# Request is executed immediately.
|
126
|
+
# @param [String] page_token PageToken provided by the API
|
127
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
128
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
129
|
+
# @return [Page] Page of ServiceInstance
|
130
|
+
def page(page_token: nil, page_number: nil, page_size: nil)
|
131
|
+
params = {
|
132
|
+
'PageToken' => page_token,
|
133
|
+
'Page' => page_number,
|
134
|
+
'PageSize' => page_size,
|
135
|
+
}
|
136
|
+
response = @version.page(
|
137
|
+
'GET',
|
138
|
+
@uri,
|
139
|
+
params
|
140
|
+
)
|
141
|
+
return ServicePage.new(@version, response, @solution)
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# Provide a user friendly representation
|
146
|
+
def to_s
|
147
|
+
'#<Twilio.Messaging.V1.ServiceList>'
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
class ServicePage < Page
|
152
|
+
##
|
153
|
+
# Initialize the ServicePage
|
154
|
+
# @param [Version] version Version that contains the resource
|
155
|
+
# @param [Response] response Response from the API
|
156
|
+
# @param [Hash] solution Path solution for the resource
|
157
|
+
# @return [ServicePage] ServicePage
|
158
|
+
def initialize(version, response, solution)
|
159
|
+
super(version, response)
|
160
|
+
|
161
|
+
# Path Solution
|
162
|
+
@solution = solution
|
163
|
+
end
|
164
|
+
|
165
|
+
##
|
166
|
+
# Build an instance of ServiceInstance
|
167
|
+
# @param [Hash] payload Payload response from the API
|
168
|
+
# @return [ServiceInstance] ServiceInstance
|
169
|
+
def get_instance(payload)
|
170
|
+
return ServiceInstance.new(
|
171
|
+
@version,
|
172
|
+
payload,
|
173
|
+
)
|
174
|
+
end
|
175
|
+
|
176
|
+
##
|
177
|
+
# Provide a user friendly representation
|
178
|
+
def to_s
|
179
|
+
'<Twilio.Messaging.V1.ServicePage>'
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
class ServiceContext < InstanceContext
|
184
|
+
##
|
185
|
+
# Initialize the ServiceContext
|
186
|
+
# @param [Version] version Version that contains the resource
|
187
|
+
# @param [String] sid The sid
|
188
|
+
# @return [ServiceContext] ServiceContext
|
189
|
+
def initialize(version, sid)
|
190
|
+
super(version)
|
191
|
+
|
192
|
+
# Path Solution
|
193
|
+
@solution = {
|
194
|
+
sid: sid,
|
195
|
+
}
|
196
|
+
@uri = "/Services/#{@solution[:sid]}"
|
197
|
+
|
198
|
+
# Dependents
|
199
|
+
@phone_numbers = nil
|
200
|
+
@short_codes = nil
|
201
|
+
@alpha_senders = nil
|
202
|
+
end
|
203
|
+
|
204
|
+
##
|
205
|
+
# Update the ServiceInstance
|
206
|
+
# @param [String] friendly_name The friendly_name
|
207
|
+
# @param [String] inbound_request_url The inbound_request_url
|
208
|
+
# @param [String] inbound_method The inbound_method
|
209
|
+
# @param [String] fallback_url The fallback_url
|
210
|
+
# @param [String] fallback_method The fallback_method
|
211
|
+
# @param [String] status_callback The status_callback
|
212
|
+
# @param [Boolean] sticky_sender The sticky_sender
|
213
|
+
# @param [Boolean] mms_converter The mms_converter
|
214
|
+
# @param [Boolean] smart_encoding The smart_encoding
|
215
|
+
# @return [ServiceInstance] Updated ServiceInstance
|
216
|
+
def update(friendly_name: nil, inbound_request_url: nil, inbound_method: nil, fallback_url: nil, fallback_method: nil, status_callback: nil, sticky_sender: nil, mms_converter: nil, smart_encoding: nil)
|
217
|
+
data = {
|
218
|
+
'FriendlyName' => friendly_name,
|
219
|
+
'InboundRequestUrl' => inbound_request_url,
|
220
|
+
'InboundMethod' => inbound_method,
|
221
|
+
'FallbackUrl' => fallback_url,
|
222
|
+
'FallbackMethod' => fallback_method,
|
223
|
+
'StatusCallback' => status_callback,
|
224
|
+
'StickySender' => sticky_sender,
|
225
|
+
'MmsConverter' => mms_converter,
|
226
|
+
'SmartEncoding' => smart_encoding,
|
227
|
+
}
|
228
|
+
|
229
|
+
payload = @version.update(
|
230
|
+
'POST',
|
231
|
+
@uri,
|
232
|
+
data: data,
|
233
|
+
)
|
234
|
+
|
235
|
+
return ServiceInstance.new(
|
236
|
+
@version,
|
237
|
+
payload,
|
238
|
+
sid: @solution[:sid],
|
239
|
+
)
|
240
|
+
end
|
241
|
+
|
242
|
+
##
|
243
|
+
# Fetch a ServiceInstance
|
244
|
+
# @return [ServiceInstance] Fetched ServiceInstance
|
245
|
+
def fetch
|
246
|
+
params = {}
|
247
|
+
|
248
|
+
payload = @version.fetch(
|
249
|
+
'GET',
|
250
|
+
@uri,
|
251
|
+
params,
|
252
|
+
)
|
253
|
+
|
254
|
+
return ServiceInstance.new(
|
255
|
+
@version,
|
256
|
+
payload,
|
257
|
+
sid: @solution[:sid],
|
258
|
+
)
|
259
|
+
end
|
260
|
+
|
261
|
+
##
|
262
|
+
# Deletes the ServiceInstance
|
263
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
264
|
+
def delete
|
265
|
+
return @version.delete('delete', @uri)
|
266
|
+
end
|
267
|
+
|
268
|
+
##
|
269
|
+
# Access the phone_numbers
|
270
|
+
# @return [PhoneNumberList] PhoneNumberList
|
271
|
+
def phone_numbers(sid=:unset)
|
272
|
+
if sid != :unset
|
273
|
+
return PhoneNumberContext.new(
|
274
|
+
@version,
|
275
|
+
@solution[:sid],
|
276
|
+
sid,
|
277
|
+
)
|
278
|
+
end
|
279
|
+
|
280
|
+
unless @phone_numbers
|
281
|
+
@phone_numbers = PhoneNumberList.new(
|
282
|
+
@version,
|
283
|
+
service_sid: @solution[:sid],
|
284
|
+
)
|
285
|
+
end
|
286
|
+
|
287
|
+
@phone_numbers
|
288
|
+
end
|
289
|
+
|
290
|
+
##
|
291
|
+
# Access the short_codes
|
292
|
+
# @return [ShortCodeList] ShortCodeList
|
293
|
+
def short_codes(sid=:unset)
|
294
|
+
if sid != :unset
|
295
|
+
return ShortCodeContext.new(
|
296
|
+
@version,
|
297
|
+
@solution[:sid],
|
298
|
+
sid,
|
299
|
+
)
|
300
|
+
end
|
301
|
+
|
302
|
+
unless @short_codes
|
303
|
+
@short_codes = ShortCodeList.new(
|
304
|
+
@version,
|
305
|
+
service_sid: @solution[:sid],
|
306
|
+
)
|
307
|
+
end
|
308
|
+
|
309
|
+
@short_codes
|
310
|
+
end
|
311
|
+
|
312
|
+
##
|
313
|
+
# Access the alpha_senders
|
314
|
+
# @return [AlphaSenderList] AlphaSenderList
|
315
|
+
def alpha_senders(sid=:unset)
|
316
|
+
if sid != :unset
|
317
|
+
return AlphaSenderContext.new(
|
318
|
+
@version,
|
319
|
+
@solution[:sid],
|
320
|
+
sid,
|
321
|
+
)
|
322
|
+
end
|
323
|
+
|
324
|
+
unless @alpha_senders
|
325
|
+
@alpha_senders = AlphaSenderList.new(
|
326
|
+
@version,
|
327
|
+
service_sid: @solution[:sid],
|
328
|
+
)
|
329
|
+
end
|
330
|
+
|
331
|
+
@alpha_senders
|
332
|
+
end
|
333
|
+
|
334
|
+
##
|
335
|
+
# Provide a user friendly representation
|
336
|
+
def to_s
|
337
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
338
|
+
"#<Twilio.Messaging.V1.ServiceContext #{context}>"
|
339
|
+
end
|
340
|
+
end
|
341
|
+
|
342
|
+
class ServiceInstance < InstanceResource
|
343
|
+
##
|
344
|
+
# Initialize the ServiceInstance
|
345
|
+
# @param [Version] version Version that contains the resource
|
346
|
+
# @param [Hash] payload payload that contains response from Twilio
|
347
|
+
# @param [String] sid The sid
|
348
|
+
# @return [ServiceInstance] ServiceInstance
|
349
|
+
def initialize(version, payload, sid: nil)
|
350
|
+
super(version)
|
351
|
+
|
352
|
+
# Marshaled Properties
|
353
|
+
@properties = {
|
354
|
+
'sid' => payload['sid'],
|
355
|
+
'account_sid' => payload['account_sid'],
|
356
|
+
'friendly_name' => payload['friendly_name'],
|
357
|
+
'date_created' => Twilio.deserialize_iso8601(payload['date_created']),
|
358
|
+
'date_updated' => Twilio.deserialize_iso8601(payload['date_updated']),
|
359
|
+
'inbound_request_url' => payload['inbound_request_url'],
|
360
|
+
'inbound_method' => payload['inbound_method'],
|
361
|
+
'fallback_url' => payload['fallback_url'],
|
362
|
+
'fallback_method' => payload['fallback_method'],
|
363
|
+
'status_callback' => payload['status_callback'],
|
364
|
+
'sticky_sender' => payload['sticky_sender'],
|
365
|
+
'mms_converter' => payload['mms_converter'],
|
366
|
+
'smart_encoding' => payload['smart_encoding'],
|
367
|
+
'url' => payload['url'],
|
368
|
+
'links' => payload['links'],
|
369
|
+
}
|
370
|
+
|
371
|
+
# Context
|
372
|
+
@instance_context = nil
|
373
|
+
@params = {
|
374
|
+
'sid' => sid || @properties['sid'],
|
375
|
+
}
|
376
|
+
end
|
377
|
+
|
378
|
+
##
|
379
|
+
# Generate an instance context for the instance, the context is capable of
|
380
|
+
# performing various actions. All instance actions are proxied to the context
|
381
|
+
# @param [Version] version Version that contains the resource
|
382
|
+
# @return [ServiceContext] ServiceContext for this ServiceInstance
|
383
|
+
def context
|
384
|
+
unless @instance_context
|
385
|
+
@instance_context = ServiceContext.new(
|
386
|
+
@version,
|
387
|
+
@params['sid'],
|
388
|
+
)
|
389
|
+
end
|
390
|
+
@instance_context
|
391
|
+
end
|
392
|
+
|
393
|
+
def sid
|
394
|
+
@properties['sid']
|
395
|
+
end
|
396
|
+
|
397
|
+
def account_sid
|
398
|
+
@properties['account_sid']
|
399
|
+
end
|
400
|
+
|
401
|
+
def friendly_name
|
402
|
+
@properties['friendly_name']
|
403
|
+
end
|
404
|
+
|
405
|
+
def date_created
|
406
|
+
@properties['date_created']
|
407
|
+
end
|
408
|
+
|
409
|
+
def date_updated
|
410
|
+
@properties['date_updated']
|
411
|
+
end
|
412
|
+
|
413
|
+
def inbound_request_url
|
414
|
+
@properties['inbound_request_url']
|
415
|
+
end
|
416
|
+
|
417
|
+
def inbound_method
|
418
|
+
@properties['inbound_method']
|
419
|
+
end
|
420
|
+
|
421
|
+
def fallback_url
|
422
|
+
@properties['fallback_url']
|
423
|
+
end
|
424
|
+
|
425
|
+
def fallback_method
|
426
|
+
@properties['fallback_method']
|
427
|
+
end
|
428
|
+
|
429
|
+
def status_callback
|
430
|
+
@properties['status_callback']
|
431
|
+
end
|
432
|
+
|
433
|
+
def sticky_sender
|
434
|
+
@properties['sticky_sender']
|
435
|
+
end
|
436
|
+
|
437
|
+
def mms_converter
|
438
|
+
@properties['mms_converter']
|
439
|
+
end
|
440
|
+
|
441
|
+
def smart_encoding
|
442
|
+
@properties['smart_encoding']
|
443
|
+
end
|
444
|
+
|
445
|
+
def url
|
446
|
+
@properties['url']
|
447
|
+
end
|
448
|
+
|
449
|
+
def links
|
450
|
+
@properties['links']
|
451
|
+
end
|
452
|
+
|
453
|
+
##
|
454
|
+
# Update the ServiceInstance
|
455
|
+
# @param [String] friendly_name The friendly_name
|
456
|
+
# @param [String] inbound_request_url The inbound_request_url
|
457
|
+
# @param [String] inbound_method The inbound_method
|
458
|
+
# @param [String] fallback_url The fallback_url
|
459
|
+
# @param [String] fallback_method The fallback_method
|
460
|
+
# @param [String] status_callback The status_callback
|
461
|
+
# @param [Boolean] sticky_sender The sticky_sender
|
462
|
+
# @param [Boolean] mms_converter The mms_converter
|
463
|
+
# @param [Boolean] smart_encoding The smart_encoding
|
464
|
+
# @return [ServiceInstance] Updated ServiceInstance
|
465
|
+
def update(friendly_name: nil, inbound_request_url: nil, inbound_method: nil, fallback_url: nil, fallback_method: nil, status_callback: nil, sticky_sender: nil, mms_converter: nil, smart_encoding: nil)
|
466
|
+
context.update(
|
467
|
+
friendly_name: friendly_name,
|
468
|
+
inbound_request_url: inbound_request_url,
|
469
|
+
inbound_method: inbound_method,
|
470
|
+
fallback_url: fallback_url,
|
471
|
+
fallback_method: fallback_method,
|
472
|
+
status_callback: status_callback,
|
473
|
+
sticky_sender: sticky_sender,
|
474
|
+
mms_converter: mms_converter,
|
475
|
+
smart_encoding: smart_encoding,
|
476
|
+
)
|
477
|
+
end
|
478
|
+
|
479
|
+
##
|
480
|
+
# Fetch a ServiceInstance
|
481
|
+
# @return [ServiceInstance] Fetched ServiceInstance
|
482
|
+
def fetch
|
483
|
+
context.fetch
|
484
|
+
end
|
485
|
+
|
486
|
+
##
|
487
|
+
# Deletes the ServiceInstance
|
488
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
489
|
+
def delete
|
490
|
+
context.delete
|
491
|
+
end
|
492
|
+
|
493
|
+
##
|
494
|
+
# Access the phone_numbers
|
495
|
+
# @return [phone_numbers] phone_numbers
|
496
|
+
def phone_numbers
|
497
|
+
context.phone_numbers
|
498
|
+
end
|
499
|
+
|
500
|
+
##
|
501
|
+
# Access the short_codes
|
502
|
+
# @return [short_codes] short_codes
|
503
|
+
def short_codes
|
504
|
+
context.short_codes
|
505
|
+
end
|
506
|
+
|
507
|
+
##
|
508
|
+
# Access the alpha_senders
|
509
|
+
# @return [alpha_senders] alpha_senders
|
510
|
+
def alpha_senders
|
511
|
+
context.alpha_senders
|
512
|
+
end
|
513
|
+
|
514
|
+
##
|
515
|
+
# Provide a user friendly representation
|
516
|
+
def to_s
|
517
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
518
|
+
"<Twilio.Messaging.V1.ServiceInstance #{values}>"
|
519
|
+
end
|
520
|
+
end
|
521
|
+
end
|
522
|
+
end
|
523
|
+
end
|
524
|
+
end
|