twilio-ruby 5.22.3 → 5.23.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +27 -0
  3. data/README.md +2 -4
  4. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +14 -0
  5. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +2 -2
  6. data/lib/twilio-ruby/rest/chat/v1.rb +4 -2
  7. data/lib/twilio-ruby/rest/chat/v1/credential.rb +68 -47
  8. data/lib/twilio-ruby/rest/chat/v1/service.rb +311 -320
  9. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +59 -41
  10. data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +52 -40
  11. data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +71 -64
  12. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +58 -40
  13. data/lib/twilio-ruby/rest/chat/v1/service/role.rb +39 -29
  14. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +51 -48
  15. data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +16 -12
  16. data/lib/twilio-ruby/rest/insights/v1/summary.rb +13 -4
  17. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +4 -2
  18. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +68 -47
  19. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +311 -320
  20. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +59 -41
  21. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +52 -40
  22. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +71 -64
  23. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +58 -40
  24. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +39 -29
  25. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +51 -48
  26. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +16 -12
  27. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +1 -1
  28. data/lib/twilio-ruby/rest/preview.rb +25 -0
  29. data/lib/twilio-ruby/rest/preview/trusted_comms.rb +49 -0
  30. data/lib/twilio-ruby/rest/preview/trusted_comms/current_call.rb +217 -0
  31. data/lib/twilio-ruby/rest/preview/trusted_comms/device.rb +146 -0
  32. data/lib/twilio-ruby/rest/preview/trusted_comms/phone_call.rb +169 -0
  33. data/lib/twilio-ruby/rest/serverless/v1.rb +2 -1
  34. data/lib/twilio-ruby/rest/serverless/v1/service.rb +4 -2
  35. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +30 -9
  36. data/lib/twilio-ruby/rest/verify/v2/service/verification.rb +1 -1
  37. data/lib/twilio-ruby/rest/video/v1/room/room_participant.rb +39 -6
  38. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribe_rule.rb +191 -0
  39. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_subscribed_track.rb +133 -99
  40. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +3 -3
  41. data/lib/twilio-ruby/version.rb +1 -1
  42. data/spec/integration/api/v2010/account/conference_spec.rb +86 -2
  43. data/spec/integration/api/v2010/account/connect_app_spec.rb +28 -6
  44. data/spec/integration/api/v2010/account/queue/member_spec.rb +4 -4
  45. data/spec/integration/insights/v1/summary_spec.rb +1 -0
  46. data/spec/integration/preview/trusted_comms/current_call_spec.rb +46 -0
  47. data/spec/integration/preview/trusted_comms/device_spec.rb +45 -0
  48. data/spec/integration/preview/trusted_comms/phone_call_spec.rb +48 -0
  49. data/spec/integration/taskrouter/v1/workspace/task_channel_spec.rb +6 -0
  50. data/spec/integration/video/v1/room/room_participant/room_participant_subscribe_rule_spec.rb +92 -0
  51. data/spec/integration/video/v1/room/room_participant/room_participant_subscribed_track_spec.rb +31 -68
  52. data/spec/integration/video/v1/room/room_participant_spec.rb +6 -3
  53. data/spec/integration/wireless/v1/sim/data_session_spec.rb +2 -2
  54. metadata +15 -2
@@ -131,14 +131,11 @@ describe 'ConnectApp' do
131
131
  ],
132
132
  "end": 0,
133
133
  "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50",
134
- "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50",
135
134
  "next_page_uri": null,
136
- "num_pages": 1,
137
135
  "page": 0,
138
136
  "page_size": 50,
139
137
  "previous_page_uri": null,
140
138
  "start": 0,
141
- "total": 1,
142
139
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json"
143
140
  }
144
141
  ]
@@ -158,14 +155,11 @@ describe 'ConnectApp' do
158
155
  "connect_apps": [],
159
156
  "end": 0,
160
157
  "first_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50",
161
- "last_page_uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50",
162
158
  "next_page_uri": null,
163
- "num_pages": 1,
164
159
  "page": 0,
165
160
  "page_size": 50,
166
161
  "previous_page_uri": null,
167
162
  "start": 0,
168
- "total": 1,
169
163
  "uri": "/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json"
170
164
  }
171
165
  ]
@@ -176,4 +170,32 @@ describe 'ConnectApp' do
176
170
 
177
171
  expect(actual).to_not eq(nil)
178
172
  end
