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
@@ -0,0 +1,404 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Api < Domain
|
10
|
+
class V2010 < Version
|
11
|
+
class AccountContext < InstanceContext
|
12
|
+
class IncomingPhoneNumberContext < InstanceContext
|
13
|
+
class AssignedAddOnList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the AssignedAddOnList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @param [String] account_sid The unique id of the Account that has installed this
|
18
|
+
# Add-on.
|
19
|
+
# @param [String] resource_sid The unique id of the Phone Number to which the
|
20
|
+
# Add-on is assigned.
|
21
|
+
# @return [AssignedAddOnList] AssignedAddOnList
|
22
|
+
def initialize(version, account_sid: nil, resource_sid: nil)
|
23
|
+
super(version)
|
24
|
+
|
25
|
+
# Path Solution
|
26
|
+
@solution = {
|
27
|
+
account_sid: account_sid,
|
28
|
+
resource_sid: resource_sid
|
29
|
+
}
|
30
|
+
@uri = "/Accounts/#{@solution[:account_sid]}/IncomingPhoneNumbers/#{@solution[:resource_sid]}/AssignedAddOns.json"
|
31
|
+
end
|
32
|
+
|
33
|
+
##
|
34
|
+
# Lists AssignedAddOnInstance records from the API as a list.
|
35
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
36
|
+
# memory before returning.
|
37
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
38
|
+
# guarantees to never return more than limit. Default is no limit
|
39
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
40
|
+
# the default value of 50 records. If no page_size is defined
|
41
|
+
# but a limit is defined, stream() will attempt to read the
|
42
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
43
|
+
# @return [Array] Array of up to limit results
|
44
|
+
def list(limit: nil, page_size: nil)
|
45
|
+
self.stream(
|
46
|
+
limit: limit,
|
47
|
+
page_size: page_size
|
48
|
+
).entries
|
49
|
+
end
|
50
|
+
|
51
|
+
##
|
52
|
+
# Streams AssignedAddOnInstance records from the API as an Enumerable.
|
53
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
54
|
+
# is reached.
|
55
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
56
|
+
# guarantees to never return more than limit. Default is no limit
|
57
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
58
|
+
# the default value of 50 records. If no page_size is defined
|
59
|
+
# but a limit is defined, stream() will attempt to read the
|
60
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
61
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
62
|
+
def stream(limit: nil, page_size: nil)
|
63
|
+
limits = @version.read_limits(limit, page_size)
|
64
|
+
|
65
|
+
page = self.page(
|
66
|
+
page_size: limits[:page_size],
|
67
|
+
)
|
68
|
+
|
69
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
70
|
+
end
|
71
|
+
|
72
|
+
##
|
73
|
+
# When passed a block, yields AssignedAddOnInstance records from the API.
|
74
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
75
|
+
# is reached.
|
76
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
77
|
+
# guarantees to never return more than limit. Default is no limit
|
78
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
79
|
+
# the default value of 50 records. If no page_size is defined
|
80
|
+
# but a limit is defined, stream() will attempt to read the
|
81
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
82
|
+
def each
|
83
|
+
limits = @version.read_limits
|
84
|
+
|
85
|
+
page = self.page(
|
86
|
+
page_size: limits[:page_size],
|
87
|
+
)
|
88
|
+
|
89
|
+
@version.stream(page,
|
90
|
+
limit: limits[:limit],
|
91
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
92
|
+
end
|
93
|
+
|
94
|
+
##
|
95
|
+
# Retrieve a single page of AssignedAddOnInstance records from the API.
|
96
|
+
# Request is executed immediately.
|
97
|
+
# @param [String] page_token PageToken provided by the API
|
98
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
99
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
100
|
+
# @return [Page] Page of AssignedAddOnInstance
|
101
|
+
def page(page_token: nil, page_number: nil, page_size: nil)
|
102
|
+
params = {
|
103
|
+
'PageToken' => page_token,
|
104
|
+
'Page' => page_number,
|
105
|
+
'PageSize' => page_size,
|
106
|
+
}
|
107
|
+
response = @version.page(
|
108
|
+
'GET',
|
109
|
+
@uri,
|
110
|
+
params
|
111
|
+
)
|
112
|
+
return AssignedAddOnPage.new(@version, response, @solution)
|
113
|
+
end
|
114
|
+
|
115
|
+
##
|
116
|
+
# Retrieve a single page of AssignedAddOnInstance records from the API.
|
117
|
+
# Request is executed immediately.
|
118
|
+
# @param [String] installed_add_on_sid A 34 character string that uniquely
|
119
|
+
# identifies the Add-on installation.
|
120
|
+
# @return [AssignedAddOnInstance] Newly created AssignedAddOnInstance
|
121
|
+
def create(installed_add_on_sid: nil)
|
122
|
+
data = {
|
123
|
+
'InstalledAddOnSid' => installed_add_on_sid,
|
124
|
+
}
|
125
|
+
|
126
|
+
payload = @version.create(
|
127
|
+
'POST',
|
128
|
+
@uri,
|
129
|
+
data: data
|
130
|
+
)
|
131
|
+
|
132
|
+
return AssignedAddOnInstance.new(
|
133
|
+
@version,
|
134
|
+
payload,
|
135
|
+
account_sid: @solution[:account_sid],
|
136
|
+
resource_sid: @solution[:resource_sid],
|
137
|
+
)
|
138
|
+
end
|
139
|
+
|
140
|
+
##
|
141
|
+
# Provide a user friendly representation
|
142
|
+
def to_s
|
143
|
+
'#<Twilio.Api.V2010.AssignedAddOnList>'
|
144
|
+
end
|
145
|
+
end
|
146
|
+
|
147
|
+
class AssignedAddOnPage < Page
|
148
|
+
##
|
149
|
+
# Initialize the AssignedAddOnPage
|
150
|
+
# @param [Version] version Version that contains the resource
|
151
|
+
# @param [Response] response Response from the API
|
152
|
+
# @param [Hash] solution Path solution for the resource
|
153
|
+
# @param [String] account_sid The unique id of the Account that has installed this
|
154
|
+
# Add-on.
|
155
|
+
# @param [String] resource_sid The unique id of the Phone Number to which the
|
156
|
+
# Add-on is assigned.
|
157
|
+
# @return [AssignedAddOnPage] AssignedAddOnPage
|
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 AssignedAddOnInstance
|
167
|
+
# @param [Hash] payload Payload response from the API
|
168
|
+
# @return [AssignedAddOnInstance] AssignedAddOnInstance
|
169
|
+
def get_instance(payload)
|
170
|
+
return AssignedAddOnInstance.new(
|
171
|
+
@version,
|
172
|
+
payload,
|
173
|
+
account_sid: @solution[:account_sid],
|
174
|
+
resource_sid: @solution[:resource_sid],
|
175
|
+
)
|
176
|
+
end
|
177
|
+
|
178
|
+
##
|
179
|
+
# Provide a user friendly representation
|
180
|
+
def to_s
|
181
|
+
'<Twilio.Api.V2010.AssignedAddOnPage>'
|
182
|
+
end
|
183
|
+
end
|
184
|
+
|
185
|
+
class AssignedAddOnContext < InstanceContext
|
186
|
+
##
|
187
|
+
# Initialize the AssignedAddOnContext
|
188
|
+
# @param [Version] version Version that contains the resource
|
189
|
+
# @param [String] account_sid The account_sid
|
190
|
+
# @param [String] resource_sid The resource_sid
|
191
|
+
# @param [String] sid The Installed Add-on Sid that uniquely identifies the
|
192
|
+
# assignment
|
193
|
+
# @return [AssignedAddOnContext] AssignedAddOnContext
|
194
|
+
def initialize(version, account_sid, resource_sid, sid)
|
195
|
+
super(version)
|
196
|
+
|
197
|
+
# Path Solution
|
198
|
+
@solution = {
|
199
|
+
account_sid: account_sid,
|
200
|
+
resource_sid: resource_sid,
|
201
|
+
sid: sid,
|
202
|
+
}
|
203
|
+
@uri = "/Accounts/#{@solution[:account_sid]}/IncomingPhoneNumbers/#{@solution[:resource_sid]}/AssignedAddOns/#{@solution[:sid]}.json"
|
204
|
+
|
205
|
+
# Dependents
|
206
|
+
@extensions = nil
|
207
|
+
end
|
208
|
+
|
209
|
+
##
|
210
|
+
# Fetch a AssignedAddOnInstance
|
211
|
+
# @return [AssignedAddOnInstance] Fetched AssignedAddOnInstance
|
212
|
+
def fetch
|
213
|
+
params = {}
|
214
|
+
|
215
|
+
payload = @version.fetch(
|
216
|
+
'GET',
|
217
|
+
@uri,
|
218
|
+
params,
|
219
|
+
)
|
220
|
+
|
221
|
+
return AssignedAddOnInstance.new(
|
222
|
+
@version,
|
223
|
+
payload,
|
224
|
+
account_sid: @solution[:account_sid],
|
225
|
+
resource_sid: @solution[:resource_sid],
|
226
|
+
sid: @solution[:sid],
|
227
|
+
)
|
228
|
+
end
|
229
|
+
|
230
|
+
##
|
231
|
+
# Deletes the AssignedAddOnInstance
|
232
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
233
|
+
def delete
|
234
|
+
return @version.delete('delete', @uri)
|
235
|
+
end
|
236
|
+
|
237
|
+
##
|
238
|
+
# Access the extensions
|
239
|
+
# @return [AssignedAddOnExtensionList] AssignedAddOnExtensionList
|
240
|
+
def extensions(sid=:unset)
|
241
|
+
if sid != :unset
|
242
|
+
return AssignedAddOnExtensionContext.new(
|
243
|
+
@version,
|
244
|
+
@solution[:account_sid],
|
245
|
+
@solution[:resource_sid],
|
246
|
+
@solution[:sid],
|
247
|
+
sid,
|
248
|
+
)
|
249
|
+
end
|
250
|
+
|
251
|
+
unless @extensions
|
252
|
+
@extensions = AssignedAddOnExtensionList.new(
|
253
|
+
@version,
|
254
|
+
account_sid: @solution[:account_sid],
|
255
|
+
resource_sid: @solution[:resource_sid],
|
256
|
+
assigned_add_on_sid: @solution[:sid],
|
257
|
+
)
|
258
|
+
end
|
259
|
+
|
260
|
+
@extensions
|
261
|
+
end
|
262
|
+
|
263
|
+
##
|
264
|
+
# Provide a user friendly representation
|
265
|
+
def to_s
|
266
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
267
|
+
"#<Twilio.Api.V2010.AssignedAddOnContext #{context}>"
|
268
|
+
end
|
269
|
+
end
|
270
|
+
|
271
|
+
class AssignedAddOnInstance < InstanceResource
|
272
|
+
##
|
273
|
+
# Initialize the AssignedAddOnInstance
|
274
|
+
# @param [Version] version Version that contains the resource
|
275
|
+
# @param [Hash] payload payload that contains response from Twilio
|
276
|
+
# @param [String] account_sid The unique id of the Account that has installed this
|
277
|
+
# Add-on.
|
278
|
+
# @param [String] resource_sid The unique id of the Phone Number to which the
|
279
|
+
# Add-on is assigned.
|
280
|
+
# @param [String] sid The Installed Add-on Sid that uniquely identifies the
|
281
|
+
# assignment
|
282
|
+
# @return [AssignedAddOnInstance] AssignedAddOnInstance
|
283
|
+
def initialize(version, payload, account_sid: nil, resource_sid: nil, sid: nil)
|
284
|
+
super(version)
|
285
|
+
|
286
|
+
# Marshaled Properties
|
287
|
+
@properties = {
|
288
|
+
'sid' => payload['sid'],
|
289
|
+
'account_sid' => payload['account_sid'],
|
290
|
+
'resource_sid' => payload['resource_sid'],
|
291
|
+
'friendly_name' => payload['friendly_name'],
|
292
|
+
'description' => payload['description'],
|
293
|
+
'configuration' => payload['configuration'],
|
294
|
+
'unique_name' => payload['unique_name'],
|
295
|
+
'date_created' => Twilio.deserialize_rfc2822(payload['date_created']),
|
296
|
+
'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
|
297
|
+
'uri' => payload['uri'],
|
298
|
+
'subresource_uris' => payload['subresource_uris'],
|
299
|
+
}
|
300
|
+
|
301
|
+
# Context
|
302
|
+
@instance_context = nil
|
303
|
+
@params = {
|
304
|
+
'account_sid' => account_sid,
|
305
|
+
'resource_sid' => resource_sid,
|
306
|
+
'sid' => sid || @properties['sid'],
|
307
|
+
}
|
308
|
+
end
|
309
|
+
|
310
|
+
##
|
311
|
+
# Generate an instance context for the instance, the context is capable of
|
312
|
+
# performing various actions. All instance actions are proxied to the context
|
313
|
+
# @param [Version] version Version that contains the resource
|
314
|
+
# @return [AssignedAddOnContext] AssignedAddOnContext for this AssignedAddOnInstance
|
315
|
+
def context
|
316
|
+
unless @instance_context
|
317
|
+
@instance_context = AssignedAddOnContext.new(
|
318
|
+
@version,
|
319
|
+
@params['account_sid'],
|
320
|
+
@params['resource_sid'],
|
321
|
+
@params['sid'],
|
322
|
+
)
|
323
|
+
end
|
324
|
+
@instance_context
|
325
|
+
end
|
326
|
+
|
327
|
+
def sid
|
328
|
+
@properties['sid']
|
329
|
+
end
|
330
|
+
|
331
|
+
def account_sid
|
332
|
+
@properties['account_sid']
|
333
|
+
end
|
334
|
+
|
335
|
+
def resource_sid
|
336
|
+
@properties['resource_sid']
|
337
|
+
end
|
338
|
+
|
339
|
+
def friendly_name
|
340
|
+
@properties['friendly_name']
|
341
|
+
end
|
342
|
+
|
343
|
+
def description
|
344
|
+
@properties['description']
|
345
|
+
end
|
346
|
+
|
347
|
+
def configuration
|
348
|
+
@properties['configuration']
|
349
|
+
end
|
350
|
+
|
351
|
+
def unique_name
|
352
|
+
@properties['unique_name']
|
353
|
+
end
|
354
|
+
|
355
|
+
def date_created
|
356
|
+
@properties['date_created']
|
357
|
+
end
|
358
|
+
|
359
|
+
def date_updated
|
360
|
+
@properties['date_updated']
|
361
|
+
end
|
362
|
+
|
363
|
+
def uri
|
364
|
+
@properties['uri']
|
365
|
+
end
|
366
|
+
|
367
|
+
def subresource_uris
|
368
|
+
@properties['subresource_uris']
|
369
|
+
end
|
370
|
+
|
371
|
+
##
|
372
|
+
# Fetch a AssignedAddOnInstance
|
373
|
+
# @return [AssignedAddOnInstance] Fetched AssignedAddOnInstance
|
374
|
+
def fetch
|
375
|
+
context.fetch
|
376
|
+
end
|
377
|
+
|
378
|
+
##
|
379
|
+
# Deletes the AssignedAddOnInstance
|
380
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
381
|
+
def delete
|
382
|
+
context.delete
|
383
|
+
end
|
384
|
+
|
385
|
+
##
|
386
|
+
# Access the extensions
|
387
|
+
# @return [extensions] extensions
|
388
|
+
def extensions
|
389
|
+
context.extensions
|
390
|
+
end
|
391
|
+
|
392
|
+
##
|
393
|
+
# Provide a user friendly representation
|
394
|
+
def to_s
|
395
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
396
|
+
"<Twilio.Api.V2010.AssignedAddOnInstance #{values}>"
|
397
|
+
end
|
398
|
+
end
|
399
|
+
end
|
400
|
+
end
|
401
|
+
end
|
402
|
+
end
|
403
|
+
end
|
404
|
+
end
|
@@ -0,0 +1,332 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Api < Domain
|
10
|
+
class V2010 < Version
|
11
|
+
class AccountContext < InstanceContext
|
12
|
+
class IncomingPhoneNumberContext < InstanceContext
|
13
|
+
class AssignedAddOnContext < InstanceContext
|
14
|
+
class AssignedAddOnExtensionList < ListResource
|
15
|
+
##
|
16
|
+
# Initialize the AssignedAddOnExtensionList
|
17
|
+
# @param [Version] version Version that contains the resource
|
18
|
+
# @param [String] account_sid The unique id of the Account that has installed this
|
19
|
+
# Add-on.
|
20
|
+
# @param [String] resource_sid The unique id of the Phone Number to which the
|
21
|
+
# Add-on is assigned.
|
22
|
+
# @param [String] assigned_add_on_sid A 34 character string that uniquely
|
23
|
+
# identifies the assigned Add-on installation.
|
24
|
+
# @return [AssignedAddOnExtensionList] AssignedAddOnExtensionList
|
25
|
+
def initialize(version, account_sid: nil, resource_sid: nil, assigned_add_on_sid: nil)
|
26
|
+
super(version)
|
27
|
+
|
28
|
+
# Path Solution
|
29
|
+
@solution = {
|
30
|
+
account_sid: account_sid,
|
31
|
+
resource_sid: resource_sid,
|
32
|
+
assigned_add_on_sid: assigned_add_on_sid
|
33
|
+
}
|
34
|
+
@uri = "/Accounts/#{@solution[:account_sid]}/IncomingPhoneNumbers/#{@solution[:resource_sid]}/AssignedAddOns/#{@solution[:assigned_add_on_sid]}/Extensions.json"
|
35
|
+
end
|
36
|
+
|
37
|
+
##
|
38
|
+
# Lists AssignedAddOnExtensionInstance records from the API as a list.
|
39
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
40
|
+
# memory before returning.
|
41
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
42
|
+
# guarantees to never return more than limit. Default is no limit
|
43
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
44
|
+
# the default value of 50 records. If no page_size is defined
|
45
|
+
# but a limit is defined, stream() will attempt to read the
|
46
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
47
|
+
# @return [Array] Array of up to limit results
|
48
|
+
def list(limit: nil, page_size: nil)
|
49
|
+
self.stream(
|
50
|
+
limit: limit,
|
51
|
+
page_size: page_size
|
52
|
+
).entries
|
53
|
+
end
|
54
|
+
|
55
|
+
##
|
56
|
+
# Streams AssignedAddOnExtensionInstance records from the API as an Enumerable.
|
57
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
58
|
+
# is reached.
|
59
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
60
|
+
# guarantees to never return more than limit. Default is no limit
|
61
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
62
|
+
# the default value of 50 records. If no page_size is defined
|
63
|
+
# but a limit is defined, stream() will attempt to read the
|
64
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
65
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
66
|
+
def stream(limit: nil, page_size: nil)
|
67
|
+
limits = @version.read_limits(limit, page_size)
|
68
|
+
|
69
|
+
page = self.page(
|
70
|
+
page_size: limits[:page_size],
|
71
|
+
)
|
72
|
+
|
73
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
74
|
+
end
|
75
|
+
|
76
|
+
##
|
77
|
+
# When passed a block, yields AssignedAddOnExtensionInstance records from the API.
|
78
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
79
|
+
# is reached.
|
80
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
81
|
+
# guarantees to never return more than limit. Default is no limit
|
82
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
83
|
+
# the default value of 50 records. If no page_size is defined
|
84
|
+
# but a limit is defined, stream() will attempt to read the
|
85
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
86
|
+
def each
|
87
|
+
limits = @version.read_limits
|
88
|
+
|
89
|
+
page = self.page(
|
90
|
+
page_size: limits[:page_size],
|
91
|
+
)
|
92
|
+
|
93
|
+
@version.stream(page,
|
94
|
+
limit: limits[:limit],
|
95
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
96
|
+
end
|
97
|
+
|
98
|
+
##
|
99
|
+
# Retrieve a single page of AssignedAddOnExtensionInstance records from the API.
|
100
|
+
# Request is executed immediately.
|
101
|
+
# @param [String] page_token PageToken provided by the API
|
102
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
103
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
104
|
+
# @return [Page] Page of AssignedAddOnExtensionInstance
|
105
|
+
def page(page_token: nil, page_number: nil, page_size: nil)
|
106
|
+
params = {
|
107
|
+
'PageToken' => page_token,
|
108
|
+
'Page' => page_number,
|
109
|
+
'PageSize' => page_size,
|
110
|
+
}
|
111
|
+
response = @version.page(
|
112
|
+
'GET',
|
113
|
+
@uri,
|
114
|
+
params
|
115
|
+
)
|
116
|
+
return AssignedAddOnExtensionPage.new(@version, response, @solution)
|
117
|
+
end
|
118
|
+
|
119
|
+
##
|
120
|
+
# Provide a user friendly representation
|
121
|
+
def to_s
|
122
|
+
'#<Twilio.Api.V2010.AssignedAddOnExtensionList>'
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
126
|
+
class AssignedAddOnExtensionPage < Page
|
127
|
+
##
|
128
|
+
# Initialize the AssignedAddOnExtensionPage
|
129
|
+
# @param [Version] version Version that contains the resource
|
130
|
+
# @param [Response] response Response from the API
|
131
|
+
# @param [Hash] solution Path solution for the resource
|
132
|
+
# @param [String] account_sid The unique id of the Account that has installed this
|
133
|
+
# Add-on.
|
134
|
+
# @param [String] resource_sid The unique id of the Phone Number to which the
|
135
|
+
# Add-on is assigned.
|
136
|
+
# @param [String] assigned_add_on_sid A 34 character string that uniquely
|
137
|
+
# identifies the assigned Add-on installation.
|
138
|
+
# @return [AssignedAddOnExtensionPage] AssignedAddOnExtensionPage
|
139
|
+
def initialize(version, response, solution)
|
140
|
+
super(version, response)
|
141
|
+
|
142
|
+
# Path Solution
|
143
|
+
@solution = solution
|
144
|
+
end
|
145
|
+
|
146
|
+
##
|
147
|
+
# Build an instance of AssignedAddOnExtensionInstance
|
148
|
+
# @param [Hash] payload Payload response from the API
|
149
|
+
# @return [AssignedAddOnExtensionInstance] AssignedAddOnExtensionInstance
|
150
|
+
def get_instance(payload)
|
151
|
+
return AssignedAddOnExtensionInstance.new(
|
152
|
+
@version,
|
153
|
+
payload,
|
154
|
+
account_sid: @solution[:account_sid],
|
155
|
+
resource_sid: @solution[:resource_sid],
|
156
|
+
assigned_add_on_sid: @solution[:assigned_add_on_sid],
|
157
|
+
)
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# Provide a user friendly representation
|
162
|
+
def to_s
|
163
|
+
'<Twilio.Api.V2010.AssignedAddOnExtensionPage>'
|
164
|
+
end
|
165
|
+
end
|
166
|
+
|
167
|
+
class AssignedAddOnExtensionContext < InstanceContext
|
168
|
+
##
|
169
|
+
# Initialize the AssignedAddOnExtensionContext
|
170
|
+
# @param [Version] version Version that contains the resource
|
171
|
+
# @param [String] account_sid The account_sid
|
172
|
+
# @param [String] resource_sid The resource_sid
|
173
|
+
# @param [String] assigned_add_on_sid The assigned_add_on_sid
|
174
|
+
# @param [String] sid The Extension Sid that uniquely identifies this resource
|
175
|
+
# @return [AssignedAddOnExtensionContext] AssignedAddOnExtensionContext
|
176
|
+
def initialize(version, account_sid, resource_sid, assigned_add_on_sid, sid)
|
177
|
+
super(version)
|
178
|
+
|
179
|
+
# Path Solution
|
180
|
+
@solution = {
|
181
|
+
account_sid: account_sid,
|
182
|
+
resource_sid: resource_sid,
|
183
|
+
assigned_add_on_sid: assigned_add_on_sid,
|
184
|
+
sid: sid,
|
185
|
+
}
|
186
|
+
@uri = "/Accounts/#{@solution[:account_sid]}/IncomingPhoneNumbers/#{@solution[:resource_sid]}/AssignedAddOns/#{@solution[:assigned_add_on_sid]}/Extensions/#{@solution[:sid]}.json"
|
187
|
+
end
|
188
|
+
|
189
|
+
##
|
190
|
+
# Fetch a AssignedAddOnExtensionInstance
|
191
|
+
# @return [AssignedAddOnExtensionInstance] Fetched AssignedAddOnExtensionInstance
|
192
|
+
def fetch
|
193
|
+
params = {}
|
194
|
+
|
195
|
+
payload = @version.fetch(
|
196
|
+
'GET',
|
197
|
+
@uri,
|
198
|
+
params,
|
199
|
+
)
|
200
|
+
|
201
|
+
return AssignedAddOnExtensionInstance.new(
|
202
|
+
@version,
|
203
|
+
payload,
|
204
|
+
account_sid: @solution[:account_sid],
|
205
|
+
resource_sid: @solution[:resource_sid],
|
206
|
+
assigned_add_on_sid: @solution[:assigned_add_on_sid],
|
207
|
+
sid: @solution[:sid],
|
208
|
+
)
|
209
|
+
end
|
210
|
+
|
211
|
+
##
|
212
|
+
# Provide a user friendly representation
|
213
|
+
def to_s
|
214
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
215
|
+
"#<Twilio.Api.V2010.AssignedAddOnExtensionContext #{context}>"
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
class AssignedAddOnExtensionInstance < InstanceResource
|
220
|
+
##
|
221
|
+
# Initialize the AssignedAddOnExtensionInstance
|
222
|
+
# @param [Version] version Version that contains the resource
|
223
|
+
# @param [Hash] payload payload that contains response from Twilio
|
224
|
+
# @param [String] account_sid The unique id of the Account that has installed this
|
225
|
+
# Add-on.
|
226
|
+
# @param [String] resource_sid The unique id of the Phone Number to which the
|
227
|
+
# Add-on is assigned.
|
228
|
+
# @param [String] assigned_add_on_sid A 34 character string that uniquely
|
229
|
+
# identifies the assigned Add-on installation.
|
230
|
+
# @param [String] sid The Extension Sid that uniquely identifies this resource
|
231
|
+
# @return [AssignedAddOnExtensionInstance] AssignedAddOnExtensionInstance
|
232
|
+
def initialize(version, payload, account_sid: nil, resource_sid: nil, assigned_add_on_sid: nil, sid: nil)
|
233
|
+
super(version)
|
234
|
+
|
235
|
+
# Marshaled Properties
|
236
|
+
@properties = {
|
237
|
+
'sid' => payload['sid'],
|
238
|
+
'account_sid' => payload['account_sid'],
|
239
|
+
'resource_sid' => payload['resource_sid'],
|
240
|
+
'assigned_add_on_sid' => payload['assigned_add_on_sid'],
|
241
|
+
'friendly_name' => payload['friendly_name'],
|
242
|
+
'product_name' => payload['product_name'],
|
243
|
+
'unique_name' => payload['unique_name'],
|
244
|
+
'uri' => payload['uri'],
|
245
|
+
'enabled' => payload['enabled'],
|
246
|
+
}
|
247
|
+
|
248
|
+
# Context
|
249
|
+
@instance_context = nil
|
250
|
+
@params = {
|
251
|
+
'account_sid' => account_sid,
|
252
|
+
'resource_sid' => resource_sid,
|
253
|
+
'assigned_add_on_sid' => assigned_add_on_sid,
|
254
|
+
'sid' => sid || @properties['sid'],
|
255
|
+
}
|
256
|
+
end
|
257
|
+
|
258
|
+
##
|
259
|
+
# Generate an instance context for the instance, the context is capable of
|
260
|
+
# performing various actions. All instance actions are proxied to the context
|
261
|
+
# @param [Version] version Version that contains the resource
|
262
|
+
# @return [AssignedAddOnExtensionContext] AssignedAddOnExtensionContext for this AssignedAddOnExtensionInstance
|
263
|
+
def context
|
264
|
+
unless @instance_context
|
265
|
+
@instance_context = AssignedAddOnExtensionContext.new(
|
266
|
+
@version,
|
267
|
+
@params['account_sid'],
|
268
|
+
@params['resource_sid'],
|
269
|
+
@params['assigned_add_on_sid'],
|
270
|
+
@params['sid'],
|
271
|
+
)
|
272
|
+
end
|
273
|
+
@instance_context
|
274
|
+
end
|
275
|
+
|
276
|
+
def sid
|
277
|
+
@properties['sid']
|
278
|
+
end
|
279
|
+
|
280
|
+
def account_sid
|
281
|
+
@properties['account_sid']
|
282
|
+
end
|
283
|
+
|
284
|
+
def resource_sid
|
285
|
+
@properties['resource_sid']
|
286
|
+
end
|
287
|
+
|
288
|
+
def assigned_add_on_sid
|
289
|
+
@properties['assigned_add_on_sid']
|
290
|
+
end
|
291
|
+
|
292
|
+
def friendly_name
|
293
|
+
@properties['friendly_name']
|
294
|
+
end
|
295
|
+
|
296
|
+
def product_name
|
297
|
+
@properties['product_name']
|
298
|
+
end
|
299
|
+
|
300
|
+
def unique_name
|
301
|
+
@properties['unique_name']
|
302
|
+
end
|
303
|
+
|
304
|
+
def uri
|
305
|
+
@properties['uri']
|
306
|
+
end
|
307
|
+
|
308
|
+
def enabled
|
309
|
+
@properties['enabled']
|
310
|
+
end
|
311
|
+
|
312
|
+
##
|
313
|
+
# Fetch a AssignedAddOnExtensionInstance
|
314
|
+
# @return [AssignedAddOnExtensionInstance] Fetched AssignedAddOnExtensionInstance
|
315
|
+
def fetch
|
316
|
+
context.fetch
|
317
|
+
end
|
318
|
+
|
319
|
+
##
|
320
|
+
# Provide a user friendly representation
|
321
|
+
def to_s
|
322
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
323
|
+
"<Twilio.Api.V2010.AssignedAddOnExtensionInstance #{values}>"
|
324
|
+
end
|
325
|
+
end
|
326
|
+
end
|
327
|
+
end
|
328
|
+
end
|
329
|
+
end
|
330
|
+
end
|
331
|
+
end
|
332
|
+
end
|