twilio-ruby 5.0.0.alpha1 → 5.0.0.rc2
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/.travis.yml +11 -2
- data/AUTHORS.md +32 -46
- data/CHANGES.md +1 -124
- data/Gemfile +2 -2
- data/LICENSE.md +12 -12
- data/Makefile +2 -15
- data/README.md +37 -29
- data/Rakefile +0 -54
- data/examples/examples.rb +57 -46
- data/examples/{print_call_log.rb → print-call-log.rb} +7 -7
- data/lib/rack/twilio_webhook_authentication.rb +6 -5
- data/lib/twilio-ruby.rb +16 -17
- data/lib/twilio-ruby/compatibility/v2010/account/call/feedback.rb +15 -0
- data/lib/twilio-ruby/compatibility/v2010/account/queue/member.rb +23 -0
- data/lib/twilio-ruby/framework/domain.rb +2 -2
- data/lib/twilio-ruby/framework/exception.rb +14 -0
- data/lib/twilio-ruby/framework/helper.rb +1 -1
- data/lib/twilio-ruby/framework/page.rb +30 -28
- data/lib/twilio-ruby/framework/resource.rb +2 -2
- data/lib/twilio-ruby/framework/serialize.rb +7 -58
- data/lib/twilio-ruby/framework/twilio_response.rb +1 -1
- data/lib/twilio-ruby/framework/version.rb +48 -43
- data/lib/twilio-ruby/http/http_client.rb +8 -8
- data/lib/twilio-ruby/rest/api.rb +33 -141
- data/lib/twilio-ruby/rest/api/v2010.rb +31 -50
- data/lib/twilio-ruby/rest/api/v2010/account.rb +239 -389
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +122 -145
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +56 -76
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +127 -144
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +83 -85
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +97 -92
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +77 -142
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +77 -142
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +77 -142
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +184 -232
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +84 -73
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +80 -85
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +115 -126
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +99 -114
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +112 -150
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +109 -228
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +98 -101
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +164 -287
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +90 -152
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +90 -152
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +90 -152
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +138 -195
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +100 -90
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +106 -118
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +105 -96
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +117 -119
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +95 -84
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +103 -194
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +93 -100
- data/lib/twilio-ruby/rest/api/v2010/account/sandbox.rb +304 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +30 -42
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +113 -111
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +115 -104
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +133 -159
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +96 -94
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +96 -94
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +114 -111
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +113 -108
- data/lib/twilio-ruby/rest/api/v2010/account/sms.rb +140 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sms/short_code.rb +431 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sms/sms_message.rb +467 -0
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +34 -41
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +90 -98
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +24 -21
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +118 -139
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +62 -106
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +124 -130
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +31 -35
- data/lib/twilio-ruby/rest/client.rb +88 -249
- data/lib/twilio-ruby/rest/{accounts.rb → conversations.rb} +14 -16
- data/lib/twilio-ruby/rest/conversations/v1.rb +35 -0
- data/lib/twilio-ruby/rest/conversations/v1/conversation.rb +270 -0
- data/lib/twilio-ruby/rest/{notify/v1/service/segment.rb → conversations/v1/conversation/completed.rb} +101 -101
- data/lib/twilio-ruby/rest/{preview/bulk_exports/export/day.rb → conversations/v1/conversation/in_progress.rb} +109 -95
- data/lib/twilio-ruby/rest/{messaging/v1/service/phone_number.rb → conversations/v1/conversation/participant.rb} +171 -178
- data/lib/twilio-ruby/rest/ip_messaging.rb +11 -26
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +7 -19
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +112 -113
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +131 -542
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +132 -194
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +103 -159
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +102 -183
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +112 -107
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +113 -186
- data/lib/twilio-ruby/rest/lookups.rb +8 -12
- data/lib/twilio-ruby/rest/lookups/v1.rb +7 -13
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +54 -71
- data/lib/twilio-ruby/rest/monitor.rb +11 -19
- data/lib/twilio-ruby/rest/monitor/v1.rb +7 -19
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +133 -121
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +127 -116
- data/lib/twilio-ruby/rest/pricing.rb +11 -17
- data/lib/twilio-ruby/rest/pricing/v1.rb +9 -21
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +23 -27
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +74 -71
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +23 -27
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +79 -69
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +27 -33
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +74 -71
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +52 -47
- data/lib/twilio-ruby/rest/taskrouter.rb +8 -12
- data/lib/twilio-ruby/rest/taskrouter/v1.rb +5 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +153 -260
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +114 -115
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +101 -105
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +139 -216
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +106 -194
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +145 -187
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +65 -57
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +57 -62
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +135 -217
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +60 -54
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +56 -52
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +123 -140
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +61 -57
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +72 -52
- data/lib/twilio-ruby/rest/trunking.rb +8 -12
- data/lib/twilio-ruby/rest/trunking/v1.rb +5 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +134 -157
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +93 -89
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +93 -89
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +111 -114
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +112 -146
- data/lib/twilio-ruby/task_router.rb +0 -0
- data/lib/twilio-ruby/task_router/capability.rb +87 -0
- data/lib/twilio-ruby/twiml/response.rb +16 -0
- data/lib/twilio-ruby/util.rb +1 -1
- data/lib/twilio-ruby/util/access_token.rb +70 -0
- data/lib/twilio-ruby/util/capability.rb +64 -0
- data/lib/twilio-ruby/util/client_config.rb +29 -0
- data/lib/twilio-ruby/{security → util}/request_validator.rb +4 -21
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/holodeck/holodeck.rb +6 -6
- data/spec/holodeck/hologram.rb +1 -0
- data/spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb +8 -8
- data/spec/integration/api/v2010/account/address_spec.rb +29 -37
- data/spec/integration/api/v2010/account/application_spec.rb +29 -29
- data/spec/integration/api/v2010/account/authorized_connect_app_spec.rb +13 -13
- data/spec/integration/api/v2010/account/available_phone_number/local_spec.rb +8 -9
- data/spec/integration/api/v2010/account/available_phone_number/mobile_spec.rb +8 -9
- data/spec/integration/api/v2010/account/available_phone_number/toll_free_spec.rb +8 -9
- data/spec/integration/api/v2010/account/available_phone_number_spec.rb +13 -13
- data/spec/integration/api/v2010/account/call/feedback_spec.rb +17 -17
- data/spec/integration/api/v2010/account/call/feedback_summary_spec.rb +19 -19
- data/spec/integration/api/v2010/account/call/notification_spec.rb +18 -18
- data/spec/integration/api/v2010/account/call/recording_spec.rb +20 -32
- data/spec/integration/api/v2010/account/call_spec.rb +29 -29
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +35 -107
- data/spec/integration/api/v2010/account/conference_spec.rb +19 -58
- data/spec/integration/api/v2010/account/connect_app_spec.rb +18 -18
- data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +14 -16
- data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +14 -16
- data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +14 -16
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +29 -41
- data/spec/integration/api/v2010/account/message/media_spec.rb +18 -18
- data/spec/integration/api/v2010/account/message_spec.rb +35 -41
- data/spec/integration/api/v2010/account/notification_spec.rb +18 -18
- data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +23 -23
- data/spec/integration/api/v2010/account/queue/member_spec.rb +18 -18
- data/spec/integration/api/v2010/account/queue_spec.rb +32 -35
- data/spec/integration/api/v2010/account/recording/transcription_spec.rb +18 -18
- data/spec/integration/api/v2010/account/recording_spec.rb +21 -42
- data/spec/integration/api/v2010/account/sandbox_spec.rb +99 -0
- data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +36 -32
- data/spec/integration/api/v2010/account/sip/credential_list_spec.rb +29 -29
- data/spec/integration/api/v2010/account/sip/domain/credential_list_mapping_spec.rb +24 -24
- data/spec/integration/api/v2010/account/sip/domain/ip_access_control_list_mapping_spec.rb +24 -24
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +29 -29
- data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +36 -32
- data/spec/integration/api/v2010/account/sip/ip_access_control_list_spec.rb +29 -29
- data/spec/integration/api/v2010/account/sip_spec.rb +1 -1
- data/spec/integration/api/v2010/account/{short_code_spec.rb → sms/short_code_spec.rb} +25 -18
- data/spec/integration/api/v2010/account/sms/sms_message_spec.rb +275 -0
- data/spec/integration/{accounts/v1/credential_spec.rb → api/v2010/account/sms_spec.rb} +2 -2
- data/spec/integration/api/v2010/account/token_spec.rb +7 -7
- data/spec/integration/api/v2010/account/transcription_spec.rb +18 -18
- data/spec/integration/api/v2010/account/usage/record/all_time_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/daily_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/last_month_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/monthly_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/this_month_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/today_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/yearly_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record/yesterday_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/record_spec.rb +8 -8
- data/spec/integration/api/v2010/account/usage/trigger_spec.rb +32 -32
- data/spec/integration/api/v2010/account/usage_spec.rb +1 -1
- data/spec/integration/api/v2010/account/validation_request_spec.rb +4 -24
- data/spec/integration/api/v2010/account_spec.rb +28 -24
- data/spec/integration/conversations/v1/conversation/completed_spec.rb +89 -0
- data/spec/integration/conversations/v1/conversation/in_progress_spec.rb +89 -0
- data/spec/integration/conversations/v1/conversation/participant_spec.rb +174 -0
- data/spec/integration/conversations/v1/conversation_spec.rb +49 -0
- data/spec/integration/ip_messaging/v1/credential_spec.rb +24 -155
- data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +13 -217
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +10 -241
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +23 -205
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +19 -184
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +24 -194
- data/spec/integration/ip_messaging/v1/service_spec.rb +17 -229
- data/spec/integration/lookups/v1/phone_number_spec.rb +6 -17
- data/spec/integration/monitor/v1/alert_spec.rb +60 -60
- data/spec/integration/monitor/v1/event_spec.rb +13 -13
- data/spec/integration/pricing/v1/messaging/country_spec.rb +7 -103
- data/spec/integration/pricing/v1/messaging_spec.rb +1 -1
- data/spec/integration/pricing/v1/phone_number/country_spec.rb +13 -13
- data/spec/integration/pricing/v1/phone_number_spec.rb +1 -1
- data/spec/integration/pricing/v1/voice/country_spec.rb +13 -13
- data/spec/integration/pricing/v1/voice/number_spec.rb +6 -6
- data/spec/integration/pricing/v1/voice_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/activity_spec.rb +38 -34
- data/spec/integration/taskrouter/v1/workspace/event_spec.rb +13 -13
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +24 -21
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_statistics_spec.rb +11 -13
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queues_statistics_spec.rb +17 -18
- data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +41 -57
- data/spec/integration/taskrouter/v1/workspace/task_spec.rb +50 -113
- data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +6 -7
- data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +6 -7
- data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +68 -96
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_statistics_spec.rb +12 -14
- data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +43 -54
- data/spec/integration/taskrouter/v1/workspace/workspace_statistics_spec.rb +9 -11
- data/spec/integration/taskrouter/v1/workspace_spec.rb +51 -71
- data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +24 -24
- data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +66 -66
- data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +28 -28
- data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +23 -23
- data/spec/integration/trunking/v1/trunk_spec.rb +28 -28
- data/spec/rack/twilio_webhook_authentication_spec.rb +23 -19
- data/spec/spec_helper.rb +2 -2
- data/spec/support/fakeweb.rb +1 -1
- data/spec/task_router_spec.rb +114 -0
- data/spec/util/access_token_spec.rb +103 -0
- data/spec/util/capability_spec.rb +186 -0
- data/spec/util/client_config_spec.rb +21 -0
- data/spec/{security → util}/request_validator_spec.rb +5 -5
- data/twilio-ruby.gemspec +8 -12
- metadata +90 -416
- data/.rubocop.yml +0 -21
- data/.rubocop_todo.yml +0 -187
- data/VERSIONS.md +0 -64
- data/lib/twilio-ruby/framework/error.rb +0 -30
- data/lib/twilio-ruby/framework/values.rb +0 -7
- data/lib/twilio-ruby/jwt/access_token.rb +0 -232
- data/lib/twilio-ruby/jwt/client_capability.rb +0 -102
- data/lib/twilio-ruby/jwt/jwt.rb +0 -50
- data/lib/twilio-ruby/jwt/task_router.rb +0 -174
- data/lib/twilio-ruby/rest/accounts/v1.rb +0 -39
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +0 -105
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +0 -370
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +0 -431
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +0 -350
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +0 -336
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +0 -165
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +0 -153
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +0 -153
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +0 -397
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +0 -378
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +0 -430
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +0 -336
- data/lib/twilio-ruby/rest/chat.rb +0 -59
- data/lib/twilio-ruby/rest/chat/v1.rb +0 -56
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +0 -403
- data/lib/twilio-ruby/rest/chat/v1/service.rb +0 -935
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +0 -554
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +0 -386
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +0 -431
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +0 -447
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +0 -396
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +0 -467
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +0 -244
- data/lib/twilio-ruby/rest/chat/v2.rb +0 -56
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +0 -403
- data/lib/twilio-ruby/rest/chat/v2/service.rb +0 -688
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +0 -554
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +0 -386
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +0 -431
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +0 -447
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +0 -396
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +0 -467
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +0 -244
- data/lib/twilio-ruby/rest/fax.rb +0 -44
- data/lib/twilio-ruby/rest/fax/v1.rb +0 -41
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -541
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +0 -326
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +0 -386
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +0 -244
- data/lib/twilio-ruby/rest/ip_messaging/v2.rb +0 -56
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +0 -403
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +0 -688
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +0 -554
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +0 -386
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +0 -431
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +0 -447
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +0 -396
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +0 -467
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +0 -244
- data/lib/twilio-ruby/rest/messaging.rb +0 -44
- data/lib/twilio-ruby/rest/messaging/v1.rb +0 -41
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -637
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +0 -352
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +0 -359
- data/lib/twilio-ruby/rest/notify.rb +0 -52
- data/lib/twilio-ruby/rest/notify/v1.rb +0 -56
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +0 -403
- data/lib/twilio-ruby/rest/notify/v1/service.rb +0 -639
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +0 -430
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +0 -288
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +0 -445
- data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +0 -254
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +0 -434
- data/lib/twilio-ruby/rest/preview.rb +0 -145
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +0 -56
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +0 -203
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +0 -243
- data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +0 -42
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +0 -557
- data/lib/twilio-ruby/rest/preview/marketplace.rb +0 -58
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +0 -333
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +0 -301
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +0 -440
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +0 -341
- data/lib/twilio-ruby/rest/preview/proxy.rb +0 -41
- data/lib/twilio-ruby/rest/preview/proxy/service.rb +0 -500
- data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +0 -359
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +0 -536
- data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +0 -429
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +0 -506
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +0 -452
- data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +0 -359
- data/lib/twilio-ruby/rest/preview/sync.rb +0 -41
- data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -504
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -445
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -395
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -438
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -430
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -395
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -438
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -432
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -395
- data/lib/twilio-ruby/rest/preview/wireless.rb +0 -71
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +0 -382
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +0 -435
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +0 -544
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +0 -236
- data/lib/twilio-ruby/rest/sync.rb +0 -44
- data/lib/twilio-ruby/rest/sync/v1.rb +0 -41
- data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -504
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +0 -445
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +0 -395
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +0 -438
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +0 -430
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +0 -395
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +0 -438
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +0 -432
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +0 -395
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +0 -315
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +0 -461
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +0 -406
- data/lib/twilio-ruby/rest/video.rb +0 -52
- data/lib/twilio-ruby/rest/video/v1.rb +0 -56
- data/lib/twilio-ruby/rest/video/v1/recording.rb +0 -382
- data/lib/twilio-ruby/rest/video/v1/room.rb +0 -485
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +0 -381
- data/lib/twilio-ruby/rest/wireless.rb +0 -60
- data/lib/twilio-ruby/rest/wireless/v1.rb +0 -71
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +0 -367
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +0 -452
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +0 -548
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +0 -235
- data/lib/twilio-ruby/twiml/messaging_response.rb +0 -141
- data/lib/twilio-ruby/twiml/twiml.rb +0 -69
- data/lib/twilio-ruby/twiml/voice_response.rb +0 -916
- data/spec/framework/serialize_spec.rb +0 -59
- data/spec/integration/accounts/v1/credential/public_key_spec.rb +0 -226
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +0 -135
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +0 -223
- data/spec/integration/api/v2010/account/key_spec.rb +0 -178
- data/spec/integration/api/v2010/account/message/feedback_spec.rb +0 -48
- data/spec/integration/api/v2010/account/new_key_spec.rb +0 -45
- data/spec/integration/api/v2010/account/new_signing_key_spec.rb +0 -45
- data/spec/integration/api/v2010/account/recording/add_on_result/payload_spec.rb +0 -175
- data/spec/integration/api/v2010/account/recording/add_on_result_spec.rb +0 -166
- data/spec/integration/api/v2010/account/signing_key_spec.rb +0 -178
- data/spec/integration/chat/v1/credential_spec.rb +0 -223
- data/spec/integration/chat/v1/service/channel/invite_spec.rb +0 -210
- data/spec/integration/chat/v1/service/channel/member_spec.rb +0 -284
- data/spec/integration/chat/v1/service/channel/message_spec.rb +0 -294
- data/spec/integration/chat/v1/service/channel_spec.rb +0 -275
- data/spec/integration/chat/v1/service/role_spec.rb +0 -263
- data/spec/integration/chat/v1/service/user/user_channel_spec.rb +0 -92
- data/spec/integration/chat/v1/service/user_spec.rb +0 -266
- data/spec/integration/chat/v1/service_spec.rb +0 -299
- data/spec/integration/chat/v2/credential_spec.rb +0 -223
- data/spec/integration/chat/v2/service/channel/invite_spec.rb +0 -210
- data/spec/integration/chat/v2/service/channel/member_spec.rb +0 -284
- data/spec/integration/chat/v2/service/channel/message_spec.rb +0 -294
- data/spec/integration/chat/v2/service/channel_spec.rb +0 -275
- data/spec/integration/chat/v2/service/role_spec.rb +0 -263
- data/spec/integration/chat/v2/service/user/user_channel_spec.rb +0 -92
- data/spec/integration/chat/v2/service/user_spec.rb +0 -266
- data/spec/integration/chat/v2/service_spec.rb +0 -325
- data/spec/integration/fax/v1/fax/fax_media_spec.rb +0 -126
- data/spec/integration/fax/v1/fax_spec.rb +0 -272
- data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +0 -210
- data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +0 -92
- data/spec/integration/ip_messaging/v2/credential_spec.rb +0 -223
- data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +0 -210
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +0 -284
- data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +0 -294
- data/spec/integration/ip_messaging/v2/service/channel_spec.rb +0 -275
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +0 -263
- data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +0 -92
- data/spec/integration/ip_messaging/v2/service/user_spec.rb +0 -266
- data/spec/integration/ip_messaging/v2/service_spec.rb +0 -325
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +0 -170
- data/spec/integration/messaging/v1/service/phone_number_spec.rb +0 -201
- data/spec/integration/messaging/v1/service/short_code_spec.rb +0 -173
- data/spec/integration/messaging/v1/service_spec.rb +0 -263
- data/spec/integration/notify/v1/credential_spec.rb +0 -223
- data/spec/integration/notify/v1/service/binding_spec.rb +0 -227
- data/spec/integration/notify/v1/service/notification_spec.rb +0 -97
- data/spec/integration/notify/v1/service/segment_spec.rb +0 -84
- data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +0 -118
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +0 -269
- data/spec/integration/notify/v1/service/user_spec.rb +0 -213
- data/spec/integration/notify/v1/service_spec.rb +0 -280
- data/spec/integration/preview/bulk_exports/export/day_spec.rb +0 -56
- data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +0 -79
- data/spec/integration/preview/bulk_exports/export_spec.rb +0 -43
- data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +0 -280
- data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +0 -121
- data/spec/integration/preview/marketplace/available_add_on_spec.rb +0 -142
- data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +0 -164
- data/spec/integration/preview/marketplace/installed_add_on_spec.rb +0 -252
- data/spec/integration/preview/proxy/service/phone_number_spec.rb +0 -173
- data/spec/integration/preview/proxy/service/session/interaction_spec.rb +0 -104
- data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +0 -164
- data/spec/integration/preview/proxy/service/session/participant_spec.rb +0 -226
- data/spec/integration/preview/proxy/service/session_spec.rb +0 -216
- data/spec/integration/preview/proxy/service/short_code_spec.rb +0 -173
- data/spec/integration/preview/proxy/service_spec.rb +0 -200
- data/spec/integration/preview/sync/service/document/document_permission_spec.rb +0 -206
- data/spec/integration/preview/sync/service/document_spec.rb +0 -254
- data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +0 -256
- data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +0 -206
- data/spec/integration/preview/sync/service/sync_list_spec.rb +0 -207
- data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +0 -257
- data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +0 -206
- data/spec/integration/preview/sync/service/sync_map_spec.rb +0 -207
- data/spec/integration/preview/sync/service_spec.rb +0 -244
- data/spec/integration/preview/wireless/command_spec.rb +0 -169
- data/spec/integration/preview/wireless/rate_plan_spec.rb +0 -260
- data/spec/integration/preview/wireless/sim/usage_spec.rb +0 -49
- data/spec/integration/preview/wireless/sim_spec.rb +0 -208
- data/spec/integration/sync/v1/service/document/document_permission_spec.rb +0 -206
- data/spec/integration/sync/v1/service/document_spec.rb +0 -254
- data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +0 -256
- data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +0 -206
- data/spec/integration/sync/v1/service/sync_list_spec.rb +0 -207
- data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +0 -257
- data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +0 -206
- data/spec/integration/sync/v1/service/sync_map_spec.rb +0 -207
- data/spec/integration/sync/v1/service_spec.rb +0 -244
- data/spec/integration/taskrouter/v1/workspace/task_channel_spec.rb +0 -127
- data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +0 -192
- data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +0 -201
- data/spec/integration/video/v1/recording_spec.rb +0 -165
- data/spec/integration/video/v1/room/recording_spec.rb +0 -146
- data/spec/integration/video/v1/room_spec.rb +0 -237
- data/spec/integration/wireless/v1/command_spec.rb +0 -166
- data/spec/integration/wireless/v1/rate_plan_spec.rb +0 -268
- data/spec/integration/wireless/v1/sim/usage_record_spec.rb +0 -65
- data/spec/integration/wireless/v1/sim_spec.rb +0 -208
- data/spec/jwt/access_token_spec.rb +0 -130
- data/spec/jwt/client_capability_spec.rb +0 -104
- data/spec/jwt/task_router_spec.rb +0 -172
- data/spec/twiml/messaging_response_spec.rb +0 -90
- data/spec/twiml/voice_response_spec.rb +0 -474
|
@@ -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
|
|
@@ -16,17 +16,18 @@ module Twilio
|
|
|
16
16
|
# @param [Version] version Version that contains the resource
|
|
17
17
|
# @param [String] account_sid A 34 character string that uniquely identifies this
|
|
18
18
|
# resource.
|
|
19
|
+
|
|
19
20
|
# @return [DomainList] DomainList
|
|
20
21
|
def initialize(version, account_sid: nil)
|
|
21
22
|
super(version)
|
|
22
|
-
|
|
23
|
+
|
|
23
24
|
# Path Solution
|
|
24
25
|
@solution = {
|
|
25
26
|
account_sid: account_sid
|
|
26
27
|
}
|
|
27
28
|
@uri = "/Accounts/#{@solution[:account_sid]}/SIP/Domains.json"
|
|
28
29
|
end
|
|
29
|
-
|
|
30
|
+
|
|
30
31
|
##
|
|
31
32
|
# Lists DomainInstance records from the API as a list.
|
|
32
33
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
@@ -37,6 +38,7 @@ module Twilio
|
|
|
37
38
|
# the default value of 50 records. If no page_size is defined
|
|
38
39
|
# but a limit is defined, stream() will attempt to read the
|
|
39
40
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
41
|
+
|
|
40
42
|
# @return [Array] Array of up to limit results
|
|
41
43
|
def list(limit: nil, page_size: nil)
|
|
42
44
|
self.stream(
|
|
@@ -44,7 +46,7 @@ module Twilio
|
|
|
44
46
|
page_size: page_size
|
|
45
47
|
).entries
|
|
46
48
|
end
|
|
47
|
-
|
|
49
|
+
|
|
48
50
|
##
|
|
49
51
|
# Streams DomainInstance records from the API as an Enumerable.
|
|
50
52
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
@@ -55,67 +57,62 @@ module Twilio
|
|
|
55
57
|
# the default value of 50 records. If no page_size is defined
|
|
56
58
|
# but a limit is defined, stream() will attempt to read the
|
|
57
59
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
|
60
|
+
|
|
58
61
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
59
62
|
def stream(limit: nil, page_size: nil)
|
|
60
63
|
limits = @version.read_limits(limit, page_size)
|
|
61
|
-
|
|
64
|
+
|
|
62
65
|
page = self.page(
|
|
63
|
-
page_size: limits[
|
|
66
|
+
page_size: limits['page_size'],
|
|
64
67
|
)
|
|
65
|
-
|
|
66
|
-
@version.stream(page, limit: limits[
|
|
68
|
+
|
|
69
|
+
@version.stream(page, limit: limits['limit'], page_limit: limits['page_limit'])
|
|
67
70
|
end
|
|
68
|
-
|
|
71
|
+
|
|
69
72
|
##
|
|
70
73
|
# When passed a block, yields DomainInstance records from the API.
|
|
71
74
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
72
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)
|
|
73
82
|
def each
|
|
74
83
|
limits = @version.read_limits
|
|
75
|
-
|
|
84
|
+
|
|
76
85
|
page = self.page(
|
|
77
|
-
page_size: limits[
|
|
86
|
+
page_size: limits['page_size'],
|
|
78
87
|
)
|
|
79
|
-
|
|
88
|
+
|
|
80
89
|
@version.stream(page,
|
|
81
|
-
limit: limits[
|
|
82
|
-
page_limit: limits[
|
|
90
|
+
limit: limits['limit'],
|
|
91
|
+
page_limit: limits['page_limit']).each {|x| yield x}
|
|
83
92
|
end
|
|
84
|
-
|
|
93
|
+
|
|
85
94
|
##
|
|
86
95
|
# Retrieve a single page of DomainInstance records from the API.
|
|
87
96
|
# Request is executed immediately.
|
|
88
97
|
# @param [String] page_token PageToken provided by the API
|
|
89
98
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
90
99
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
100
|
+
|
|
91
101
|
# @return [Page] Page of DomainInstance
|
|
92
|
-
def page(page_token:
|
|
93
|
-
params =
|
|
102
|
+
def page(page_token: nil, page_number: nil, page_size: nil)
|
|
103
|
+
params = {
|
|
94
104
|
'PageToken' => page_token,
|
|
95
105
|
'Page' => page_number,
|
|
96
106
|
'PageSize' => page_size,
|
|
97
|
-
}
|
|
107
|
+
}
|
|
98
108
|
response = @version.page(
|
|
99
109
|
'GET',
|
|
100
110
|
@uri,
|
|
101
111
|
params
|
|
102
112
|
)
|
|
103
|
-
DomainPage.new(@version, response, @solution)
|
|
113
|
+
return DomainPage.new(@version, response, @solution)
|
|
104
114
|
end
|
|
105
|
-
|
|
106
|
-
##
|
|
107
|
-
# Retrieve a single page of DomainInstance records from the API.
|
|
108
|
-
# Request is executed immediately.
|
|
109
|
-
# @param [String] target_url API-generated URL for the requested results page
|
|
110
|
-
# @return [Page] Page of DomainInstance
|
|
111
|
-
def get_page(target_url)
|
|
112
|
-
response = @version.domain.request(
|
|
113
|
-
'GET',
|
|
114
|
-
target_url
|
|
115
|
-
)
|
|
116
|
-
DomainPage.new(@version, response, @solution)
|
|
117
|
-
end
|
|
118
|
-
|
|
115
|
+
|
|
119
116
|
##
|
|
120
117
|
# Retrieve a single page of DomainInstance records from the API.
|
|
121
118
|
# Request is executed immediately.
|
|
@@ -123,8 +120,6 @@ module Twilio
|
|
|
123
120
|
# you route your SIP traffic
|
|
124
121
|
# @param [String] friendly_name A user-specified, human-readable name for the
|
|
125
122
|
# trigger.
|
|
126
|
-
# @param [String] auth_type The types of authentication you have mapped to your
|
|
127
|
-
# domain
|
|
128
123
|
# @param [String] voice_url The URL Twilio will request when this domain receives
|
|
129
124
|
# a call
|
|
130
125
|
# @param [String] voice_method The HTTP method to use with the voice_url
|
|
@@ -135,118 +130,136 @@ module Twilio
|
|
|
135
130
|
# @param [String] voice_status_callback_url The URL that Twilio will request to
|
|
136
131
|
# pass status parameters
|
|
137
132
|
# @param [String] voice_status_callback_method The voice_status_callback_method
|
|
133
|
+
|
|
138
134
|
# @return [DomainInstance] Newly created DomainInstance
|
|
139
|
-
def create(domain_name: nil, friendly_name:
|
|
140
|
-
data =
|
|
135
|
+
def create(domain_name: nil, friendly_name: nil, voice_url: nil, voice_method: nil, voice_fallback_url: nil, voice_fallback_method: nil, voice_status_callback_url: nil, voice_status_callback_method: nil)
|
|
136
|
+
data = {
|
|
141
137
|
'DomainName' => domain_name,
|
|
142
138
|
'FriendlyName' => friendly_name,
|
|
143
|
-
'AuthType' => auth_type,
|
|
144
139
|
'VoiceUrl' => voice_url,
|
|
145
140
|
'VoiceMethod' => voice_method,
|
|
146
141
|
'VoiceFallbackUrl' => voice_fallback_url,
|
|
147
142
|
'VoiceFallbackMethod' => voice_fallback_method,
|
|
148
143
|
'VoiceStatusCallbackUrl' => voice_status_callback_url,
|
|
149
144
|
'VoiceStatusCallbackMethod' => voice_status_callback_method,
|
|
150
|
-
}
|
|
151
|
-
|
|
145
|
+
}
|
|
146
|
+
|
|
152
147
|
payload = @version.create(
|
|
153
148
|
'POST',
|
|
154
149
|
@uri,
|
|
155
150
|
data: data
|
|
156
151
|
)
|
|
157
|
-
|
|
158
|
-
DomainInstance.new(
|
|
152
|
+
|
|
153
|
+
return DomainInstance.new(
|
|
159
154
|
@version,
|
|
160
155
|
payload,
|
|
156
|
+
account_sid: @solution['account_sid'],
|
|
157
|
+
)
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
##
|
|
161
|
+
# Constructs a DomainContext
|
|
162
|
+
# @param [String] sid The domain sid that uniquely identifies the resource
|
|
163
|
+
|
|
164
|
+
# @return [DomainContext] DomainContext
|
|
165
|
+
def get(sid)
|
|
166
|
+
DomainContext.new(
|
|
167
|
+
@version,
|
|
161
168
|
account_sid: @solution[:account_sid],
|
|
169
|
+
sid: sid,
|
|
162
170
|
)
|
|
163
171
|
end
|
|
164
|
-
|
|
172
|
+
|
|
165
173
|
##
|
|
166
174
|
# Provide a user friendly representation
|
|
167
175
|
def to_s
|
|
168
176
|
'#<Twilio.Api.V2010.DomainList>'
|
|
169
177
|
end
|
|
170
178
|
end
|
|
171
|
-
|
|
179
|
+
|
|
172
180
|
class DomainPage < Page
|
|
173
181
|
##
|
|
174
182
|
# Initialize the DomainPage
|
|
175
183
|
# @param [Version] version Version that contains the resource
|
|
176
184
|
# @param [Response] response Response from the API
|
|
177
185
|
# @param [Hash] solution Path solution for the resource
|
|
186
|
+
# @param [String] account_sid A 34 character string that uniquely identifies this
|
|
187
|
+
# resource.
|
|
188
|
+
|
|
178
189
|
# @return [DomainPage] DomainPage
|
|
179
190
|
def initialize(version, response, solution)
|
|
180
191
|
super(version, response)
|
|
181
|
-
|
|
192
|
+
|
|
182
193
|
# Path Solution
|
|
183
194
|
@solution = solution
|
|
184
195
|
end
|
|
185
|
-
|
|
196
|
+
|
|
186
197
|
##
|
|
187
198
|
# Build an instance of DomainInstance
|
|
188
199
|
# @param [Hash] payload Payload response from the API
|
|
200
|
+
|
|
189
201
|
# @return [DomainInstance] DomainInstance
|
|
190
202
|
def get_instance(payload)
|
|
191
|
-
DomainInstance.new(
|
|
203
|
+
return DomainInstance.new(
|
|
192
204
|
@version,
|
|
193
205
|
payload,
|
|
194
|
-
account_sid: @solution[
|
|
206
|
+
account_sid: @solution['account_sid'],
|
|
195
207
|
)
|
|
196
208
|
end
|
|
197
|
-
|
|
209
|
+
|
|
198
210
|
##
|
|
199
211
|
# Provide a user friendly representation
|
|
200
212
|
def to_s
|
|
201
213
|
'<Twilio.Api.V2010.DomainPage>'
|
|
202
214
|
end
|
|
203
215
|
end
|
|
204
|
-
|
|
216
|
+
|
|
205
217
|
class DomainContext < InstanceContext
|
|
206
218
|
##
|
|
207
219
|
# Initialize the DomainContext
|
|
208
220
|
# @param [Version] version Version that contains the resource
|
|
209
221
|
# @param [String] account_sid The account_sid
|
|
210
222
|
# @param [String] sid The domain sid that uniquely identifies the resource
|
|
223
|
+
|
|
211
224
|
# @return [DomainContext] DomainContext
|
|
212
225
|
def initialize(version, account_sid, sid)
|
|
213
226
|
super(version)
|
|
214
|
-
|
|
227
|
+
|
|
215
228
|
# Path Solution
|
|
216
229
|
@solution = {
|
|
217
230
|
account_sid: account_sid,
|
|
218
231
|
sid: sid,
|
|
219
232
|
}
|
|
220
233
|
@uri = "/Accounts/#{@solution[:account_sid]}/SIP/Domains/#{@solution[:sid]}.json"
|
|
221
|
-
|
|
234
|
+
|
|
222
235
|
# Dependents
|
|
223
236
|
@ip_access_control_list_mappings = nil
|
|
224
237
|
@credential_list_mappings = nil
|
|
225
238
|
end
|
|
226
|
-
|
|
239
|
+
|
|
227
240
|
##
|
|
228
241
|
# Fetch a DomainInstance
|
|
229
242
|
# @return [DomainInstance] Fetched DomainInstance
|
|
230
243
|
def fetch
|
|
231
|
-
params =
|
|
232
|
-
|
|
244
|
+
params = {}
|
|
245
|
+
|
|
233
246
|
payload = @version.fetch(
|
|
234
247
|
'GET',
|
|
235
248
|
@uri,
|
|
236
249
|
params,
|
|
237
250
|
)
|
|
238
|
-
|
|
239
|
-
DomainInstance.new(
|
|
251
|
+
|
|
252
|
+
return DomainInstance.new(
|
|
240
253
|
@version,
|
|
241
254
|
payload,
|
|
242
|
-
account_sid: @solution[
|
|
243
|
-
sid: @solution[
|
|
255
|
+
account_sid: @solution['account_sid'],
|
|
256
|
+
sid: @solution['sid'],
|
|
244
257
|
)
|
|
245
258
|
end
|
|
246
|
-
|
|
259
|
+
|
|
247
260
|
##
|
|
248
261
|
# Update the DomainInstance
|
|
249
|
-
# @param [String]
|
|
262
|
+
# @param [String] api_version The api_version
|
|
250
263
|
# @param [String] friendly_name A user-specified, human-readable name for the
|
|
251
264
|
# trigger.
|
|
252
265
|
# @param [String] voice_fallback_method The voice_fallback_method
|
|
@@ -255,10 +268,11 @@ module Twilio
|
|
|
255
268
|
# @param [String] voice_status_callback_method The voice_status_callback_method
|
|
256
269
|
# @param [String] voice_status_callback_url The voice_status_callback_url
|
|
257
270
|
# @param [String] voice_url The voice_url
|
|
271
|
+
|
|
258
272
|
# @return [DomainInstance] Updated DomainInstance
|
|
259
|
-
def update(
|
|
260
|
-
data =
|
|
261
|
-
'
|
|
273
|
+
def update(api_version: nil, friendly_name: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_status_callback_method: nil, voice_status_callback_url: nil, voice_url: nil)
|
|
274
|
+
data = {
|
|
275
|
+
'ApiVersion' => api_version,
|
|
262
276
|
'FriendlyName' => friendly_name,
|
|
263
277
|
'VoiceFallbackMethod' => voice_fallback_method,
|
|
264
278
|
'VoiceFallbackUrl' => voice_fallback_url,
|
|
@@ -266,36 +280,33 @@ module Twilio
|
|
|
266
280
|
'VoiceStatusCallbackMethod' => voice_status_callback_method,
|
|
267
281
|
'VoiceStatusCallbackUrl' => voice_status_callback_url,
|
|
268
282
|
'VoiceUrl' => voice_url,
|
|
269
|
-
}
|
|
270
|
-
|
|
283
|
+
}
|
|
284
|
+
|
|
271
285
|
payload = @version.update(
|
|
272
286
|
'POST',
|
|
273
287
|
@uri,
|
|
274
288
|
data: data,
|
|
275
289
|
)
|
|
276
|
-
|
|
277
|
-
DomainInstance.new(
|
|
290
|
+
|
|
291
|
+
return DomainInstance.new(
|
|
278
292
|
@version,
|
|
279
293
|
payload,
|
|
280
|
-
account_sid: @solution[
|
|
281
|
-
sid: @solution[
|
|
294
|
+
account_sid: @solution['account_sid'],
|
|
295
|
+
sid: @solution['sid'],
|
|
282
296
|
)
|
|
283
297
|
end
|
|
284
|
-
|
|
298
|
+
|
|
285
299
|
##
|
|
286
300
|
# Deletes the DomainInstance
|
|
287
301
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
288
302
|
def delete
|
|
289
|
-
@version.delete('delete', @uri)
|
|
303
|
+
return @version.delete('delete', @uri)
|
|
290
304
|
end
|
|
291
|
-
|
|
305
|
+
|
|
292
306
|
##
|
|
293
307
|
# Access the ip_access_control_list_mappings
|
|
294
|
-
# @return [IpAccessControlListMappingList]
|
|
295
|
-
# @return [IpAccessControlListMappingContext] if sid was passed.
|
|
308
|
+
# @return [IpAccessControlListMappingList] IpAccessControlListMappingList
|
|
296
309
|
def ip_access_control_list_mappings(sid=:unset)
|
|
297
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
|
298
|
-
|
|
299
310
|
if sid != :unset
|
|
300
311
|
return IpAccessControlListMappingContext.new(
|
|
301
312
|
@version,
|
|
@@ -304,7 +315,7 @@ module Twilio
|
|
|
304
315
|
sid,
|
|
305
316
|
)
|
|
306
317
|
end
|
|
307
|
-
|
|
318
|
+
|
|
308
319
|
unless @ip_access_control_list_mappings
|
|
309
320
|
@ip_access_control_list_mappings = IpAccessControlListMappingList.new(
|
|
310
321
|
@version,
|
|
@@ -312,17 +323,14 @@ module Twilio
|
|
|
312
323
|
domain_sid: @solution[:sid],
|
|
313
324
|
)
|
|
314
325
|
end
|
|
315
|
-
|
|
326
|
+
|
|
316
327
|
@ip_access_control_list_mappings
|
|
317
328
|
end
|
|
318
|
-
|
|
329
|
+
|
|
319
330
|
##
|
|
320
331
|
# Access the credential_list_mappings
|
|
321
|
-
# @return [CredentialListMappingList]
|
|
322
|
-
# @return [CredentialListMappingContext] if sid was passed.
|
|
332
|
+
# @return [CredentialListMappingList] CredentialListMappingList
|
|
323
333
|
def credential_list_mappings(sid=:unset)
|
|
324
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
|
325
|
-
|
|
326
334
|
if sid != :unset
|
|
327
335
|
return CredentialListMappingContext.new(
|
|
328
336
|
@version,
|
|
@@ -331,7 +339,7 @@ module Twilio
|
|
|
331
339
|
sid,
|
|
332
340
|
)
|
|
333
341
|
end
|
|
334
|
-
|
|
342
|
+
|
|
335
343
|
unless @credential_list_mappings
|
|
336
344
|
@credential_list_mappings = CredentialListMappingList.new(
|
|
337
345
|
@version,
|
|
@@ -339,10 +347,10 @@ module Twilio
|
|
|
339
347
|
domain_sid: @solution[:sid],
|
|
340
348
|
)
|
|
341
349
|
end
|
|
342
|
-
|
|
350
|
+
|
|
343
351
|
@credential_list_mappings
|
|
344
352
|
end
|
|
345
|
-
|
|
353
|
+
|
|
346
354
|
##
|
|
347
355
|
# Provide a user friendly representation
|
|
348
356
|
def to_s
|
|
@@ -350,7 +358,7 @@ module Twilio
|
|
|
350
358
|
"#<Twilio.Api.V2010.DomainContext #{context}>"
|
|
351
359
|
end
|
|
352
360
|
end
|
|
353
|
-
|
|
361
|
+
|
|
354
362
|
class DomainInstance < InstanceResource
|
|
355
363
|
##
|
|
356
364
|
# Initialize the DomainInstance
|
|
@@ -359,10 +367,11 @@ module Twilio
|
|
|
359
367
|
# @param [String] account_sid A 34 character string that uniquely identifies this
|
|
360
368
|
# resource.
|
|
361
369
|
# @param [String] sid The domain sid that uniquely identifies the resource
|
|
370
|
+
|
|
362
371
|
# @return [DomainInstance] DomainInstance
|
|
363
372
|
def initialize(version, payload, account_sid: nil, sid: nil)
|
|
364
373
|
super(version)
|
|
365
|
-
|
|
374
|
+
|
|
366
375
|
# Marshaled Properties
|
|
367
376
|
@properties = {
|
|
368
377
|
'account_sid' => payload['account_sid'],
|
|
@@ -380,9 +389,8 @@ module Twilio
|
|
|
380
389
|
'voice_status_callback_method' => payload['voice_status_callback_method'],
|
|
381
390
|
'voice_status_callback_url' => payload['voice_status_callback_url'],
|
|
382
391
|
'voice_url' => payload['voice_url'],
|
|
383
|
-
'subresource_uris' => payload['subresource_uris'],
|
|
384
392
|
}
|
|
385
|
-
|
|
393
|
+
|
|
386
394
|
# Context
|
|
387
395
|
@instance_context = nil
|
|
388
396
|
@params = {
|
|
@@ -390,10 +398,12 @@ module Twilio
|
|
|
390
398
|
'sid' => sid || @properties['sid'],
|
|
391
399
|
}
|
|
392
400
|
end
|
|
393
|
-
|
|
401
|
+
|
|
394
402
|
##
|
|
395
403
|
# Generate an instance context for the instance, the context is capable of
|
|
396
404
|
# performing various actions. All instance actions are proxied to the context
|
|
405
|
+
# @param [Version] version Version that contains the resource
|
|
406
|
+
|
|
397
407
|
# @return [DomainContext] DomainContext for this DomainInstance
|
|
398
408
|
def context
|
|
399
409
|
unless @instance_context
|
|
@@ -405,113 +415,77 @@ module Twilio
|
|
|
405
415
|
end
|
|
406
416
|
@instance_context
|
|
407
417
|
end
|
|
408
|
-
|
|
409
|
-
##
|
|
410
|
-
# @return [String] The unique id of the account that sent the message
|
|
418
|
+
|
|
411
419
|
def account_sid
|
|
412
420
|
@properties['account_sid']
|
|
413
421
|
end
|
|
414
|
-
|
|
415
|
-
##
|
|
416
|
-
# @return [String] The Twilio API version used to process the message
|
|
422
|
+
|
|
417
423
|
def api_version
|
|
418
424
|
@properties['api_version']
|
|
419
425
|
end
|
|
420
|
-
|
|
421
|
-
##
|
|
422
|
-
# @return [String] The types of authentication mapped to the domain
|
|
426
|
+
|
|
423
427
|
def auth_type
|
|
424
428
|
@properties['auth_type']
|
|
425
429
|
end
|
|
426
|
-
|
|
427
|
-
##
|
|
428
|
-
# @return [Time] The date this resource was created
|
|
430
|
+
|
|
429
431
|
def date_created
|
|
430
432
|
@properties['date_created']
|
|
431
433
|
end
|
|
432
|
-
|
|
433
|
-
##
|
|
434
|
-
# @return [Time] The date this resource was last updated
|
|
434
|
+
|
|
435
435
|
def date_updated
|
|
436
436
|
@properties['date_updated']
|
|
437
437
|
end
|
|
438
|
-
|
|
439
|
-
##
|
|
440
|
-
# @return [String] The unique address on Twilio to route SIP traffic
|
|
438
|
+
|
|
441
439
|
def domain_name
|
|
442
440
|
@properties['domain_name']
|
|
443
441
|
end
|
|
444
|
-
|
|
445
|
-
##
|
|
446
|
-
# @return [String] A user-specified, human-readable name for the trigger.
|
|
442
|
+
|
|
447
443
|
def friendly_name
|
|
448
444
|
@properties['friendly_name']
|
|
449
445
|
end
|
|
450
|
-
|
|
451
|
-
##
|
|
452
|
-
# @return [String] A string that uniquely identifies the SIP Domain
|
|
446
|
+
|
|
453
447
|
def sid
|
|
454
448
|
@properties['sid']
|
|
455
449
|
end
|
|
456
|
-
|
|
457
|
-
##
|
|
458
|
-
# @return [String] The URI for this resource
|
|
450
|
+
|
|
459
451
|
def uri
|
|
460
452
|
@properties['uri']
|
|
461
453
|
end
|
|
462
|
-
|
|
463
|
-
##
|
|
464
|
-
# @return [String] HTTP method used with voice_fallback_url
|
|
454
|
+
|
|
465
455
|
def voice_fallback_method
|
|
466
456
|
@properties['voice_fallback_method']
|
|
467
457
|
end
|
|
468
|
-
|
|
469
|
-
##
|
|
470
|
-
# @return [String] URL Twilio will request if an error occurs in executing TwiML
|
|
458
|
+
|
|
471
459
|
def voice_fallback_url
|
|
472
460
|
@properties['voice_fallback_url']
|
|
473
461
|
end
|
|
474
|
-
|
|
475
|
-
##
|
|
476
|
-
# @return [String] HTTP method to use with voice_url
|
|
462
|
+
|
|
477
463
|
def voice_method
|
|
478
464
|
@properties['voice_method']
|
|
479
465
|
end
|
|
480
|
-
|
|
481
|
-
##
|
|
482
|
-
# @return [String] The voice_status_callback_method
|
|
466
|
+
|
|
483
467
|
def voice_status_callback_method
|
|
484
468
|
@properties['voice_status_callback_method']
|
|
485
469
|
end
|
|
486
|
-
|
|
487
|
-
##
|
|
488
|
-
# @return [String] URL that Twilio will request with status updates
|
|
470
|
+
|
|
489
471
|
def voice_status_callback_url
|
|
490
472
|
@properties['voice_status_callback_url']
|
|
491
473
|
end
|
|
492
|
-
|
|
493
|
-
##
|
|
494
|
-
# @return [String] URL Twilio will request when receiving a call
|
|
474
|
+
|
|
495
475
|
def voice_url
|
|
496
476
|
@properties['voice_url']
|
|
497
477
|
end
|
|
498
|
-
|
|
499
|
-
##
|
|
500
|
-
# @return [String] The subresource_uris
|
|
501
|
-
def subresource_uris
|
|
502
|
-
@properties['subresource_uris']
|
|
503
|
-
end
|
|
504
|
-
|
|
478
|
+
|
|
505
479
|
##
|
|
506
480
|
# Fetch a DomainInstance
|
|
507
481
|
# @return [DomainInstance] Fetched DomainInstance
|
|
508
482
|
def fetch
|
|
509
|
-
context.fetch
|
|
483
|
+
@context.fetch()
|
|
510
484
|
end
|
|
511
|
-
|
|
485
|
+
|
|
512
486
|
##
|
|
513
487
|
# Update the DomainInstance
|
|
514
|
-
# @param [String]
|
|
488
|
+
# @param [String] api_version The api_version
|
|
515
489
|
# @param [String] friendly_name A user-specified, human-readable name for the
|
|
516
490
|
# trigger.
|
|
517
491
|
# @param [String] voice_fallback_method The voice_fallback_method
|
|
@@ -520,10 +494,10 @@ module Twilio
|
|
|
520
494
|
# @param [String] voice_status_callback_method The voice_status_callback_method
|
|
521
495
|
# @param [String] voice_status_callback_url The voice_status_callback_url
|
|
522
496
|
# @param [String] voice_url The voice_url
|
|
497
|
+
|
|
523
498
|
# @return [DomainInstance] Updated DomainInstance
|
|
524
|
-
def update(
|
|
525
|
-
context.update(
|
|
526
|
-
auth_type: auth_type,
|
|
499
|
+
def update(api_version: nil, friendly_name: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_status_callback_method: nil, voice_status_callback_url: nil, voice_url: nil)
|
|
500
|
+
@context.update(
|
|
527
501
|
friendly_name: friendly_name,
|
|
528
502
|
voice_fallback_method: voice_fallback_method,
|
|
529
503
|
voice_fallback_url: voice_fallback_url,
|
|
@@ -533,33 +507,33 @@ module Twilio
|
|
|
533
507
|
voice_url: voice_url,
|
|
534
508
|
)
|
|
535
509
|
end
|
|
536
|
-
|
|
510
|
+
|
|
537
511
|
##
|
|
538
512
|
# Deletes the DomainInstance
|
|
539
513
|
# @return [Boolean] true if delete succeeds, true otherwise
|
|
540
514
|
def delete
|
|
541
|
-
context.delete
|
|
515
|
+
@context.delete()
|
|
542
516
|
end
|
|
543
|
-
|
|
517
|
+
|
|
544
518
|
##
|
|
545
519
|
# Access the ip_access_control_list_mappings
|
|
546
520
|
# @return [ip_access_control_list_mappings] ip_access_control_list_mappings
|
|
547
521
|
def ip_access_control_list_mappings
|
|
548
|
-
context.ip_access_control_list_mappings
|
|
522
|
+
@context.ip_access_control_list_mappings
|
|
549
523
|
end
|
|
550
|
-
|
|
524
|
+
|
|
551
525
|
##
|
|
552
526
|
# Access the credential_list_mappings
|
|
553
527
|
# @return [credential_list_mappings] credential_list_mappings
|
|
554
528
|
def credential_list_mappings
|
|
555
|
-
context.credential_list_mappings
|
|
529
|
+
@context.credential_list_mappings
|
|
556
530
|
end
|
|
557
|
-
|
|
531
|
+
|
|
558
532
|
##
|
|
559
533
|
# Provide a user friendly representation
|
|
560
534
|
def to_s
|
|
561
|
-
|
|
562
|
-
"<Twilio.Api.V2010.DomainInstance #{
|
|
535
|
+
context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
536
|
+
"<Twilio.Api.V2010.DomainInstance #{context}>"
|
|
563
537
|
end
|
|
564
538
|
end
|
|
565
539
|
end
|