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