twilio-ruby 5.13.0 → 5.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGES.md +18 -0
  3. data/README.md +2 -2
  4. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +8 -8
  5. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +1 -5
  6. data/lib/twilio-ruby/rest/api/v2010/account/conference/recording.rb +8 -8
  7. data/lib/twilio-ruby/rest/client.rb +7 -0
  8. data/lib/twilio-ruby/rest/preview/marketplace.rb +13 -13
  9. data/lib/twilio-ruby/rest/preview.rb +8 -21
  10. data/lib/twilio-ruby/rest/video/v1/composition.rb +1 -1
  11. data/lib/twilio-ruby/rest/video/v1/composition_hook.rb +626 -0
  12. data/lib/twilio-ruby/rest/video/v1.rb +32 -16
  13. data/lib/twilio-ruby/rest/video.rb +18 -9
  14. data/lib/twilio-ruby/rest/{preview/permissions → voice/v1}/voice_permission/bulk_country_update.rb +12 -11
  15. data/lib/twilio-ruby/rest/{preview/permissions → voice/v1}/voice_permission/country/highrisk_special_prefix.rb +14 -14
  16. data/lib/twilio-ruby/rest/{preview/permissions → voice/v1}/voice_permission/country.rb +57 -45
  17. data/lib/twilio-ruby/rest/{preview/permissions → voice/v1}/voice_permission.rb +6 -6
  18. data/lib/twilio-ruby/rest/{preview/permissions.rb → voice/v1.rb} +6 -6
  19. data/lib/twilio-ruby/rest/voice.rb +44 -0
  20. data/lib/twilio-ruby/version.rb +1 -1
  21. data/spec/integration/video/v1/composition_hook_spec.rb +410 -0
  22. data/spec/integration/{preview/permissions → voice/v1}/voice_permission/bulk_country_update_spec.rb +5 -5
  23. data/spec/integration/{preview/permissions → voice/v1}/voice_permission/country/highrisk_special_prefix_spec.rb +9 -9
  24. data/spec/integration/{preview/permissions → voice/v1}/voice_permission/country_spec.rb +16 -16
  25. data/spec/integration/{preview/permissions → voice/v1}/voice_permission_spec.rb +0 -0
  26. metadata +20 -19
  27. data/lib/twilio-ruby/rest/preview/permissions/voice_permission/settings.rb +0 -197
  28. data/spec/integration/preview/permissions/voice_permission/settings_spec.rb +0 -77
@@ -8,8 +8,8 @@
8
8
 
9
9
  module Twilio
10
10
  module REST
11
- class Preview < Domain
12
- class Permissions < Version
11
+ class Voice < Domain
12
+ class V1 < Version
13
13
  ##
14
14
  # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
15
15
  class VoicePermissionList < ListResource
@@ -66,7 +66,7 @@ module Twilio
66
66
  ##
67
67
  # Provide a user friendly representation
68
68
  def to_s
69
- '#<Twilio.Preview.Permissions.VoicePermissionList>'
69
+ '#<Twilio.Voice.V1.VoicePermissionList>'
70
70
  end
71
71
  end
72
72
 
@@ -97,7 +97,7 @@ module Twilio
97
97
  ##
98
98
  # Provide a user friendly representation
99
99
  def to_s
100
- '<Twilio.Preview.Permissions.VoicePermissionPage>'
100
+ '<Twilio.Voice.V1.VoicePermissionPage>'
101
101
  end
102
102
  end
103
103
 
@@ -116,13 +116,13 @@ module Twilio
116
116
  ##
117
117
  # Provide a user friendly representation
118
118
  def to_s
119
- "<Twilio.Preview.Permissions.VoicePermissionInstance>"
119
+ "<Twilio.Voice.V1.VoicePermissionInstance>"
120
120
  end
121
121
 
122
122
  ##
123
123
  # Provide a detailed, user friendly representation
124
124
  def inspect
