twilio-ruby 5.0.0.alpha1 → 5.0.0.rc2
Sign up to get free protection for your applications and to get access to all the features.
- 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
|
@@ -13,24 +13,25 @@ module Twilio
|
|
13
13
|
##
|
14
14
|
# Initialize the IncomingPhoneNumberList
|
15
15
|
# @param [Version] version Version that contains the resource
|
16
|
-
# @param [String]
|
17
|
-
#
|
16
|
+
# @param [String] owner_account_sid A 34 character string that uniquely identifies
|
17
|
+
# this resource.
|
18
|
+
|
18
19
|
# @return [IncomingPhoneNumberList] IncomingPhoneNumberList
|
19
|
-
def initialize(version,
|
20
|
+
def initialize(version, owner_account_sid: nil)
|
20
21
|
super(version)
|
21
|
-
|
22
|
+
|
22
23
|
# Path Solution
|
23
24
|
@solution = {
|
24
|
-
|
25
|
+
owner_account_sid: owner_account_sid
|
25
26
|
}
|
26
|
-
@uri = "/Accounts/#{@solution[:
|
27
|
-
|
27
|
+
@uri = "/Accounts/#{@solution[:owner_account_sid]}/IncomingPhoneNumbers.json"
|
28
|
+
|
28
29
|
# Components
|
29
30
|
@local = nil
|
30
31
|
@mobile = nil
|
31
32
|
@toll_free = nil
|
32
33
|
end
|
33
|
-
|
34
|
+
|
34
35
|
##
|
35
36
|
# Lists IncomingPhoneNumberInstance records from the API as a list.
|
36
37
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
@@ -40,25 +41,24 @@ module Twilio
|
|
40
41
|
# friendly names that exactly match this name
|
41
42
|
# @param [String] phone_number Only show the incoming phone number resources that
|
42
43
|
# match this pattern
|
43
|
-
# @param [String] origin The origin
|
44
44
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
45
45
|
# guarantees to never return more than limit. Default is no limit
|
46
46
|
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
47
47
|
# the default value of 50 records. If no page_size is defined
|
48
48
|
# but a limit is defined, stream() will attempt to read the
|
49
49
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
50
|
+
|
50
51
|
# @return [Array] Array of up to limit results
|
51
|
-
def list(beta:
|
52
|
+
def list(beta: nil, friendly_name: nil, phone_number: nil, limit: nil, page_size: nil)
|
52
53
|
self.stream(
|
53
54
|
beta: beta,
|
54
55
|
friendly_name: friendly_name,
|
55
56
|
phone_number: phone_number,
|
56
|
-
origin: origin,
|
57
57
|
limit: limit,
|
58
58
|
page_size: page_size
|
59
59
|
).entries
|
60
60
|
end
|
61
|
-
|
61
|
+
|
62
62
|
##
|
63
63
|
# Streams IncomingPhoneNumberInstance records from the API as an Enumerable.
|
64
64
|
# This operation lazily loads records as efficiently as possible until the limit
|
@@ -68,44 +68,54 @@ module Twilio
|
|
68
68
|
# friendly names that exactly match this name
|
69
69
|
# @param [String] phone_number Only show the incoming phone number resources that
|
70
70
|
# match this pattern
|
71
|
-
# @param [String] origin The origin
|
72
71
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
73
72
|
# guarantees to never return more than limit. Default is no limit
|
74
73
|
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
75
74
|
# the default value of 50 records. If no page_size is defined
|
76
75
|
# but a limit is defined, stream() will attempt to read the
|
77
76
|
# limit with the most efficient page size, i.e. min(limit, 1000)
|
77
|
+
|
78
78
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
79
|
-
def stream(beta:
|
79
|
+
def stream(beta: nil, friendly_name: nil, phone_number: nil, limit: nil, page_size: nil)
|
80
80
|
limits = @version.read_limits(limit, page_size)
|
81
|
-
|
81
|
+
|
82
82
|
page = self.page(
|
83
83
|
beta: beta,
|
84
84
|
friendly_name: friendly_name,
|
85
85
|
phone_number: phone_number,
|
86
|
-
|
87
|
-
page_size: limits[:page_size],
|
86
|
+
page_size: limits['page_size'],
|
88
87
|
)
|
89
|
-
|
90
|
-
@version.stream(page, limit: limits[
|
88
|
+
|
89
|
+
@version.stream(page, limit: limits['limit'], page_limit: limits['page_limit'])
|
91
90
|
end
|
92
|
-
|
91
|
+
|
93
92
|
##
|
94
93
|
# When passed a block, yields IncomingPhoneNumberInstance records from the API.
|
95
94
|
# This operation lazily loads records as efficiently as possible until the limit
|
96
95
|
# is reached.
|
96
|
+
# @param [Boolean] beta Include phone numbers new to the Twilio platform
|
97
|
+
# @param [String] friendly_name Only show the incoming phone number resources with
|
98
|
+
# friendly names that exactly match this name
|
99
|
+
# @param [String] phone_number Only show the incoming phone number resources that
|
100
|
+
# match this pattern
|
101
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
102
|
+
# guarantees to never return more than limit. Default is no limit
|
103
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
104
|
+
# the default value of 50 records. If no page_size is defined
|
105
|
+
# but a limit is defined, stream() will attempt to read the
|
106
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
97
107
|
def each
|
98
108
|
limits = @version.read_limits
|
99
|
-
|
109
|
+
|
100
110
|
page = self.page(
|
101
|
-
page_size: limits[
|
111
|
+
page_size: limits['page_size'],
|
102
112
|
)
|
103
|
-
|
113
|
+
|
104
114
|
@version.stream(page,
|
105
|
-
limit: limits[
|
106
|
-
page_limit: limits[
|
115
|
+
limit: limits['limit'],
|
116
|
+
page_limit: limits['page_limit']).each {|x| yield x}
|
107
117
|
end
|
108
|
-
|
118
|
+
|
109
119
|
##
|
110
120
|
# Retrieve a single page of IncomingPhoneNumberInstance records from the API.
|
111
121
|
# Request is executed immediately.
|
@@ -114,42 +124,28 @@ module Twilio
|
|
114
124
|
# friendly names that exactly match this name
|
115
125
|
# @param [String] phone_number Only show the incoming phone number resources that
|
116
126
|
# match this pattern
|
117
|
-
# @param [String] origin The origin
|
118
127
|
# @param [String] page_token PageToken provided by the API
|
119
128
|
# @param [Integer] page_number Page Number, this value is simply for client state
|
120
129
|
# @param [Integer] page_size Number of records to return, defaults to 50
|
130
|
+
|
121
131
|
# @return [Page] Page of IncomingPhoneNumberInstance
|
122
|
-
def page(beta:
|
123
|
-
params =
|
132
|
+
def page(beta: nil, friendly_name: nil, phone_number: nil, page_token: nil, page_number: nil, page_size: nil)
|
133
|
+
params = {
|
124
134
|
'Beta' => beta,
|
125
135
|
'FriendlyName' => friendly_name,
|
126
136
|
'PhoneNumber' => phone_number,
|
127
|
-
'Origin' => origin,
|
128
137
|
'PageToken' => page_token,
|
129
138
|
'Page' => page_number,
|
130
139
|
'PageSize' => page_size,
|
131
|
-
}
|
140
|
+
}
|
132
141
|
response = @version.page(
|
133
142
|
'GET',
|
134
143
|
@uri,
|
135
144
|
params
|
136
145
|
)
|
137
|
-
IncomingPhoneNumberPage.new(@version, response, @solution)
|
138
|
-
end
|
139
|
-
|
140
|
-
##
|
141
|
-
# Retrieve a single page of IncomingPhoneNumberInstance records from the API.
|
142
|
-
# Request is executed immediately.
|
143
|
-
# @param [String] target_url API-generated URL for the requested results page
|
144
|
-
# @return [Page] Page of IncomingPhoneNumberInstance
|
145
|
-
def get_page(target_url)
|
146
|
-
response = @version.domain.request(
|
147
|
-
'GET',
|
148
|
-
target_url
|
149
|
-
)
|
150
|
-
IncomingPhoneNumberPage.new(@version, response, @solution)
|
146
|
+
return IncomingPhoneNumberPage.new(@version, response, @solution)
|
151
147
|
end
|
152
|
-
|
148
|
+
|
153
149
|
##
|
154
150
|
# Retrieve a single page of IncomingPhoneNumberInstance records from the API.
|
155
151
|
# Request is executed immediately.
|
@@ -190,21 +186,14 @@ module Twilio
|
|
190
186
|
# @param [String] voice_url The URL Twilio will request when this phone number
|
191
187
|
# receives a call. The VoiceURL will no longer be used if a `VoiceApplicationSid`
|
192
188
|
# or a `TrunkSid` is set.
|
193
|
-
# @param [incoming_phone_number.EmergencyStatus] emergency_status The
|
194
|
-
# emergency_status
|
195
|
-
# @param [String] emergency_address_sid The emergency_address_sid
|
196
|
-
# @param [String] trunk_sid The 34 character sid of the Trunk Twilio should use to
|
197
|
-
# handle phone calls to this number. If a `TrunkSid` is present, Twilio will
|
198
|
-
# ignore all of the voice urls and voice applications above and use those set on
|
199
|
-
# the Trunk. Setting a `TrunkSid` will automatically delete your
|
200
|
-
# `VoiceApplicationSid` and vice versa.
|
201
189
|
# @param [String] phone_number The phone number to purchase. e.g., +16175551212
|
202
190
|
# (E.164 format)
|
203
191
|
# @param [String] area_code The desired area code for the new phone number. Any
|
204
192
|
# three digit US or Canada rea code is valid
|
193
|
+
|
205
194
|
# @return [IncomingPhoneNumberInstance] Newly created IncomingPhoneNumberInstance
|
206
|
-
def create(api_version:
|
207
|
-
data =
|
195
|
+
def create(api_version: nil, friendly_name: nil, sms_application_sid: nil, sms_fallback_method: nil, sms_fallback_url: nil, sms_method: nil, sms_url: nil, status_callback: nil, status_callback_method: nil, voice_application_sid: nil, voice_caller_id_lookup: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_url: nil, phone_number: nil, area_code: nil)
|
196
|
+
data = {
|
208
197
|
'PhoneNumber' => phone_number,
|
209
198
|
'AreaCode' => area_code,
|
210
199
|
'ApiVersion' => api_version,
|
@@ -222,121 +211,133 @@ module Twilio
|
|
222
211
|
'VoiceFallbackUrl' => voice_fallback_url,
|
223
212
|
'VoiceMethod' => voice_method,
|
224
213
|
'VoiceUrl' => voice_url,
|
225
|
-
|
226
|
-
|
227
|
-
'TrunkSid' => trunk_sid,
|
228
|
-
})
|
229
|
-
|
214
|
+
}
|
215
|
+
|
230
216
|
payload = @version.create(
|
231
217
|
'POST',
|
232
218
|
@uri,
|
233
219
|
data: data
|
234
220
|
)
|
235
|
-
|
236
|
-
IncomingPhoneNumberInstance.new(
|
221
|
+
|
222
|
+
return IncomingPhoneNumberInstance.new(
|
237
223
|
@version,
|
238
224
|
payload,
|
239
|
-
|
225
|
+
owner_account_sid: @solution['owner_account_sid'],
|
240
226
|
)
|
241
227
|
end
|
242
|
-
|
228
|
+
|
243
229
|
##
|
244
230
|
# Access the local
|
245
|
-
# @return [LocalList]
|
246
|
-
# @return [LocalContext]
|
231
|
+
# @return [LocalList] LocalList
|
247
232
|
def local
|
248
233
|
@local ||= LocalList.new(
|
249
234
|
@version,
|
250
|
-
|
235
|
+
owner_account_sid: @solution[:owner_account_sid],
|
251
236
|
)
|
252
237
|
end
|
253
|
-
|
238
|
+
|
254
239
|
##
|
255
240
|
# Access the mobile
|
256
|
-
# @return [MobileList]
|
257
|
-
# @return [MobileContext]
|
241
|
+
# @return [MobileList] MobileList
|
258
242
|
def mobile
|
259
243
|
@mobile ||= MobileList.new(
|
260
244
|
@version,
|
261
|
-
|
245
|
+
owner_account_sid: @solution[:owner_account_sid],
|
262
246
|
)
|
263
247
|
end
|
264
|
-
|
248
|
+
|
265
249
|
##
|
266
250
|
# Access the toll_free
|
267
|
-
# @return [TollFreeList]
|
268
|
-
# @return [TollFreeContext]
|
251
|
+
# @return [TollFreeList] TollFreeList
|
269
252
|
def toll_free
|
270
253
|
@toll_free ||= TollFreeList.new(
|
271
254
|
@version,
|
272
|
-
|
255
|
+
owner_account_sid: @solution[:owner_account_sid],
|
273
256
|
)
|
274
257
|
end
|
275
|
-
|
258
|
+
|
259
|
+
##
|
260
|
+
# Constructs a IncomingPhoneNumberContext
|
261
|
+
# @param [String] sid The incoming-phone-number Sid that uniquely identifies this
|
262
|
+
# resource
|
263
|
+
|
264
|
+
# @return [IncomingPhoneNumberContext] IncomingPhoneNumberContext
|
265
|
+
def get(sid)
|
266
|
+
IncomingPhoneNumberContext.new(
|
267
|
+
@version,
|
268
|
+
owner_account_sid: @solution[:owner_account_sid],
|
269
|
+
sid: sid,
|
270
|
+
)
|
271
|
+
end
|
272
|
+
|
276
273
|
##
|
277
274
|
# Provide a user friendly representation
|
278
275
|
def to_s
|
279
276
|
'#<Twilio.Api.V2010.IncomingPhoneNumberList>'
|
280
277
|
end
|
281
278
|
end
|
282
|
-
|
279
|
+
|
283
280
|
class IncomingPhoneNumberPage < Page
|
284
281
|
##
|
285
282
|
# Initialize the IncomingPhoneNumberPage
|
286
283
|
# @param [Version] version Version that contains the resource
|
287
284
|
# @param [Response] response Response from the API
|
288
285
|
# @param [Hash] solution Path solution for the resource
|
286
|
+
# @param [String] owner_account_sid A 34 character string that uniquely identifies
|
287
|
+
# this resource.
|
288
|
+
|
289
289
|
# @return [IncomingPhoneNumberPage] IncomingPhoneNumberPage
|
290
290
|
def initialize(version, response, solution)
|
291
291
|
super(version, response)
|
292
|
-
|
292
|
+
|
293
293
|
# Path Solution
|
294
294
|
@solution = solution
|
295
295
|
end
|
296
|
-
|
296
|
+
|
297
297
|
##
|
298
298
|
# Build an instance of IncomingPhoneNumberInstance
|
299
299
|
# @param [Hash] payload Payload response from the API
|
300
|
+
|
300
301
|
# @return [IncomingPhoneNumberInstance] IncomingPhoneNumberInstance
|
301
302
|
def get_instance(payload)
|
302
|
-
IncomingPhoneNumberInstance.new(
|
303
|
+
return IncomingPhoneNumberInstance.new(
|
303
304
|
@version,
|
304
305
|
payload,
|
305
|
-
|
306
|
+
owner_account_sid: @solution['owner_account_sid'],
|
306
307
|
)
|
307
308
|
end
|
308
|
-
|
309
|
+
|
309
310
|
##
|
310
311
|
# Provide a user friendly representation
|
311
312
|
def to_s
|
312
313
|
'<Twilio.Api.V2010.IncomingPhoneNumberPage>'
|
313
314
|
end
|
314
315
|
end
|
315
|
-
|
316
|
+
|
316
317
|
class IncomingPhoneNumberContext < InstanceContext
|
317
318
|
##
|
318
319
|
# Initialize the IncomingPhoneNumberContext
|
319
320
|
# @param [Version] version Version that contains the resource
|
320
|
-
# @param [String]
|
321
|
+
# @param [String] owner_account_sid The owner_account_sid
|
321
322
|
# @param [String] sid The incoming-phone-number Sid that uniquely identifies this
|
322
323
|
# resource
|
324
|
+
|
323
325
|
# @return [IncomingPhoneNumberContext] IncomingPhoneNumberContext
|
324
|
-
def initialize(version,
|
326
|
+
def initialize(version, owner_account_sid, sid)
|
325
327
|
super(version)
|
326
|
-
|
328
|
+
|
327
329
|
# Path Solution
|
328
330
|
@solution = {
|
329
|
-
|
331
|
+
owner_account_sid: owner_account_sid,
|
330
332
|
sid: sid,
|
331
333
|
}
|
332
|
-
@uri = "/Accounts/#{@solution[:
|
333
|
-
|
334
|
-
# Dependents
|
335
|
-
@assigned_add_ons = nil
|
334
|
+
@uri = "/Accounts/#{@solution[:owner_account_sid]}/IncomingPhoneNumbers/#{@solution[:sid]}.json"
|
336
335
|
end
|
337
|
-
|
336
|
+
|
338
337
|
##
|
339
338
|
# Update the IncomingPhoneNumberInstance
|
339
|
+
# @param [String] account_sid The unique id of the Account to which you wish to
|
340
|
+
# transfer this phnoe number
|
340
341
|
# @param [String] api_version Calls to this phone number will start a new TwiML
|
341
342
|
# session with this API version.
|
342
343
|
# @param [String] friendly_name A human readable descriptive text for this
|
@@ -374,17 +375,11 @@ module Twilio
|
|
374
375
|
# @param [String] voice_url The URL Twilio will request when this phone number
|
375
376
|
# receives a call. The VoiceURL will no longer be used if a `VoiceApplicationSid`
|
376
377
|
# or a `TrunkSid` is set.
|
377
|
-
|
378
|
-
# emergency_status
|
379
|
-
# @param [String] emergency_address_sid The emergency_address_sid
|
380
|
-
# @param [String] trunk_sid The 34 character sid of the Trunk Twilio should use to
|
381
|
-
# handle phone calls to this number. If a `TrunkSid` is present, Twilio will
|
382
|
-
# ignore all of the voice urls and voice applications above and use those set on
|
383
|
-
# the Trunk. Setting a `TrunkSid` will automatically delete your
|
384
|
-
# `VoiceApplicationSid` and vice versa.
|
378
|
+
|
385
379
|
# @return [IncomingPhoneNumberInstance] Updated IncomingPhoneNumberInstance
|
386
|
-
def update(api_version:
|
387
|
-
data =
|
380
|
+
def update(account_sid: nil, api_version: nil, friendly_name: nil, sms_application_sid: nil, sms_fallback_method: nil, sms_fallback_url: nil, sms_method: nil, sms_url: nil, status_callback: nil, status_callback_method: nil, voice_application_sid: nil, voice_caller_id_lookup: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_url: nil)
|
381
|
+
data = {
|
382
|
+
'AccountSid' => account_sid,
|
388
383
|
'ApiVersion' => api_version,
|
389
384
|
'FriendlyName' => friendly_name,
|
390
385
|
'SmsApplicationSid' => sms_application_sid,
|
@@ -400,79 +395,49 @@ module Twilio
|
|
400
395
|
'VoiceFallbackUrl' => voice_fallback_url,
|
401
396
|
'VoiceMethod' => voice_method,
|
402
397
|
'VoiceUrl' => voice_url,
|
403
|
-
|
404
|
-
|
405
|
-
'TrunkSid' => trunk_sid,
|
406
|
-
})
|
407
|
-
|
398
|
+
}
|
399
|
+
|
408
400
|
payload = @version.update(
|
409
401
|
'POST',
|
410
402
|
@uri,
|
411
403
|
data: data,
|
412
404
|
)
|
413
|
-
|
414
|
-
IncomingPhoneNumberInstance.new(
|
405
|
+
|
406
|
+
return IncomingPhoneNumberInstance.new(
|
415
407
|
@version,
|
416
408
|
payload,
|
417
|
-
|
418
|
-
sid: @solution[
|
409
|
+
owner_account_sid: @solution['owner_account_sid'],
|
410
|
+
sid: @solution['sid'],
|
419
411
|
)
|
420
412
|
end
|
421
|
-
|
413
|
+
|
422
414
|
##
|
423
415
|
# Fetch a IncomingPhoneNumberInstance
|
424
416
|
# @return [IncomingPhoneNumberInstance] Fetched IncomingPhoneNumberInstance
|
425
417
|
def fetch
|
426
|
-
params =
|
427
|
-
|
418
|
+
params = {}
|
419
|
+
|
428
420
|
payload = @version.fetch(
|
429
421
|
'GET',
|
430
422
|
@uri,
|
431
423
|
params,
|
432
424
|
)
|
433
|
-
|
434
|
-
IncomingPhoneNumberInstance.new(
|
425
|
+
|
426
|
+
return IncomingPhoneNumberInstance.new(
|
435
427
|
@version,
|
436
428
|
payload,
|
437
|
-
|
438
|
-
sid: @solution[
|
429
|
+
owner_account_sid: @solution['owner_account_sid'],
|
430
|
+
sid: @solution['sid'],
|
439
431
|
)
|
440
432
|
end
|
441
|
-
|
433
|
+
|
442
434
|
##
|
443
435
|
# Deletes the IncomingPhoneNumberInstance
|
444
436
|
# @return [Boolean] true if delete succeeds, true otherwise
|
445
437
|
def delete
|
446
|
-
@version.delete('delete', @uri)
|
447
|
-
end
|
448
|
-
|
449
|
-
##
|
450
|
-
# Access the assigned_add_ons
|
451
|
-
# @return [AssignedAddOnList]
|
452
|
-
# @return [AssignedAddOnContext] if sid was passed.
|
453
|
-
def assigned_add_ons(sid=:unset)
|
454
|
-
raise ArgumentError, 'sid cannot be nil' if sid.nil?
|
455
|
-
|
456
|
-
if sid != :unset
|
457
|
-
return AssignedAddOnContext.new(
|
458
|
-
@version,
|
459
|
-
@solution[:account_sid],
|
460
|
-
@solution[:sid],
|
461
|
-
sid,
|
462
|
-
)
|
463
|
-
end
|
464
|
-
|
465
|
-
unless @assigned_add_ons
|
466
|
-
@assigned_add_ons = AssignedAddOnList.new(
|
467
|
-
@version,
|
468
|
-
account_sid: @solution[:account_sid],
|
469
|
-
resource_sid: @solution[:sid],
|
470
|
-
)
|
471
|
-
end
|
472
|
-
|
473
|
-
@assigned_add_ons
|
438
|
+
return @version.delete('delete', @uri)
|
474
439
|
end
|
475
|
-
|
440
|
+
|
476
441
|
##
|
477
442
|
# Provide a user friendly representation
|
478
443
|
def to_s
|
@@ -480,20 +445,21 @@ module Twilio
|
|
480
445
|
"#<Twilio.Api.V2010.IncomingPhoneNumberContext #{context}>"
|
481
446
|
end
|
482
447
|
end
|
483
|
-
|
448
|
+
|
484
449
|
class IncomingPhoneNumberInstance < InstanceResource
|
485
450
|
##
|
486
451
|
# Initialize the IncomingPhoneNumberInstance
|
487
452
|
# @param [Version] version Version that contains the resource
|
488
453
|
# @param [Hash] payload payload that contains response from Twilio
|
489
|
-
# @param [String]
|
490
|
-
#
|
454
|
+
# @param [String] owner_account_sid A 34 character string that uniquely identifies
|
455
|
+
# this resource.
|
491
456
|
# @param [String] sid The incoming-phone-number Sid that uniquely identifies this
|
492
457
|
# resource
|
458
|
+
|
493
459
|
# @return [IncomingPhoneNumberInstance] IncomingPhoneNumberInstance
|
494
|
-
def initialize(version, payload,
|
460
|
+
def initialize(version, payload, owner_account_sid: nil, sid: nil)
|
495
461
|
super(version)
|
496
|
-
|
462
|
+
|
497
463
|
# Marshaled Properties
|
498
464
|
@properties = {
|
499
465
|
'account_sid' => payload['account_sid'],
|
@@ -505,7 +471,6 @@ module Twilio
|
|
505
471
|
'date_updated' => Twilio.deserialize_rfc2822(payload['date_updated']),
|
506
472
|
'friendly_name' => payload['friendly_name'],
|
507
473
|
'phone_number' => payload['phone_number'],
|
508
|
-
'origin' => payload['origin'],
|
509
474
|
'sid' => payload['sid'],
|
510
475
|
'sms_application_sid' => payload['sms_application_sid'],
|
511
476
|
'sms_fallback_method' => payload['sms_fallback_method'],
|
@@ -514,7 +479,6 @@ module Twilio
|
|
514
479
|
'sms_url' => payload['sms_url'],
|
515
480
|
'status_callback' => payload['status_callback'],
|
516
481
|
'status_callback_method' => payload['status_callback_method'],
|
517
|
-
'trunk_sid' => payload['trunk_sid'],
|
518
482
|
'uri' => payload['uri'],
|
519
483
|
'voice_application_sid' => payload['voice_application_sid'],
|
520
484
|
'voice_caller_id_lookup' => payload['voice_caller_id_lookup'],
|
@@ -522,203 +486,133 @@ module Twilio
|
|
522
486
|
'voice_fallback_url' => payload['voice_fallback_url'],
|
523
487
|
'voice_method' => payload['voice_method'],
|
524
488
|
'voice_url' => payload['voice_url'],
|
525
|
-
'emergency_status' => payload['emergency_status'],
|
526
|
-
'emergency_address_sid' => payload['emergency_address_sid'],
|
527
489
|
}
|
528
|
-
|
490
|
+
|
529
491
|
# Context
|
530
492
|
@instance_context = nil
|
531
493
|
@params = {
|
532
|
-
'
|
494
|
+
'owner_account_sid' => owner_account_sid,
|
533
495
|
'sid' => sid || @properties['sid'],
|
534
496
|
}
|
535
497
|
end
|
536
|
-
|
498
|
+
|
537
499
|
##
|
538
500
|
# Generate an instance context for the instance, the context is capable of
|
539
501
|
# performing various actions. All instance actions are proxied to the context
|
502
|
+
# @param [Version] version Version that contains the resource
|
503
|
+
|
540
504
|
# @return [IncomingPhoneNumberContext] IncomingPhoneNumberContext for this IncomingPhoneNumberInstance
|
541
505
|
def context
|
542
506
|
unless @instance_context
|
543
507
|
@instance_context = IncomingPhoneNumberContext.new(
|
544
508
|
@version,
|
545
|
-
@params['
|
509
|
+
@params['owner_account_sid'],
|
546
510
|
@params['sid'],
|
547
511
|
)
|
548
512
|
end
|
549
513
|
@instance_context
|
550
514
|
end
|
551
|
-
|
552
|
-
##
|
553
|
-
# @return [String] The unique sid that identifies this account
|
515
|
+
|
554
516
|
def account_sid
|
555
517
|
@properties['account_sid']
|
556
518
|
end
|
557
|
-
|
558
|
-
##
|
559
|
-
# @return [toll_free.AddressRequirement] Indicates if the customer requires an address
|
519
|
+
|
560
520
|
def address_requirements
|
561
521
|
@properties['address_requirements']
|
562
522
|
end
|
563
|
-
|
564
|
-
##
|
565
|
-
# @return [String] The Twilio REST API version to use
|
523
|
+
|
566
524
|
def api_version
|
567
525
|
@properties['api_version']
|
568
526
|
end
|
569
|
-
|
570
|
-
##
|
571
|
-
# @return [Boolean] Indicates if the phone number is a beta number
|
527
|
+
|
572
528
|
def beta
|
573
529
|
@properties['beta']
|
574
530
|
end
|
575
|
-
|
576
|
-
##
|
577
|
-
# @return [String] Indicate if a phone can receive calls or messages
|
531
|
+
|
578
532
|
def capabilities
|
579
533
|
@properties['capabilities']
|
580
534
|
end
|
581
|
-
|
582
|
-
##
|
583
|
-
# @return [Time] The date this resource was created
|
535
|
+
|
584
536
|
def date_created
|
585
537
|
@properties['date_created']
|
586
538
|
end
|
587
|
-
|
588
|
-
##
|
589
|
-
# @return [Time] The date this resource was last updated
|
539
|
+
|
590
540
|
def date_updated
|
591
541
|
@properties['date_updated']
|
592
542
|
end
|
593
|
-
|
594
|
-
##
|
595
|
-
# @return [String] A human readable description of this resouce
|
543
|
+
|
596
544
|
def friendly_name
|
597
545
|
@properties['friendly_name']
|
598
546
|
end
|
599
|
-
|
600
|
-
##
|
601
|
-
# @return [String] The incoming phone number
|
547
|
+
|
602
548
|
def phone_number
|
603
549
|
@properties['phone_number']
|
604
550
|
end
|
605
|
-
|
606
|
-
##
|
607
|
-
# @return [String] The origin
|
608
|
-
def origin
|
609
|
-
@properties['origin']
|
610
|
-
end
|
611
|
-
|
612
|
-
##
|
613
|
-
# @return [String] A string that uniquely identifies this resource
|
551
|
+
|
614
552
|
def sid
|
615
553
|
@properties['sid']
|
616
554
|
end
|
617
|
-
|
618
|
-
##
|
619
|
-
# @return [String] Unique string that identifies the application
|
555
|
+
|
620
556
|
def sms_application_sid
|
621
557
|
@properties['sms_application_sid']
|
622
558
|
end
|
623
|
-
|
624
|
-
##
|
625
|
-
# @return [String] HTTP method used with sms fallback url
|
559
|
+
|
626
560
|
def sms_fallback_method
|
627
561
|
@properties['sms_fallback_method']
|
628
562
|
end
|
629
|
-
|
630
|
-
##
|
631
|
-
# @return [String] URL Twilio will request if an error occurs in executing TwiML
|
563
|
+
|
632
564
|
def sms_fallback_url
|
633
565
|
@properties['sms_fallback_url']
|
634
566
|
end
|
635
|
-
|
636
|
-
##
|
637
|
-
# @return [String] HTTP method to use with sms url
|
567
|
+
|
638
568
|
def sms_method
|
639
569
|
@properties['sms_method']
|
640
570
|
end
|
641
|
-
|
642
|
-
##
|
643
|
-
# @return [String] URL Twilio will request when receiving an SMS
|
571
|
+
|
644
572
|
def sms_url
|
645
573
|
@properties['sms_url']
|
646
574
|
end
|
647
|
-
|
648
|
-
##
|
649
|
-
# @return [String] URL Twilio will use to pass status parameters
|
575
|
+
|
650
576
|
def status_callback
|
651
577
|
@properties['status_callback']
|
652
578
|
end
|
653
|
-
|
654
|
-
##
|
655
|
-
# @return [String] HTTP method twilio will use with status callback
|
579
|
+
|
656
580
|
def status_callback_method
|
657
581
|
@properties['status_callback_method']
|
658
582
|
end
|
659
|
-
|
660
|
-
##
|
661
|
-
# @return [String] Unique string to identify the trunk
|
662
|
-
def trunk_sid
|
663
|
-
@properties['trunk_sid']
|
664
|
-
end
|
665
|
-
|
666
|
-
##
|
667
|
-
# @return [String] The URI for this resource
|
583
|
+
|
668
584
|
def uri
|
669
585
|
@properties['uri']
|
670
586
|
end
|
671
|
-
|
672
|
-
##
|
673
|
-
# @return [String] The unique sid of the application to handle this number
|
587
|
+
|
674
588
|
def voice_application_sid
|
675
589
|
@properties['voice_application_sid']
|
676
590
|
end
|
677
|
-
|
678
|
-
##
|
679
|
-
# @return [Boolean] Look up the caller's caller-ID
|
591
|
+
|
680
592
|
def voice_caller_id_lookup
|
681
593
|
@properties['voice_caller_id_lookup']
|
682
594
|
end
|
683
|
-
|
684
|
-
##
|
685
|
-
# @return [String] HTTP method used with fallback_url
|
595
|
+
|
686
596
|
def voice_fallback_method
|
687
597
|
@properties['voice_fallback_method']
|
688
598
|
end
|
689
|
-
|
690
|
-
##
|
691
|
-
# @return [String] URL Twilio will request when an error occurs in TwiML
|
599
|
+
|
692
600
|
def voice_fallback_url
|
693
601
|
@properties['voice_fallback_url']
|
694
602
|
end
|
695
|
-
|
696
|
-
##
|
697
|
-
# @return [String] HTTP method used with the voice url
|
603
|
+
|
698
604
|
def voice_method
|
699
605
|
@properties['voice_method']
|
700
606
|
end
|
701
|
-
|
702
|
-
##
|
703
|
-
# @return [String] URL Twilio will request when receiving a call
|
607
|
+
|
704
608
|
def voice_url
|
705
609
|
@properties['voice_url']
|
706
610
|
end
|
707
|
-
|
708
|
-
##
|
709
|
-
# @return [incoming_phone_number.EmergencyStatus] The emergency_status
|
710
|
-
def emergency_status
|
711
|
-
@properties['emergency_status']
|
712
|
-
end
|
713
|
-
|
714
|
-
##
|
715
|
-
# @return [String] The emergency_address_sid
|
716
|
-
def emergency_address_sid
|
717
|
-
@properties['emergency_address_sid']
|
718
|
-
end
|
719
|
-
|
611
|
+
|
720
612
|
##
|
721
613
|
# Update the IncomingPhoneNumberInstance
|
614
|
+
# @param [String] account_sid The unique id of the Account to which you wish to
|
615
|
+
# transfer this phnoe number
|
722
616
|
# @param [String] api_version Calls to this phone number will start a new TwiML
|
723
617
|
# session with this API version.
|
724
618
|
# @param [String] friendly_name A human readable descriptive text for this
|
@@ -756,17 +650,10 @@ module Twilio
|
|
756
650
|
# @param [String] voice_url The URL Twilio will request when this phone number
|
757
651
|
# receives a call. The VoiceURL will no longer be used if a `VoiceApplicationSid`
|
758
652
|
# or a `TrunkSid` is set.
|
759
|
-
|
760
|
-
# emergency_status
|
761
|
-
# @param [String] emergency_address_sid The emergency_address_sid
|
762
|
-
# @param [String] trunk_sid The 34 character sid of the Trunk Twilio should use to
|
763
|
-
# handle phone calls to this number. If a `TrunkSid` is present, Twilio will
|
764
|
-
# ignore all of the voice urls and voice applications above and use those set on
|
765
|
-
# the Trunk. Setting a `TrunkSid` will automatically delete your
|
766
|
-
# `VoiceApplicationSid` and vice versa.
|
653
|
+
|
767
654
|
# @return [IncomingPhoneNumberInstance] Updated IncomingPhoneNumberInstance
|
768
|
-
def update(api_version:
|
769
|
-
context.update(
|
655
|
+
def update(account_sid: nil, api_version: nil, friendly_name: nil, sms_application_sid: nil, sms_fallback_method: nil, sms_fallback_url: nil, sms_method: nil, sms_url: nil, status_callback: nil, status_callback_method: nil, voice_application_sid: nil, voice_caller_id_lookup: nil, voice_fallback_method: nil, voice_fallback_url: nil, voice_method: nil, voice_url: nil)
|
656
|
+
@context.update(
|
770
657
|
api_version: api_version,
|
771
658
|
friendly_name: friendly_name,
|
772
659
|
sms_application_sid: sms_application_sid,
|
@@ -782,38 +669,28 @@ module Twilio
|
|
782
669
|
voice_fallback_url: voice_fallback_url,
|
783
670
|
voice_method: voice_method,
|
784
671
|
voice_url: voice_url,
|
785
|
-
emergency_status: emergency_status,
|
786
|
-
emergency_address_sid: emergency_address_sid,
|
787
|
-
trunk_sid: trunk_sid,
|
788
672
|
)
|
789
673
|
end
|
790
|
-
|
674
|
+
|
791
675
|
##
|
792
676
|
# Fetch a IncomingPhoneNumberInstance
|
793
677
|
# @return [IncomingPhoneNumberInstance] Fetched IncomingPhoneNumberInstance
|
794
678
|
def fetch
|
795
|
-
context.fetch
|
679
|
+
@context.fetch()
|
796
680
|
end
|
797
|
-
|
681
|
+
|
798
682
|
##
|
799
683
|
# Deletes the IncomingPhoneNumberInstance
|
800
684
|
# @return [Boolean] true if delete succeeds, true otherwise
|
801
685
|
def delete
|
802
|
-
context.delete
|
686
|
+
@context.delete()
|
803
687
|
end
|
804
|
-
|
805
|
-
##
|
806
|
-
# Access the assigned_add_ons
|
807
|
-
# @return [assigned_add_ons] assigned_add_ons
|
808
|
-
def assigned_add_ons
|
809
|
-
context.assigned_add_ons
|
810
|
-
end
|
811
|
-
|
688
|
+
|
812
689
|
##
|
813
690
|
# Provide a user friendly representation
|
814
691
|
def to_s
|
815
|
-
|
816
|
-
"<Twilio.Api.V2010.IncomingPhoneNumberInstance #{
|
692
|
+
context = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
693
|
+
"<Twilio.Api.V2010.IncomingPhoneNumberInstance #{context}>"
|
817
694
|
end
|
818
695
|
end
|
819
696
|
end
|