twilio-ruby 5.0.0 → 5.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +30 -2
- data/CONTRIBUTING.md +159 -0
- data/ISSUE_TEMPLATE.md +26 -0
- data/LICENSE.md +1 -1
- data/README.md +6 -7
- data/VERSIONS.md +21 -49
- data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/address.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/application.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +11 -18
- data/lib/twilio-ruby/rest/api/v2010/account/call.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +358 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +439 -0
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +48 -11
- data/lib/twilio-ruby/rest/api/v2010/account/key.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/message.rb +22 -12
- data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +11 -18
- data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +11 -11
- data/lib/twilio-ruby/rest/api/v2010/account.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/credential.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v1/service.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/credential.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/chat/v2/service.rb +11 -11
- data/lib/twilio-ruby/rest/client.rb +42 -0
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +334 -0
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +549 -0
- data/lib/twilio-ruby/rest/fax/v1.rb +41 -0
- data/lib/twilio-ruby/rest/fax.rb +44 -0
- data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +11 -11
- data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +11 -11
- data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +360 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +367 -0
- data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +367 -0
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +645 -0
- data/lib/twilio-ruby/rest/messaging/v1.rb +41 -0
- data/lib/twilio-ruby/rest/messaging.rb +44 -0
- data/lib/twilio-ruby/rest/monitor/v1/alert.rb +11 -11
- data/lib/twilio-ruby/rest/monitor/v1/event.rb +11 -11
- data/lib/twilio-ruby/rest/notify/v1/credential.rb +411 -0
- data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +438 -0
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +294 -0
- data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +230 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +262 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +442 -0
- data/lib/twilio-ruby/rest/notify/v1/service/user.rb +453 -0
- data/lib/twilio-ruby/rest/notify/v1/service.rb +647 -0
- data/lib/twilio-ruby/rest/notify/v1.rb +56 -0
- data/lib/twilio-ruby/rest/notify.rb +52 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +216 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +211 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +251 -0
- data/lib/twilio-ruby/rest/preview/bulk_exports.rb +56 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +570 -0
- data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +42 -0
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +309 -0
- data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +341 -0
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +349 -0
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +448 -0
- data/lib/twilio-ruby/rest/preview/marketplace.rb +58 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +367 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +437 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +460 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +514 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +544 -0
- data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +367 -0
- data/lib/twilio-ruby/rest/preview/proxy/service.rb +508 -0
- data/lib/twilio-ruby/rest/preview/proxy.rb +41 -0
- data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +403 -0
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +453 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +438 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +403 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +446 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +440 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +403 -0
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +446 -0
- data/lib/twilio-ruby/rest/preview/sync/service.rb +512 -0
- data/lib/twilio-ruby/rest/preview/sync.rb +41 -0
- data/lib/twilio-ruby/rest/preview/wireless/command.rb +390 -0
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +443 -0
- data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +244 -0
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +552 -0
- data/lib/twilio-ruby/rest/preview/wireless.rb +71 -0
- data/lib/twilio-ruby/rest/preview.rb +145 -0
- data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +11 -11
- data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +11 -11
- data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +11 -11
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +403 -0
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +453 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +438 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +403 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +446 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +440 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +403 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +446 -0
- data/lib/twilio-ruby/rest/sync/v1/service.rb +512 -0
- data/lib/twilio-ruby/rest/sync/v1.rb +41 -0
- data/lib/twilio-ruby/rest/sync.rb +44 -0
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +143 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +143 -13
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +11 -11
- data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +11 -11
- data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +11 -11
- data/lib/twilio-ruby/rest/video/v1/recording.rb +11 -11
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +11 -11
- data/lib/twilio-ruby/rest/video/v1/room.rb +11 -11
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +375 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +460 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +241 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +556 -0
- data/lib/twilio-ruby/rest/wireless/v1.rb +71 -0
- data/lib/twilio-ruby/rest/wireless.rb +60 -0
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/integration/api/v2010/account/call/recording_spec.rb +0 -2
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +135 -0
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +223 -0
- data/spec/integration/api/v2010/account/recording_spec.rb +0 -2
- data/spec/integration/fax/v1/fax/fax_media_spec.rb +126 -0
- data/spec/integration/fax/v1/fax_spec.rb +272 -0
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +170 -0
- data/spec/integration/messaging/v1/service/phone_number_spec.rb +201 -0
- data/spec/integration/messaging/v1/service/short_code_spec.rb +173 -0
- data/spec/integration/messaging/v1/service_spec.rb +263 -0
- data/spec/integration/notify/v1/credential_spec.rb +223 -0
- data/spec/integration/notify/v1/service/binding_spec.rb +227 -0
- data/spec/integration/notify/v1/service/notification_spec.rb +97 -0
- data/spec/integration/notify/v1/service/segment_spec.rb +84 -0
- data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +118 -0
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +269 -0
- data/spec/integration/notify/v1/service/user_spec.rb +213 -0
- data/spec/integration/notify/v1/service_spec.rb +280 -0
- data/spec/integration/preview/bulk_exports/export/day_spec.rb +56 -0
- data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +79 -0
- data/spec/integration/preview/bulk_exports/export_spec.rb +43 -0
- data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +280 -0
- data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +121 -0
- data/spec/integration/preview/marketplace/available_add_on_spec.rb +142 -0
- data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +164 -0
- data/spec/integration/preview/marketplace/installed_add_on_spec.rb +252 -0
- data/spec/integration/preview/proxy/service/phone_number_spec.rb +173 -0
- data/spec/integration/preview/proxy/service/session/interaction_spec.rb +104 -0
- data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +164 -0
- data/spec/integration/preview/proxy/service/session/participant_spec.rb +226 -0
- data/spec/integration/preview/proxy/service/session_spec.rb +216 -0
- data/spec/integration/preview/proxy/service/short_code_spec.rb +173 -0
- data/spec/integration/preview/proxy/service_spec.rb +200 -0
- data/spec/integration/preview/sync/service/document/document_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/document_spec.rb +254 -0
- data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +256 -0
- data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/sync_list_spec.rb +207 -0
- data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +257 -0
- data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +206 -0
- data/spec/integration/preview/sync/service/sync_map_spec.rb +207 -0
- data/spec/integration/preview/sync/service_spec.rb +244 -0
- data/spec/integration/preview/wireless/command_spec.rb +169 -0
- data/spec/integration/preview/wireless/rate_plan_spec.rb +260 -0
- data/spec/integration/preview/wireless/sim/usage_spec.rb +49 -0
- data/spec/integration/preview/wireless/sim_spec.rb +208 -0
- data/spec/integration/sync/v1/service/document/document_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/document_spec.rb +254 -0
- data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +256 -0
- data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/sync_list_spec.rb +207 -0
- data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +257 -0
- data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/sync_map_spec.rb +207 -0
- data/spec/integration/sync/v1/service_spec.rb +244 -0
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +5 -5
- data/spec/integration/wireless/v1/command_spec.rb +166 -0
- data/spec/integration/wireless/v1/rate_plan_spec.rb +268 -0
- data/spec/integration/wireless/v1/sim/usage_record_spec.rb +65 -0
- data/spec/integration/wireless/v1/sim_spec.rb +208 -0
- data/twilio-ruby.gemspec +1 -3
- metadata +192 -2
@@ -0,0 +1,241 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Wireless < Domain
|
10
|
+
class V1 < Version
|
11
|
+
class SimContext < InstanceContext
|
12
|
+
##
|
13
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
14
|
+
class UsageRecordList < ListResource
|
15
|
+
##
|
16
|
+
# Initialize the UsageRecordList
|
17
|
+
# @param [Version] version Version that contains the resource
|
18
|
+
# @param [String] sim_sid The sim_sid
|
19
|
+
# @return [UsageRecordList] UsageRecordList
|
20
|
+
def initialize(version, sim_sid: nil)
|
21
|
+
super(version)
|
22
|
+
|
23
|
+
# Path Solution
|
24
|
+
@solution = {
|
25
|
+
sim_sid: sim_sid
|
26
|
+
}
|
27
|
+
@uri = "/Sims/#{@solution[:sim_sid]}/UsageRecords"
|
28
|
+
end
|
29
|
+
|
30
|
+
##
|
31
|
+
# Lists UsageRecordInstance records from the API as a list.
|
32
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
33
|
+
# memory before returning.
|
34
|
+
# @param [Time] end_ The end
|
35
|
+
# @param [Time] start The start
|
36
|
+
# @param [usage_record.Granularity] granularity The granularity
|
37
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
38
|
+
# guarantees to never return more than limit. Default is no limit
|
39
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
40
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
41
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
42
|
+
# efficient page size, i.e. min(limit, 1000)
|
43
|
+
# @return [Array] Array of up to limit results
|
44
|
+
def list(end_: :unset, start: :unset, granularity: :unset, limit: nil, page_size: nil)
|
45
|
+
self.stream(
|
46
|
+
end_: end_,
|
47
|
+
start: start,
|
48
|
+
granularity: granularity,
|
49
|
+
limit: limit,
|
50
|
+
page_size: page_size
|
51
|
+
).entries
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Streams UsageRecordInstance records from the API as an Enumerable.
|
56
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
57
|
+
# is reached.
|
58
|
+
# @param [Time] end_ The end
|
59
|
+
# @param [Time] start The start
|
60
|
+
# @param [usage_record.Granularity] granularity The granularity
|
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(end_: :unset, start: :unset, granularity: :unset, limit: nil, page_size: nil)
|
69
|
+
limits = @version.read_limits(limit, page_size)
|
70
|
+
|
71
|
+
page = self.page(
|
72
|
+
end_: end_,
|
73
|
+
start: start,
|
74
|
+
granularity: granularity,
|
75
|
+
page_size: limits[:page_size],
|
76
|
+
)
|
77
|
+
|
78
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
79
|
+
end
|
80
|
+
|
81
|
+
##
|
82
|
+
# When passed a block, yields UsageRecordInstance records from the API.
|
83
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
84
|
+
# is reached.
|
85
|
+
def each
|
86
|
+
limits = @version.read_limits
|
87
|
+
|
88
|
+
page = self.page(
|
89
|
+
page_size: limits[:page_size],
|
90
|
+
)
|
91
|
+
|
92
|
+
@version.stream(page,
|
93
|
+
limit: limits[:limit],
|
94
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
95
|
+
end
|
96
|
+
|
97
|
+
##
|
98
|
+
# Retrieve a single page of UsageRecordInstance records from the API.
|
99
|
+
# Request is executed immediately.
|
100
|
+
# @param [Time] end_ The end
|
101
|
+
# @param [Time] start The start
|
102
|
+
# @param [usage_record.Granularity] granularity The granularity
|
103
|
+
# @param [String] page_token PageToken provided by the API
|
104
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
105
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
106
|
+
# @return [Page] Page of UsageRecordInstance
|
107
|
+
def page(end_: :unset, start: :unset, granularity: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
108
|
+
params = Twilio::Values.of({
|
109
|
+
'End' => Twilio.serialize_iso8601_datetime(end_),
|
110
|
+
'Start' => Twilio.serialize_iso8601_datetime(start),
|
111
|
+
'Granularity' => granularity,
|
112
|
+
'PageToken' => page_token,
|
113
|
+
'Page' => page_number,
|
114
|
+
'PageSize' => page_size,
|
115
|
+
})
|
116
|
+
response = @version.page(
|
117
|
+
'GET',
|
118
|
+
@uri,
|
119
|
+
params
|
120
|
+
)
|
121
|
+
UsageRecordPage.new(@version, response, @solution)
|
122
|
+
end
|
123
|
+
|
124
|
+
##
|
125
|
+
# Retrieve a single page of UsageRecordInstance records from the API.
|
126
|
+
# Request is executed immediately.
|
127
|
+
# @param [String] target_url API-generated URL for the requested results page
|
128
|
+
# @return [Page] Page of UsageRecordInstance
|
129
|
+
def get_page(target_url)
|
130
|
+
response = @version.domain.request(
|
131
|
+
'GET',
|
132
|
+
target_url
|
133
|
+
)
|
134
|
+
UsageRecordPage.new(@version, response, @solution)
|
135
|
+
end
|
136
|
+
|
137
|
+
##
|
138
|
+
# Provide a user friendly representation
|
139
|
+
def to_s
|
140
|
+
'#<Twilio.Wireless.V1.UsageRecordList>'
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
146
|
+
class UsageRecordPage < Page
|
147
|
+
##
|
148
|
+
# Initialize the UsageRecordPage
|
149
|
+
# @param [Version] version Version that contains the resource
|
150
|
+
# @param [Response] response Response from the API
|
151
|
+
# @param [Hash] solution Path solution for the resource
|
152
|
+
# @return [UsageRecordPage] UsageRecordPage
|
153
|
+
def initialize(version, response, solution)
|
154
|
+
super(version, response)
|
155
|
+
|
156
|
+
# Path Solution
|
157
|
+
@solution = solution
|
158
|
+
end
|
159
|
+
|
160
|
+
##
|
161
|
+
# Build an instance of UsageRecordInstance
|
162
|
+
# @param [Hash] payload Payload response from the API
|
163
|
+
# @return [UsageRecordInstance] UsageRecordInstance
|
164
|
+
def get_instance(payload)
|
165
|
+
UsageRecordInstance.new(
|
166
|
+
@version,
|
167
|
+
payload,
|
168
|
+
sim_sid: @solution[:sim_sid],
|
169
|
+
)
|
170
|
+
end
|
171
|
+
|
172
|
+
##
|
173
|
+
# Provide a user friendly representation
|
174
|
+
def to_s
|
175
|
+
'<Twilio.Wireless.V1.UsageRecordPage>'
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
##
|
180
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
181
|
+
class UsageRecordInstance < InstanceResource
|
182
|
+
##
|
183
|
+
# Initialize the UsageRecordInstance
|
184
|
+
# @param [Version] version Version that contains the resource
|
185
|
+
# @param [Hash] payload payload that contains response from Twilio
|
186
|
+
# @param [String] sim_sid The sim_sid
|
187
|
+
# @return [UsageRecordInstance] UsageRecordInstance
|
188
|
+
def initialize(version, payload, sim_sid: nil)
|
189
|
+
super(version)
|
190
|
+
|
191
|
+
# Marshaled Properties
|
192
|
+
@properties = {
|
193
|
+
'sim_sid' => payload['sim_sid'],
|
194
|
+
'account_sid' => payload['account_sid'],
|
195
|
+
'period' => payload['period'],
|
196
|
+
'commands' => payload['commands'],
|
197
|
+
'data' => payload['data'],
|
198
|
+
}
|
199
|
+
end
|
200
|
+
|
201
|
+
##
|
202
|
+
# @return [String] The sim_sid
|
203
|
+
def sim_sid
|
204
|
+
@properties['sim_sid']
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# @return [String] The account_sid
|
209
|
+
def account_sid
|
210
|
+
@properties['account_sid']
|
211
|
+
end
|
212
|
+
|
213
|
+
##
|
214
|
+
# @return [Hash] The period
|
215
|
+
def period
|
216
|
+
@properties['period']
|
217
|
+
end
|
218
|
+
|
219
|
+
##
|
220
|
+
# @return [Hash] The commands
|
221
|
+
def commands
|
222
|
+
@properties['commands']
|
223
|
+
end
|
224
|
+
|
225
|
+
##
|
226
|
+
# @return [Hash] The data
|
227
|
+
def data
|
228
|
+
@properties['data']
|
229
|
+
end
|
230
|
+
|
231
|
+
##
|
232
|
+
# Provide a user friendly representation
|
233
|
+
def to_s
|
234
|
+
"<Twilio.Wireless.V1.UsageRecordInstance>"
|
235
|
+
end
|
236
|
+
end
|
237
|
+
end
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
@@ -0,0 +1,556 @@
|
|
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 SimList < ListResource
|
14
|
+
##
|
15
|
+
# Initialize the SimList
|
16
|
+
# @param [Version] version Version that contains the resource
|
17
|
+
# @return [SimList] SimList
|
18
|
+
def initialize(version)
|
19
|
+
super(version)
|
20
|
+
|
21
|
+
# Path Solution
|
22
|
+
@solution = {}
|
23
|
+
@uri = "/Sims"
|
24
|
+
end
|
25
|
+
|
26
|
+
##
|
27
|
+
# Lists SimInstance 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 [sim.Status] status The status
|
31
|
+
# @param [String] iccid The iccid
|
32
|
+
# @param [String] rate_plan The rate_plan
|
33
|
+
# @param [String] e_id The e_id
|
34
|
+
# @param [String] sim_registration_code The sim_registration_code
|
35
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
36
|
+
# guarantees to never return more than limit. Default is no limit
|
37
|
+
# @param [Integer] page_size Number of records to fetch per request, when
|
38
|
+
# not set will use the default value of 50 records. If no page_size is defined
|
39
|
+
# but a limit is defined, stream() will attempt to read the limit with the most
|
40
|
+
# efficient page size, i.e. min(limit, 1000)
|
41
|
+
# @return [Array] Array of up to limit results
|
42
|
+
def list(status: :unset, iccid: :unset, rate_plan: :unset, e_id: :unset, sim_registration_code: :unset, limit: nil, page_size: nil)
|
43
|
+
self.stream(
|
44
|
+
status: status,
|
45
|
+
iccid: iccid,
|
46
|
+
rate_plan: rate_plan,
|
47
|
+
e_id: e_id,
|
48
|
+
sim_registration_code: sim_registration_code,
|
49
|
+
limit: limit,
|
50
|
+
page_size: page_size
|
51
|
+
).entries
|
52
|
+
end
|
53
|
+
|
54
|
+
##
|
55
|
+
# Streams SimInstance records from the API as an Enumerable.
|
56
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
57
|
+
# is reached.
|
58
|
+
# @param [sim.Status] status The status
|
59
|
+
# @param [String] iccid The iccid
|
60
|
+
# @param [String] rate_plan The rate_plan
|
61
|
+
# @param [String] e_id The e_id
|
62
|
+
# @param [String] sim_registration_code The sim_registration_code
|
63
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
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
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
70
|
+
def stream(status: :unset, iccid: :unset, rate_plan: :unset, e_id: :unset, sim_registration_code: :unset, limit: nil, page_size: nil)
|
71
|
+
limits = @version.read_limits(limit, page_size)
|
72
|
+
|
73
|
+
page = self.page(
|
74
|
+
status: status,
|
75
|
+
iccid: iccid,
|
76
|
+
rate_plan: rate_plan,
|
77
|
+
e_id: e_id,
|
78
|
+
sim_registration_code: sim_registration_code,
|
79
|
+
page_size: limits[:page_size],
|
80
|
+
)
|
81
|
+
|
82
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
83
|
+
end
|
84
|
+
|
85
|
+
##
|
86
|
+
# When passed a block, yields SimInstance records from the API.
|
87
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
88
|
+
# is reached.
|
89
|
+
def each
|
90
|
+
limits = @version.read_limits
|
91
|
+
|
92
|
+
page = self.page(
|
93
|
+
page_size: limits[:page_size],
|
94
|
+
)
|
95
|
+
|
96
|
+
@version.stream(page,
|
97
|
+
limit: limits[:limit],
|
98
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
99
|
+
end
|
100
|
+
|
101
|
+
##
|
102
|
+
# Retrieve a single page of SimInstance records from the API.
|
103
|
+
# Request is executed immediately.
|
104
|
+
# @param [sim.Status] status The status
|
105
|
+
# @param [String] iccid The iccid
|
106
|
+
# @param [String] rate_plan The rate_plan
|
107
|
+
# @param [String] e_id The e_id
|
108
|
+
# @param [String] sim_registration_code The sim_registration_code
|
109
|
+
# @param [String] page_token PageToken provided by the API
|
110
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
111
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
112
|
+
# @return [Page] Page of SimInstance
|
113
|
+
def page(status: :unset, iccid: :unset, rate_plan: :unset, e_id: :unset, sim_registration_code: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
|
114
|
+
params = Twilio::Values.of({
|
115
|
+
'Status' => status,
|
116
|
+
'Iccid' => iccid,
|
117
|
+
'RatePlan' => rate_plan,
|
118
|
+
'EId' => e_id,
|
119
|
+
'SimRegistrationCode' => sim_registration_code,
|
120
|
+
'PageToken' => page_token,
|
121
|
+
'Page' => page_number,
|
122
|
+
'PageSize' => page_size,
|
123
|
+
})
|
124
|
+
response = @version.page(
|
125
|
+
'GET',
|
126
|
+
@uri,
|
127
|
+
params
|
128
|
+
)
|
129
|
+
SimPage.new(@version, response, @solution)
|
130
|
+
end
|
131
|
+
|
132
|
+
##
|
133
|
+
# Retrieve a single page of SimInstance records from the API.
|
134
|
+
# Request is executed immediately.
|
135
|
+
# @param [String] target_url API-generated URL for the requested results page
|
136
|
+
# @return [Page] Page of SimInstance
|
137
|
+
def get_page(target_url)
|
138
|
+
response = @version.domain.request(
|
139
|
+
'GET',
|
140
|
+
target_url
|
141
|
+
)
|
142
|
+
SimPage.new(@version, response, @solution)
|
143
|
+
end
|
144
|
+
|
145
|
+
##
|
146
|
+
# Provide a user friendly representation
|
147
|
+
def to_s
|
148
|
+
'#<Twilio.Wireless.V1.SimList>'
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
##
|
153
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
154
|
+
class SimPage < Page
|
155
|
+
##
|
156
|
+
# Initialize the SimPage
|
157
|
+
# @param [Version] version Version that contains the resource
|
158
|
+
# @param [Response] response Response from the API
|
159
|
+
# @param [Hash] solution Path solution for the resource
|
160
|
+
# @return [SimPage] SimPage
|
161
|
+
def initialize(version, response, solution)
|
162
|
+
super(version, response)
|
163
|
+
|
164
|
+
# Path Solution
|
165
|
+
@solution = solution
|
166
|
+
end
|
167
|
+
|
168
|
+
##
|
169
|
+
# Build an instance of SimInstance
|
170
|
+
# @param [Hash] payload Payload response from the API
|
171
|
+
# @return [SimInstance] SimInstance
|
172
|
+
def get_instance(payload)
|
173
|
+
SimInstance.new(
|
174
|
+
@version,
|
175
|
+
payload,
|
176
|
+
)
|
177
|
+
end
|
178
|
+
|
179
|
+
##
|
180
|
+
# Provide a user friendly representation
|
181
|
+
def to_s
|
182
|
+
'<Twilio.Wireless.V1.SimPage>'
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
##
|
187
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
188
|
+
class SimContext < InstanceContext
|
189
|
+
##
|
190
|
+
# Initialize the SimContext
|
191
|
+
# @param [Version] version Version that contains the resource
|
192
|
+
# @param [String] sid The sid
|
193
|
+
# @return [SimContext] SimContext
|
194
|
+
def initialize(version, sid)
|
195
|
+
super(version)
|
196
|
+
|
197
|
+
# Path Solution
|
198
|
+
@solution = {
|
199
|
+
sid: sid,
|
200
|
+
}
|
201
|
+
@uri = "/Sims/#{@solution[:sid]}"
|
202
|
+
|
203
|
+
# Dependents
|
204
|
+
@usage_records = nil
|
205
|
+
end
|
206
|
+
|
207
|
+
##
|
208
|
+
# Fetch a SimInstance
|
209
|
+
# @return [SimInstance] Fetched SimInstance
|
210
|
+
def fetch
|
211
|
+
params = Twilio::Values.of({})
|
212
|
+
|
213
|
+
payload = @version.fetch(
|
214
|
+
'GET',
|
215
|
+
@uri,
|
216
|
+
params,
|
217
|
+
)
|
218
|
+
|
219
|
+
SimInstance.new(
|
220
|
+
@version,
|
221
|
+
payload,
|
222
|
+
sid: @solution[:sid],
|
223
|
+
)
|
224
|
+
end
|
225
|
+
|
226
|
+
##
|
227
|
+
# Update the SimInstance
|
228
|
+
# @param [String] unique_name The unique_name
|
229
|
+
# @param [String] callback_method The callback_method
|
230
|
+
# @param [String] callback_url The callback_url
|
231
|
+
# @param [String] friendly_name The friendly_name
|
232
|
+
# @param [String] rate_plan The rate_plan
|
233
|
+
# @param [sim.Status] status The status
|
234
|
+
# @param [String] commands_callback_method The commands_callback_method
|
235
|
+
# @param [String] commands_callback_url The commands_callback_url
|
236
|
+
# @param [String] sms_fallback_method The sms_fallback_method
|
237
|
+
# @param [String] sms_fallback_url The sms_fallback_url
|
238
|
+
# @param [String] sms_method The sms_method
|
239
|
+
# @param [String] sms_url The sms_url
|
240
|
+
# @param [String] voice_fallback_method The voice_fallback_method
|
241
|
+
# @param [String] voice_fallback_url The voice_fallback_url
|
242
|
+
# @param [String] voice_method The voice_method
|
243
|
+
# @param [String] voice_url The voice_url
|
244
|
+
# @return [SimInstance] Updated SimInstance
|
245
|
+
def update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset)
|
246
|
+
data = Twilio::Values.of({
|
247
|
+
'UniqueName' => unique_name,
|
248
|
+
'CallbackMethod' => callback_method,
|
249
|
+
'CallbackUrl' => callback_url,
|
250
|
+
'FriendlyName' => friendly_name,
|
251
|
+
'RatePlan' => rate_plan,
|
252
|
+
'Status' => status,
|
253
|
+
'CommandsCallbackMethod' => commands_callback_method,
|
254
|
+
'CommandsCallbackUrl' => commands_callback_url,
|
255
|
+
'SmsFallbackMethod' => sms_fallback_method,
|
256
|
+
'SmsFallbackUrl' => sms_fallback_url,
|
257
|
+
'SmsMethod' => sms_method,
|
258
|
+
'SmsUrl' => sms_url,
|
259
|
+
'VoiceFallbackMethod' => voice_fallback_method,
|
260
|
+
'VoiceFallbackUrl' => voice_fallback_url,
|
261
|
+
'VoiceMethod' => voice_method,
|
262
|
+
'VoiceUrl' => voice_url,
|
263
|
+
})
|
264
|
+
|
265
|
+
payload = @version.update(
|
266
|
+
'POST',
|
267
|
+
@uri,
|
268
|
+
data: data,
|
269
|
+
)
|
270
|
+
|
271
|
+
SimInstance.new(
|
272
|
+
@version,
|
273
|
+
payload,
|
274
|
+
sid: @solution[:sid],
|
275
|
+
)
|
276
|
+
end
|
277
|
+
|
278
|
+
##
|
279
|
+
# Access the usage_records
|
280
|
+
# @return [UsageRecordList]
|
281
|
+
# @return [UsageRecordContext]
|
282
|
+
def usage_records
|
283
|
+
unless @usage_records
|
284
|
+
@usage_records = UsageRecordList.new(
|
285
|
+
@version,
|
286
|
+
sim_sid: @solution[:sid],
|
287
|
+
)
|
288
|
+
end
|
289
|
+
|
290
|
+
@usage_records
|
291
|
+
end
|
292
|
+
|
293
|
+
##
|
294
|
+
# Provide a user friendly representation
|
295
|
+
def to_s
|
296
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
297
|
+
"#<Twilio.Wireless.V1.SimContext #{context}>"
|
298
|
+
end
|
299
|
+
end
|
300
|
+
|
301
|
+
##
|
302
|
+
# PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
|
303
|
+
class SimInstance < InstanceResource
|
304
|
+
##
|
305
|
+
# Initialize the SimInstance
|
306
|
+
# @param [Version] version Version that contains the resource
|
307
|
+
# @param [Hash] payload payload that contains response from Twilio
|
308
|
+
# @param [String] sid The sid
|
309
|
+
# @return [SimInstance] SimInstance
|
310
|
+
def initialize(version, payload, sid: nil)
|
311
|
+
super(version)
|
312
|
+
|
313
|
+
# Marshaled Properties
|
314
|
+
@properties = {
|
315
|
+
'sid' => payload['sid'],
|
316
|
+
'unique_name' => payload['unique_name'],
|
317
|
+
'account_sid' => payload['account_sid'],
|
318
|
+
'rate_plan_sid' => payload['rate_plan_sid'],
|
319
|
+
'friendly_name' => payload['friendly_name'],
|
320
|
+
'iccid' => payload['iccid'],
|
321
|
+
'e_id' => payload['e_id'],
|
322
|
+
'status' => payload['status'],
|
323
|
+
'commands_callback_url' => payload['commands_callback_url'],
|
324
|
+
'commands_callback_method' => payload['commands_callback_method'],
|
325
|
+
'sms_fallback_method' => payload['sms_fallback_method'],
|
326
|
+
'sms_fallback_url' => payload['sms_fallback_url'],
|
327
|
+
'sms_method' => payload['sms_method'],
|
328
|
+
'sms_url' => payload['sms_url'],
|
329
|
+
'voice_fallback_method' => payload['voice_fallback_method'],
|
330
|
+
'voice_fallback_url' => payload['voice_fallback_url'],
|
331
|
+
'voice_method' => payload['voice_method'],
|
332
|
+
'voice_url' => payload['voice_url'],
|
333
|
+
'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
|
334
|
+
'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
|
335
|
+
'url' => payload['url'],
|
336
|
+
'links' => payload['links'],
|
337
|
+
}
|
338
|
+
|
339
|
+
# Context
|
340
|
+
@instance_context = nil
|
341
|
+
@params = {
|
342
|
+
'sid' => sid || @properties['sid'],
|
343
|
+
}
|
344
|
+
end
|
345
|
+
|
346
|
+
##
|
347
|
+
# Generate an instance context for the instance, the context is capable of
|
348
|
+
# performing various actions. All instance actions are proxied to the context
|
349
|
+
# @return [SimContext] SimContext for this SimInstance
|
350
|
+
def context
|
351
|
+
unless @instance_context
|
352
|
+
@instance_context = SimContext.new(
|
353
|
+
@version,
|
354
|
+
@params['sid'],
|
355
|
+
)
|
356
|
+
end
|
357
|
+
@instance_context
|
358
|
+
end
|
359
|
+
|
360
|
+
##
|
361
|
+
# @return [String] The sid
|
362
|
+
def sid
|
363
|
+
@properties['sid']
|
364
|
+
end
|
365
|
+
|
366
|
+
##
|
367
|
+
# @return [String] The unique_name
|
368
|
+
def unique_name
|
369
|
+
@properties['unique_name']
|
370
|
+
end
|
371
|
+
|
372
|
+
##
|
373
|
+
# @return [String] The account_sid
|
374
|
+
def account_sid
|
375
|
+
@properties['account_sid']
|
376
|
+
end
|
377
|
+
|
378
|
+
##
|
379
|
+
# @return [String] The rate_plan_sid
|
380
|
+
def rate_plan_sid
|
381
|
+
@properties['rate_plan_sid']
|
382
|
+
end
|
383
|
+
|
384
|
+
##
|
385
|
+
# @return [String] The friendly_name
|
386
|
+
def friendly_name
|
387
|
+
@properties['friendly_name']
|
388
|
+
end
|
389
|
+
|
390
|
+
##
|
391
|
+
# @return [String] The iccid
|
392
|
+
def iccid
|
393
|
+
@properties['iccid']
|
394
|
+
end
|
395
|
+
|
396
|
+
##
|
397
|
+
# @return [String] The e_id
|
398
|
+
def e_id
|
399
|
+
@properties['e_id']
|
400
|
+
end
|
401
|
+
|
402
|
+
##
|
403
|
+
# @return [sim.Status] The status
|
404
|
+
def status
|
405
|
+
@properties['status']
|
406
|
+
end
|
407
|
+
|
408
|
+
##
|
409
|
+
# @return [String] The commands_callback_url
|
410
|
+
def commands_callback_url
|
411
|
+
@properties['commands_callback_url']
|
412
|
+
end
|
413
|
+
|
414
|
+
##
|
415
|
+
# @return [String] The commands_callback_method
|
416
|
+
def commands_callback_method
|
417
|
+
@properties['commands_callback_method']
|
418
|
+
end
|
419
|
+
|
420
|
+
##
|
421
|
+
# @return [String] The sms_fallback_method
|
422
|
+
def sms_fallback_method
|
423
|
+
@properties['sms_fallback_method']
|
424
|
+
end
|
425
|
+
|
426
|
+
##
|
427
|
+
# @return [String] The sms_fallback_url
|
428
|
+
def sms_fallback_url
|
429
|
+
@properties['sms_fallback_url']
|
430
|
+
end
|
431
|
+
|
432
|
+
##
|
433
|
+
# @return [String] The sms_method
|
434
|
+
def sms_method
|
435
|
+
@properties['sms_method']
|
436
|
+
end
|
437
|
+
|
438
|
+
##
|
439
|
+
# @return [String] The sms_url
|
440
|
+
def sms_url
|
441
|
+
@properties['sms_url']
|
442
|
+
end
|
443
|
+
|
444
|
+
##
|
445
|
+
# @return [String] The voice_fallback_method
|
446
|
+
def voice_fallback_method
|
447
|
+
@properties['voice_fallback_method']
|
448
|
+
end
|
449
|
+
|
450
|
+
##
|
451
|
+
# @return [String] The voice_fallback_url
|
452
|
+
def voice_fallback_url
|
453
|
+
@properties['voice_fallback_url']
|
454
|
+
end
|
455
|
+
|
456
|
+
##
|
457
|
+
# @return [String] The voice_method
|
458
|
+
def voice_method
|
459
|
+
@properties['voice_method']
|
460
|
+
end
|
461
|
+
|
462
|
+
##
|
463
|
+
# @return [String] The voice_url
|
464
|
+
def voice_url
|
465
|
+
@properties['voice_url']
|
466
|
+
end
|
467
|
+
|
468
|
+
##
|
469
|
+
# @return [Time] The date_created
|
470
|
+
def date_created
|
471
|
+
@properties['date_created']
|
472
|
+
end
|
473
|
+
|
474
|
+
##
|
475
|
+
# @return [Time] The date_updated
|
476
|
+
def date_updated
|
477
|
+
@properties['date_updated']
|
478
|
+
end
|
479
|
+
|
480
|
+
##
|
481
|
+
# @return [String] The url
|
482
|
+
def url
|
483
|
+
@properties['url']
|
484
|
+
end
|
485
|
+
|
486
|
+
##
|
487
|
+
# @return [String] The links
|
488
|
+
def links
|
489
|
+
@properties['links']
|
490
|
+
end
|
491
|
+
|
492
|
+
##
|
493
|
+
# Fetch a SimInstance
|
494
|
+
# @return [SimInstance] Fetched SimInstance
|
495
|
+
def fetch
|
496
|
+
context.fetch
|
497
|
+
end
|
498
|
+
|
499
|
+
##
|
500
|
+
# Update the SimInstance
|
501
|
+
# @param [String] unique_name The unique_name
|
502
|
+
# @param [String] callback_method The callback_method
|
503
|
+
# @param [String] callback_url The callback_url
|
504
|
+
# @param [String] friendly_name The friendly_name
|
505
|
+
# @param [String] rate_plan The rate_plan
|
506
|
+
# @param [sim.Status] status The status
|
507
|
+
# @param [String] commands_callback_method The commands_callback_method
|
508
|
+
# @param [String] commands_callback_url The commands_callback_url
|
509
|
+
# @param [String] sms_fallback_method The sms_fallback_method
|
510
|
+
# @param [String] sms_fallback_url The sms_fallback_url
|
511
|
+
# @param [String] sms_method The sms_method
|
512
|
+
# @param [String] sms_url The sms_url
|
513
|
+
# @param [String] voice_fallback_method The voice_fallback_method
|
514
|
+
# @param [String] voice_fallback_url The voice_fallback_url
|
515
|
+
# @param [String] voice_method The voice_method
|
516
|
+
# @param [String] voice_url The voice_url
|
517
|
+
# @return [SimInstance] Updated SimInstance
|
518
|
+
def update(unique_name: :unset, callback_method: :unset, callback_url: :unset, friendly_name: :unset, rate_plan: :unset, status: :unset, commands_callback_method: :unset, commands_callback_url: :unset, sms_fallback_method: :unset, sms_fallback_url: :unset, sms_method: :unset, sms_url: :unset, voice_fallback_method: :unset, voice_fallback_url: :unset, voice_method: :unset, voice_url: :unset)
|
519
|
+
context.update(
|
520
|
+
unique_name: unique_name,
|
521
|
+
callback_method: callback_method,
|
522
|
+
callback_url: callback_url,
|
523
|
+
friendly_name: friendly_name,
|
524
|
+
rate_plan: rate_plan,
|
525
|
+
status: status,
|
526
|
+
commands_callback_method: commands_callback_method,
|
527
|
+
commands_callback_url: commands_callback_url,
|
528
|
+
sms_fallback_method: sms_fallback_method,
|
529
|
+
sms_fallback_url: sms_fallback_url,
|
530
|
+
sms_method: sms_method,
|
531
|
+
sms_url: sms_url,
|
532
|
+
voice_fallback_method: voice_fallback_method,
|
533
|
+
voice_fallback_url: voice_fallback_url,
|
534
|
+
voice_method: voice_method,
|
535
|
+
voice_url: voice_url,
|
536
|
+
)
|
537
|
+
end
|
538
|
+
|
539
|
+
##
|
540
|
+
# Access the usage_records
|
541
|
+
# @return [usage_records] usage_records
|
542
|
+
def usage_records
|
543
|
+
context.usage_records
|
544
|
+
end
|
545
|
+
|
546
|
+
##
|
547
|
+
# Provide a user friendly representation
|
548
|
+
def to_s
|
549
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
550
|
+
"<Twilio.Wireless.V1.SimInstance #{values}>"
|
551
|
+
end
|
552
|
+
end
|
553
|
+
end
|
554
|
+
end
|
555
|
+
end
|
556
|
+
end
|