twilio-ruby 4.13.0 → 5.0.0.alpha1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +21 -0
- data/.rubocop_todo.yml +187 -0
- data/.travis.yml +13 -0
- data/AUTHORS.md +46 -32
- data/CHANGES.md +87 -65
- data/Gemfile +2 -2
- data/LICENSE.md +12 -12
- data/Makefile +13 -3
- data/README.md +50 -139
- data/Rakefile +54 -0
- data/VERSIONS.md +64 -0
- data/examples/examples.rb +46 -57
- data/examples/{print-call-log.rb → print_call_log.rb} +7 -7
- data/lib/rack/twilio_webhook_authentication.rb +5 -6
- data/lib/twilio-ruby.rb +30 -102
- data/lib/twilio-ruby/framework/domain.rb +34 -0
- data/lib/twilio-ruby/framework/error.rb +30 -0
- data/lib/twilio-ruby/framework/helper.rb +9 -0
- data/lib/twilio-ruby/framework/page.rb +101 -0
- data/lib/twilio-ruby/framework/resource.rb +21 -0
- data/lib/twilio-ruby/framework/serialize.rb +70 -0
- data/lib/twilio-ruby/framework/twilio_response.rb +15 -0
- data/lib/twilio-ruby/framework/values.rb +7 -0
- data/lib/twilio-ruby/framework/version.rb +164 -0
- data/lib/twilio-ruby/http/http_client.rb +46 -0
- data/lib/twilio-ruby/jwt/access_token.rb +232 -0
- data/lib/twilio-ruby/jwt/client_capability.rb +102 -0
- data/lib/twilio-ruby/jwt/jwt.rb +50 -0
- data/lib/twilio-ruby/jwt/task_router.rb +174 -0
- data/lib/twilio-ruby/rest/accounts.rb +36 -10
- data/lib/twilio-ruby/rest/accounts/v1.rb +39 -0
- data/lib/twilio-ruby/rest/accounts/v1/credential.rb +105 -0
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +370 -0
- data/lib/twilio-ruby/rest/api.rb +234 -0
- data/lib/twilio-ruby/rest/api/v2010.rb +147 -0
- data/lib/twilio-ruby/rest/api/v2010/account.rb +1098 -0
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +509 -0
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +265 -0
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +620 -0
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +331 -0
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +370 -0
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +389 -0
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +389 -0
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +389 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +799 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +296 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +317 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +427 -0
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +379 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +455 -0
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +515 -0
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +413 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +823 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +431 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +350 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +445 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +445 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +445 -0
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +336 -0
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +583 -0
- data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +165 -0
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +355 -0
- data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +153 -0
- data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +153 -0
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +418 -0
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +377 -0
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +438 -0
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +345 -0
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +479 -0
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +397 -0
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +378 -0
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +375 -0
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +430 -0
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +336 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +174 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +419 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +395 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +570 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +361 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +361 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +424 -0
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +406 -0
- data/lib/twilio-ruby/rest/api/v2010/account/token.rb +168 -0
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +366 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +127 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +418 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +304 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +304 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +304 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +304 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +304 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +304 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +304 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +304 -0
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +507 -0
- data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +161 -0
- data/lib/twilio-ruby/rest/chat.rb +59 -0
- data/lib/twilio-ruby/rest/chat/v1.rb +56 -0
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +403 -0
- data/lib/twilio-ruby/rest/chat/v1/service.rb +935 -0
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +554 -0
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +386 -0
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +431 -0
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +447 -0
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +396 -0
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +467 -0
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +244 -0
- data/lib/twilio-ruby/rest/chat/v2.rb +56 -0
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +403 -0
- data/lib/twilio-ruby/rest/chat/v2/service.rb +688 -0
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +554 -0
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +386 -0
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +431 -0
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +447 -0
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +396 -0
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +467 -0
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +244 -0
- data/lib/twilio-ruby/rest/client.rb +352 -153
- data/lib/twilio-ruby/rest/fax.rb +44 -0
- data/lib/twilio-ruby/rest/fax/v1.rb +41 -0
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +541 -0
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +326 -0
- data/lib/twilio-ruby/rest/ip_messaging.rb +59 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1.rb +56 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +403 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +935 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +554 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +386 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +431 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +447 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +396 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +467 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +244 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2.rb +56 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +403 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +688 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +554 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +386 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +431 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +447 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +396 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +467 -0
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +244 -0
- data/lib/twilio-ruby/rest/lookups.rb +44 -0
- data/lib/twilio-ruby/rest/lookups/v1.rb +41 -0
- data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +224 -0
- data/lib/twilio-ruby/rest/messaging.rb +44 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +41 -0
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +637 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +352 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +359 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +359 -0
- data/lib/twilio-ruby/rest/monitor.rb +52 -0
- data/lib/twilio-ruby/rest/monitor/v1.rb +56 -0
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +398 -0
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +381 -0
- data/lib/twilio-ruby/rest/notify.rb +52 -0
- data/lib/twilio-ruby/rest/notify/v1.rb +56 -0
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +403 -0
- data/lib/twilio-ruby/rest/notify/v1/service.rb +639 -0
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +430 -0
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +288 -0
- data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +224 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +445 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +254 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +434 -0
- data/lib/twilio-ruby/rest/preview.rb +145 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +56 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +203 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +210 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +243 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +42 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +557 -0
- data/lib/twilio-ruby/rest/preview/marketplace.rb +58 -0
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +333 -0
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +301 -0
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +440 -0
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +341 -0
- data/lib/twilio-ruby/rest/preview/proxy.rb +41 -0
- data/lib/twilio-ruby/rest/preview/proxy/service.rb +500 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +359 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +536 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +429 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +506 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +452 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +359 -0
- data/lib/twilio-ruby/rest/preview/sync.rb +41 -0
- data/lib/twilio-ruby/rest/preview/sync/service.rb +504 -0
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +445 -0
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +395 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +438 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +430 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +395 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +438 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +432 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +395 -0
- data/lib/twilio-ruby/rest/preview/wireless.rb +71 -0
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +382 -0
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +435 -0
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +544 -0
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +236 -0
- data/lib/twilio-ruby/rest/pricing.rb +50 -2
- data/lib/twilio-ruby/rest/pricing/v1.rb +65 -0
- data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +129 -0
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +291 -0
- data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +129 -0
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +284 -0
- data/lib/twilio-ruby/rest/pricing/v1/voice.rb +150 -0
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +291 -0
- data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +208 -0
- data/lib/twilio-ruby/rest/sync.rb +44 -0
- data/lib/twilio-ruby/rest/sync/v1.rb +41 -0
- data/lib/twilio-ruby/rest/sync/v1/service.rb +504 -0
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +445 -0
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +395 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +438 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +430 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +395 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +438 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +432 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +395 -0
- data/lib/twilio-ruby/rest/taskrouter.rb +44 -0
- data/lib/twilio-ruby/rest/taskrouter/v1.rb +41 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +712 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +399 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +418 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +584 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +461 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +315 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +527 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +230 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +243 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +585 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +461 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +406 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +223 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +226 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +475 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +230 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +212 -0
- data/lib/twilio-ruby/rest/trunking.rb +44 -0
- data/lib/twilio-ruby/rest/trunking/v1.rb +41 -0
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +577 -0
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +345 -0
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +345 -0
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +430 -0
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +478 -0
- data/lib/twilio-ruby/rest/video.rb +52 -0
- data/lib/twilio-ruby/rest/video/v1.rb +56 -0
- data/lib/twilio-ruby/rest/video/v1/recording.rb +382 -0
- data/lib/twilio-ruby/rest/video/v1/room.rb +485 -0
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +381 -0
- data/lib/twilio-ruby/rest/wireless.rb +60 -0
- data/lib/twilio-ruby/rest/wireless/v1.rb +71 -0
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +367 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +452 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +548 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +235 -0
- data/lib/twilio-ruby/{util → security}/request_validator.rb +21 -4
- data/lib/twilio-ruby/twiml/messaging_response.rb +141 -0
- data/lib/twilio-ruby/twiml/twiml.rb +69 -0
- data/lib/twilio-ruby/twiml/voice_response.rb +916 -0
- data/lib/twilio-ruby/util.rb +1 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/serialize_spec.rb +59 -0
- data/spec/holodeck/holodeck.rb +61 -0
- data/spec/holodeck/hologram.rb +4 -0
- data/spec/integration/accounts/v1/credential/public_key_spec.rb +226 -0
- data/spec/integration/accounts/v1/credential_spec.rb +10 -0
- data/spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb +90 -0
- data/spec/integration/api/v2010/account/address_spec.rb +267 -0
- data/spec/integration/api/v2010/account/application_spec.rb +286 -0
- data/spec/integration/api/v2010/account/authorized_connect_app_spec.rb +137 -0
- data/spec/integration/api/v2010/account/available_phone_number/local_spec.rb +101 -0
- data/spec/integration/api/v2010/account/available_phone_number/mobile_spec.rb +100 -0
- data/spec/integration/api/v2010/account/available_phone_number/toll_free_spec.rb +100 -0
- data/spec/integration/api/v2010/account/available_phone_number_spec.rb +128 -0
- data/spec/integration/api/v2010/account/call/feedback_spec.rb +141 -0
- data/spec/integration/api/v2010/account/call/feedback_summary_spec.rb +149 -0
- data/spec/integration/api/v2010/account/call/notification_spec.rb +179 -0
- data/spec/integration/api/v2010/account/call/recording_spec.rb +178 -0
- data/spec/integration/api/v2010/account/call_spec.rb +319 -0
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +283 -0
- data/spec/integration/api/v2010/account/conference_spec.rb +174 -0
- data/spec/integration/api/v2010/account/connect_app_spec.rb +177 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +135 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +223 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +181 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +181 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +181 -0
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +331 -0
- data/spec/integration/api/v2010/account/key_spec.rb +178 -0
- data/spec/integration/api/v2010/account/message/feedback_spec.rb +48 -0
- data/spec/integration/api/v2010/account/message/media_spec.rb +162 -0
- data/spec/integration/api/v2010/account/message_spec.rb +297 -0
- data/spec/integration/api/v2010/account/new_key_spec.rb +45 -0
- data/spec/integration/api/v2010/account/new_signing_key_spec.rb +45 -0
- data/spec/integration/api/v2010/account/notification_spec.rb +172 -0
- data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +193 -0
- data/spec/integration/api/v2010/account/queue/member_spec.rb +170 -0
- data/spec/integration/api/v2010/account/queue_spec.rb +242 -0
- data/spec/integration/api/v2010/account/recording/add_on_result/payload_spec.rb +175 -0
- data/spec/integration/api/v2010/account/recording/add_on_result_spec.rb +166 -0
- data/spec/integration/api/v2010/account/recording/transcription_spec.rb +174 -0
- data/spec/integration/api/v2010/account/recording_spec.rb +179 -0
- data/spec/integration/api/v2010/account/short_code_spec.rb +180 -0
- data/spec/integration/api/v2010/account/signing_key_spec.rb +178 -0
- data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +257 -0
- data/spec/integration/api/v2010/account/sip/credential_list_spec.rb +246 -0
- data/spec/integration/api/v2010/account/sip/domain/credential_list_mapping_spec.rb +210 -0
- data/spec/integration/api/v2010/account/sip/domain/ip_access_control_list_mapping_spec.rb +220 -0
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +283 -0
- data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +261 -0
- data/spec/integration/api/v2010/account/sip/ip_access_control_list_spec.rb +256 -0
- data/spec/integration/api/v2010/account/sip_spec.rb +10 -0
- data/spec/integration/api/v2010/account/token_spec.rb +56 -0
- data/spec/integration/api/v2010/account/transcription_spec.rb +167 -0
- data/spec/integration/api/v2010/account/usage/record/all_time_spec.rb +111 -0
- data/spec/integration/api/v2010/account/usage/record/daily_spec.rb +111 -0
- data/spec/integration/api/v2010/account/usage/record/last_month_spec.rb +111 -0
- data/spec/integration/api/v2010/account/usage/record/monthly_spec.rb +111 -0
- data/spec/integration/api/v2010/account/usage/record/this_month_spec.rb +111 -0
- data/spec/integration/api/v2010/account/usage/record/today_spec.rb +111 -0
- data/spec/integration/api/v2010/account/usage/record/yearly_spec.rb +111 -0
- data/spec/integration/api/v2010/account/usage/record/yesterday_spec.rb +111 -0
- data/spec/integration/api/v2010/account/usage/record_spec.rb +108 -0
- data/spec/integration/api/v2010/account/usage/trigger_spec.rb +283 -0
- data/spec/integration/api/v2010/account/usage_spec.rb +10 -0
- data/spec/integration/api/v2010/account/validation_request_spec.rb +48 -0
- data/spec/integration/api/v2010/account_spec.rb +254 -0
- data/spec/integration/chat/v1/credential_spec.rb +223 -0
- data/spec/integration/chat/v1/service/channel/invite_spec.rb +210 -0
- data/spec/integration/chat/v1/service/channel/member_spec.rb +284 -0
- data/spec/integration/chat/v1/service/channel/message_spec.rb +294 -0
- data/spec/integration/chat/v1/service/channel_spec.rb +275 -0
- data/spec/integration/chat/v1/service/role_spec.rb +263 -0
- data/spec/integration/chat/v1/service/user/user_channel_spec.rb +92 -0
- data/spec/integration/chat/v1/service/user_spec.rb +266 -0
- data/spec/integration/chat/v1/service_spec.rb +299 -0
- data/spec/integration/chat/v2/credential_spec.rb +223 -0
- data/spec/integration/chat/v2/service/channel/invite_spec.rb +210 -0
- data/spec/integration/chat/v2/service/channel/member_spec.rb +284 -0
- data/spec/integration/chat/v2/service/channel/message_spec.rb +294 -0
- data/spec/integration/chat/v2/service/channel_spec.rb +275 -0
- data/spec/integration/chat/v2/service/role_spec.rb +263 -0
- data/spec/integration/chat/v2/service/user/user_channel_spec.rb +92 -0
- data/spec/integration/chat/v2/service/user_spec.rb +266 -0
- data/spec/integration/chat/v2/service_spec.rb +325 -0
- data/spec/integration/fax/v1/fax/fax_media_spec.rb +126 -0
- data/spec/integration/fax/v1/fax_spec.rb +272 -0
- data/spec/integration/ip_messaging/v1/credential_spec.rb +223 -0
- data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +210 -0
- data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +284 -0
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +294 -0
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +275 -0
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +263 -0
- data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +92 -0
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +266 -0
- data/spec/integration/ip_messaging/v1/service_spec.rb +299 -0
- data/spec/integration/ip_messaging/v2/credential_spec.rb +223 -0
- data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +210 -0
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +284 -0
- data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +294 -0
- data/spec/integration/ip_messaging/v2/service/channel_spec.rb +275 -0
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +263 -0
- data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +92 -0
- data/spec/integration/ip_messaging/v2/service/user_spec.rb +266 -0
- data/spec/integration/ip_messaging/v2/service_spec.rb +325 -0
- data/spec/integration/lookups/v1/phone_number_spec.rb +60 -0
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +170 -0
- data/spec/integration/messaging/v1/service/phone_number_spec.rb +201 -0
- data/spec/integration/messaging/v1/service/short_code_spec.rb +173 -0
- data/spec/integration/messaging/v1/service_spec.rb +263 -0
- data/spec/integration/monitor/v1/alert_spec.rb +161 -0
- data/spec/integration/monitor/v1/event_spec.rb +148 -0
- data/spec/integration/notify/v1/credential_spec.rb +223 -0
- data/spec/integration/notify/v1/service/binding_spec.rb +227 -0
- data/spec/integration/notify/v1/service/notification_spec.rb +97 -0
- data/spec/integration/notify/v1/service/segment_spec.rb +84 -0
- data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +118 -0
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +269 -0
- data/spec/integration/notify/v1/service/user_spec.rb +213 -0
- data/spec/integration/notify/v1/service_spec.rb +280 -0
- data/spec/integration/preview/bulk_exports/export/day_spec.rb +56 -0
- data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +79 -0
- data/spec/integration/preview/bulk_exports/export_spec.rb +43 -0
- data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +280 -0
- data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +121 -0
- data/spec/integration/preview/marketplace/available_add_on_spec.rb +142 -0
- data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +164 -0
- data/spec/integration/preview/marketplace/installed_add_on_spec.rb +252 -0
- data/spec/integration/preview/proxy/service/phone_number_spec.rb +173 -0
- data/spec/integration/preview/proxy/service/session/interaction_spec.rb +104 -0
- data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +164 -0
- data/spec/integration/preview/proxy/service/session/participant_spec.rb +226 -0
- data/spec/integration/preview/proxy/service/session_spec.rb +216 -0
- data/spec/integration/preview/proxy/service/short_code_spec.rb +173 -0
- data/spec/integration/preview/proxy/service_spec.rb +200 -0
- data/spec/integration/preview/sync/service/document/document_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/document_spec.rb +254 -0
- data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +256 -0
- data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/sync_list_spec.rb +207 -0
- data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +257 -0
- data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/sync_map_spec.rb +207 -0
- data/spec/integration/preview/sync/service_spec.rb +244 -0
- data/spec/integration/preview/wireless/command_spec.rb +169 -0
- data/spec/integration/preview/wireless/rate_plan_spec.rb +260 -0
- data/spec/integration/preview/wireless/sim/usage_spec.rb +49 -0
- data/spec/integration/preview/wireless/sim_spec.rb +208 -0
- data/spec/integration/pricing/v1/messaging/country_spec.rb +137 -0
- data/spec/integration/pricing/v1/messaging_spec.rb +10 -0
- data/spec/integration/pricing/v1/phone_number/country_spec.rb +128 -0
- data/spec/integration/pricing/v1/phone_number_spec.rb +10 -0
- data/spec/integration/pricing/v1/voice/country_spec.rb +266 -0
- data/spec/integration/pricing/v1/voice/number_spec.rb +54 -0
- data/spec/integration/pricing/v1/voice_spec.rb +10 -0
- data/spec/integration/sync/v1/service/document/document_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/document_spec.rb +254 -0
- data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +256 -0
- data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/sync_list_spec.rb +207 -0
- data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +257 -0
- data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/sync_map_spec.rb +207 -0
- data/spec/integration/sync/v1/service_spec.rb +244 -0
- data/spec/integration/taskrouter/v1/workspace/activity_spec.rb +236 -0
- data/spec/integration/taskrouter/v1/workspace/event_spec.rb +157 -0
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +192 -0
- data/spec/integration/taskrouter/v1/workspace/task_channel_spec.rb +127 -0
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_statistics_spec.rb +106 -0
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queues_statistics_spec.rb +144 -0
- data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +292 -0
- data/spec/integration/taskrouter/v1/workspace/task_spec.rb +324 -0
- data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +192 -0
- data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +201 -0
- data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +107 -0
- data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +141 -0
- data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +282 -0
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_statistics_spec.rb +69 -0
- data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +265 -0
- data/spec/integration/taskrouter/v1/workspace/workspace_statistics_spec.rb +103 -0
- data/spec/integration/taskrouter/v1/workspace_spec.rb +287 -0
- data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +192 -0
- data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +192 -0
- data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +250 -0
- data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +267 -0
- data/spec/integration/trunking/v1/trunk_spec.rb +276 -0
- data/spec/integration/video/v1/recording_spec.rb +165 -0
- data/spec/integration/video/v1/room/recording_spec.rb +146 -0
- data/spec/integration/video/v1/room_spec.rb +237 -0
- data/spec/integration/wireless/v1/command_spec.rb +166 -0
- data/spec/integration/wireless/v1/rate_plan_spec.rb +268 -0
- data/spec/integration/wireless/v1/sim/usage_record_spec.rb +65 -0
- data/spec/integration/wireless/v1/sim_spec.rb +208 -0
- data/spec/jwt/access_token_spec.rb +130 -0
- data/spec/jwt/client_capability_spec.rb +104 -0
- data/spec/jwt/task_router_spec.rb +172 -0
- data/spec/rack/twilio_webhook_authentication_spec.rb +19 -23
- data/spec/{util → security}/request_validator_spec.rb +5 -5
- data/spec/spec_helper.rb +18 -1
- data/spec/support/fakeweb.rb +1 -1
- data/spec/twiml/messaging_response_spec.rb +90 -0
- data/spec/twiml/voice_response_spec.rb +474 -0
- data/twilio-ruby.gemspec +13 -8
- metadata +708 -251
- data/docs/Makefile +0 -130
- data/docs/_themes/LICENSE +0 -45
- data/docs/_themes/README.rst +0 -25
- data/docs/_themes/flask_theme_support.py +0 -86
- data/docs/_themes/kr/layout.html +0 -32
- data/docs/_themes/kr/relations.html +0 -19
- data/docs/_themes/kr/static/flasky.css_t +0 -469
- data/docs/_themes/kr/static/small_flask.css +0 -70
- data/docs/_themes/kr/theme.conf +0 -7
- data/docs/_themes/kr_small/layout.html +0 -22
- data/docs/_themes/kr_small/static/flasky.css_t +0 -287
- data/docs/_themes/kr_small/theme.conf +0 -10
- data/docs/changelog.rst +0 -1
- data/docs/conf.py +0 -266
- data/docs/faq.rst +0 -42
- data/docs/getting-started.rst +0 -117
- data/docs/index.rst +0 -135
- data/docs/make.bat +0 -170
- data/docs/src/pip-delete-this-directory.txt +0 -5
- data/docs/usage/accounts.rst +0 -89
- data/docs/usage/addresses.rst +0 -101
- data/docs/usage/applications.rst +0 -108
- data/docs/usage/basics.rst +0 -115
- data/docs/usage/caller-ids.rst +0 -47
- data/docs/usage/conferences.rst +0 -108
- data/docs/usage/errors.rst +0 -29
- data/docs/usage/lookups.rst +0 -62
- data/docs/usage/messages.rst +0 -137
- data/docs/usage/notifications.rst +0 -72
- data/docs/usage/phone-calls.rst +0 -185
- data/docs/usage/phone-numbers.rst +0 -189
- data/docs/usage/pricing.rst +0 -169
- data/docs/usage/queues.rst +0 -112
- data/docs/usage/recordings.rst +0 -98
- data/docs/usage/sip.rst +0 -104
- data/docs/usage/taskrouter-tokens.rst +0 -98
- data/docs/usage/taskrouter.rst +0 -440
- data/docs/usage/token-generation.rst +0 -115
- data/docs/usage/transcriptions.rst +0 -32
- data/docs/usage/twiml.rst +0 -69
- data/docs/usage/validation.rst +0 -107
- data/examples/taskrouter.examples.rb +0 -86
- data/issue_template.md +0 -25
- data/lib/twilio-ruby/rest/addresses.rb +0 -12
- data/lib/twilio-ruby/rest/addresses/dependent_phone_numbers.rb +0 -6
- data/lib/twilio-ruby/rest/applications.rb +0 -6
- data/lib/twilio-ruby/rest/authorized_connect_apps.rb +0 -6
- data/lib/twilio-ruby/rest/available_phone_numbers.rb +0 -13
- data/lib/twilio-ruby/rest/available_phone_numbers/country.rb +0 -10
- data/lib/twilio-ruby/rest/available_phone_numbers/local.rb +0 -11
- data/lib/twilio-ruby/rest/available_phone_numbers/mobile.rb +0 -11
- data/lib/twilio-ruby/rest/available_phone_numbers/toll_free.rb +0 -11
- data/lib/twilio-ruby/rest/base_client.rb +0 -131
- data/lib/twilio-ruby/rest/call_feedback.rb +0 -28
- data/lib/twilio-ruby/rest/call_feedback_summary.rb +0 -13
- data/lib/twilio-ruby/rest/calls.rb +0 -33
- data/lib/twilio-ruby/rest/conferences.rb +0 -12
- data/lib/twilio-ruby/rest/conferences/participants.rb +0 -23
- data/lib/twilio-ruby/rest/connect_apps.rb +0 -6
- data/lib/twilio-ruby/rest/errors.rb +0 -14
- data/lib/twilio-ruby/rest/incoming_phone_numbers.rb +0 -17
- data/lib/twilio-ruby/rest/incoming_phone_numbers/local.rb +0 -13
- data/lib/twilio-ruby/rest/incoming_phone_numbers/mobile.rb +0 -13
- data/lib/twilio-ruby/rest/incoming_phone_numbers/toll_free.rb +0 -13
- data/lib/twilio-ruby/rest/instance_resource.rb +0 -87
- data/lib/twilio-ruby/rest/ip-messaging/channels.rb +0 -15
- data/lib/twilio-ruby/rest/ip-messaging/credentials.rb +0 -19
- data/lib/twilio-ruby/rest/ip-messaging/members.rb +0 -8
- data/lib/twilio-ruby/rest/ip-messaging/messages.rb +0 -8
- data/lib/twilio-ruby/rest/ip-messaging/roles.rb +0 -8
- data/lib/twilio-ruby/rest/ip-messaging/services.rb +0 -17
- data/lib/twilio-ruby/rest/ip-messaging/users.rb +0 -8
- data/lib/twilio-ruby/rest/ip_messaging_client.rb +0 -100
- data/lib/twilio-ruby/rest/keys.rb +0 -6
- data/lib/twilio-ruby/rest/list_resource.rb +0 -100
- data/lib/twilio-ruby/rest/lookups/phone_numbers.rb +0 -17
- data/lib/twilio-ruby/rest/lookups_client.rb +0 -99
- data/lib/twilio-ruby/rest/media.rb +0 -14
- data/lib/twilio-ruby/rest/messages.rb +0 -22
- data/lib/twilio-ruby/rest/monitor/alerts.rb +0 -8
- data/lib/twilio-ruby/rest/monitor/events.rb +0 -8
- data/lib/twilio-ruby/rest/monitor_client.rb +0 -101
- data/lib/twilio-ruby/rest/next_gen_list_resource.rb +0 -36
- data/lib/twilio-ruby/rest/notifications.rb +0 -6
- data/lib/twilio-ruby/rest/outgoing_caller_ids.rb +0 -25
- data/lib/twilio-ruby/rest/pricing/countries.rb +0 -21
- data/lib/twilio-ruby/rest/pricing/messaging.rb +0 -15
- data/lib/twilio-ruby/rest/pricing/phone_numbers.rb +0 -14
- data/lib/twilio-ruby/rest/pricing/voice.rb +0 -15
- data/lib/twilio-ruby/rest/pricing/voice/numbers.rb +0 -19
- data/lib/twilio-ruby/rest/pricing_client.rb +0 -108
- data/lib/twilio-ruby/rest/queues.rb +0 -12
- data/lib/twilio-ruby/rest/queues/members.rb +0 -29
- data/lib/twilio-ruby/rest/recordings.rb +0 -35
- data/lib/twilio-ruby/rest/sandbox.rb +0 -5
- data/lib/twilio-ruby/rest/sip.rb +0 -10
- data/lib/twilio-ruby/rest/sip/credential_lists.rb +0 -11
- data/lib/twilio-ruby/rest/sip/credential_lists/credentials.rb +0 -6
- data/lib/twilio-ruby/rest/sip/domains.rb +0 -12
- data/lib/twilio-ruby/rest/sip/domains/credential_list_mappings.rb +0 -6
- data/lib/twilio-ruby/rest/sip/domains/ip_access_control_list_mappings.rb +0 -6
- data/lib/twilio-ruby/rest/sip/ip_access_control_lists.rb +0 -11
- data/lib/twilio-ruby/rest/sip/ip_access_control_lists/ip_addresses.rb +0 -6
- data/lib/twilio-ruby/rest/sms.rb +0 -11
- data/lib/twilio-ruby/rest/sms/messages.rb +0 -38
- data/lib/twilio-ruby/rest/sms/short_codes.rb +0 -8
- data/lib/twilio-ruby/rest/task_router/activities.rb +0 -8
- data/lib/twilio-ruby/rest/task_router/events.rb +0 -8
- data/lib/twilio-ruby/rest/task_router/reservations.rb +0 -8
- data/lib/twilio-ruby/rest/task_router/statistics.rb +0 -26
- data/lib/twilio-ruby/rest/task_router/task_queues.rb +0 -17
- data/lib/twilio-ruby/rest/task_router/task_queues_statistics.rb +0 -15
- data/lib/twilio-ruby/rest/task_router/tasks.rb +0 -15
- data/lib/twilio-ruby/rest/task_router/workers.rb +0 -19
- data/lib/twilio-ruby/rest/task_router/workers_statistics.rb +0 -8
- data/lib/twilio-ruby/rest/task_router/workflow_statistics.rb +0 -7
- data/lib/twilio-ruby/rest/task_router/workflows.rb +0 -11
- data/lib/twilio-ruby/rest/task_router/workspace_statistics.rb +0 -7
- data/lib/twilio-ruby/rest/task_router/workspaces.rb +0 -17
- data/lib/twilio-ruby/rest/task_router_client.rb +0 -176
- data/lib/twilio-ruby/rest/tokens.rb +0 -7
- data/lib/twilio-ruby/rest/transcriptions.rb +0 -6
- data/lib/twilio-ruby/rest/trunking/credential_lists.rb +0 -8
- data/lib/twilio-ruby/rest/trunking/ip_access_control_lists.rb +0 -8
- data/lib/twilio-ruby/rest/trunking/origination_urls.rb +0 -8
- data/lib/twilio-ruby/rest/trunking/phone_numbers.rb +0 -8
- data/lib/twilio-ruby/rest/trunking/trunks.rb +0 -19
- data/lib/twilio-ruby/rest/trunking_client.rb +0 -106
- data/lib/twilio-ruby/rest/usage.rb +0 -10
- data/lib/twilio-ruby/rest/usage/records.rb +0 -21
- data/lib/twilio-ruby/rest/usage/triggers.rb +0 -12
- data/lib/twilio-ruby/rest/utils.rb +0 -49
- data/lib/twilio-ruby/task_router.rb +0 -0
- data/lib/twilio-ruby/task_router/capability.rb +0 -230
- data/lib/twilio-ruby/task_router/workflow_builder.rb +0 -135
- data/lib/twilio-ruby/twiml/response.rb +0 -16
- data/lib/twilio-ruby/util/access_token.rb +0 -158
- data/lib/twilio-ruby/util/capability.rb +0 -64
- data/lib/twilio-ruby/util/client_config.rb +0 -29
- data/spec/rest/account_spec.rb +0 -89
- data/spec/rest/address_spec.rb +0 -11
- data/spec/rest/call_feedback_spec.rb +0 -12
- data/spec/rest/call_feedback_summary_spec.rb +0 -9
- data/spec/rest/call_spec.rb +0 -22
- data/spec/rest/client_spec.rb +0 -277
- data/spec/rest/conference_spec.rb +0 -11
- data/spec/rest/instance_resource_spec.rb +0 -15
- data/spec/rest/ip-messaging/channel_spec.rb +0 -21
- data/spec/rest/ip-messaging/service_spec.rb +0 -30
- data/spec/rest/ip_messaging_client_spec.rb +0 -21
- data/spec/rest/key_spec.rb +0 -11
- data/spec/rest/lookups/phone_number_spec.rb +0 -28
- data/spec/rest/message_spec.rb +0 -12
- data/spec/rest/monitor_client_spec.rb +0 -17
- data/spec/rest/numbers_spec.rb +0 -58
- data/spec/rest/pricing_client_spec.rb +0 -60
- data/spec/rest/queue_spec.rb +0 -11
- data/spec/rest/recording_spec.rb +0 -11
- data/spec/rest/sms/message_spec.rb +0 -37
- data/spec/rest/sms/messages_spec.rb +0 -31
- data/spec/rest/task_router/reservation_spec.rb +0 -14
- data/spec/rest/task_router/statistics_spec.rb +0 -37
- data/spec/rest/task_router/task_queue_spec.rb +0 -9
- data/spec/rest/token_spec.rb +0 -7
- data/spec/rest/trunking/trunk_spec.rb +0 -36
- data/spec/rest/utils_spec.rb +0 -45
- data/spec/task_router/workflow_builder_spec.rb +0 -501
- data/spec/task_router_deprecated_spec.rb +0 -139
- data/spec/task_router_spec.rb +0 -110
- data/spec/task_router_taskqueue_spec.rb +0 -111
- data/spec/task_router_worker_spec.rb +0 -146
- data/spec/task_router_workspace_spec.rb +0 -110
- data/spec/util/access_token_spec.rb +0 -161
- data/spec/util/capability_spec.rb +0 -186
- data/spec/util/client_config_spec.rb +0 -21
@@ -0,0 +1,367 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Wireless < Domain
|
10
|
+
class V1 < Version
|
11
|
+
class CommandList < ListResource
|
12
|
+
##
|
13
|
+
# Initialize the CommandList
|
14
|
+
# @param [Version] version Version that contains the resource
|
15
|
+
# @return [CommandList] CommandList
|
16
|
+
def initialize(version)
|
17
|
+
super(version)
|
18
|
+
|
19
|
+
# Path Solution
|
20
|
+
@solution = {}
|
21
|
+
@uri = "/Commands"
|
22
|
+
end
|
23
|
+
|
24
|
+
##
|
25
|
+
# Lists CommandInstance records from the API as a list.
|
26
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
27
|
+
# memory before returning.
|
28
|
+
# @param [String] sim The sim
|
29
|
+
# @param [command.Status] status The status
|
30
|
+
# @param [command.Direction] direction The direction
|
31
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
32
|
+
# guarantees to never return more than limit. Default is no limit
|
33
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
34
|
+
# the default value of 50 records. If no page_size is defined
|
35
|
+
# but a limit is defined, stream() will attempt to read the
|
36
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
37
|
+
# @return [Array] Array of up to limit results
|
38
|
+
def list(sim: :unset, status: :unset, direction: :unset, limit: nil, page_size: nil)
|
39
|
+
self.stream(
|
40
|
+
sim: sim,
|
41
|
+
status: status,
|
42
|
+
direction: direction,
|
43
|
+
limit: limit,
|
44
|
+
page_size: page_size
|
45
|
+
).entries
|
46
|
+
end
|
47
|
+
|
48
|
+
##
|
49
|
+
# Streams CommandInstance records from the API as an Enumerable.
|
50
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
51
|
+
# is reached.
|
52
|
+
# @param [String] sim The sim
|
53
|
+
# @param [command.Status] status The status
|
54
|
+
# @param [command.Direction] direction The direction
|
55
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
56
|
+
# guarantees to never return more than limit. Default is no limit
|
57
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
58
|
+
# the default value of 50 records. If no page_size is defined
|
59
|
+
# but a limit is defined, stream() will attempt to read the
|
60
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
61
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
62
|
+
def stream(sim: :unset, status: :unset, direction: :unset, limit: nil, page_size: nil)
|
63
|
+
limits = @version.read_limits(limit, page_size)
|
64
|
+
|
65
|
+
page = self.page(
|
66
|
+
sim: sim,
|
67
|
+
status: status,
|
68
|
+
direction: direction,
|
69
|
+
page_size: limits[:page_size],
|
70
|
+
)
|
71
|
+
|
72
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
73
|
+
end
|
74
|
+
|
75
|
+
##
|
76
|
+
# When passed a block, yields CommandInstance records from the API.
|
77
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
78
|
+
# is reached.
|
79
|
+
def each
|
80
|
+
limits = @version.read_limits
|
81
|
+
|
82
|
+
page = self.page(
|
83
|
+
page_size: limits[:page_size],
|
84
|
+
)
|
85
|
+
|
86
|
+
@version.stream(page,
|
87
|
+
limit: limits[:limit],
|
88
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
89
|
+
end
|
90
|
+
|
91
|
+
##
|
92
|
+
# Retrieve a single page of CommandInstance records from the API.
|
93
|
+
# Request is executed immediately.
|
94
|
+
# @param [String] sim The sim
|
95
|
+
# @param [command.Status] status The status
|
96
|
+
# @param [command.Direction] direction The direction
|
97
|
+
# @param [String] page_token PageToken provided by the API
|
98
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
99
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
100
|
+
# @return [Page] Page of CommandInstance
|
101
|
+
def page(sim: :unset, status: :unset, direction: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
102
|
+
params = Twilio::Values.of({
|
103
|
+
'Sim' => sim,
|
104
|
+
'Status' => status,
|
105
|
+
'Direction' => direction,
|
106
|
+
'PageToken' => page_token,
|
107
|
+
'Page' => page_number,
|
108
|
+
'PageSize' => page_size,
|
109
|
+
})
|
110
|
+
response = @version.page(
|
111
|
+
'GET',
|
112
|
+
@uri,
|
113
|
+
params
|
114
|
+
)
|
115
|
+
CommandPage.new(@version, response, @solution)
|
116
|
+
end
|
117
|
+
|
118
|
+
##
|
119
|
+
# Retrieve a single page of CommandInstance records from the API.
|
120
|
+
# Request is executed immediately.
|
121
|
+
# @param [String] target_url API-generated URL for the requested results page
|
122
|
+
# @return [Page] Page of CommandInstance
|
123
|
+
def get_page(target_url)
|
124
|
+
response = @version.domain.request(
|
125
|
+
'GET',
|
126
|
+
target_url
|
127
|
+
)
|
128
|
+
CommandPage.new(@version, response, @solution)
|
129
|
+
end
|
130
|
+
|
131
|
+
##
|
132
|
+
# Retrieve a single page of CommandInstance records from the API.
|
133
|
+
# Request is executed immediately.
|
134
|
+
# @param [String] command The command
|
135
|
+
# @param [String] sim The sim
|
136
|
+
# @param [String] callback_method The callback_method
|
137
|
+
# @param [String] callback_url The callback_url
|
138
|
+
# @param [command.CommandMode] command_mode The command_mode
|
139
|
+
# @param [String] include_sid The include_sid
|
140
|
+
# @return [CommandInstance] Newly created CommandInstance
|
141
|
+
def create(command: nil, sim: :unset, callback_method: :unset, callback_url: :unset, command_mode: :unset, include_sid: :unset)
|
142
|
+
data = Twilio::Values.of({
|
143
|
+
'Command' => command,
|
144
|
+
'Sim' => sim,
|
145
|
+
'CallbackMethod' => callback_method,
|
146
|
+
'CallbackUrl' => callback_url,
|
147
|
+
'CommandMode' => command_mode,
|
148
|
+
'IncludeSid' => include_sid,
|
149
|
+
})
|
150
|
+
|
151
|
+
payload = @version.create(
|
152
|
+
'POST',
|
153
|
+
@uri,
|
154
|
+
data: data
|
155
|
+
)
|
156
|
+
|
157
|
+
CommandInstance.new(
|
158
|
+
@version,
|
159
|
+
payload,
|
160
|
+
)
|
161
|
+
end
|
162
|
+
|
163
|
+
##
|
164
|
+
# Provide a user friendly representation
|
165
|
+
def to_s
|
166
|
+
'#<Twilio.Wireless.V1.CommandList>'
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
class CommandPage < Page
|
171
|
+
##
|
172
|
+
# Initialize the CommandPage
|
173
|
+
# @param [Version] version Version that contains the resource
|
174
|
+
# @param [Response] response Response from the API
|
175
|
+
# @param [Hash] solution Path solution for the resource
|
176
|
+
# @return [CommandPage] CommandPage
|
177
|
+
def initialize(version, response, solution)
|
178
|
+
super(version, response)
|
179
|
+
|
180
|
+
# Path Solution
|
181
|
+
@solution = solution
|
182
|
+
end
|
183
|
+
|
184
|
+
##
|
185
|
+
# Build an instance of CommandInstance
|
186
|
+
# @param [Hash] payload Payload response from the API
|
187
|
+
# @return [CommandInstance] CommandInstance
|
188
|
+
def get_instance(payload)
|
189
|
+
CommandInstance.new(
|
190
|
+
@version,
|
191
|
+
payload,
|
192
|
+
)
|
193
|
+
end
|
194
|
+
|
195
|
+
##
|
196
|
+
# Provide a user friendly representation
|
197
|
+
def to_s
|
198
|
+
'<Twilio.Wireless.V1.CommandPage>'
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
202
|
+
class CommandContext < InstanceContext
|
203
|
+
##
|
204
|
+
# Initialize the CommandContext
|
205
|
+
# @param [Version] version Version that contains the resource
|
206
|
+
# @param [String] sid The sid
|
207
|
+
# @return [CommandContext] CommandContext
|
208
|
+
def initialize(version, sid)
|
209
|
+
super(version)
|
210
|
+
|
211
|
+
# Path Solution
|
212
|
+
@solution = {
|
213
|
+
sid: sid,
|
214
|
+
}
|
215
|
+
@uri = "/Commands/#{@solution[:sid]}"
|
216
|
+
end
|
217
|
+
|
218
|
+
##
|
219
|
+
# Fetch a CommandInstance
|
220
|
+
# @return [CommandInstance] Fetched CommandInstance
|
221
|
+
def fetch
|
222
|
+
params = Twilio::Values.of({})
|
223
|
+
|
224
|
+
payload = @version.fetch(
|
225
|
+
'GET',
|
226
|
+
@uri,
|
227
|
+
params,
|
228
|
+
)
|
229
|
+
|
230
|
+
CommandInstance.new(
|
231
|
+
@version,
|
232
|
+
payload,
|
233
|
+
sid: @solution[:sid],
|
234
|
+
)
|
235
|
+
end
|
236
|
+
|
237
|
+
##
|
238
|
+
# Provide a user friendly representation
|
239
|
+
def to_s
|
240
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
241
|
+
"#<Twilio.Wireless.V1.CommandContext #{context}>"
|
242
|
+
end
|
243
|
+
end
|
244
|
+
|
245
|
+
class CommandInstance < InstanceResource
|
246
|
+
##
|
247
|
+
# Initialize the CommandInstance
|
248
|
+
# @param [Version] version Version that contains the resource
|
249
|
+
# @param [Hash] payload payload that contains response from Twilio
|
250
|
+
# @param [String] sid The sid
|
251
|
+
# @return [CommandInstance] CommandInstance
|
252
|
+
def initialize(version, payload, sid: nil)
|
253
|
+
super(version)
|
254
|
+
|
255
|
+
# Marshaled Properties
|
256
|
+
@properties = {
|
257
|
+
'sid' => payload['sid'],
|
258
|
+
'account_sid' => payload['account_sid'],
|
259
|
+
'sim_sid' => payload['sim_sid'],
|
260
|
+
'command' => payload['command'],
|
261
|
+
'command_mode' => payload['command_mode'],
|
262
|
+
'status' => payload['status'],
|
263
|
+
'direction' => payload['direction'],
|
264
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
265
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
266
|
+
'url' => payload['url'],
|
267
|
+
}
|
268
|
+
|
269
|
+
# Context
|
270
|
+
@instance_context = nil
|
271
|
+
@params = {
|
272
|
+
'sid' => sid || @properties['sid'],
|
273
|
+
}
|
274
|
+
end
|
275
|
+
|
276
|
+
##
|
277
|
+
# Generate an instance context for the instance, the context is capable of
|
278
|
+
# performing various actions. All instance actions are proxied to the context
|
279
|
+
# @return [CommandContext] CommandContext for this CommandInstance
|
280
|
+
def context
|
281
|
+
unless @instance_context
|
282
|
+
@instance_context = CommandContext.new(
|
283
|
+
@version,
|
284
|
+
@params['sid'],
|
285
|
+
)
|
286
|
+
end
|
287
|
+
@instance_context
|
288
|
+
end
|
289
|
+
|
290
|
+
##
|
291
|
+
# @return [String] The sid
|
292
|
+
def sid
|
293
|
+
@properties['sid']
|
294
|
+
end
|
295
|
+
|
296
|
+
##
|
297
|
+
# @return [String] The account_sid
|
298
|
+
def account_sid
|
299
|
+
@properties['account_sid']
|
300
|
+
end
|
301
|
+
|
302
|
+
##
|
303
|
+
# @return [String] The sim_sid
|
304
|
+
def sim_sid
|
305
|
+
@properties['sim_sid']
|
306
|
+
end
|
307
|
+
|
308
|
+
##
|
309
|
+
# @return [String] The command
|
310
|
+
def command
|
311
|
+
@properties['command']
|
312
|
+
end
|
313
|
+
|
314
|
+
##
|
315
|
+
# @return [command.CommandMode] The command_mode
|
316
|
+
def command_mode
|
317
|
+
@properties['command_mode']
|
318
|
+
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# @return [command.Status] The status
|
322
|
+
def status
|
323
|
+
@properties['status']
|
324
|
+
end
|
325
|
+
|
326
|
+
##
|
327
|
+
# @return [command.Direction] The direction
|
328
|
+
def direction
|
329
|
+
@properties['direction']
|
330
|
+
end
|
331
|
+
|
332
|
+
##
|
333
|
+
# @return [Time] The date_created
|
334
|
+
def date_created
|
335
|
+
@properties['date_created']
|
336
|
+
end
|
337
|
+
|
338
|
+
##
|
339
|
+
# @return [Time] The date_updated
|
340
|
+
def date_updated
|
341
|
+
@properties['date_updated']
|
342
|
+
end
|
343
|
+
|
344
|
+
##
|
345
|
+
# @return [String] The url
|
346
|
+
def url
|
347
|
+
@properties['url']
|
348
|
+
end
|
349
|
+
|
350
|
+
##
|
351
|
+
# Fetch a CommandInstance
|
352
|
+
# @return [CommandInstance] Fetched CommandInstance
|
353
|
+
def fetch
|
354
|
+
context.fetch
|
355
|
+
end
|
356
|
+
|
357
|
+
##
|
358
|
+
# Provide a user friendly representation
|
359
|
+
def to_s
|
360
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
361
|
+
"<Twilio.Wireless.V1.CommandInstance #{values}>"
|
362
|
+
end
|
363
|
+
end
|
364
|
+
end
|
365
|
+
end
|
366
|
+
end
|
367
|
+
end
|
@@ -0,0 +1,452 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Wireless < Domain
|
10
|
+
class V1 < Version
|
11
|
+
class RatePlanList < ListResource
|
12
|
+
##
|
13
|
+
# Initialize the RatePlanList
|
14
|
+
# @param [Version] version Version that contains the resource
|
15
|
+
# @return [RatePlanList] RatePlanList
|
16
|
+
def initialize(version)
|
17
|
+
super(version)
|
18
|
+
|
19
|
+
# Path Solution
|
20
|
+
@solution = {}
|
21
|
+
@uri = "/RatePlans"
|
22
|
+
end
|
23
|
+
|
24
|
+
##
|
25
|
+
# Lists RatePlanInstance records from the API as a list.
|
26
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
27
|
+
# memory before returning.
|
28
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
29
|
+
# guarantees to never return more than limit. Default is no limit
|
30
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
31
|
+
# the default value of 50 records. If no page_size is defined
|
32
|
+
# but a limit is defined, stream() will attempt to read the
|
33
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
34
|
+
# @return [Array] Array of up to limit results
|
35
|
+
def list(limit: nil, page_size: nil)
|
36
|
+
self.stream(
|
37
|
+
limit: limit,
|
38
|
+
page_size: page_size
|
39
|
+
).entries
|
40
|
+
end
|
41
|
+
|
42
|
+
##
|
43
|
+
# Streams RatePlanInstance records from the API as an Enumerable.
|
44
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
45
|
+
# is reached.
|
46
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
47
|
+
# guarantees to never return more than limit. Default is no limit
|
48
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
49
|
+
# the default value of 50 records. If no page_size is defined
|
50
|
+
# but a limit is defined, stream() will attempt to read the
|
51
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
52
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
53
|
+
def stream(limit: nil, page_size: nil)
|
54
|
+
limits = @version.read_limits(limit, page_size)
|
55
|
+
|
56
|
+
page = self.page(
|
57
|
+
page_size: limits[:page_size],
|
58
|
+
)
|
59
|
+
|
60
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
61
|
+
end
|
62
|
+
|
63
|
+
##
|
64
|
+
# When passed a block, yields RatePlanInstance records from the API.
|
65
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
66
|
+
# is reached.
|
67
|
+
def each
|
68
|
+
limits = @version.read_limits
|
69
|
+
|
70
|
+
page = self.page(
|
71
|
+
page_size: limits[:page_size],
|
72
|
+
)
|
73
|
+
|
74
|
+
@version.stream(page,
|
75
|
+
limit: limits[:limit],
|
76
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
77
|
+
end
|
78
|
+
|
79
|
+
##
|
80
|
+
# Retrieve a single page of RatePlanInstance records from the API.
|
81
|
+
# Request is executed immediately.
|
82
|
+
# @param [String] page_token PageToken provided by the API
|
83
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
84
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
85
|
+
# @return [Page] Page of RatePlanInstance
|
86
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
87
|
+
params = Twilio::Values.of({
|
88
|
+
'PageToken' => page_token,
|
89
|
+
'Page' => page_number,
|
90
|
+
'PageSize' => page_size,
|
91
|
+
})
|
92
|
+
response = @version.page(
|
93
|
+
'GET',
|
94
|
+
@uri,
|
95
|
+
params
|
96
|
+
)
|
97
|
+
RatePlanPage.new(@version, response, @solution)
|
98
|
+
end
|
99
|
+
|
100
|
+
##
|
101
|
+
# Retrieve a single page of RatePlanInstance records from the API.
|
102
|
+
# Request is executed immediately.
|
103
|
+
# @param [String] target_url API-generated URL for the requested results page
|
104
|
+
# @return [Page] Page of RatePlanInstance
|
105
|
+
def get_page(target_url)
|
106
|
+
response = @version.domain.request(
|
107
|
+
'GET',
|
108
|
+
target_url
|
109
|
+
)
|
110
|
+
RatePlanPage.new(@version, response, @solution)
|
111
|
+
end
|
112
|
+
|
113
|
+
##
|
114
|
+
# Retrieve a single page of RatePlanInstance records from the API.
|
115
|
+
# Request is executed immediately.
|
116
|
+
# @param [String] unique_name The unique_name
|
117
|
+
# @param [String] friendly_name The friendly_name
|
118
|
+
# @param [Boolean] data_enabled The data_enabled
|
119
|
+
# @param [String] data_limit The data_limit
|
120
|
+
# @param [String] data_metering The data_metering
|
121
|
+
# @param [Boolean] messaging_enabled The messaging_enabled
|
122
|
+
# @param [Boolean] voice_enabled The voice_enabled
|
123
|
+
# @param [Boolean] national_roaming_enabled The national_roaming_enabled
|
124
|
+
# @param [String] international_roaming The international_roaming
|
125
|
+
# @param [String] national_roaming_data_limit The national_roaming_data_limit
|
126
|
+
# @param [String] international_roaming_data_limit The
|
127
|
+
# international_roaming_data_limit
|
128
|
+
# @return [RatePlanInstance] Newly created RatePlanInstance
|
129
|
+
def create(unique_name: :unset, friendly_name: :unset, data_enabled: :unset, data_limit: :unset, data_metering: :unset, messaging_enabled: :unset, voice_enabled: :unset, national_roaming_enabled: :unset, international_roaming: :unset, national_roaming_data_limit: :unset, international_roaming_data_limit: :unset)
|
130
|
+
data = Twilio::Values.of({
|
131
|
+
'UniqueName' => unique_name,
|
132
|
+
'FriendlyName' => friendly_name,
|
133
|
+
'DataEnabled' => data_enabled,
|
134
|
+
'DataLimit' => data_limit,
|
135
|
+
'DataMetering' => data_metering,
|
136
|
+
'MessagingEnabled' => messaging_enabled,
|
137
|
+
'VoiceEnabled' => voice_enabled,
|
138
|
+
'NationalRoamingEnabled' => national_roaming_enabled,
|
139
|
+
'InternationalRoaming' => international_roaming,
|
140
|
+
'NationalRoamingDataLimit' => national_roaming_data_limit,
|
141
|
+
'InternationalRoamingDataLimit' => international_roaming_data_limit,
|
142
|
+
})
|
143
|
+
|
144
|
+
payload = @version.create(
|
145
|
+
'POST',
|
146
|
+
@uri,
|
147
|
+
data: data
|
148
|
+
)
|
149
|
+
|
150
|
+
RatePlanInstance.new(
|
151
|
+
@version,
|
152
|
+
payload,
|
153
|
+
)
|
154
|
+
end
|
155
|
+
|
156
|
+
##
|
157
|
+
# Provide a user friendly representation
|
158
|
+
def to_s
|
159
|
+
'#<Twilio.Wireless.V1.RatePlanList>'
|
160
|
+
end
|
161
|
+
end
|
162
|
+
|
163
|
+
class RatePlanPage < Page
|
164
|
+
##
|
165
|
+
# Initialize the RatePlanPage
|
166
|
+
# @param [Version] version Version that contains the resource
|
167
|
+
# @param [Response] response Response from the API
|
168
|
+
# @param [Hash] solution Path solution for the resource
|
169
|
+
# @return [RatePlanPage] RatePlanPage
|
170
|
+
def initialize(version, response, solution)
|
171
|
+
super(version, response)
|
172
|
+
|
173
|
+
# Path Solution
|
174
|
+
@solution = solution
|
175
|
+
end
|
176
|
+
|
177
|
+
##
|
178
|
+
# Build an instance of RatePlanInstance
|
179
|
+
# @param [Hash] payload Payload response from the API
|
180
|
+
# @return [RatePlanInstance] RatePlanInstance
|
181
|
+
def get_instance(payload)
|
182
|
+
RatePlanInstance.new(
|
183
|
+
@version,
|
184
|
+
payload,
|
185
|
+
)
|
186
|
+
end
|
187
|
+
|
188
|
+
##
|
189
|
+
# Provide a user friendly representation
|
190
|
+
def to_s
|
191
|
+
'<Twilio.Wireless.V1.RatePlanPage>'
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
class RatePlanContext < InstanceContext
|
196
|
+
##
|
197
|
+
# Initialize the RatePlanContext
|
198
|
+
# @param [Version] version Version that contains the resource
|
199
|
+
# @param [String] sid The sid
|
200
|
+
# @return [RatePlanContext] RatePlanContext
|
201
|
+
def initialize(version, sid)
|
202
|
+
super(version)
|
203
|
+
|
204
|
+
# Path Solution
|
205
|
+
@solution = {
|
206
|
+
sid: sid,
|
207
|
+
}
|
208
|
+
@uri = "/RatePlans/#{@solution[:sid]}"
|
209
|
+
end
|
210
|
+
|
211
|
+
##
|
212
|
+
# Fetch a RatePlanInstance
|
213
|
+
# @return [RatePlanInstance] Fetched RatePlanInstance
|
214
|
+
def fetch
|
215
|
+
params = Twilio::Values.of({})
|
216
|
+
|
217
|
+
payload = @version.fetch(
|
218
|
+
'GET',
|
219
|
+
@uri,
|
220
|
+
params,
|
221
|
+
)
|
222
|
+
|
223
|
+
RatePlanInstance.new(
|
224
|
+
@version,
|
225
|
+
payload,
|
226
|
+
sid: @solution[:sid],
|
227
|
+
)
|
228
|
+
end
|
229
|
+
|
230
|
+
##
|
231
|
+
# Update the RatePlanInstance
|
232
|
+
# @param [String] unique_name The unique_name
|
233
|
+
# @param [String] friendly_name The friendly_name
|
234
|
+
# @return [RatePlanInstance] Updated RatePlanInstance
|
235
|
+
def update(unique_name: :unset, friendly_name: :unset)
|
236
|
+
data = Twilio::Values.of({
|
237
|
+
'UniqueName' => unique_name,
|
238
|
+
'FriendlyName' => friendly_name,
|
239
|
+
})
|
240
|
+
|
241
|
+
payload = @version.update(
|
242
|
+
'POST',
|
243
|
+
@uri,
|
244
|
+
data: data,
|
245
|
+
)
|
246
|
+
|
247
|
+
RatePlanInstance.new(
|
248
|
+
@version,
|
249
|
+
payload,
|
250
|
+
sid: @solution[:sid],
|
251
|
+
)
|
252
|
+
end
|
253
|
+
|
254
|
+
##
|
255
|
+
# Deletes the RatePlanInstance
|
256
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
257
|
+
def delete
|
258
|
+
@version.delete('delete', @uri)
|
259
|
+
end
|
260
|
+
|
261
|
+
##
|
262
|
+
# Provide a user friendly representation
|
263
|
+
def to_s
|
264
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
265
|
+
"#<Twilio.Wireless.V1.RatePlanContext #{context}>"
|
266
|
+
end
|
267
|
+
end
|
268
|
+
|
269
|
+
class RatePlanInstance < InstanceResource
|
270
|
+
##
|
271
|
+
# Initialize the RatePlanInstance
|
272
|
+
# @param [Version] version Version that contains the resource
|
273
|
+
# @param [Hash] payload payload that contains response from Twilio
|
274
|
+
# @param [String] sid The sid
|
275
|
+
# @return [RatePlanInstance] RatePlanInstance
|
276
|
+
def initialize(version, payload, sid: nil)
|
277
|
+
super(version)
|
278
|
+
|
279
|
+
# Marshaled Properties
|
280
|
+
@properties = {
|
281
|
+
'sid' => payload['sid'],
|
282
|
+
'unique_name' => payload['unique_name'],
|
283
|
+
'account_sid' => payload['account_sid'],
|
284
|
+
'friendly_name' => payload['friendly_name'],
|
285
|
+
'data_enabled' => payload['data_enabled'],
|
286
|
+
'data_metering' => payload['data_metering'],
|
287
|
+
'data_limit' => payload['data_limit'].to_i,
|
288
|
+
'messaging_enabled' => payload['messaging_enabled'],
|
289
|
+
'voice_enabled' => payload['voice_enabled'],
|
290
|
+
'national_roaming_enabled' => payload['national_roaming_enabled'],
|
291
|
+
'national_roaming_data_limit' => payload['national_roaming_data_limit'].to_i,
|
292
|
+
'international_roaming' => payload['international_roaming'],
|
293
|
+
'international_roaming_data_limit' => payload['international_roaming_data_limit'].to_i,
|
294
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
295
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
296
|
+
'url' => payload['url'],
|
297
|
+
}
|
298
|
+
|
299
|
+
# Context
|
300
|
+
@instance_context = nil
|
301
|
+
@params = {
|
302
|
+
'sid' => sid || @properties['sid'],
|
303
|
+
}
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# Generate an instance context for the instance, the context is capable of
|
308
|
+
# performing various actions. All instance actions are proxied to the context
|
309
|
+
# @return [RatePlanContext] RatePlanContext for this RatePlanInstance
|
310
|
+
def context
|
311
|
+
unless @instance_context
|
312
|
+
@instance_context = RatePlanContext.new(
|
313
|
+
@version,
|
314
|
+
@params['sid'],
|
315
|
+
)
|
316
|
+
end
|
317
|
+
@instance_context
|
318
|
+
end
|
319
|
+
|
320
|
+
##
|
321
|
+
# @return [String] The sid
|
322
|
+
def sid
|
323
|
+
@properties['sid']
|
324
|
+
end
|
325
|
+
|
326
|
+
##
|
327
|
+
# @return [String] The unique_name
|
328
|
+
def unique_name
|
329
|
+
@properties['unique_name']
|
330
|
+
end
|
331
|
+
|
332
|
+
##
|
333
|
+
# @return [String] The account_sid
|
334
|
+
def account_sid
|
335
|
+
@properties['account_sid']
|
336
|
+
end
|
337
|
+
|
338
|
+
##
|
339
|
+
# @return [String] The friendly_name
|
340
|
+
def friendly_name
|
341
|
+
@properties['friendly_name']
|
342
|
+
end
|
343
|
+
|
344
|
+
##
|
345
|
+
# @return [Boolean] The data_enabled
|
346
|
+
def data_enabled
|
347
|
+
@properties['data_enabled']
|
348
|
+
end
|
349
|
+
|
350
|
+
##
|
351
|
+
# @return [String] The data_metering
|
352
|
+
def data_metering
|
353
|
+
@properties['data_metering']
|
354
|
+
end
|
355
|
+
|
356
|
+
##
|
357
|
+
# @return [String] The data_limit
|
358
|
+
def data_limit
|
359
|
+
@properties['data_limit']
|
360
|
+
end
|
361
|
+
|
362
|
+
##
|
363
|
+
# @return [Boolean] The messaging_enabled
|
364
|
+
def messaging_enabled
|
365
|
+
@properties['messaging_enabled']
|
366
|
+
end
|
367
|
+
|
368
|
+
##
|
369
|
+
# @return [Boolean] The voice_enabled
|
370
|
+
def voice_enabled
|
371
|
+
@properties['voice_enabled']
|
372
|
+
end
|
373
|
+
|
374
|
+
##
|
375
|
+
# @return [Boolean] The national_roaming_enabled
|
376
|
+
def national_roaming_enabled
|
377
|
+
@properties['national_roaming_enabled']
|
378
|
+
end
|
379
|
+
|
380
|
+
##
|
381
|
+
# @return [String] The national_roaming_data_limit
|
382
|
+
def national_roaming_data_limit
|
383
|
+
@properties['national_roaming_data_limit']
|
384
|
+
end
|
385
|
+
|
386
|
+
##
|
387
|
+
# @return [String] The international_roaming
|
388
|
+
def international_roaming
|
389
|
+
@properties['international_roaming']
|
390
|
+
end
|
391
|
+
|
392
|
+
##
|
393
|
+
# @return [String] The international_roaming_data_limit
|
394
|
+
def international_roaming_data_limit
|
395
|
+
@properties['international_roaming_data_limit']
|
396
|
+
end
|
397
|
+
|
398
|
+
##
|
399
|
+
# @return [Time] The date_created
|
400
|
+
def date_created
|
401
|
+
@properties['date_created']
|
402
|
+
end
|
403
|
+
|
404
|
+
##
|
405
|
+
# @return [Time] The date_updated
|
406
|
+
def date_updated
|
407
|
+
@properties['date_updated']
|
408
|
+
end
|
409
|
+
|
410
|
+
##
|
411
|
+
# @return [String] The url
|
412
|
+
def url
|
413
|
+
@properties['url']
|
414
|
+
end
|
415
|
+
|
416
|
+
##
|
417
|
+
# Fetch a RatePlanInstance
|
418
|
+
# @return [RatePlanInstance] Fetched RatePlanInstance
|
419
|
+
def fetch
|
420
|
+
context.fetch
|
421
|
+
end
|
422
|
+
|
423
|
+
##
|
424
|
+
# Update the RatePlanInstance
|
425
|
+
# @param [String] unique_name The unique_name
|
426
|
+
# @param [String] friendly_name The friendly_name
|
427
|
+
# @return [RatePlanInstance] Updated RatePlanInstance
|
428
|
+
def update(unique_name: :unset, friendly_name: :unset)
|
429
|
+
context.update(
|
430
|
+
unique_name: unique_name,
|
431
|
+
friendly_name: friendly_name,
|
432
|
+
)
|
433
|
+
end
|
434
|
+
|
435
|
+
##
|
436
|
+
# Deletes the RatePlanInstance
|
437
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
438
|
+
def delete
|
439
|
+
context.delete
|
440
|
+
end
|
441
|
+
|
442
|
+
##
|
443
|
+
# Provide a user friendly representation
|
444
|
+
def to_s
|
445
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
446
|
+
"<Twilio.Wireless.V1.RatePlanInstance #{values}>"
|
447
|
+
end
|
448
|
+
end
|
449
|
+
end
|
450
|
+
end
|
451
|
+
end
|
452
|
+
end
|