twilio-ruby 5.0.0.rc19 → 5.0.0.rc20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +8 -0
- data/README.md +2 -2
- data/VERSIONS.md +64 -0
- data/lib/twilio-ruby/framework/{exception.rb → error.rb} +3 -2
- data/lib/twilio-ruby/framework/page.rb +3 -3
- data/lib/twilio-ruby/framework/serialize.rb +9 -0
- data/lib/twilio-ruby/framework/version.rb +1 -1
- data/lib/twilio-ruby/http/http_client.rb +1 -0
- data/lib/twilio-ruby/jwt/access_token.rb +28 -0
- data/lib/twilio-ruby/rest/client.rb +64 -42
- data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +303 -0
- data/lib/twilio-ruby/rest/fax/v1/fax.rb +80 -6
- data/lib/twilio-ruby/rest/messaging/v1/service.rb +50 -3
- data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
- data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service/document.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +2 -2
- data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +2 -2
- data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +38 -17
- data/lib/twilio-ruby/rest/preview/wireless/sim.rb +74 -2
- data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +377 -0
- data/lib/twilio-ruby/rest/sync/v1/service/document.rb +415 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +409 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +377 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +407 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +411 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +377 -0
- data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +407 -0
- data/lib/twilio-ruby/rest/sync/v1/service.rb +469 -0
- data/lib/twilio-ruby/rest/sync/v1.rb +35 -0
- data/lib/twilio-ruby/rest/sync.rb +40 -0
- data/lib/twilio-ruby/rest/video/v1/room/recording.rb +324 -0
- data/lib/twilio-ruby/rest/video/v1/room.rb +37 -0
- data/lib/twilio-ruby/rest/wireless/v1/command.rb +344 -0
- data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +399 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +222 -0
- data/lib/twilio-ruby/rest/wireless/v1/sim.rb +502 -0
- data/lib/twilio-ruby/rest/wireless/v1.rb +53 -0
- data/lib/twilio-ruby/rest/wireless.rb +48 -0
- data/lib/twilio-ruby/security/request_validator.rb +19 -1
- data/lib/twilio-ruby/version.rb +1 -1
- data/spec/framework/serialize_spec.rb +20 -1
- data/spec/integration/accounts/v1/credential/public_key_spec.rb +5 -5
- data/spec/integration/api/v2010/account/address/dependent_phone_number_spec.rb +1 -1
- data/spec/integration/api/v2010/account/address_spec.rb +5 -5
- data/spec/integration/api/v2010/account/application_spec.rb +5 -5
- data/spec/integration/api/v2010/account/authorized_connect_app_spec.rb +2 -2
- data/spec/integration/api/v2010/account/available_phone_number/local_spec.rb +1 -1
- data/spec/integration/api/v2010/account/available_phone_number/mobile_spec.rb +1 -1
- data/spec/integration/api/v2010/account/available_phone_number/toll_free_spec.rb +1 -1
- data/spec/integration/api/v2010/account/available_phone_number_spec.rb +2 -2
- data/spec/integration/api/v2010/account/call/feedback_spec.rb +3 -3
- data/spec/integration/api/v2010/account/call/feedback_summary_spec.rb +3 -3
- data/spec/integration/api/v2010/account/call/notification_spec.rb +3 -3
- data/spec/integration/api/v2010/account/call/recording_spec.rb +3 -3
- data/spec/integration/api/v2010/account/call_spec.rb +5 -5
- data/spec/integration/api/v2010/account/conference/participant_spec.rb +5 -5
- data/spec/integration/api/v2010/account/conference_spec.rb +3 -3
- data/spec/integration/api/v2010/account/connect_app_spec.rb +3 -3
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +2 -2
- data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +4 -4
- data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +2 -2
- data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +2 -2
- data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +2 -2
- data/spec/integration/api/v2010/account/incoming_phone_number_spec.rb +5 -5
- data/spec/integration/api/v2010/account/key_spec.rb +4 -4
- data/spec/integration/api/v2010/account/message/feedback_spec.rb +1 -1
- data/spec/integration/api/v2010/account/message/media_spec.rb +3 -3
- data/spec/integration/api/v2010/account/message_spec.rb +5 -5
- data/spec/integration/api/v2010/account/new_key_spec.rb +1 -1
- data/spec/integration/api/v2010/account/new_signing_key_spec.rb +1 -1
- data/spec/integration/api/v2010/account/notification_spec.rb +3 -3
- data/spec/integration/api/v2010/account/outgoing_caller_id_spec.rb +4 -4
- data/spec/integration/api/v2010/account/queue/member_spec.rb +3 -3
- data/spec/integration/api/v2010/account/queue_spec.rb +5 -5
- data/spec/integration/api/v2010/account/recording/add_on_result/payload_spec.rb +3 -3
- data/spec/integration/api/v2010/account/recording/add_on_result_spec.rb +3 -3
- data/spec/integration/api/v2010/account/recording/transcription_spec.rb +3 -3
- data/spec/integration/api/v2010/account/recording_spec.rb +3 -3
- data/spec/integration/api/v2010/account/short_code_spec.rb +3 -3
- data/spec/integration/api/v2010/account/signing_key_spec.rb +4 -4
- data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +5 -5
- data/spec/integration/api/v2010/account/sip/credential_list_spec.rb +5 -5
- data/spec/integration/api/v2010/account/sip/domain/credential_list_mapping_spec.rb +4 -4
- data/spec/integration/api/v2010/account/sip/domain/ip_access_control_list_mapping_spec.rb +4 -4
- data/spec/integration/api/v2010/account/sip/domain_spec.rb +5 -5
- data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +5 -5
- data/spec/integration/api/v2010/account/sip/ip_access_control_list_spec.rb +5 -5
- data/spec/integration/api/v2010/account/token_spec.rb +1 -1
- data/spec/integration/api/v2010/account/transcription_spec.rb +3 -3
- data/spec/integration/api/v2010/account/usage/record/all_time_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/daily_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/last_month_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/monthly_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/this_month_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/today_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/yearly_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record/yesterday_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/record_spec.rb +1 -1
- data/spec/integration/api/v2010/account/usage/trigger_spec.rb +5 -5
- data/spec/integration/api/v2010/account/validation_request_spec.rb +1 -1
- data/spec/integration/api/v2010/account_spec.rb +4 -4
- data/spec/integration/chat/v1/credential_spec.rb +5 -5
- data/spec/integration/chat/v1/service/channel/invite_spec.rb +4 -4
- data/spec/integration/chat/v1/service/channel/member_spec.rb +5 -5
- data/spec/integration/chat/v1/service/channel/message_spec.rb +5 -5
- data/spec/integration/chat/v1/service/channel_spec.rb +5 -5
- data/spec/integration/chat/v1/service/role_spec.rb +5 -5
- data/spec/integration/chat/v1/service/user/user_channel_spec.rb +1 -1
- data/spec/integration/chat/v1/service/user_spec.rb +5 -5
- data/spec/integration/chat/v1/service_spec.rb +5 -5
- data/spec/integration/chat/v2/credential_spec.rb +5 -5
- data/spec/integration/chat/v2/service/channel/invite_spec.rb +4 -4
- data/spec/integration/chat/v2/service/channel/member_spec.rb +5 -5
- data/spec/integration/chat/v2/service/channel/message_spec.rb +5 -5
- data/spec/integration/chat/v2/service/channel_spec.rb +5 -5
- data/spec/integration/chat/v2/service/role_spec.rb +5 -5
- data/spec/integration/chat/v2/service/user/user_channel_spec.rb +1 -1
- data/spec/integration/chat/v2/service/user_spec.rb +5 -5
- data/spec/integration/chat/v2/service_spec.rb +5 -5
- data/spec/integration/fax/v1/fax/fax_media_spec.rb +126 -0
- data/spec/integration/fax/v1/fax_spec.rb +48 -7
- data/spec/integration/ip_messaging/v1/credential_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +4 -4
- data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service/channel_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service/role_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service/user/user_channel_spec.rb +1 -1
- data/spec/integration/ip_messaging/v1/service/user_spec.rb +5 -5
- data/spec/integration/ip_messaging/v1/service_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/credential_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +4 -4
- data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service/channel/message_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service/channel_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service/role_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service/user/user_channel_spec.rb +1 -1
- data/spec/integration/ip_messaging/v2/service/user_spec.rb +5 -5
- data/spec/integration/ip_messaging/v2/service_spec.rb +5 -5
- data/spec/integration/lookups/v1/phone_number_spec.rb +1 -1
- data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +4 -4
- data/spec/integration/messaging/v1/service/phone_number_spec.rb +4 -4
- data/spec/integration/messaging/v1/service/short_code_spec.rb +4 -4
- data/spec/integration/messaging/v1/service_spec.rb +21 -5
- data/spec/integration/monitor/v1/alert_spec.rb +3 -3
- data/spec/integration/monitor/v1/event_spec.rb +2 -2
- data/spec/integration/notify/v1/credential_spec.rb +5 -5
- data/spec/integration/notify/v1/service/binding_spec.rb +4 -4
- data/spec/integration/notify/v1/service/notification_spec.rb +1 -1
- data/spec/integration/notify/v1/service/segment_spec.rb +1 -1
- data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +3 -3
- data/spec/integration/notify/v1/service/user/user_binding_spec.rb +4 -4
- data/spec/integration/notify/v1/service/user_spec.rb +4 -4
- data/spec/integration/notify/v1/service_spec.rb +5 -5
- data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +2 -2
- data/spec/integration/preview/marketplace/available_add_on_spec.rb +2 -2
- data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +3 -3
- data/spec/integration/preview/marketplace/installed_add_on_spec.rb +5 -5
- data/spec/integration/preview/sync/service/document/document_permission_spec.rb +4 -4
- data/spec/integration/preview/sync/service/document_spec.rb +6 -6
- data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +7 -7
- data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +4 -4
- data/spec/integration/preview/sync/service/sync_list_spec.rb +4 -4
- data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +7 -7
- data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +4 -4
- data/spec/integration/preview/sync/service/sync_map_spec.rb +4 -4
- data/spec/integration/preview/sync/service_spec.rb +5 -5
- data/spec/integration/preview/wireless/command_spec.rb +3 -3
- data/spec/integration/preview/wireless/rate_plan_spec.rb +45 -45
- data/spec/integration/preview/wireless/sim/usage_spec.rb +1 -1
- data/spec/integration/preview/wireless/sim_spec.rb +27 -3
- data/spec/integration/pricing/v1/messaging/country_spec.rb +2 -2
- data/spec/integration/pricing/v1/phone_number/country_spec.rb +2 -2
- data/spec/integration/pricing/v1/voice/country_spec.rb +2 -2
- data/spec/integration/pricing/v1/voice/number_spec.rb +1 -1
- data/spec/integration/sync/v1/service/document/document_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/document_spec.rb +254 -0
- data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +256 -0
- data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/sync_list_spec.rb +207 -0
- data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +257 -0
- data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +206 -0
- data/spec/integration/sync/v1/service/sync_map_spec.rb +207 -0
- data/spec/integration/sync/v1/service_spec.rb +244 -0
- data/spec/integration/taskrouter/v1/workspace/activity_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/event_spec.rb +2 -2
- data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +3 -3
- data/spec/integration/taskrouter/v1/workspace/task_channel_spec.rb +2 -2
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queue_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/task_queue/task_queues_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/task_queue_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/task_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +3 -3
- data/spec/integration/taskrouter/v1/workspace/worker/worker_channel_spec.rb +3 -3
- data/spec/integration/taskrouter/v1/workspace/worker/worker_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/worker/workers_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/workflow/workflow_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +5 -5
- data/spec/integration/taskrouter/v1/workspace/workspace_statistics_spec.rb +1 -1
- data/spec/integration/taskrouter/v1/workspace_spec.rb +5 -5
- data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +4 -4
- data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +4 -4
- data/spec/integration/trunking/v1/trunk/origination_url_spec.rb +5 -5
- data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +4 -4
- data/spec/integration/trunking/v1/trunk_spec.rb +5 -5
- data/spec/integration/video/v1/recording_spec.rb +3 -3
- data/spec/integration/video/v1/room/recording_spec.rb +145 -0
- data/spec/integration/video/v1/room_spec.rb +20 -8
- data/spec/integration/wireless/v1/command_spec.rb +166 -0
- data/spec/integration/wireless/v1/rate_plan_spec.rb +260 -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 -1
- metadata +55 -5
@@ -0,0 +1,35 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Sync
|
10
|
+
class V1 < Version
|
11
|
+
##
|
12
|
+
# Initialize the V1 version of Sync
|
13
|
+
def initialize(domain)
|
14
|
+
super
|
15
|
+
@version = 'v1'
|
16
|
+
@services = nil
|
17
|
+
end
|
18
|
+
|
19
|
+
def services(sid=:unset)
|
20
|
+
if sid == :unset
|
21
|
+
@services ||= ServiceList.new self
|
22
|
+
else
|
23
|
+
ServiceContext.new(self, sid)
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
##
|
28
|
+
# Provide a user friendly representation
|
29
|
+
def to_s
|
30
|
+
'<Twilio::REST::Sync::V1>'
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Sync < Domain
|
10
|
+
##
|
11
|
+
# Initialize the Sync Domain
|
12
|
+
def initialize(twilio)
|
13
|
+
super
|
14
|
+
|
15
|
+
@base_url = 'https://sync.twilio.com'
|
16
|
+
@host = 'sync.twilio.com'
|
17
|
+
@port = 443
|
18
|
+
|
19
|
+
# Versions
|
20
|
+
@v1 = nil
|
21
|
+
end
|
22
|
+
|
23
|
+
##
|
24
|
+
# Version v1 of sync
|
25
|
+
def v1
|
26
|
+
@v1 ||= V1.new self
|
27
|
+
end
|
28
|
+
|
29
|
+
def services
|
30
|
+
self.v1.services
|
31
|
+
end
|
32
|
+
|
33
|
+
##
|
34
|
+
# Provide a user friendly representation
|
35
|
+
def to_s
|
36
|
+
'#<Twilio::REST::Sync>'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,324 @@
|
|
1
|
+
##
|
2
|
+
# This code was generated by
|
3
|
+
# \ / _ _ _| _ _
|
4
|
+
# | (_)\/(_)(_|\/| |(/_ v1.0.0
|
5
|
+
# / /
|
6
|
+
|
7
|
+
module Twilio
|
8
|
+
module REST
|
9
|
+
class Video < Domain
|
10
|
+
class V1 < Version
|
11
|
+
class RoomContext < InstanceContext
|
12
|
+
class RoomRecordingList < ListResource
|
13
|
+
##
|
14
|
+
# Initialize the RoomRecordingList
|
15
|
+
# @param [Version] version Version that contains the resource
|
16
|
+
# @param [String] room_sid The room_sid
|
17
|
+
# @return [RoomRecordingList] RoomRecordingList
|
18
|
+
def initialize(version, room_sid: nil)
|
19
|
+
super(version)
|
20
|
+
|
21
|
+
# Path Solution
|
22
|
+
@solution = {
|
23
|
+
room_sid: room_sid
|
24
|
+
}
|
25
|
+
@uri = "/Rooms/#{@solution[:room_sid]}/Recordings"
|
26
|
+
end
|
27
|
+
|
28
|
+
##
|
29
|
+
# Lists RoomRecordingInstance records from the API as a list.
|
30
|
+
# Unlike stream(), this operation is eager and will load `limit` records into
|
31
|
+
# memory before returning.
|
32
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
33
|
+
# guarantees to never return more than limit. Default is no limit
|
34
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
35
|
+
# the default value of 50 records. If no page_size is defined
|
36
|
+
# but a limit is defined, stream() will attempt to read the
|
37
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
38
|
+
# @return [Array] Array of up to limit results
|
39
|
+
def list(limit: nil, page_size: nil)
|
40
|
+
self.stream(
|
41
|
+
limit: limit,
|
42
|
+
page_size: page_size
|
43
|
+
).entries
|
44
|
+
end
|
45
|
+
|
46
|
+
##
|
47
|
+
# Streams RoomRecordingInstance records from the API as an Enumerable.
|
48
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
49
|
+
# is reached.
|
50
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
51
|
+
# guarantees to never return more than limit. Default is no limit
|
52
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
53
|
+
# the default value of 50 records. If no page_size is defined
|
54
|
+
# but a limit is defined, stream() will attempt to read the
|
55
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
56
|
+
# @return [Enumerable] Enumerable that will yield up to limit results
|
57
|
+
def stream(limit: nil, page_size: nil)
|
58
|
+
limits = @version.read_limits(limit, page_size)
|
59
|
+
|
60
|
+
page = self.page(
|
61
|
+
page_size: limits[:page_size],
|
62
|
+
)
|
63
|
+
|
64
|
+
@version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
|
65
|
+
end
|
66
|
+
|
67
|
+
##
|
68
|
+
# When passed a block, yields RoomRecordingInstance records from the API.
|
69
|
+
# This operation lazily loads records as efficiently as possible until the limit
|
70
|
+
# is reached.
|
71
|
+
# @param [Integer] limit Upper limit for the number of records to return. stream()
|
72
|
+
# guarantees to never return more than limit. Default is no limit
|
73
|
+
# @param [Integer] page_size Number of records to fetch per request, when not set will use
|
74
|
+
# the default value of 50 records. If no page_size is defined
|
75
|
+
# but a limit is defined, stream() will attempt to read the
|
76
|
+
# limit with the most efficient page size, i.e. min(limit, 1000)
|
77
|
+
def each
|
78
|
+
limits = @version.read_limits
|
79
|
+
|
80
|
+
page = self.page(
|
81
|
+
page_size: limits[:page_size],
|
82
|
+
)
|
83
|
+
|
84
|
+
@version.stream(page,
|
85
|
+
limit: limits[:limit],
|
86
|
+
page_limit: limits[:page_limit]).each {|x| yield x}
|
87
|
+
end
|
88
|
+
|
89
|
+
##
|
90
|
+
# Retrieve a single page of RoomRecordingInstance records from the API.
|
91
|
+
# Request is executed immediately.
|
92
|
+
# @param [String] page_token PageToken provided by the API
|
93
|
+
# @param [Integer] page_number Page Number, this value is simply for client state
|
94
|
+
# @param [Integer] page_size Number of records to return, defaults to 50
|
95
|
+
# @return [Page] Page of RoomRecordingInstance
|
96
|
+
def page(page_token: nil, page_number: nil, page_size: nil)
|
97
|
+
params = {
|
98
|
+
'PageToken' => page_token,
|
99
|
+
'Page' => page_number,
|
100
|
+
'PageSize' => page_size,
|
101
|
+
}
|
102
|
+
response = @version.page(
|
103
|
+
'GET',
|
104
|
+
@uri,
|
105
|
+
params
|
106
|
+
)
|
107
|
+
return RoomRecordingPage.new(@version, response, @solution)
|
108
|
+
end
|
109
|
+
|
110
|
+
##
|
111
|
+
# Provide a user friendly representation
|
112
|
+
def to_s
|
113
|
+
'#<Twilio.Video.V1.RoomRecordingList>'
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
class RoomRecordingPage < Page
|
118
|
+
##
|
119
|
+
# Initialize the RoomRecordingPage
|
120
|
+
# @param [Version] version Version that contains the resource
|
121
|
+
# @param [Response] response Response from the API
|
122
|
+
# @param [Hash] solution Path solution for the resource
|
123
|
+
# @param [String] room_sid The room_sid
|
124
|
+
# @return [RoomRecordingPage] RoomRecordingPage
|
125
|
+
def initialize(version, response, solution)
|
126
|
+
super(version, response)
|
127
|
+
|
128
|
+
# Path Solution
|
129
|
+
@solution = solution
|
130
|
+
end
|
131
|
+
|
132
|
+
##
|
133
|
+
# Build an instance of RoomRecordingInstance
|
134
|
+
# @param [Hash] payload Payload response from the API
|
135
|
+
# @return [RoomRecordingInstance] RoomRecordingInstance
|
136
|
+
def get_instance(payload)
|
137
|
+
return RoomRecordingInstance.new(
|
138
|
+
@version,
|
139
|
+
payload,
|
140
|
+
room_sid: @solution[:room_sid],
|
141
|
+
)
|
142
|
+
end
|
143
|
+
|
144
|
+
##
|
145
|
+
# Provide a user friendly representation
|
146
|
+
def to_s
|
147
|
+
'<Twilio.Video.V1.RoomRecordingPage>'
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
class RoomRecordingContext < InstanceContext
|
152
|
+
##
|
153
|
+
# Initialize the RoomRecordingContext
|
154
|
+
# @param [Version] version Version that contains the resource
|
155
|
+
# @param [String] room_sid The room_sid
|
156
|
+
# @param [String] sid The sid
|
157
|
+
# @return [RoomRecordingContext] RoomRecordingContext
|
158
|
+
def initialize(version, room_sid, sid)
|
159
|
+
super(version)
|
160
|
+
|
161
|
+
# Path Solution
|
162
|
+
@solution = {
|
163
|
+
room_sid: room_sid,
|
164
|
+
sid: sid,
|
165
|
+
}
|
166
|
+
@uri = "/Rooms/#{@solution[:room_sid]}/Recordings/#{@solution[:sid]}"
|
167
|
+
end
|
168
|
+
|
169
|
+
##
|
170
|
+
# Fetch a RoomRecordingInstance
|
171
|
+
# @return [RoomRecordingInstance] Fetched RoomRecordingInstance
|
172
|
+
def fetch
|
173
|
+
params = {}
|
174
|
+
|
175
|
+
payload = @version.fetch(
|
176
|
+
'GET',
|
177
|
+
@uri,
|
178
|
+
params,
|
179
|
+
)
|
180
|
+
|
181
|
+
return RoomRecordingInstance.new(
|
182
|
+
@version,
|
183
|
+
payload,
|
184
|
+
room_sid: @solution[:room_sid],
|
185
|
+
sid: @solution[:sid],
|
186
|
+
)
|
187
|
+
end
|
188
|
+
|
189
|
+
##
|
190
|
+
# Provide a user friendly representation
|
191
|
+
def to_s
|
192
|
+
context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
|
193
|
+
"#<Twilio.Video.V1.RoomRecordingContext #{context}>"
|
194
|
+
end
|
195
|
+
end
|
196
|
+
|
197
|
+
class RoomRecordingInstance < InstanceResource
|
198
|
+
##
|
199
|
+
# Initialize the RoomRecordingInstance
|
200
|
+
# @param [Version] version Version that contains the resource
|
201
|
+
# @param [Hash] payload payload that contains response from Twilio
|
202
|
+
# @param [String] room_sid The room_sid
|
203
|
+
# @param [String] sid The sid
|
204
|
+
# @return [RoomRecordingInstance] RoomRecordingInstance
|
205
|
+
def initialize(version, payload, room_sid: nil, sid: nil)
|
206
|
+
super(version)
|
207
|
+
|
208
|
+
# Marshaled Properties
|
209
|
+
@properties = {
|
210
|
+
'account_sid' => payload['account_sid'],
|
211
|
+
'status' => payload['status'],
|
212
|
+
'date_created' => Twilio.deserialize_iso8601(payload['date_created']),
|
213
|
+
'sid' => payload['sid'],
|
214
|
+
'source_sid' => payload['source_sid'],
|
215
|
+
'size' => payload['size'] == nil ? payload['size'] : payload['size'].to_i,
|
216
|
+
'type' => payload['type'],
|
217
|
+
'duration' => payload['duration'] == nil ? payload['duration'] : payload['duration'].to_i,
|
218
|
+
'container_format' => payload['container_format'],
|
219
|
+
'codec' => payload['codec'],
|
220
|
+
'grouping_sids' => payload['grouping_sids'],
|
221
|
+
'room_sid' => payload['room_sid'],
|
222
|
+
'url' => payload['url'],
|
223
|
+
'links' => payload['links'],
|
224
|
+
}
|
225
|
+
|
226
|
+
# Context
|
227
|
+
@instance_context = nil
|
228
|
+
@params = {
|
229
|
+
'room_sid' => room_sid,
|
230
|
+
'sid' => sid || @properties['sid'],
|
231
|
+
}
|
232
|
+
end
|
233
|
+
|
234
|
+
##
|
235
|
+
# Generate an instance context for the instance, the context is capable of
|
236
|
+
# performing various actions. All instance actions are proxied to the context
|
237
|
+
# @param [Version] version Version that contains the resource
|
238
|
+
# @return [RoomRecordingContext] RoomRecordingContext for this RoomRecordingInstance
|
239
|
+
def context
|
240
|
+
unless @instance_context
|
241
|
+
@instance_context = RoomRecordingContext.new(
|
242
|
+
@version,
|
243
|
+
@params['room_sid'],
|
244
|
+
@params['sid'],
|
245
|
+
)
|
246
|
+
end
|
247
|
+
@instance_context
|
248
|
+
end
|
249
|
+
|
250
|
+
def account_sid
|
251
|
+
@properties['account_sid']
|
252
|
+
end
|
253
|
+
|
254
|
+
def status
|
255
|
+
@properties['status']
|
256
|
+
end
|
257
|
+
|
258
|
+
def date_created
|
259
|
+
@properties['date_created']
|
260
|
+
end
|
261
|
+
|
262
|
+
def sid
|
263
|
+
@properties['sid']
|
264
|
+
end
|
265
|
+
|
266
|
+
def source_sid
|
267
|
+
@properties['source_sid']
|
268
|
+
end
|
269
|
+
|
270
|
+
def size
|
271
|
+
@properties['size']
|
272
|
+
end
|
273
|
+
|
274
|
+
def type
|
275
|
+
@properties['type']
|
276
|
+
end
|
277
|
+
|
278
|
+
def duration
|
279
|
+
@properties['duration']
|
280
|
+
end
|
281
|
+
|
282
|
+
def container_format
|
283
|
+
@properties['container_format']
|
284
|
+
end
|
285
|
+
|
286
|
+
def codec
|
287
|
+
@properties['codec']
|
288
|
+
end
|
289
|
+
|
290
|
+
def grouping_sids
|
291
|
+
@properties['grouping_sids']
|
292
|
+
end
|
293
|
+
|
294
|
+
def room_sid
|
295
|
+
@properties['room_sid']
|
296
|
+
end
|
297
|
+
|
298
|
+
def url
|
299
|
+
@properties['url']
|
300
|
+
end
|
301
|
+
|
302
|
+
def links
|
303
|
+
@properties['links']
|
304
|
+
end
|
305
|
+
|
306
|
+
##
|
307
|
+
# Fetch a RoomRecordingInstance
|
308
|
+
# @return [RoomRecordingInstance] Fetched RoomRecordingInstance
|
309
|
+
def fetch
|
310
|
+
context.fetch
|
311
|
+
end
|
312
|
+
|
313
|
+
##
|
314
|
+
# Provide a user friendly representation
|
315
|
+
def to_s
|
316
|
+
values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
|
317
|
+
"<Twilio.Video.V1.RoomRecordingInstance #{values}>"
|
318
|
+
end
|
319
|
+
end
|
320
|
+
end
|
321
|
+
end
|
322
|
+
end
|
323
|
+
end
|
324
|
+
end
|
@@ -219,6 +219,9 @@ module Twilio
|
|
219
219
|
sid: sid,
|
220
220
|
}
|
221
221
|
@uri = "/Rooms/#{@solution[:sid]}"
|
222
|
+
|
223
|
+
# Dependents
|
224
|
+
@recordings = nil
|
222
225
|
end
|
223
226
|
|
224
227
|
##
|
@@ -262,6 +265,28 @@ module Twilio
|
|
262
265
|
)
|
263
266
|
end
|
264
267
|
|
268
|
+
##
|
269
|
+
# Access the recordings
|
270
|
+
# @return [RoomRecordingList] RoomRecordingList
|
271
|
+
def recordings(sid=:unset)
|
272
|
+
if sid != :unset
|
273
|
+
return RoomRecordingContext.new(
|
274
|
+
@version,
|
275
|
+
@solution[:sid],
|
276
|
+
sid,
|
277
|
+
)
|
278
|
+
end
|
279
|
+
|
280
|
+
unless @recordings
|
281
|
+
@recordings = RoomRecordingList.new(
|
282
|
+
@version,
|
283
|
+
room_sid: @solution[:sid],
|
284
|
+
)
|
285
|
+
end
|
286
|
+
|
287
|
+
@recordings
|
288
|
+
end
|
289
|
+
|
265
290
|
##
|
266
291
|
# Provide a user friendly representation
|
267
292
|
def to_s
|
@@ -297,6 +322,7 @@ module Twilio
|
|
297
322
|
'max_participants' => payload['max_participants'].to_i,
|
298
323
|
'record_participants_on_connect' => payload['record_participants_on_connect'],
|
299
324
|
'url' => payload['url'],
|
325
|
+
'links' => payload['links'],
|
300
326
|
}
|
301
327
|
|
302
328
|
# Context
|
@@ -381,6 +407,10 @@ module Twilio
|
|
381
407
|
@properties['url']
|
382
408
|
end
|
383
409
|
|
410
|
+
def links
|
411
|
+
@properties['links']
|
412
|
+
end
|
413
|
+
|
384
414
|
##
|
385
415
|
# Fetch a RoomInstance
|
386
416
|
# @return [RoomInstance] Fetched RoomInstance
|
@@ -398,6 +428,13 @@ module Twilio
|
|
398
428
|
)
|
399
429
|
end
|
400
430
|
|
431
|
+
##
|
432
|
+
# Access the recordings
|
433
|
+
# @return [recordings] recordings
|
434
|
+
def recordings
|
435
|
+
context.recordings
|
436
|
+
end
|
437
|
+
|
401
438
|
##
|
402
439
|
# Provide a user friendly representation
|
403
440
|
def to_s
|