twilio-ruby 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +30 -2
- data/CONTRIBUTING.md +159 -0
- data/ISSUE_TEMPLATE.md +26 -0
- data/LICENSE.md +1 -1
- data/README.md +6 -7
- data/VERSIONS.md +21 -49
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +11 -18
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +358 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +439 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +48 -11
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +22 -12
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +11 -18
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service.rb +11 -11
- data/lib/twilio-ruby/rest/client.rb +42 -0
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +334 -0
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +549 -0
- data/lib/twilio-ruby/rest/fax/v1.rb +41 -0
- data/lib/twilio-ruby/rest/fax.rb +44 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +11 -11
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +360 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +367 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +367 -0
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +645 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +41 -0
- data/lib/twilio-ruby/rest/messaging.rb +44 -0
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +11 -11
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +11 -11
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +411 -0
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +438 -0
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +294 -0
- data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +230 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +262 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +442 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +453 -0
- data/lib/twilio-ruby/rest/notify/v1/service.rb +647 -0
- data/lib/twilio-ruby/rest/notify/v1.rb +56 -0
- data/lib/twilio-ruby/rest/notify.rb +52 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +216 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +211 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +251 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +56 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +570 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +42 -0
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +309 -0
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +341 -0
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +349 -0
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +448 -0
- data/lib/twilio-ruby/rest/preview/marketplace.rb +58 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +367 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +437 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +460 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +514 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +544 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +367 -0
- data/lib/twilio-ruby/rest/preview/proxy/service.rb +508 -0
- data/lib/twilio-ruby/rest/preview/proxy.rb +41 -0
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +403 -0
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +453 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +438 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +403 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +446 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +440 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +403 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +446 -0
- data/lib/twilio-ruby/rest/preview/sync/service.rb +512 -0
- data/lib/twilio-ruby/rest/preview/sync.rb +41 -0
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +390 -0
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +443 -0
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +244 -0
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +552 -0
- data/lib/twilio-ruby/rest/preview/wireless.rb +71 -0
- data/lib/twilio-ruby/rest/preview.rb +145 -0
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +11 -11
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +11 -11
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +11 -11
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +403 -0
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +453 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +438 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +403 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +446 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +440 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +403 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +446 -0
- data/lib/twilio-ruby/rest/sync/v1/service.rb +512 -0
- data/lib/twilio-ruby/rest/sync/v1.rb +41 -0
- data/lib/twilio-ruby/rest/sync.rb +44 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +143 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +143 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +11 -11
- data/lib/twilio-ruby/rest/video/v1/recording.rb +11 -11
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +11 -11
- data/lib/twilio-ruby/rest/video/v1/room.rb +11 -11
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +375 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +460 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +241 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +556 -0
- data/lib/twilio-ruby/rest/wireless/v1.rb +71 -0
- data/lib/twilio-ruby/rest/wireless.rb +60 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call/recording_spec.rb +0 -2
- 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/recording_spec.rb +0 -2
- 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/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/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/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/task/reservation_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +5 -5
- 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/twilio-ruby.gemspec +1 -3
- metadata +192 -2
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
module Twilio
|
|
8
|
+
module REST
|
|
9
|
+
class Preview
|
|
10
|
+
class Marketplace < Version
|
|
11
|
+
##
|
|
12
|
+
# Initialize the Marketplace version of Preview
|
|
13
|
+
def initialize(domain)
|
|
14
|
+
super
|
|
15
|
+
@version = 'marketplace'
|
|
16
|
+
@available_add_ons = nil
|
|
17
|
+
@installed_add_ons = nil
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
##
|
|
21
|
+
# @param [String] sid The Available Add-on Sid that uniquely identifies this
|
|
22
|
+
# resource
|
|
23
|
+
# @return [Twilio::REST::Preview::Marketplace::AvailableAddOnInstance] if sid was passed.
|
|
24
|
+
# @return [Twilio::REST::Preview::Marketplace::AvailableAddOnList]
|
|
25
|
+
def available_add_ons(sid=:unset)
|
|
26
|
+
if sid.nil?
|
|
27
|
+
raise ArgumentError, 'sid cannot be nil'
|
|
28
|
+
elsif sid == :unset
|
|
29
|
+
@available_add_ons ||= AvailableAddOnList.new self
|
|
30
|
+
else
|
|
31
|
+
AvailableAddOnContext.new(self, sid)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
##
|
|
36
|
+
# @param [String] sid The Installed Add-on Sid that uniquely identifies this
|
|
37
|
+
# resource
|
|
38
|
+
# @return [Twilio::REST::Preview::Marketplace::InstalledAddOnInstance] if sid was passed.
|
|
39
|
+
# @return [Twilio::REST::Preview::Marketplace::InstalledAddOnList]
|
|
40
|
+
def installed_add_ons(sid=:unset)
|
|
41
|
+
if sid.nil?
|
|
42
|
+
raise ArgumentError, 'sid cannot be nil'
|
|
43
|
+
elsif sid == :unset
|
|
44
|
+
@installed_add_ons ||= InstalledAddOnList.new self
|
|
45
|
+
else
|
|
46
|
+
InstalledAddOnContext.new(self, sid)
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
##
|
|
51
|
+
# Provide a user friendly representation
|
|
52
|
+
def to_s
|
|
53
|
+
'<Twilio::REST::Preview::Marketplace>'
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
end
|
|
58
|
+
end
|
|
@@ -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 Preview < Domain
|
|
10
|
+
class Proxy < Version
|
|
11
|
+
class ServiceContext < InstanceContext
|
|
12
|
+
##
|
|
13
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
14
|
+
class PhoneNumberList < ListResource
|
|
15
|
+
##
|
|
16
|
+
# Initialize the PhoneNumberList
|
|
17
|
+
# @param [Version] version Version that contains the resource
|
|
18
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
|
19
|
+
# @return [PhoneNumberList] PhoneNumberList
|
|
20
|
+
def initialize(version, service_sid: nil)
|
|
21
|
+
super(version)
|
|
22
|
+
|
|
23
|
+
# Path Solution
|
|
24
|
+
@solution = {
|
|
25
|
+
service_sid: service_sid
|
|
26
|
+
}
|
|
27
|
+
@uri = "/Services/#{@solution[:service_sid]}/PhoneNumbers"
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
##
|
|
31
|
+
# Retrieve a single page of PhoneNumberInstance records from the API.
|
|
32
|
+
# Request is executed immediately.
|
|
33
|
+
# @param [String] sid The phone-number Sid that uniquely identifies this resource
|
|
34
|
+
# @return [PhoneNumberInstance] Newly created PhoneNumberInstance
|
|
35
|
+
def create(sid: nil)
|
|
36
|
+
data = Twilio::Values.of({
|
|
37
|
+
'Sid' => sid,
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
payload = @version.create(
|
|
41
|
+
'POST',
|
|
42
|
+
@uri,
|
|
43
|
+
data: data
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
PhoneNumberInstance.new(
|
|
47
|
+
@version,
|
|
48
|
+
payload,
|
|
49
|
+
service_sid: @solution[:service_sid],
|
|
50
|
+
)
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
##
|
|
54
|
+
# Lists PhoneNumberInstance records from the API as a list.
|
|
55
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
56
|
+
# memory before returning.
|
|
57
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
58
|
+
# guarantees to never return more than limit. Default is no limit
|
|
59
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
60
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
61
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
62
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
63
|
+
# @return [Array] Array of up to limit results
|
|
64
|
+
def list(limit: nil, page_size: nil)
|
|
65
|
+
self.stream(
|
|
66
|
+
limit: limit,
|
|
67
|
+
page_size: page_size
|
|
68
|
+
).entries
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
##
|
|
72
|
+
# Streams PhoneNumberInstance records from the API as an Enumerable.
|
|
73
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
74
|
+
# is reached.
|
|
75
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
76
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
77
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
78
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
79
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
80
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
81
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
82
|
+
def stream(limit: nil, page_size: nil)
|
|
83
|
+
limits = @version.read_limits(limit, page_size)
|
|
84
|
+
|
|
85
|
+
page = self.page(
|
|
86
|
+
page_size: limits[:page_size],
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
##
|
|
93
|
+
# When passed a block, yields PhoneNumberInstance records from the API.
|
|
94
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
95
|
+
# is reached.
|
|
96
|
+
def each
|
|
97
|
+
limits = @version.read_limits
|
|
98
|
+
|
|
99
|
+
page = self.page(
|
|
100
|
+
page_size: limits[:page_size],
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
@version.stream(page,
|
|
104
|
+
limit: limits[:limit],
|
|
105
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
##
|
|
109
|
+
# Retrieve a single page of PhoneNumberInstance records from the API.
|
|
110
|
+
# Request is executed immediately.
|
|
111
|
+
# @param [String] page_token PageToken provided by the API
|
|
112
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
113
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
114
|
+
# @return [Page] Page of PhoneNumberInstance
|
|
115
|
+
def page(page_token: :unset, page_number: :unset, page_size: :unset)
|
|
116
|
+
params = Twilio::Values.of({
|
|
117
|
+
'PageToken' => page_token,
|
|
118
|
+
'Page' => page_number,
|
|
119
|
+
'PageSize' => page_size,
|
|
120
|
+
})
|
|
121
|
+
response = @version.page(
|
|
122
|
+
'GET',
|
|
123
|
+
@uri,
|
|
124
|
+
params
|
|
125
|
+
)
|
|
126
|
+
PhoneNumberPage.new(@version, response, @solution)
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
##
|
|
130
|
+
# Retrieve a single page of PhoneNumberInstance records from the API.
|
|
131
|
+
# Request is executed immediately.
|
|
132
|
+
# @param [String] target_url API-generated URL for the requested results page
|
|
133
|
+
# @return [Page] Page of PhoneNumberInstance
|
|
134
|
+
def get_page(target_url)
|
|
135
|
+
response = @version.domain.request(
|
|
136
|
+
'GET',
|
|
137
|
+
target_url
|
|
138
|
+
)
|
|
139
|
+
PhoneNumberPage.new(@version, response, @solution)
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
##
|
|
143
|
+
# Provide a user friendly representation
|
|
144
|
+
def to_s
|
|
145
|
+
'#<Twilio.Preview.Proxy.PhoneNumberList>'
|
|
146
|
+
end
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
##
|
|
150
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
151
|
+
class PhoneNumberPage < Page
|
|
152
|
+
##
|
|
153
|
+
# Initialize the PhoneNumberPage
|
|
154
|
+
# @param [Version] version Version that contains the resource
|
|
155
|
+
# @param [Response] response Response from the API
|
|
156
|
+
# @param [Hash] solution Path solution for the resource
|
|
157
|
+
# @return [PhoneNumberPage] PhoneNumberPage
|
|
158
|
+
def initialize(version, response, solution)
|
|
159
|
+
super(version, response)
|
|
160
|
+
|
|
161
|
+
# Path Solution
|
|
162
|
+
@solution = solution
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
##
|
|
166
|
+
# Build an instance of PhoneNumberInstance
|
|
167
|
+
# @param [Hash] payload Payload response from the API
|
|
168
|
+
# @return [PhoneNumberInstance] PhoneNumberInstance
|
|
169
|
+
def get_instance(payload)
|
|
170
|
+
PhoneNumberInstance.new(
|
|
171
|
+
@version,
|
|
172
|
+
payload,
|
|
173
|
+
service_sid: @solution[:service_sid],
|
|
174
|
+
)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
##
|
|
178
|
+
# Provide a user friendly representation
|
|
179
|
+
def to_s
|
|
180
|
+
'<Twilio.Preview.Proxy.PhoneNumberPage>'
|
|
181
|
+
end
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
##
|
|
185
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
186
|
+
class PhoneNumberContext < InstanceContext
|
|
187
|
+
##
|
|
188
|
+
# Initialize the PhoneNumberContext
|
|
189
|
+
# @param [Version] version Version that contains the resource
|
|
190
|
+
# @param [String] service_sid The service_sid
|
|
191
|
+
# @param [String] sid The phone-number Sid that uniquely identifies this resource
|
|
192
|
+
# @return [PhoneNumberContext] PhoneNumberContext
|
|
193
|
+
def initialize(version, service_sid, sid)
|
|
194
|
+
super(version)
|
|
195
|
+
|
|
196
|
+
# Path Solution
|
|
197
|
+
@solution = {
|
|
198
|
+
service_sid: service_sid,
|
|
199
|
+
sid: sid,
|
|
200
|
+
}
|
|
201
|
+
@uri = "/Services/#{@solution[:service_sid]}/PhoneNumbers/#{@solution[:sid]}"
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
##
|
|
205
|
+
# Deletes the PhoneNumberInstance
|
|
206
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
|
207
|
+
def delete
|
|
208
|
+
@version.delete('delete', @uri)
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
##
|
|
212
|
+
# Fetch a PhoneNumberInstance
|
|
213
|
+
# @return [PhoneNumberInstance] Fetched PhoneNumberInstance
|
|
214
|
+
def fetch
|
|
215
|
+
params = Twilio::Values.of({})
|
|
216
|
+
|
|
217
|
+
payload = @version.fetch(
|
|
218
|
+
'GET',
|
|
219
|
+
@uri,
|
|
220
|
+
params,
|
|
221
|
+
)
|
|
222
|
+
|
|
223
|
+
PhoneNumberInstance.new(
|
|
224
|
+
@version,
|
|
225
|
+
payload,
|
|
226
|
+
service_sid: @solution[:service_sid],
|
|
227
|
+
sid: @solution[:sid],
|
|
228
|
+
)
|
|
229
|
+
end
|
|
230
|
+
|
|
231
|
+
##
|
|
232
|
+
# Provide a user friendly representation
|
|
233
|
+
def to_s
|
|
234
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
235
|
+
"#<Twilio.Preview.Proxy.PhoneNumberContext #{context}>"
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
##
|
|
240
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
241
|
+
class PhoneNumberInstance < InstanceResource
|
|
242
|
+
##
|
|
243
|
+
# Initialize the PhoneNumberInstance
|
|
244
|
+
# @param [Version] version Version that contains the resource
|
|
245
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
246
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
|
247
|
+
# @param [String] sid The phone-number Sid that uniquely identifies this resource
|
|
248
|
+
# @return [PhoneNumberInstance] PhoneNumberInstance
|
|
249
|
+
def initialize(version, payload, service_sid: nil, sid: nil)
|
|
250
|
+
super(version)
|
|
251
|
+
|
|
252
|
+
# Marshaled Properties
|
|
253
|
+
@properties = {
|
|
254
|
+
'sid' => payload['sid'],
|
|
255
|
+
'account_sid' => payload['account_sid'],
|
|
256
|
+
'service_sid' => payload['service_sid'],
|
|
257
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
258
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
259
|
+
'phone_number' => payload['phone_number'],
|
|
260
|
+
'country_code' => payload['country_code'],
|
|
261
|
+
'capabilities' => payload['capabilities'],
|
|
262
|
+
'url' => payload['url'],
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
# Context
|
|
266
|
+
@instance_context = nil
|
|
267
|
+
@params = {
|
|
268
|
+
'service_sid' => service_sid,
|
|
269
|
+
'sid' => sid || @properties['sid'],
|
|
270
|
+
}
|
|
271
|
+
end
|
|
272
|
+
|
|
273
|
+
##
|
|
274
|
+
# Generate an instance context for the instance, the context is capable of
|
|
275
|
+
# performing various actions. All instance actions are proxied to the context
|
|
276
|
+
# @return [PhoneNumberContext] PhoneNumberContext for this PhoneNumberInstance
|
|
277
|
+
def context
|
|
278
|
+
unless @instance_context
|
|
279
|
+
@instance_context = PhoneNumberContext.new(
|
|
280
|
+
@version,
|
|
281
|
+
@params['service_sid'],
|
|
282
|
+
@params['sid'],
|
|
283
|
+
)
|
|
284
|
+
end
|
|
285
|
+
@instance_context
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
##
|
|
289
|
+
# @return [String] A string that uniquely identifies this resource
|
|
290
|
+
def sid
|
|
291
|
+
@properties['sid']
|
|
292
|
+
end
|
|
293
|
+
|
|
294
|
+
##
|
|
295
|
+
# @return [String] Account Sid.
|
|
296
|
+
def account_sid
|
|
297
|
+
@properties['account_sid']
|
|
298
|
+
end
|
|
299
|
+
|
|
300
|
+
##
|
|
301
|
+
# @return [String] Service Sid.
|
|
302
|
+
def service_sid
|
|
303
|
+
@properties['service_sid']
|
|
304
|
+
end
|
|
305
|
+
|
|
306
|
+
##
|
|
307
|
+
# @return [Time] The date this resource was created
|
|
308
|
+
def date_created
|
|
309
|
+
@properties['date_created']
|
|
310
|
+
end
|
|
311
|
+
|
|
312
|
+
##
|
|
313
|
+
# @return [Time] The date this resource was last updated
|
|
314
|
+
def date_updated
|
|
315
|
+
@properties['date_updated']
|
|
316
|
+
end
|
|
317
|
+
|
|
318
|
+
##
|
|
319
|
+
# @return [String] The phone number
|
|
320
|
+
def phone_number
|
|
321
|
+
@properties['phone_number']
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
##
|
|
325
|
+
# @return [String] The ISO 3166-1 alpha-2 country code
|
|
326
|
+
def country_code
|
|
327
|
+
@properties['country_code']
|
|
328
|
+
end
|
|
329
|
+
|
|
330
|
+
##
|
|
331
|
+
# @return [String] Indicate if a phone can receive calls or messages
|
|
332
|
+
def capabilities
|
|
333
|
+
@properties['capabilities']
|
|
334
|
+
end
|
|
335
|
+
|
|
336
|
+
##
|
|
337
|
+
# @return [String] The URL of this resource.
|
|
338
|
+
def url
|
|
339
|
+
@properties['url']
|
|
340
|
+
end
|
|
341
|
+
|
|
342
|
+
##
|
|
343
|
+
# Deletes the PhoneNumberInstance
|
|
344
|
+
# @return [Boolean] true if delete succeeds, true otherwise
|
|
345
|
+
def delete
|
|
346
|
+
context.delete
|
|
347
|
+
end
|
|
348
|
+
|
|
349
|
+
##
|
|
350
|
+
# Fetch a PhoneNumberInstance
|
|
351
|
+
# @return [PhoneNumberInstance] Fetched PhoneNumberInstance
|
|
352
|
+
def fetch
|
|
353
|
+
context.fetch
|
|
354
|
+
end
|
|
355
|
+
|
|
356
|
+
##
|
|
357
|
+
# Provide a user friendly representation
|
|
358
|
+
def to_s
|
|
359
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
360
|
+
"<Twilio.Preview.Proxy.PhoneNumberInstance #{values}>"
|
|
361
|
+
end
|
|
362
|
+
end
|
|
363
|
+
end
|
|
364
|
+
end
|
|
365
|
+
end
|
|
366
|
+
end
|
|
367
|
+
end
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
module Twilio
|
|
8
|
+
module REST
|
|
9
|
+
class Preview < Domain
|
|
10
|
+
class Proxy < Version
|
|
11
|
+
class ServiceContext < InstanceContext
|
|
12
|
+
class SessionContext < InstanceContext
|
|
13
|
+
##
|
|
14
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
15
|
+
class InteractionList < ListResource
|
|
16
|
+
##
|
|
17
|
+
# Initialize the InteractionList
|
|
18
|
+
# @param [Version] version Version that contains the resource
|
|
19
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
|
20
|
+
# @param [String] session_sid The unique SID identifier of the Session.
|
|
21
|
+
# @return [InteractionList] InteractionList
|
|
22
|
+
def initialize(version, service_sid: nil, session_sid: nil)
|
|
23
|
+
super(version)
|
|
24
|
+
|
|
25
|
+
# Path Solution
|
|
26
|
+
@solution = {
|
|
27
|
+
service_sid: service_sid,
|
|
28
|
+
session_sid: session_sid
|
|
29
|
+
}
|
|
30
|
+
@uri = "/Services/#{@solution[:service_sid]}/Sessions/#{@solution[:session_sid]}/Interactions"
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
##
|
|
34
|
+
# Lists InteractionInstance records from the API as a list.
|
|
35
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
36
|
+
# memory before returning.
|
|
37
|
+
# @param [interaction.ResourceStatus] inbound_participant_status The Inbound
|
|
38
|
+
# Participant Status of this Interaction. One of `completed`, `in-progress` or
|
|
39
|
+
# `failed`.
|
|
40
|
+
# @param [interaction.ResourceStatus] outbound_participant_status The Outbound
|
|
41
|
+
# Participant Status of this Interaction. One of `completed`, `in-progress` or
|
|
42
|
+
# `failed`.
|
|
43
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
44
|
+
# guarantees to never return more than limit. Default is no limit
|
|
45
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
46
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
47
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
48
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
49
|
+
# @return [Array] Array of up to limit results
|
|
50
|
+
def list(inbound_participant_status: :unset, outbound_participant_status: :unset, limit: nil, page_size: nil)
|
|
51
|
+
self.stream(
|
|
52
|
+
inbound_participant_status: inbound_participant_status,
|
|
53
|
+
outbound_participant_status: outbound_participant_status,
|
|
54
|
+
limit: limit,
|
|
55
|
+
page_size: page_size
|
|
56
|
+
).entries
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
##
|
|
60
|
+
# Streams InteractionInstance records from the API as an Enumerable.
|
|
61
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
62
|
+
# is reached.
|
|
63
|
+
# @param [interaction.ResourceStatus] inbound_participant_status The Inbound
|
|
64
|
+
# Participant Status of this Interaction. One of `completed`, `in-progress` or
|
|
65
|
+
# `failed`.
|
|
66
|
+
# @param [interaction.ResourceStatus] outbound_participant_status The Outbound
|
|
67
|
+
# Participant Status of this Interaction. One of `completed`, `in-progress` or
|
|
68
|
+
# `failed`.
|
|
69
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
70
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
71
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
72
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
73
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
74
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
75
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
76
|
+
def stream(inbound_participant_status: :unset, outbound_participant_status: :unset, limit: nil, page_size: nil)
|
|
77
|
+
limits = @version.read_limits(limit, page_size)
|
|
78
|
+
|
|
79
|
+
page = self.page(
|
|
80
|
+
inbound_participant_status: inbound_participant_status,
|
|
81
|
+
outbound_participant_status: outbound_participant_status,
|
|
82
|
+
page_size: limits[:page_size],
|
|
83
|
+
)
|
|
84
|
+
|
|
85
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
##
|
|
89
|
+
# When passed a block, yields InteractionInstance records from the API.
|
|
90
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
91
|
+
# is reached.
|
|
92
|
+
def each
|
|
93
|
+
limits = @version.read_limits
|
|
94
|
+
|
|
95
|
+
page = self.page(
|
|
96
|
+
page_size: limits[:page_size],
|
|
97
|
+
)
|
|
98
|
+
|
|
99
|
+
@version.stream(page,
|
|
100
|
+
limit: limits[:limit],
|
|
101
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
##
|
|
105
|
+
# Retrieve a single page of InteractionInstance records from the API.
|
|
106
|
+
# Request is executed immediately.
|
|
107
|
+
# @param [interaction.ResourceStatus] inbound_participant_status The Inbound
|
|
108
|
+
# Participant Status of this Interaction. One of `completed`, `in-progress` or
|
|
109
|
+
# `failed`.
|
|
110
|
+
# @param [interaction.ResourceStatus] outbound_participant_status The Outbound
|
|
111
|
+
# Participant Status of this Interaction. One of `completed`, `in-progress` or
|
|
112
|
+
# `failed`.
|
|
113
|
+
# @param [String] page_token PageToken provided by the API
|
|
114
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
115
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
116
|
+
# @return [Page] Page of InteractionInstance
|
|
117
|
+
def page(inbound_participant_status: :unset, outbound_participant_status: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
|
118
|
+
params = Twilio::Values.of({
|
|
119
|
+
'InboundParticipantStatus' => inbound_participant_status,
|
|
120
|
+
'OutboundParticipantStatus' => outbound_participant_status,
|
|
121
|
+
'PageToken' => page_token,
|
|
122
|
+
'Page' => page_number,
|
|
123
|
+
'PageSize' => page_size,
|
|
124
|
+
})
|
|
125
|
+
response = @version.page(
|
|
126
|
+
'GET',
|
|
127
|
+
@uri,
|
|
128
|
+
params
|
|
129
|
+
)
|
|
130
|
+
InteractionPage.new(@version, response, @solution)
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
##
|
|
134
|
+
# Retrieve a single page of InteractionInstance records from the API.
|
|
135
|
+
# Request is executed immediately.
|
|
136
|
+
# @param [String] target_url API-generated URL for the requested results page
|
|
137
|
+
# @return [Page] Page of InteractionInstance
|
|
138
|
+
def get_page(target_url)
|
|
139
|
+
response = @version.domain.request(
|
|
140
|
+
'GET',
|
|
141
|
+
target_url
|
|
142
|
+
)
|
|
143
|
+
InteractionPage.new(@version, response, @solution)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
##
|
|
147
|
+
# Provide a user friendly representation
|
|
148
|
+
def to_s
|
|
149
|
+
'#<Twilio.Preview.Proxy.InteractionList>'
|
|
150
|
+
end
|
|
151
|
+
end
|
|
152
|
+
|
|
153
|
+
##
|
|
154
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
155
|
+
class InteractionPage < Page
|
|
156
|
+
##
|
|
157
|
+
# Initialize the InteractionPage
|
|
158
|
+
# @param [Version] version Version that contains the resource
|
|
159
|
+
# @param [Response] response Response from the API
|
|
160
|
+
# @param [Hash] solution Path solution for the resource
|
|
161
|
+
# @return [InteractionPage] InteractionPage
|
|
162
|
+
def initialize(version, response, solution)
|
|
163
|
+
super(version, response)
|
|
164
|
+
|
|
165
|
+
# Path Solution
|
|
166
|
+
@solution = solution
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
##
|
|
170
|
+
# Build an instance of InteractionInstance
|
|
171
|
+
# @param [Hash] payload Payload response from the API
|
|
172
|
+
# @return [InteractionInstance] InteractionInstance
|
|
173
|
+
def get_instance(payload)
|
|
174
|
+
InteractionInstance.new(
|
|
175
|
+
@version,
|
|
176
|
+
payload,
|
|
177
|
+
service_sid: @solution[:service_sid],
|
|
178
|
+
session_sid: @solution[:session_sid],
|
|
179
|
+
)
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
##
|
|
183
|
+
# Provide a user friendly representation
|
|
184
|
+
def to_s
|
|
185
|
+
'<Twilio.Preview.Proxy.InteractionPage>'
|
|
186
|
+
end
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
##
|
|
190
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
191
|
+
class InteractionContext < InstanceContext
|
|
192
|
+
##
|
|
193
|
+
# Initialize the InteractionContext
|
|
194
|
+
# @param [Version] version Version that contains the resource
|
|
195
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
|
196
|
+
# @param [String] session_sid The unique SID identifier of the Session.
|
|
197
|
+
# @param [String] sid A 34 character string that uniquely identifies this
|
|
198
|
+
# Interaction.
|
|
199
|
+
# @return [InteractionContext] InteractionContext
|
|
200
|
+
def initialize(version, service_sid, session_sid, sid)
|
|
201
|
+
super(version)
|
|
202
|
+
|
|
203
|
+
# Path Solution
|
|
204
|
+
@solution = {
|
|
205
|
+
service_sid: service_sid,
|
|
206
|
+
session_sid: session_sid,
|
|
207
|
+
sid: sid,
|
|
208
|
+
}
|
|
209
|
+
@uri = "/Services/#{@solution[:service_sid]}/Sessions/#{@solution[:session_sid]}/Interactions/#{@solution[:sid]}"
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
##
|
|
213
|
+
# Fetch a InteractionInstance
|
|
214
|
+
# @return [InteractionInstance] Fetched InteractionInstance
|
|
215
|
+
def fetch
|
|
216
|
+
params = Twilio::Values.of({})
|
|
217
|
+
|
|
218
|
+
payload = @version.fetch(
|
|
219
|
+
'GET',
|
|
220
|
+
@uri,
|
|
221
|
+
params,
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
InteractionInstance.new(
|
|
225
|
+
@version,
|
|
226
|
+
payload,
|
|
227
|
+
service_sid: @solution[:service_sid],
|
|
228
|
+
session_sid: @solution[:session_sid],
|
|
229
|
+
sid: @solution[:sid],
|
|
230
|
+
)
|
|
231
|
+
end
|
|
232
|
+
|
|
233
|
+
##
|
|
234
|
+
# Provide a user friendly representation
|
|
235
|
+
def to_s
|
|
236
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
237
|
+
"#<Twilio.Preview.Proxy.InteractionContext #{context}>"
|
|
238
|
+
end
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
##
|
|
242
|
+
# PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
|
|
243
|
+
class InteractionInstance < InstanceResource
|
|
244
|
+
##
|
|
245
|
+
# Initialize the InteractionInstance
|
|
246
|
+
# @param [Version] version Version that contains the resource
|
|
247
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
248
|
+
# @param [String] service_sid The unique SID identifier of the Service.
|
|
249
|
+
# @param [String] session_sid The unique SID identifier of the Session.
|
|
250
|
+
# @param [String] sid A 34 character string that uniquely identifies this
|
|
251
|
+
# Interaction.
|
|
252
|
+
# @return [InteractionInstance] InteractionInstance
|
|
253
|
+
def initialize(version, payload, service_sid: nil, session_sid: nil, sid: nil)
|
|
254
|
+
super(version)
|
|
255
|
+
|
|
256
|
+
# Marshaled Properties
|
|
257
|
+
@properties = {
|
|
258
|
+
'sid' => payload['sid'],
|
|
259
|
+
'session_sid' => payload['session_sid'],
|
|
260
|
+
'service_sid' => payload['service_sid'],
|
|
261
|
+
'account_sid' => payload['account_sid'],
|
|
262
|
+
'data' => payload['data'],
|
|
263
|
+
'status' => payload['status'],
|
|
264
|
+
'inbound_participant_sid' => payload['inbound_participant_sid'],
|
|
265
|
+
'inbound_resource_sid' => payload['inbound_resource_sid'],
|
|
266
|
+
'inbound_resource_status' => payload['inbound_resource_status'],
|
|
267
|
+
'inbound_resource_type' => payload['inbound_resource_type'],
|
|
268
|
+
'inbound_resource_url' => payload['inbound_resource_url'],
|
|
269
|
+
'outbound_participant_sid' => payload['outbound_participant_sid'],
|
|
270
|
+
'outbound_resource_sid' => payload['outbound_resource_sid'],
|
|
271
|
+
'outbound_resource_status' => payload['outbound_resource_status'],
|
|
272
|
+
'outbound_resource_type' => payload['outbound_resource_type'],
|
|
273
|
+
'outbound_resource_url' => payload['outbound_resource_url'],
|
|
274
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
275
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
276
|
+
'url' => payload['url'],
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
# Context
|
|
280
|
+
@instance_context = nil
|
|
281
|
+
@params = {
|
|
282
|
+
'service_sid' => service_sid,
|
|
283
|
+
'session_sid' => session_sid,
|
|
284
|
+
'sid' => sid || @properties['sid'],
|
|
285
|
+
}
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
##
|
|
289
|
+
# Generate an instance context for the instance, the context is capable of
|
|
290
|
+
# performing various actions. All instance actions are proxied to the context
|
|
291
|
+
# @return [InteractionContext] InteractionContext for this InteractionInstance
|
|
292
|
+
def context
|
|
293
|
+
unless @instance_context
|
|
294
|
+
@instance_context = InteractionContext.new(
|
|
295
|
+
@version,
|
|
296
|
+
@params['service_sid'],
|
|
297
|
+
@params['session_sid'],
|
|
298
|
+
@params['sid'],
|
|
299
|
+
)
|
|
300
|
+
end
|
|
301
|
+
@instance_context
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
##
|
|
305
|
+
# @return [String] A string that uniquely identifies this Interaction.
|
|
306
|
+
def sid
|
|
307
|
+
@properties['sid']
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
##
|
|
311
|
+
# @return [String] Session Sid.
|
|
312
|
+
def session_sid
|
|
313
|
+
@properties['session_sid']
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
##
|
|
317
|
+
# @return [String] Service Sid.
|
|
318
|
+
def service_sid
|
|
319
|
+
@properties['service_sid']
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
##
|
|
323
|
+
# @return [String] Account Sid.
|
|
324
|
+
def account_sid
|
|
325
|
+
@properties['account_sid']
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
##
|
|
329
|
+
# @return [String] What happened in this Interaction.
|
|
330
|
+
def data
|
|
331
|
+
@properties['data']
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
##
|
|
335
|
+
# @return [interaction.Status] The Status of this Interaction
|
|
336
|
+
def status
|
|
337
|
+
@properties['status']
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
##
|
|
341
|
+
# @return [String] The inbound_participant_sid
|
|
342
|
+
def inbound_participant_sid
|
|
343
|
+
@properties['inbound_participant_sid']
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
##
|
|
347
|
+
# @return [String] The SID of the inbound resource.
|
|
348
|
+
def inbound_resource_sid
|
|
349
|
+
@properties['inbound_resource_sid']
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
##
|
|
353
|
+
# @return [interaction.ResourceStatus] The Inbound Resource Status of this Interaction
|
|
354
|
+
def inbound_resource_status
|
|
355
|
+
@properties['inbound_resource_status']
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
##
|
|
359
|
+
# @return [String] The Twilio object type of the inbound resource.
|
|
360
|
+
def inbound_resource_type
|
|
361
|
+
@properties['inbound_resource_type']
|
|
362
|
+
end
|
|
363
|
+
|
|
364
|
+
##
|
|
365
|
+
# @return [String] The URL of the inbound resource.
|
|
366
|
+
def inbound_resource_url
|
|
367
|
+
@properties['inbound_resource_url']
|
|
368
|
+
end
|
|
369
|
+
|
|
370
|
+
##
|
|
371
|
+
# @return [String] The outbound_participant_sid
|
|
372
|
+
def outbound_participant_sid
|
|
373
|
+
@properties['outbound_participant_sid']
|
|
374
|
+
end
|
|
375
|
+
|
|
376
|
+
##
|
|
377
|
+
# @return [String] The SID of the outbound resource.
|
|
378
|
+
def outbound_resource_sid
|
|
379
|
+
@properties['outbound_resource_sid']
|
|
380
|
+
end
|
|
381
|
+
|
|
382
|
+
##
|
|
383
|
+
# @return [interaction.ResourceStatus] The Outbound Resource Status of this Interaction
|
|
384
|
+
def outbound_resource_status
|
|
385
|
+
@properties['outbound_resource_status']
|
|
386
|
+
end
|
|
387
|
+
|
|
388
|
+
##
|
|
389
|
+
# @return [String] The Twilio object type of the outbound resource.
|
|
390
|
+
def outbound_resource_type
|
|
391
|
+
@properties['outbound_resource_type']
|
|
392
|
+
end
|
|
393
|
+
|
|
394
|
+
##
|
|
395
|
+
# @return [String] The URL of the outbound resource.
|
|
396
|
+
def outbound_resource_url
|
|
397
|
+
@properties['outbound_resource_url']
|
|
398
|
+
end
|
|
399
|
+
|
|
400
|
+
##
|
|
401
|
+
# @return [Time] The date this Interaction was created
|
|
402
|
+
def date_created
|
|
403
|
+
@properties['date_created']
|
|
404
|
+
end
|
|
405
|
+
|
|
406
|
+
##
|
|
407
|
+
# @return [Time] The date this Interaction was updated
|
|
408
|
+
def date_updated
|
|
409
|
+
@properties['date_updated']
|
|
410
|
+
end
|
|
411
|
+
|
|
412
|
+
##
|
|
413
|
+
# @return [String] The URL of this Interaction.
|
|
414
|
+
def url
|
|
415
|
+
@properties['url']
|
|
416
|
+
end
|
|
417
|
+
|
|
418
|
+
##
|
|
419
|
+
# Fetch a InteractionInstance
|
|
420
|
+
# @return [InteractionInstance] Fetched InteractionInstance
|
|
421
|
+
def fetch
|
|
422
|
+
context.fetch
|
|
423
|
+
end
|
|
424
|
+
|
|
425
|
+
##
|
|
426
|
+
# Provide a user friendly representation
|
|
427
|
+
def to_s
|
|
428
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
429
|
+
"<Twilio.Preview.Proxy.InteractionInstance #{values}>"
|
|
430
|
+
end
|
|
431
|
+
end
|
|
432
|
+
end
|
|
433
|
+
end
|
|
434
|
+
end
|
|
435
|
+
end
|
|
436
|
+
end
|
|
437
|
+
end
|