125
- "<Twilio.Preview.Permissions.VoicePermissionInstance>"
125
+ "<Twilio.Voice.V1.VoicePermissionInstance>"
126
126
  end
127
127
  end
128
128
  end
@@ -8,18 +8,18 @@
8
8
 
9
9
  module Twilio
10
10
  module REST
11
- class Preview
12
- class Permissions < Version
11
+ class Voice
12
+ class V1 < Version
13
13
  ##
14
- # Initialize the Permissions version of Preview
14
+ # Initialize the V1 version of Voice
15
15
  def initialize(domain)
16
16
  super
17
- @version = 'permissions'
17
+ @version = 'v1'
18
18
  @voice_permissions = nil
19
19
  end
20
20
 
21
21
  ##
22
- # @return [Twilio::REST::Preview::Permissions::VoicePermissionContext]
22
+ # @return [Twilio::REST::Voice::V1::VoicePermissionContext]
23
23
  def voice_permissions
24
24
  @voice_permissions ||= VoicePermissionList.new self
25
25
  end
@@ -27,7 +27,7 @@ module Twilio
27
27
  ##
28
28
  # Provide a user friendly representation
29
29
  def to_s
30
- '<Twilio::REST::Preview::Permissions>'
30
+ '<Twilio::REST::Voice::V1>'
31
31
  end
32
32
  end
33
33
  end
@@ -0,0 +1,44 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+ #
7
+ # frozen_string_literal: true
8
+
9
+ module Twilio
10
+ module REST
11
+ class Voice < Domain
12
+ ##
13
+ # Initialize the Voice Domain
14
+ def initialize(twilio)
15
+ super
16
+
17
+ @base_url = 'https://voice.twilio.com'
18
+ @host = 'voice.twilio.com'
19
+ @port = 443
20
+
21
+ # Versions
22
+ @v1 = nil
23
+ end
24
+
25
+ ##
26
+ # Version v1 of voice
27
+ def v1
28
+ @v1 ||= V1.new self
29
+ end
30
+
31
+ ##
32
+ # @return [Twilio::REST::Voice::V1::VoicePermissionInstance]
33
+ def voice_permissions
34
+ self.v1.voice_permissions()
35
+ end
36
+
37
+ ##
38
+ # Provide a user friendly representation
39
+ def to_s
40
+ '#<Twilio::REST::Voice>'
41
+ end
42
+ end
43
+ end
44
+ end
@@ -1,3 +1,3 @@
1
1
  module Twilio
2
- VERSION = '5.13.0'
2
+ VERSION = '5.14.0'
3
3
  end
