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
|
@@ -61,11 +61,11 @@ module Twilio
|
|
|
61
61
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
62
62
|
# memory before returning.
|
|
63
63
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
64
|
-
#
|
|
65
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
66
|
-
#
|
|
67
|
-
#
|
|
68
|
-
#
|
|
64
|
+
# guarantees to never return more than limit. Default is no limit
|
|
65
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
66
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
67
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
68
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
69
69
|
# @return [Array] Array of up to limit results
|
|
70
70
|
def list(limit: nil, page_size: nil)
|
|
71
71
|
self.stream(
|
|
@@ -78,12 +78,12 @@ module Twilio
|
|
|
78
78
|
# Streams OriginationUrlInstance records from the API as an Enumerable.
|
|
79
79
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
80
80
|
# is reached.
|
|
81
|
-
# @param [Integer] limit Upper limit for the number of records to return.
|
|
82
|
-
#
|
|
83
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
84
|
-
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
81
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
82
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
83
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
84
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
85
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
86
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
87
87
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
88
88
|
def stream(limit: nil, page_size: nil)
|
|
89
89
|
limits = @version.read_limits(limit, page_size)
|
|
@@ -53,11 +53,11 @@ module Twilio
|
|
|
53
53
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
54
54
|
# memory before returning.
|
|
55
55
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
56
|
-
#
|
|
57
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
58
|
-
#
|
|
59
|
-
#
|
|
60
|
-
#
|
|
56
|
+
# guarantees to never return more than limit. Default is no limit
|
|
57
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
58
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
59
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
60
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
61
61
|
# @return [Array] Array of up to limit results
|
|
62
62
|
def list(limit: nil, page_size: nil)
|
|
63
63
|
self.stream(
|
|
@@ -70,12 +70,12 @@ module Twilio
|
|
|
70
70
|
# Streams PhoneNumberInstance records from the API as an Enumerable.
|
|
71
71
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
72
72
|
# is reached.
|
|
73
|
-
# @param [Integer] limit Upper limit for the number of records to return.
|
|
74
|
-
#
|
|
75
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
76
|
-
#
|
|
77
|
-
#
|
|
78
|
-
#
|
|
73
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
74
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
75
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
76
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
77
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
78
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
79
79
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
80
80
|
def stream(limit: nil, page_size: nil)
|
|
81
81
|
limits = @version.read_limits(limit, page_size)
|
|
@@ -58,11 +58,11 @@ module Twilio
|
|
|
58
58
|
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
59
59
|
# memory before returning.
|
|
60
60
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
61
|
-
#
|
|
62
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
63
|
-
#
|
|
64
|
-
#
|
|
65
|
-
#
|
|
61
|
+
# guarantees to never return more than limit. Default is no limit
|
|
62
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
63
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
64
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
65
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
66
66
|
# @return [Array] Array of up to limit results
|
|
67
67
|
def list(limit: nil, page_size: nil)
|
|
68
68
|
self.stream(
|
|
@@ -75,12 +75,12 @@ module Twilio
|
|
|
75
75
|
# Streams TrunkInstance records from the API as an Enumerable.
|
|
76
76
|
# This operation lazily loads records as efficiently as possible until the limit
|
|
77
77
|
# is reached.
|
|
78
|
-
# @param [Integer] limit Upper limit for the number of records to return.
|
|
79
|
-
#
|
|
80
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
81
|
-
#
|
|
82
|
-
#
|
|
83
|
-
#
|
|
78
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
79
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
80
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
81
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
82
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
83
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
84
84
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
85
85
|
def stream(limit: nil, page_size: nil)
|
|
86
86
|
limits = @version.read_limits(limit, page_size)
|
|
@@ -31,11 +31,11 @@ module Twilio
|
|
|
31
31
|
# @param [Time] date_created_after The date_created_after
|
|
32
32
|
# @param [Time] date_created_before The date_created_before
|
|
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(status: :unset, source_sid: :unset, grouping_sid: :unset, date_created_after: :unset, date_created_before: :unset, limit: nil, page_size: nil)
|
|
41
41
|
self.stream(
|
|
@@ -58,12 +58,12 @@ module Twilio
|
|
|
58
58
|
# @param [String] grouping_sid The grouping_sid
|
|
59
59
|
# @param [Time] date_created_after The date_created_after
|
|
60
60
|
# @param [Time] date_created_before The date_created_before
|
|
61
|
-
# @param [Integer] limit Upper limit for the number of records to return.
|
|
62
|
-
#
|
|
63
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
64
|
-
#
|
|
65
|
-
#
|
|
66
|
-
#
|
|
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
67
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
68
68
|
def stream(status: :unset, source_sid: :unset, grouping_sid: :unset, date_created_after: :unset, date_created_before: :unset, limit: nil, page_size: nil)
|
|
69
69
|
limits = @version.read_limits(limit, page_size)
|
|
@@ -34,11 +34,11 @@ module Twilio
|
|
|
34
34
|
# @param [Time] date_created_after The date_created_after
|
|
35
35
|
# @param [Time] date_created_before The date_created_before
|
|
36
36
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
37
|
-
#
|
|
38
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
37
|
+
# guarantees to never return more than limit. Default is no limit
|
|
38
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
39
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
40
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
41
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
42
42
|
# @return [Array] Array of up to limit results
|
|
43
43
|
def list(status: :unset, source_sid: :unset, date_created_after: :unset, date_created_before: :unset, limit: nil, page_size: nil)
|
|
44
44
|
self.stream(
|
|
@@ -59,12 +59,12 @@ module Twilio
|
|
|
59
59
|
# @param [String] source_sid The source_sid
|
|
60
60
|
# @param [Time] date_created_after The date_created_after
|
|
61
61
|
# @param [Time] date_created_before The date_created_before
|
|
62
|
-
# @param [Integer] limit Upper limit for the number of records to return.
|
|
63
|
-
#
|
|
64
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
65
|
-
#
|
|
66
|
-
#
|
|
67
|
-
#
|
|
62
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
63
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
64
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
65
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
66
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
67
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
68
68
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
69
69
|
def stream(status: :unset, source_sid: :unset, date_created_after: :unset, date_created_before: :unset, limit: nil, page_size: nil)
|
|
70
70
|
limits = @version.read_limits(limit, page_size)
|
|
@@ -65,11 +65,11 @@ module Twilio
|
|
|
65
65
|
# @param [Time] date_created_after The date_created_after
|
|
66
66
|
# @param [Time] date_created_before The date_created_before
|
|
67
67
|
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
68
|
-
#
|
|
69
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
70
|
-
#
|
|
71
|
-
#
|
|
72
|
-
#
|
|
68
|
+
# guarantees to never return more than limit. Default is no limit
|
|
69
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
70
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
71
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
72
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
73
73
|
# @return [Array] Array of up to limit results
|
|
74
74
|
def list(status: :unset, unique_name: :unset, date_created_after: :unset, date_created_before: :unset, limit: nil, page_size: nil)
|
|
75
75
|
self.stream(
|
|
@@ -90,12 +90,12 @@ module Twilio
|
|
|
90
90
|
# @param [String] unique_name The unique_name
|
|
91
91
|
# @param [Time] date_created_after The date_created_after
|
|
92
92
|
# @param [Time] date_created_before The date_created_before
|
|
93
|
-
# @param [Integer] limit Upper limit for the number of records to return.
|
|
94
|
-
#
|
|
95
|
-
# @param [Integer] page_size Number of records to fetch per request, when
|
|
96
|
-
#
|
|
97
|
-
#
|
|
98
|
-
#
|
|
93
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
94
|
+
# guarantees to never return more than limit. Default is no limit.
|
|
95
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
|
96
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
|
97
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
|
98
|
+
# efficient page size, i.e. min(limit, 1000)
|
|
99
99
|
# @return [Enumerable] Enumerable that will yield up to limit results
|
|
100
100
|
def stream(status: :unset, unique_name: :unset, date_created_after: :unset, date_created_before: :unset, limit: nil, page_size: nil)
|
|
101
101
|
limits = @version.read_limits(limit, page_size)
|
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
##
|
|
2
|
+
# This code was generated by
|
|
3
|
+
# \ / _ _ _| _ _
|
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
|
5
|
+
# / /
|
|
6
|
+
|
|
7
|
+
module Twilio
|
|
8
|
+
module REST
|
|
9
|
+
class Wireless < Domain
|
|
10
|
+
class V1 < Version
|
|
11
|
+
##
|
|
12
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
13
|
+
class CommandList < ListResource
|
|
14
|
+
##
|
|
15
|
+
# Initialize the CommandList
|
|
16
|
+
# @param [Version] version Version that contains the resource
|
|
17
|
+
# @return [CommandList] CommandList
|
|
18
|
+
def initialize(version)
|
|
19
|
+
super(version)
|
|
20
|
+
|
|
21
|
+
# Path Solution
|
|
22
|
+
@solution = {}
|
|
23
|
+
@uri = "/Commands"
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
##
|
|
27
|
+
# Lists CommandInstance records from the API as a list.
|
|
28
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
|
29
|
+
# memory before returning.
|
|
30
|
+
# @param [String] sim The sim
|
|
31
|
+
# @param [command.Status] status The status
|
|
32
|
+
# @param [command.Direction] direction The direction
|
|
33
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
|
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
|
+
# @return [Array] Array of up to limit results
|
|
40
|
+
def list(sim: :unset, status: :unset, direction: :unset, limit: nil, page_size: nil)
|
|
41
|
+
self.stream(
|
|
42
|
+
sim: sim,
|
|
43
|
+
status: status,
|
|
44
|
+
direction: direction,
|
|
45
|
+
limit: limit,
|
|
46
|
+
page_size: page_size
|
|
47
|
+
).entries
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
##
|
|
51
|
+
# Streams CommandInstance records from the API as an Enumerable.
|
|
52
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
53
|
+
# is reached.
|
|
54
|
+
# @param [String] sim The sim
|
|
55
|
+
# @param [command.Status] status The status
|
|
56
|
+
# @param [command.Direction] direction The direction
|
|
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(sim: :unset, status: :unset, direction: :unset, limit: nil, page_size: nil)
|
|
65
|
+
limits = @version.read_limits(limit, page_size)
|
|
66
|
+
|
|
67
|
+
page = self.page(
|
|
68
|
+
sim: sim,
|
|
69
|
+
status: status,
|
|
70
|
+
direction: direction,
|
|
71
|
+
page_size: limits[:page_size],
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
##
|
|
78
|
+
# When passed a block, yields CommandInstance records from the API.
|
|
79
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
|
80
|
+
# is reached.
|
|
81
|
+
def each
|
|
82
|
+
limits = @version.read_limits
|
|
83
|
+
|
|
84
|
+
page = self.page(
|
|
85
|
+
page_size: limits[:page_size],
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
@version.stream(page,
|
|
89
|
+
limit: limits[:limit],
|
|
90
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
##
|
|
94
|
+
# Retrieve a single page of CommandInstance records from the API.
|
|
95
|
+
# Request is executed immediately.
|
|
96
|
+
# @param [String] sim The sim
|
|
97
|
+
# @param [command.Status] status The status
|
|
98
|
+
# @param [command.Direction] direction The direction
|
|
99
|
+
# @param [String] page_token PageToken provided by the API
|
|
100
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
|
101
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
|
102
|
+
# @return [Page] Page of CommandInstance
|
|
103
|
+
def page(sim: :unset, status: :unset, direction: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
|
104
|
+
params = Twilio::Values.of({
|
|
105
|
+
'Sim' => sim,
|
|
106
|
+
'Status' => status,
|
|
107
|
+
'Direction' => direction,
|
|
108
|
+
'PageToken' => page_token,
|
|
109
|
+
'Page' => page_number,
|
|
110
|
+
'PageSize' => page_size,
|
|
111
|
+
})
|
|
112
|
+
response = @version.page(
|
|
113
|
+
'GET',
|
|
114
|
+
@uri,
|
|
115
|
+
params
|
|
116
|
+
)
|
|
117
|
+
CommandPage.new(@version, response, @solution)
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
##
|
|
121
|
+
# Retrieve a single page of CommandInstance records from the API.
|
|
122
|
+
# Request is executed immediately.
|
|
123
|
+
# @param [String] target_url API-generated URL for the requested results page
|
|
124
|
+
# @return [Page] Page of CommandInstance
|
|
125
|
+
def get_page(target_url)
|
|
126
|
+
response = @version.domain.request(
|
|
127
|
+
'GET',
|
|
128
|
+
target_url
|
|
129
|
+
)
|
|
130
|
+
CommandPage.new(@version, response, @solution)
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
##
|
|
134
|
+
# Retrieve a single page of CommandInstance records from the API.
|
|
135
|
+
# Request is executed immediately.
|
|
136
|
+
# @param [String] command The command
|
|
137
|
+
# @param [String] sim The sim
|
|
138
|
+
# @param [String] callback_method The callback_method
|
|
139
|
+
# @param [String] callback_url The callback_url
|
|
140
|
+
# @param [command.CommandMode] command_mode The command_mode
|
|
141
|
+
# @param [String] include_sid The include_sid
|
|
142
|
+
# @return [CommandInstance] Newly created CommandInstance
|
|
143
|
+
def create(command: nil, sim: :unset, callback_method: :unset, callback_url: :unset, command_mode: :unset, include_sid: :unset)
|
|
144
|
+
data = Twilio::Values.of({
|
|
145
|
+
'Command' => command,
|
|
146
|
+
'Sim' => sim,
|
|
147
|
+
'CallbackMethod' => callback_method,
|
|
148
|
+
'CallbackUrl' => callback_url,
|
|
149
|
+
'CommandMode' => command_mode,
|
|
150
|
+
'IncludeSid' => include_sid,
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
payload = @version.create(
|
|
154
|
+
'POST',
|
|
155
|
+
@uri,
|
|
156
|
+
data: data
|
|
157
|
+
)
|
|
158
|
+
|
|
159
|
+
CommandInstance.new(
|
|
160
|
+
@version,
|
|
161
|
+
payload,
|
|
162
|
+
)
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
##
|
|
166
|
+
# Provide a user friendly representation
|
|
167
|
+
def to_s
|
|
168
|
+
'#<Twilio.Wireless.V1.CommandList>'
|
|
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 CommandPage < Page
|
|
175
|
+
##
|
|
176
|
+
# Initialize the CommandPage
|
|
177
|
+
# @param [Version] version Version that contains the resource
|
|
178
|
+
# @param [Response] response Response from the API
|
|
179
|
+
# @param [Hash] solution Path solution for the resource
|
|
180
|
+
# @return [CommandPage] CommandPage
|
|
181
|
+
def initialize(version, response, solution)
|
|
182
|
+
super(version, response)
|
|
183
|
+
|
|
184
|
+
# Path Solution
|
|
185
|
+
@solution = solution
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
##
|
|
189
|
+
# Build an instance of CommandInstance
|
|
190
|
+
# @param [Hash] payload Payload response from the API
|
|
191
|
+
# @return [CommandInstance] CommandInstance
|
|
192
|
+
def get_instance(payload)
|
|
193
|
+
CommandInstance.new(
|
|
194
|
+
@version,
|
|
195
|
+
payload,
|
|
196
|
+
)
|
|
197
|
+
end
|
|
198
|
+
|
|
199
|
+
##
|
|
200
|
+
# Provide a user friendly representation
|
|
201
|
+
def to_s
|
|
202
|
+
'<Twilio.Wireless.V1.CommandPage>'
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
##
|
|
207
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
208
|
+
class CommandContext < InstanceContext
|
|
209
|
+
##
|
|
210
|
+
# Initialize the CommandContext
|
|
211
|
+
# @param [Version] version Version that contains the resource
|
|
212
|
+
# @param [String] sid The sid
|
|
213
|
+
# @return [CommandContext] CommandContext
|
|
214
|
+
def initialize(version, sid)
|
|
215
|
+
super(version)
|
|
216
|
+
|
|
217
|
+
# Path Solution
|
|
218
|
+
@solution = {
|
|
219
|
+
sid: sid,
|
|
220
|
+
}
|
|
221
|
+
@uri = "/Commands/#{@solution[:sid]}"
|
|
222
|
+
end
|
|
223
|
+
|
|
224
|
+
##
|
|
225
|
+
# Fetch a CommandInstance
|
|
226
|
+
# @return [CommandInstance] Fetched CommandInstance
|
|
227
|
+
def fetch
|
|
228
|
+
params = Twilio::Values.of({})
|
|
229
|
+
|
|
230
|
+
payload = @version.fetch(
|
|
231
|
+
'GET',
|
|
232
|
+
@uri,
|
|
233
|
+
params,
|
|
234
|
+
)
|
|
235
|
+
|
|
236
|
+
CommandInstance.new(
|
|
237
|
+
@version,
|
|
238
|
+
payload,
|
|
239
|
+
sid: @solution[:sid],
|
|
240
|
+
)
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
##
|
|
244
|
+
# Provide a user friendly representation
|
|
245
|
+
def to_s
|
|
246
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
|
247
|
+
"#<Twilio.Wireless.V1.CommandContext #{context}>"
|
|
248
|
+
end
|
|
249
|
+
end
|
|
250
|
+
|
|
251
|
+
##
|
|
252
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
|
253
|
+
class CommandInstance < InstanceResource
|
|
254
|
+
##
|
|
255
|
+
# Initialize the CommandInstance
|
|
256
|
+
# @param [Version] version Version that contains the resource
|
|
257
|
+
# @param [Hash] payload payload that contains response from Twilio
|
|
258
|
+
# @param [String] sid The sid
|
|
259
|
+
# @return [CommandInstance] CommandInstance
|
|
260
|
+
def initialize(version, payload, sid: nil)
|
|
261
|
+
super(version)
|
|
262
|
+
|
|
263
|
+
# Marshaled Properties
|
|
264
|
+
@properties = {
|
|
265
|
+
'sid' => payload['sid'],
|
|
266
|
+
'account_sid' => payload['account_sid'],
|
|
267
|
+
'sim_sid' => payload['sim_sid'],
|
|
268
|
+
'command' => payload['command'],
|
|
269
|
+
'command_mode' => payload['command_mode'],
|
|
270
|
+
'status' => payload['status'],
|
|
271
|
+
'direction' => payload['direction'],
|
|
272
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
|
273
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
|
274
|
+
'url' => payload['url'],
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
# Context
|
|
278
|
+
@instance_context = nil
|
|
279
|
+
@params = {
|
|
280
|
+
'sid' => sid || @properties['sid'],
|
|
281
|
+
}
|
|
282
|
+
end
|
|
283
|
+
|
|
284
|
+
##
|
|
285
|
+
# Generate an instance context for the instance, the context is capable of
|
|
286
|
+
# performing various actions. All instance actions are proxied to the context
|
|
287
|
+
# @return [CommandContext] CommandContext for this CommandInstance
|
|
288
|
+
def context
|
|
289
|
+
unless @instance_context
|
|
290
|
+
@instance_context = CommandContext.new(
|
|
291
|
+
@version,
|
|
292
|
+
@params['sid'],
|
|
293
|
+
)
|
|
294
|
+
end
|
|
295
|
+
@instance_context
|
|
296
|
+
end
|
|
297
|
+
|
|
298
|
+
##
|
|
299
|
+
# @return [String] The sid
|
|
300
|
+
def sid
|
|
301
|
+
@properties['sid']
|
|
302
|
+
end
|
|
303
|
+
|
|
304
|
+
##
|
|
305
|
+
# @return [String] The account_sid
|
|
306
|
+
def account_sid
|
|
307
|
+
@properties['account_sid']
|
|
308
|
+
end
|
|
309
|
+
|
|
310
|
+
##
|
|
311
|
+
# @return [String] The sim_sid
|
|
312
|
+
def sim_sid
|
|
313
|
+
@properties['sim_sid']
|
|
314
|
+
end
|
|
315
|
+
|
|
316
|
+
##
|
|
317
|
+
# @return [String] The command
|
|
318
|
+
def command
|
|
319
|
+
@properties['command']
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
##
|
|
323
|
+
# @return [command.CommandMode] The command_mode
|
|
324
|
+
def command_mode
|
|
325
|
+
@properties['command_mode']
|
|
326
|
+
end
|
|
327
|
+
|
|
328
|
+
##
|
|
329
|
+
# @return [command.Status] The status
|
|
330
|
+
def status
|
|
331
|
+
@properties['status']
|
|
332
|
+
end
|
|
333
|
+
|
|
334
|
+
##
|
|
335
|
+
# @return [command.Direction] The direction
|
|
336
|
+
def direction
|
|
337
|
+
@properties['direction']
|
|
338
|
+
end
|
|
339
|
+
|
|
340
|
+
##
|
|
341
|
+
# @return [Time] The date_created
|
|
342
|
+
def date_created
|
|
343
|
+
@properties['date_created']
|
|
344
|
+
end
|
|
345
|
+
|
|
346
|
+
##
|
|
347
|
+
# @return [Time] The date_updated
|
|
348
|
+
def date_updated
|
|
349
|
+
@properties['date_updated']
|
|
350
|
+
end
|
|
351
|
+
|
|
352
|
+
##
|
|
353
|
+
# @return [String] The url
|
|
354
|
+
def url
|
|
355
|
+
@properties['url']
|
|
356
|
+
end
|
|
357
|
+
|
|
358
|
+
##
|
|
359
|
+
# Fetch a CommandInstance
|
|
360
|
+
# @return [CommandInstance] Fetched CommandInstance
|
|
361
|
+
def fetch
|
|
362
|
+
context.fetch
|
|
363
|
+
end
|
|
364
|
+
|
|
365
|
+
##
|
|
366
|
+
# Provide a user friendly representation
|
|
367
|
+
def to_s
|
|
368
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
|
369
|
+
"<Twilio.Wireless.V1.CommandInstance #{values}>"
|
|
370
|
+
end
|
|
371
|
+
end
|
|
372
|
+
end
|
|
373
|
+
end
|
|
374
|
+
end
|
|
375
|
+
end
|