173
+
174
+ it "can delete" do
175
+ @holodeck.mock(Twilio::Response.new(500, ''))
176
+
177
+ expect {
178
+ @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
179
+ .connect_apps('CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
180
+ }.to raise_exception(Twilio::REST::TwilioError)
181
+
182
+ values = {}
183
+ expect(
184
+ @holodeck.has_request?(Holodeck::Request.new(
185
+ method: 'delete',
186
+ url: 'https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/ConnectApps/CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX.json',
187
+ ))).to eq(true)
188
+ end
189
+
190
+ it "receives delete responses" do
191
+ @holodeck.mock(Twilio::Response.new(
192
+ 204,
193
+ nil,
194
+ ))
195
+
196
+ actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
197
+ .connect_apps('CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
198
+
199
+ expect(actual).to eq(true)
200
+ end
179
201
  end
@@ -76,10 +76,10 @@ describe 'Member' do
76
76
  expect {
77
77
  @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
78
78
  .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
79
- .members('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(url: 'https://example.com', method: 'GET')
79
+ .members('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(url: 'https://example.com')
80
80
  }.to raise_exception(Twilio::REST::TwilioError)
81
81
 
82
- values = {'Url' => 'https://example.com', 'Method' => 'GET', }
82
+ values = {'Url' => 'https://example.com', }
83
83
  expect(
84
84
  @holodeck.has_request?(Holodeck::Request.new(
85
85
  method: 'post',
@@ -105,7 +105,7 @@ describe 'Member' do
105
105
 
106
106
  actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
107
107
  .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
108
- .members('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(url: 'https://example.com', method: 'GET')
108
+ .members('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(url: 'https://example.com')
109
109
 
110
110
  expect(actual).to_not eq(nil)
111
111
  end
@@ -127,7 +127,7 @@ describe 'Member' do
127
127
 
128
128
  actual = @client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
129
129
  .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
130
- .members('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(url: 'https://example.com', method: 'GET')
130
+ .members('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(url: 'https://example.com')
131
131
 
132
132
  expect(actual).to_not eq(nil)
133
133
  end
@@ -44,6 +44,7 @@ describe 'CallSummary' do
44
44
  "to": {},
45
45
  "carrier_edge": {},
46
46
  "client_edge": {},
47
+ "sdk_edge": {},
47
48
  "sip_edge": {},
48
49
  "tags": [
49
50
  "tags"
@@ -0,0 +1,46 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'CurrentCall' do
12
+ it "can fetch" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.preview.trusted_comms.current_calls().fetch()
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {}
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'get',
23
+ url: 'https://preview.twilio.com/TrustedComms/CurrentCall',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives read_found responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
+ "from": "+15000000000",
34
+ "to": "+573000000000",
35
+ "reason": "Hello Jhon, your appointment has been confirmed.",
36
+ "created_at": "2019-05-01T20:00:00Z",
37
+ "url": "https://preview.twilio.com/TrustedComms/CurrentCall"
38
+ }
39
+ ]
40
+ ))
41
+
42
+ actual = @client.preview.trusted_comms.current_calls().fetch()
43
+
44
+ expect(actual).to_not eq(nil)
45
+ end
46
+ end
@@ -0,0 +1,45 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'Device' do
12
+ it "can create" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.preview.trusted_comms.devices.create(phone_number: 'phone_number', push_token: 'push_token')
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {'PhoneNumber' => 'phone_number', 'PushToken' => 'push_token', }
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'post',
23
+ url: 'https://preview.twilio.com/TrustedComms/Devices',
24
+ data: values,
25
+ ))).to eq(true)
26
+ end
27
+
28
+ it "receives create responses" do
29
+ @holodeck.mock(Twilio::Response.new(
30
+ 201,
31
+ %q[
32
+ {
33
+ "sid": "DDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "binding_sid": "BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
+ "phone_number": "+573000000000",
36
+ "url": "https://preview.twilio.com/TrustedComms/Devices"
37
+ }
38
+ ]
39
+ ))
40
+
41
+ actual = @client.preview.trusted_comms.devices.create(phone_number: 'phone_number', push_token: 'push_token')
42
+
43
+ expect(actual).to_not eq(nil)
44
+ end
45
+ end
@@ -0,0 +1,48 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'PhoneCall' do
12
+ it "can create" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.preview.trusted_comms.phone_calls.create(from: 'from', to: 'to', url: 'url')
17
+ }.to raise_exception(Twilio::REST::TwilioError)
18
+
19
+ values = {'From' => 'from', 'To' => 'to', 'Url' => 'url', }
20
+ expect(
21
+ @holodeck.has_request?(Holodeck::Request.new(
22
+ method: 'post',
23
+ url: 'https://preview.twilio.com/TrustedComms/Business/PhoneCalls',
24
+ data: values,
25
+ ))).to eq(true)
26
+ end
27
+
28
+ it "receives create responses" do
29
+ @holodeck.mock(Twilio::Response.new(
30
+ 201,
31
+ %q[
32
+ {
33
+ "sid": "CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
34
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
+ "from": "+15000000000",
36
+ "to": "+573000000000",
37
+ "reason": "Hello Jhon, your appointment has been confirmed.",
38
+ "created_at": "2019-05-01T20:00:00Z",
39
+ "url": "https://preview.twilio.com/TrustedComms/Business/PhoneCalls"
40
+ }
41
+ ]
42
+ ))
43
+
44
+ actual = @client.preview.trusted_comms.phone_calls.create(from: 'from', to: 'to', url: 'url')
45
+
46
+ expect(actual).to_not eq(nil)
47
+ end
48
+ end
@@ -38,6 +38,7 @@ describe 'TaskChannel' do
38
38
  "unique_name": "default",
39
39
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40
40
  "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
41
+ "channel_optimized_routing": true,
41
42
  "links": {
42
43
  "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
43
44
  }
@@ -64,6 +65,7 @@ describe 'TaskChannel' do
64
65
  "unique_name": "default",
65
66
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
66
67
  "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
68
+ "channel_optimized_routing": false,
67
69
  "links": {
68
70
  "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
69
71
  }
@@ -108,6 +110,7 @@ describe 'TaskChannel' do
108
110
  "unique_name": "default",
109
111
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
110
112
  "workspace_sid": "WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
113
+ "channel_optimized_routing": true,
111
114
  "links": {
112
115
  "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
113
116
  }
@@ -186,6 +189,7 @@ describe 'TaskChannel' do
186
189
  "date_created": "2016-04-14T17:35:54Z",
187
190
  "date_updated": "2016-04-14T17:35:54Z",
188
191
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
192
+ "channel_optimized_routing": true,
189
193
  "links": {
190
194
  "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
191
195
  }
@@ -212,6 +216,7 @@ describe 'TaskChannel' do
212
216
  "date_created": "2016-04-14T17:35:54Z",
213
217
  "date_updated": "2016-04-14T17:35:54Z",
214
218
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
219
+ "channel_optimized_routing": true,
215
220
  "links": {
216
221
  "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
217
222
  }
@@ -294,6 +299,7 @@ describe 'TaskChannel' do
294
299
  "unique_name": "ovoice",
295
300
  "date_created": "2016-04-14T17:35:54Z",
296
301
  "date_updated": "2016-04-14T17:35:54Z",
302
+ "channel_optimized_routing": true,
297
303
  "url": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels/TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
298
304
  "links": {
299
305
  "workspace": "https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@@ -0,0 +1,92 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ require 'spec_helper.rb'
10
+
11
+ describe 'SubscribeRules' do
12
+ it "can fetch" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
+ .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
18
+ .subscribe_rules.fetch()
19
+ }.to raise_exception(Twilio::REST::TwilioError)
20
+
21
+ values = {}
22
+ expect(
23
+ @holodeck.has_request?(Holodeck::Request.new(
24
+ method: 'get',
25
+ url: 'https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SubscribeRules',
26
+ ))).to eq(true)
27
+ end
28
+
29
+ it "receives read_empty responses" do
30
+ @holodeck.mock(Twilio::Response.new(
31
+ 200,
32
+ %q[
33
+ {
34
+ "participant_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
+ "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
36
+ "date_created": null,
37
+ "date_updated": null,
38
+ "rules": []
39
+ }
40
+ ]
41
+ ))
42
+
43
+ actual = @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
44
+ .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
45
+ .subscribe_rules.fetch()
46
+
47
+ expect(actual).to_not eq(nil)
48
+ end
49
+
50
+ it "can update" do
51
+ @holodeck.mock(Twilio::Response.new(500, ''))
52
+
53
+ expect {
54
+ @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
55
+ .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
56
+ .subscribe_rules.update()
57
+ }.to raise_exception(Twilio::REST::TwilioError)
58
+
59
+ values = {}
60
+ expect(
61
+ @holodeck.has_request?(Holodeck::Request.new(
62
+ method: 'post',
63
+ url: 'https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SubscribeRules',
64
+ ))).to eq(true)
65
+ end
66
+
67
+ it "receives update_filters responses" do
68
+ @holodeck.mock(Twilio::Response.new(
69
+ 202,
70
+ %q[
71
+ {
72
+ "participant_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
73
+ "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
74
+ "date_created": null,
75
+ "date_updated": null,
76
+ "rules": [
77
+ {
78
+ "type": "exclude",
79
+ "all": true
80
+ }
81
+ ]
82
+ }
83
+ ]
84
+ ))
85
+
86
+ actual = @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
87
+ .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
88
+ .subscribe_rules.update()
89
+
90
+ expect(actual).to_not eq(nil)
91
+ end
92
+ end
@@ -9,125 +9,88 @@
9
9
  require 'spec_helper.rb'
10
10
 
11
11
  describe 'SubscribedTrack' do
12
- it "can read" do
12
+ it "can fetch" do
13
13
  @holodeck.mock(Twilio::Response.new(500, ''))
14
14
 
15
15
  expect {
16
16
  @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
17
17
  .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
18
- .subscribed_tracks.list()
18
+ .subscribed_tracks('MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
19
19
  }.to raise_exception(Twilio::REST::TwilioError)
20
20
 
21
21
  values = {}
22
22
  expect(
23
23
  @holodeck.has_request?(Holodeck::Request.new(
24
24
  method: 'get',
25
- url: 'https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SubscribedTracks',
25
+ url: 'https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SubscribedTracks/MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
26
26
  ))).to eq(true)
27
27
  end
28
28
 
29
- it "receives read_empty responses" do
29
+ it "receives fetch responses" do
30
30
  @holodeck.mock(Twilio::Response.new(
31
31
  200,
32
32
  %q[
33
33
  {
34
- "subscribed_tracks": [],
35
- "meta": {
36
- "page": 0,
37
- "page_size": 50,
38
- "first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks?PageSize=50&Page=0",
39
- "previous_page_url": null,
40
- "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks?PageSize=50&Page=0",
41
- "next_page_url": null,
42
- "key": "subscribed_tracks"
43
- }
44
- }
45
- ]
46
- ))
47
-
48
- actual = @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
49
- .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
50
- .subscribed_tracks.list()
51
-
52
- expect(actual).to_not eq(nil)
53
- end
54
-
55
- it "receives read_filters responses" do
56
- @holodeck.mock(Twilio::Response.new(
57
- 200,
58
- %q[
59
- {
60
- "subscribed_tracks": [
61
- {
62
- "publisher_sid": "PAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb",
63
- "subscriber_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
64
- "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
65
- "date_created": "2015-07-30T20:00:00Z",
66
- "date_updated": "2015-07-30T20:00:00Z",
67
- "sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
68
- "name": "bob-track",
69
- "kind": "data",
70
- "enabled": true
71
- }
72
- ],
73
- "meta": {
74
- "page": 0,
75
- "page_size": 50,
76
- "first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks?PageSize=50&Page=0",
77
- "previous_page_url": null,
78
- "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks?PageSize=50&Page=0",
79
- "next_page_url": null,
80
- "key": "subscribed_tracks"
81
- }
34
+ "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
35
+ "date_created": "2015-07-30T20:00:00Z",
36
+ "date_updated": "2015-07-30T20:00:00Z",
37
+ "participant_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
+ "publisher_sid": "PAbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
39
+ "sid": "MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
40
+ "name": "bob-track",
41
+ "kind": "data",
42
+ "enabled": true,
43
+ "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks/MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
82
44
  }
83
45
  ]
84
46
  ))
85
47
 
86
48
  actual = @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
87
49
  .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
88
- .subscribed_tracks.list()
50
+ .subscribed_tracks('MTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
89
51
 
90
52
  expect(actual).to_not eq(nil)
91
53
  end
92
54
 
93
- it "can update" do
55
+ it "can read" do
94
56
  @holodeck.mock(Twilio::Response.new(500, ''))
95
57
 
96
58
  expect {
97
59
  @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
98
60
  .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
99
- .subscribed_tracks.update()
61
+ .subscribed_tracks.list()
100
62
  }.to raise_exception(Twilio::REST::TwilioError)
101
63
 
102
64
  values = {}
103
65
  expect(
104
66
  @holodeck.has_request?(Holodeck::Request.new(
105
- method: 'post',
67
+ method: 'get',
106
68
  url: 'https://video.twilio.com/v1/Rooms/RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Participants/PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/SubscribedTracks',
107
69
  ))).to eq(true)
108
70
  end
109
71
 
110
- it "receives update_filters responses" do
72
+ it "receives read_empty responses" do
111
73
  @holodeck.mock(Twilio::Response.new(
112
- 202,
74
+ 200,
113
75
  %q[
114
76
  {
115
- "publisher_sid": null,
116
- "subscriber_sid": "PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
117
- "room_sid": "RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
118
- "date_created": null,
119
- "date_updated": null,
120
- "sid": null,
121
- "name": "bob-track",
122
- "kind": "data",
123
- "enabled": null
77
+ "subscribed_tracks": [],
78
+ "meta": {
79
+ "page": 0,
80
+ "page_size": 50,
81
+ "first_page_url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks?PageSize=50&Page=0",
82
+ "previous_page_url": null,
83
+ "url": "https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks?PageSize=50&Page=0",
84
+ "next_page_url": null,
85
+ "key": "subscribed_tracks"
86
+ }
124
87
  }
125
88
  ]
126
89
  ))
127
90
 
128
91
  actual = @client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
129
92
  .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') \
130
- .subscribed_tracks.update()
93
+ .subscribed_tracks.list()
131
94
 
132
95
  expect(actual).to_not eq(nil)
133
96
  end