@@ -0,0 +1,410 @@
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 'CompositionHook' do
12
+ it "can fetch" do
13
+ @holodeck.mock(Twilio::Response.new(500, ''))
14
+
15
+ expect {
16
+ @client.video.v1.composition_hooks('HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').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://video.twilio.com/v1/CompositionHooks/HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
24
+ ))).to eq(true)
25
+ end
26
+
27
+ it "receives fetch responses" do
28
+ @holodeck.mock(Twilio::Response.new(
29
+ 200,
30
+ %q[
31
+ {
32
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
33
+ "friendly_name": "My composition hook",
34
+ "enabled": true,
35
+ "date_created": "2015-07-30T20:00:00Z",
36
+ "date_updated": "2015-07-30T20:01:33Z",
37
+ "sid": "HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
38
+ "audio_sources": [
39
+ "user*"
40
+ ],
41
+ "audio_sources_excluded": [
42
+ "moderator*"
43
+ ],
44
+ "video_layout": {
45
+ "grid": {
46
+ "video_sources": [
47
+ "*"
48
+ ],
49
+ "video_sources_excluded": [
50
+ "moderator*"
51
+ ],
52
+ "reuse": "show_oldest",
53
+ "x_pos": 100,
54
+ "y_pos": 600,
55
+ "z_pos": 10,
56
+ "width": 0,
57
+ "height": 0,
58
+ "max_columns": 0,
59
+ "max_rows": 0,
60
+ "cells_excluded": []
61
+ },
62
+ "pip": {
63
+ "video_sources": [
64
+ "student*"
65
+ ],
66
+ "video_sources_excluded": [],
67
+ "reuse": "none",
68
+ "x_pos": 100,
69
+ "y_pos": 600,
70
+ "z_pos": 10,
71
+ "width": 0,
72
+ "height": 0,
73
+ "max_columns": 0,
74
+ "max_rows": 0,
75
+ "cells_excluded": []
76
+ }
77
+ },
78
+ "resolution": "1280x720",
79
+ "format": "webm",
80
+ "trim": true,
81
+ "status_callback": "http://www.example.com",
82
+ "status_callback_method": "POST",
83
+ "url": "https://video.twilio.com/v1/CompositionHooks/HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
84
+ }
85
+ ]
86
+ ))
87
+
88
+ actual = @client.video.v1.composition_hooks('HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch()
89
+
90
+ expect(actual).to_not eq(nil)
91
+ end
92
+
93
+ it "can read" do
94
+ @holodeck.mock(Twilio::Response.new(500, ''))
95
+
96
+ expect {
97
+ @client.video.v1.composition_hooks.list()
98
+ }.to raise_exception(Twilio::REST::TwilioError)
99
+
100
+ values = {}
101
+ expect(
102
+ @holodeck.has_request?(Holodeck::Request.new(
103
+ method: 'get',
104
+ url: 'https://video.twilio.com/v1/CompositionHooks',
105
+ ))).to eq(true)
106
+ end
107
+
108
+ it "receives read_empty responses" do
109
+ @holodeck.mock(Twilio::Response.new(
110
+ 200,
111
+ %q[
112
+ {
113
+ "composition_hooks": [],
114
+ "meta": {
115
+ "page": 0,
116
+ "page_size": 50,
117
+ "first_page_url": "https://video.twilio.com/v1/CompositionHooks?PageSize=50&Page=0",
118
+ "previous_page_url": null,
119
+ "url": "https://video.twilio.com/v1/CompositionHooks?PageSize=50&Page=0",
120
+ "next_page_url": null,
121
+ "key": "composition_hooks"
122
+ }
123
+ }
124
+ ]
125
+ ))
126
+
127
+ actual = @client.video.v1.composition_hooks.list()
128
+
129
+ expect(actual).to_not eq(nil)
130
+ end
131
+
132
+ it "receives read_results responses" do
133
+ @holodeck.mock(Twilio::Response.new(
134
+ 200,
135
+ %q[
136
+ {
137
+ "composition_hooks": [
138
+ {
139
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
140
+ "friendly_name": "My composition hook",
141
+ "enabled": true,
142
+ "date_created": "2015-07-30T20:00:00Z",
143
+ "date_updated": "2015-07-30T20:01:33Z",
144
+ "sid": "HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
145
+ "audio_sources": [
146
+ "*"
147
+ ],
148
+ "audio_sources_excluded": [],
149
+ "video_layout": {
150
+ "grid": {
151
+ "video_sources": [
152
+ "*"
153
+ ],
154
+ "video_sources_excluded": [
155
+ "moderator*"
156
+ ],
157
+ "reuse": "show_oldest",
158
+ "x_pos": 100,
159
+ "y_pos": 600,
160
+ "z_pos": 10,
161
+ "width": 0,
162
+ "height": 0,
163
+ "max_columns": 0,
164
+ "max_rows": 0,
165
+ "cells_excluded": []
166
+ },
167
+ "pip": {
168
+ "video_sources": [
169
+ "student*"
170
+ ],
171
+ "video_sources_excluded": [],
172
+ "reuse": "none",
173
+ "x_pos": 100,
174
+ "y_pos": 600,
175
+ "z_pos": 10,
176
+ "width": 0,
177
+ "height": 0,
178
+ "max_columns": 0,
179
+ "max_rows": 0,
180
+ "cells_excluded": []
181
+ }
182
+ },
183
+ "resolution": "1280x720",
184
+ "format": "webm",
185
+ "trim": true,
186
+ "status_callback": "http://www.example.com",
187
+ "status_callback_method": "POST",
188
+ "url": "https://video.twilio.com/v1/CompositionHooks/HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
189
+ }
190
+ ],
191
+ "meta": {
192
+ "page": 0,
193
+ "page_size": 50,
194
+ "first_page_url": "https://video.twilio.com/v1/CompositionHooks?PageSize=50&Page=0",
195
+ "previous_page_url": null,
196
+ "url": "https://video.twilio.com/v1/CompositionHooks?PageSize=50&Page=0",
197
+ "next_page_url": null,
198
+ "key": "composition_hooks"
199
+ }
200
+ }
201
+ ]
202
+ ))
203
+
204
+ actual = @client.video.v1.composition_hooks.list()
205
+
206
+ expect(actual).to_not eq(nil)
207
+ end
208
+
209
+ it "can delete" do
210
+ @holodeck.mock(Twilio::Response.new(500, ''))
211
+
212
+ expect {
213
+ @client.video.v1.composition_hooks('HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
214
+ }.to raise_exception(Twilio::REST::TwilioError)
215
+
216
+ values = {}
217
+ expect(
218
+ @holodeck.has_request?(Holodeck::Request.new(
219
+ method: 'delete',
220
+ url: 'https://video.twilio.com/v1/CompositionHooks/HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
221
+ ))).to eq(true)
222
+ end
223
+
224
+ it "receives delete responses" do
225
+ @holodeck.mock(Twilio::Response.new(
226
+ 204,
227
+ nil,
228
+ ))
229
+
230
+ actual = @client.video.v1.composition_hooks('HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').delete()
231
+
232
+ expect(actual).to eq(true)
233
+ end
234
+
235
+ it "can create" do
236
+ @holodeck.mock(Twilio::Response.new(500, ''))
237
+
238
+ expect {
239
+ @client.video.v1.composition_hooks.create(friendly_name: 'friendly_name')
240
+ }.to raise_exception(Twilio::REST::TwilioError)
241
+
242
+ values = {'FriendlyName' => 'friendly_name', }
243
+ expect(
244
+ @holodeck.has_request?(Holodeck::Request.new(
245
+ method: 'post',
246
+ url: 'https://video.twilio.com/v1/CompositionHooks',
247
+ data: values,
248
+ ))).to eq(true)
249
+ end
250
+
251
+ it "receives create responses" do
252
+ @holodeck.mock(Twilio::Response.new(
253
+ 201,
254
+ %q[
255
+ {
256
+ "friendly_name": "My composition hook",
257
+ "enabled": false,
258
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
259
+ "date_created": "2015-07-30T20:00:00Z",
260
+ "date_updated": null,
261
+ "sid": "HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
262
+ "audio_sources": [
263
+ "user*",
264
+ "moderator"
265
+ ],
266
+ "audio_sources_excluded": [
267
+ "admin"
268
+ ],
269
+ "video_layout": {
270
+ "custom": {
271
+ "video_sources": [
272
+ "user*"
273
+ ],
274
+ "video_sources_excluded": [
275
+ "moderator"
276
+ ],
277
+ "reuse": "show_oldest",
278
+ "x_pos": 100,
279
+ "y_pos": 600,
280
+ "z_pos": 10,
281
+ "width": 800,
282
+ "height": 0,
283
+ "max_columns": 0,
284
+ "max_rows": 0,
285
+ "cells_excluded": [
286
+ 2,
287
+ 3
288
+ ]
289
+ }
290
+ },
291
+ "trim": true,
292
+ "format": "mp4",
293
+ "resolution": "1280x720",
294
+ "status_callback": "http://www.example.com",
295
+ "status_callback_method": "POST",
296
+ "url": "https://video.twilio.com/v1/CompositionHooks/HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
297
+ }
298
+ ]
299
+ ))
300
+
301
+ actual = @client.video.v1.composition_hooks.create(friendly_name: 'friendly_name')
302
+
303
+ expect(actual).to_not eq(nil)
304
+ end
305
+
306
+ it "can update" do
307
+ @holodeck.mock(Twilio::Response.new(500, ''))
308
+
309
+ expect {
310
+ @client.video.v1.composition_hooks('HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(friendly_name: 'friendly_name')
311
+ }.to raise_exception(Twilio::REST::TwilioError)
312
+
313
+ values = {'FriendlyName' => 'friendly_name', }
314
+ expect(
315
+ @holodeck.has_request?(Holodeck::Request.new(
316
+ method: 'post',
317
+ url: 'https://video.twilio.com/v1/CompositionHooks/HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
318
+ data: values,
319
+ ))).to eq(true)
320
+ end
321
+
322
+ it "receives update_all_fields responses" do
323
+ @holodeck.mock(Twilio::Response.new(
324
+ 200,
325
+ %q[
326
+ {
327
+ "friendly_name": "My composition hook",
328
+ "enabled": true,
329
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
330
+ "date_created": "2015-07-30T20:00:00Z",
331
+ "date_updated": "2015-07-30T20:00:00Z",
332
+ "sid": "HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
333
+ "audio_sources": [
334
+ "user*",
335
+ "moderator"
336
+ ],
337
+ "audio_sources_excluded": [
338
+ "admin"
339
+ ],
340
+ "video_layout": {
341
+ "custom": {
342
+ "video_sources": [
343
+ "user*"
344
+ ],
345
+ "video_sources_excluded": [
346
+ "moderator"
347
+ ],
348
+ "reuse": "show_oldest",
349
+ "x_pos": 100,
350
+ "y_pos": 600,
351
+ "z_pos": 10,
352
+ "width": 800,
353
+ "height": 0,
354
+ "max_columns": 0,
355
+ "max_rows": 0,
356
+ "cells_excluded": [
357
+ 2,
358
+ 3
359
+ ]
360
+ }
361
+ },
362
+ "trim": true,
363
+ "format": "mp4",
364
+ "resolution": "1280x720",
365
+ "status_callback": "http://www.example.com",
366
+ "status_callback_method": "POST",
367
+ "url": "https://video.twilio.com/v1/CompositionHooks/HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
368
+ }
369
+ ]
370
+ ))
371
+
372
+ actual = @client.video.v1.composition_hooks('HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(friendly_name: 'friendly_name')
373
+
374
+ expect(actual).to_not eq(nil)
375
+ end
376
+
377
+ it "receives update_with_defaults responses" do
378
+ @holodeck.mock(Twilio::Response.new(
379
+ 200,
380
+ %q[
381
+ {
382
+ "friendly_name": "My composition hook",
383
+ "enabled": true,
384
+ "account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
385
+ "date_created": "2015-07-30T20:00:00Z",
386
+ "date_updated": "2015-07-30T20:00:00Z",
387
+ "sid": "HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
388
+ "audio_sources": [
389
+ "user*",
390
+ "moderator"
391
+ ],
392
+ "audio_sources_excluded": [
393
+ "admin"
394
+ ],
395
+ "video_layout": {},
396
+ "trim": true,
397
+ "format": "mp4",
398
+ "resolution": "1280x720",
399
+ "status_callback": null,
400
+ "status_callback_method": "POST",
401
+ "url": "https://video.twilio.com/v1/CompositionHooks/HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
402
+ }
403
+ ]
404
+ ))
405
+
406
+ actual = @client.video.v1.composition_hooks('HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(friendly_name: 'friendly_name')
407
+
408
+ expect(actual).to_not eq(nil)
409
+ end
410
+ end