twilio-ruby 5.4.5 → 5.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbfdbc284ee5f66bb3ad186e1f7963c8ac9547eb
4
- data.tar.gz: fe6ca5303962c0ab33c6fcafeffacfd2c8c5a9c8
3
+ metadata.gz: de82e7ce09dccf4f890315d24d61a60b3bbf5922
4
+ data.tar.gz: 2da72c1ccf96fd4f50e1892bfe04a00ab953edcc
5
5
  SHA512:
6
- metadata.gz: 44f962fca3d1e86a93b7301f0e7c69a708039fa86ad3985c966f8bb35530f404a7ef3f64d0e609b0db591135af96e910436d4fc03b93cd720d5ff376fb485ca8
7
- data.tar.gz: 37d6837d74805d553d87394fde14149f86f644ba8158ba81d83030a3d28a53f3fabe07974c5bc9237f9202aabbbe661474ae8777aaa56323470d646bcc0339a7
6
+ metadata.gz: d31423a00d281bc2c5fc505d01a290cdac77702f373ed71fb158edb7f71f54a3866699c9b765e6f64b00f68a1a1abc10baf229eb7228e5deba71c6efa97f078c
7
+ data.tar.gz: 803543186f0f561a58188538a802a0aaa02391138aff8c1fc510ef459399f869598e6240352ebcc9bbc923fae4fbd70f53fdd8ab106ab9eded86f5b977b534f5
data/.travis.yml CHANGED
@@ -10,6 +10,7 @@ rvm:
10
10
  - 2.2.0
11
11
  - 2.1
12
12
  - 2.0.0
13
+ - jruby-9.1.9.0
13
14
 
14
15
  matrix:
15
16
  fast_finish: true
data/CHANGES.md CHANGED
@@ -1,6 +1,19 @@
1
1
  twilio-ruby changelog
2
2
  =====================
3
3
 
4
+ [2017-11-17] Version 5.5.0
5
+ ---------------------------
6
+ **Sync**
7
+ - Add TTL support for Sync objects *(breaking change)*
8
+ - The required `data` parameter on the following actions is now optional: "Update Document", "Update Map Item", "Update List Item"
9
+ - New actions available for updating TTL of Sync objects: "Update List", "Update Map", "Update Stream"
10
+
11
+ **Video**
12
+ - [bi] Rename `RoomParticipant` to `Participant`
13
+ - Add Recording Settings resource
14
+ - Expose EncryptionKey and MediaExternalLocation properties in Recording resource
15
+
16
+
4
17
  [2017-11-10] Version 5.4.5
5
18
  ---------------------------
6
19
  **Accounts**
data/README.md CHANGED
@@ -27,13 +27,13 @@ in-line code documentation here in the library.
27
27
  To install using [Bundler][bundler] grab the latest stable version:
28
28
 
29
29
  ```ruby
30
- gem 'twilio-ruby', '~> 5.4.5'
30
+ gem 'twilio-ruby', '~> 5.5.0'
31
31
  ```
32
32
 
33
33
  To manually install `twilio-ruby` via [Rubygems][rubygems] simply gem install:
34
34
 
35
35
  ```bash
36
- gem install twilio-ruby -v 5.4.5
36
+ gem install twilio-ruby -v 5.5.0
37
37
  ```
38
38
 
39
39
  To build and install the development branch yourself from the latest source:
data/lib/twilio-ruby.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'net/http'
2
2
  require 'net/https'
3
- require 'libxml'
3
+ require 'nokogiri'
4
4
  require 'cgi'
5
5
  require 'openssl'
6
6
  require 'base64'
@@ -30,9 +30,14 @@ module Twilio
30
30
  # Request is executed immediately.
31
31
  # @param [String] unique_name The unique_name
32
32
  # @param [Hash] data The data
33
+ # @param [String] ttl The ttl
33
34
  # @return [DocumentInstance] Newly created DocumentInstance
34
- def create(unique_name: :unset, data: :unset)
35
- data = Twilio::Values.of({'UniqueName' => unique_name, 'Data' => Twilio.serialize_object(data)})
35
+ def create(unique_name: :unset, data: :unset, ttl: :unset)
36
+ data = Twilio::Values.of({
37
+ 'UniqueName' => unique_name,
38
+ 'Data' => Twilio.serialize_object(data),
39
+ 'Ttl' => ttl,
40
+ })
36
41
 
37
42
  payload = @version.create(
38
43
  'POST',
@@ -208,9 +213,10 @@ module Twilio
208
213
  ##
209
214
  # Update the DocumentInstance
210
215
  # @param [Hash] data The data
216
+ # @param [String] ttl The ttl
211
217
  # @return [DocumentInstance] Updated DocumentInstance
212
- def update(data: nil)
213
- data = Twilio::Values.of({'Data' => Twilio.serialize_object(data)})
218
+ def update(data: :unset, ttl: :unset)
219
+ data = Twilio::Values.of({'Data' => Twilio.serialize_object(data), 'Ttl' => ttl})
214
220
 
215
221
  payload = @version.update(
216
222
  'POST',
@@ -274,6 +280,7 @@ module Twilio
274
280
  'links' => payload['links'],
275
281
  'revision' => payload['revision'],
276
282
  'data' => payload['data'],
283
+ 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
277
284
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
278
285
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
279
286
  'created_by' => payload['created_by'],
@@ -343,6 +350,12 @@ module Twilio
343
350
  @properties['data']
344
351
  end
345
352
 
353
+ ##
354
+ # @return [Time] The date_expires
355
+ def date_expires
356
+ @properties['date_expires']
357
+ end
358
+
346
359
  ##
347
360
  # @return [Time] The date_created
348
361
  def date_created
@@ -378,9 +391,10 @@ module Twilio
378
391
  ##
379
392
  # Update the DocumentInstance
380
393
  # @param [Hash] data The data
394
+ # @param [String] ttl The ttl
381
395
  # @return [DocumentInstance] Updated DocumentInstance
382
- def update(data: nil)
383
- context.update(data: data)
396
+ def update(data: :unset, ttl: :unset)
397
+ context.update(data: data, ttl: ttl)
384
398
  end
385
399
 
386
400
  ##
@@ -29,9 +29,10 @@ module Twilio
29
29
  # Retrieve a single page of SyncListInstance records from the API.
30
30
  # Request is executed immediately.
31
31
  # @param [String] unique_name The unique_name
32
+ # @param [String] ttl The ttl
32
33
  # @return [SyncListInstance] Newly created SyncListInstance
33
- def create(unique_name: :unset)
34
- data = Twilio::Values.of({'UniqueName' => unique_name})
34
+ def create(unique_name: :unset, ttl: :unset)
35
+ data = Twilio::Values.of({'UniqueName' => unique_name, 'Ttl' => ttl})
35
36
 
36
37
  payload = @version.create(
37
38
  'POST',
@@ -205,6 +206,22 @@ module Twilio
205
206
  @version.delete('delete', @uri)
206
207
  end
207
208
 
209
+ ##
210
+ # Update the SyncListInstance
211
+ # @param [String] ttl The ttl
212
+ # @return [SyncListInstance] Updated SyncListInstance
213
+ def update(ttl: :unset)
214
+ data = Twilio::Values.of({'Ttl' => ttl})
215
+
216
+ payload = @version.update(
217
+ 'POST',
218
+ @uri,
219
+ data: data,
220
+ )
221
+
222
+ SyncListInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid])
223
+ end
224
+
208
225
  ##
209
226
  # Access the sync_list_items
210
227
  # @return [SyncListItemList]
@@ -279,6 +296,7 @@ module Twilio
279
296
  'url' => payload['url'],
280
297
  'links' => payload['links'],
281
298
  'revision' => payload['revision'],
299
+ 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
282
300
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
283
301
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
284
302
  'created_by' => payload['created_by'],
@@ -342,6 +360,12 @@ module Twilio
342
360
  @properties['revision']
343
361
  end
344
362
 
363
+ ##
364
+ # @return [Time] The date_expires
365
+ def date_expires
366
+ @properties['date_expires']
367
+ end
368
+
345
369
  ##
346
370
  # @return [Time] The date_created
347
371
  def date_created
@@ -374,6 +398,14 @@ module Twilio
374
398
  context.delete
375
399
  end
376
400
 
401
+ ##
402
+ # Update the SyncListInstance
403
+ # @param [String] ttl The ttl
404
+ # @return [SyncListInstance] Updated SyncListInstance
405
+ def update(ttl: :unset)
406
+ context.update(ttl: ttl)
407
+ end
408
+
377
409
  ##
378
410
  # Access the sync_list_items
379
411
  # @return [sync_list_items] sync_list_items
@@ -31,9 +31,10 @@ module Twilio
31
31
  # Retrieve a single page of SyncListItemInstance records from the API.
32
32
  # Request is executed immediately.
33
33
  # @param [Hash] data The data
34
+ # @param [String] ttl The ttl
34
35
  # @return [SyncListItemInstance] Newly created SyncListItemInstance
35
- def create(data: nil)
36
- data = Twilio::Values.of({'Data' => Twilio.serialize_object(data)})
36
+ def create(data: nil, ttl: :unset)
37
+ data = Twilio::Values.of({'Data' => Twilio.serialize_object(data), 'Ttl' => ttl})
37
38
 
38
39
  payload = @version.create(
39
40
  'POST',
@@ -235,9 +236,10 @@ module Twilio
235
236
  ##
236
237
  # Update the SyncListItemInstance
237
238
  # @param [Hash] data The data
239
+ # @param [String] ttl The ttl
238
240
  # @return [SyncListItemInstance] Updated SyncListItemInstance
239
- def update(data: nil)
240
- data = Twilio::Values.of({'Data' => Twilio.serialize_object(data)})
241
+ def update(data: :unset, ttl: :unset)
242
+ data = Twilio::Values.of({'Data' => Twilio.serialize_object(data), 'Ttl' => ttl})
241
243
 
242
244
  payload = @version.update(
243
245
  'POST',
@@ -285,6 +287,7 @@ module Twilio
285
287
  'url' => payload['url'],
286
288
  'revision' => payload['revision'],
287
289
  'data' => payload['data'],
290
+ 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
288
291
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
289
292
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
290
293
  'created_by' => payload['created_by'],
@@ -357,6 +360,12 @@ module Twilio
357
360
  @properties['data']
358
361
  end
359
362
 
363
+ ##
364
+ # @return [Time] The date_expires
365
+ def date_expires
366
+ @properties['date_expires']
367
+ end
368
+
360
369
  ##
361
370
  # @return [Time] The date_created
362
371
  def date_created
@@ -392,9 +401,10 @@ module Twilio
392
401
  ##
393
402
  # Update the SyncListItemInstance
394
403
  # @param [Hash] data The data
404
+ # @param [String] ttl The ttl
395
405
  # @return [SyncListItemInstance] Updated SyncListItemInstance
396
- def update(data: nil)
397
- context.update(data: data)
406
+ def update(data: :unset, ttl: :unset)
407
+ context.update(data: data, ttl: ttl)
398
408
  end
399
409
 
400
410
  ##
@@ -29,9 +29,10 @@ module Twilio
29
29
  # Retrieve a single page of SyncMapInstance records from the API.
30
30
  # Request is executed immediately.
31
31
  # @param [String] unique_name The unique_name
32
+ # @param [String] ttl The ttl
32
33
  # @return [SyncMapInstance] Newly created SyncMapInstance
33
- def create(unique_name: :unset)
34
- data = Twilio::Values.of({'UniqueName' => unique_name})
34
+ def create(unique_name: :unset, ttl: :unset)
35
+ data = Twilio::Values.of({'UniqueName' => unique_name, 'Ttl' => ttl})
35
36
 
36
37
  payload = @version.create(
37
38
  'POST',
@@ -205,6 +206,22 @@ module Twilio
205
206
  @version.delete('delete', @uri)
206
207
  end
207
208
 
209
+ ##
210
+ # Update the SyncMapInstance
211
+ # @param [String] ttl The ttl
212
+ # @return [SyncMapInstance] Updated SyncMapInstance
213
+ def update(ttl: :unset)
214
+ data = Twilio::Values.of({'Ttl' => ttl})
215
+
216
+ payload = @version.update(
217
+ 'POST',
218
+ @uri,
219
+ data: data,
220
+ )
221
+
222
+ SyncMapInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid])
223
+ end
224
+
208
225
  ##
209
226
  # Access the sync_map_items
210
227
  # @return [SyncMapItemList]
@@ -279,6 +296,7 @@ module Twilio
279
296
  'url' => payload['url'],
280
297
  'links' => payload['links'],
281
298
  'revision' => payload['revision'],
299
+ 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
282
300
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
283
301
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
284
302
  'created_by' => payload['created_by'],
@@ -342,6 +360,12 @@ module Twilio
342
360
  @properties['revision']
343
361
  end
344
362
 
363
+ ##
364
+ # @return [Time] The date_expires
365
+ def date_expires
366
+ @properties['date_expires']
367
+ end
368
+
345
369
  ##
346
370
  # @return [Time] The date_created
347
371
  def date_created
@@ -374,6 +398,14 @@ module Twilio
374
398
  context.delete
375
399
  end
376
400
 
401
+ ##
402
+ # Update the SyncMapInstance
403
+ # @param [String] ttl The ttl
404
+ # @return [SyncMapInstance] Updated SyncMapInstance
405
+ def update(ttl: :unset)
406
+ context.update(ttl: ttl)
407
+ end
408
+
377
409
  ##
378
410
  # Access the sync_map_items
379
411
  # @return [sync_map_items] sync_map_items
@@ -32,9 +32,10 @@ module Twilio
32
32
  # Request is executed immediately.
33
33
  # @param [String] key The key
34
34
  # @param [Hash] data The data
35
+ # @param [String] ttl The ttl
35
36
  # @return [SyncMapItemInstance] Newly created SyncMapItemInstance
36
- def create(key: nil, data: nil)
37
- data = Twilio::Values.of({'Key' => key, 'Data' => Twilio.serialize_object(data)})
37
+ def create(key: nil, data: nil, ttl: :unset)
38
+ data = Twilio::Values.of({'Key' => key, 'Data' => Twilio.serialize_object(data), 'Ttl' => ttl})
38
39
 
39
40
  payload = @version.create(
40
41
  'POST',
@@ -236,9 +237,10 @@ module Twilio
236
237
  ##
237
238
  # Update the SyncMapItemInstance
238
239
  # @param [Hash] data The data
240
+ # @param [String] ttl The ttl
239
241
  # @return [SyncMapItemInstance] Updated SyncMapItemInstance
240
- def update(data: nil)
241
- data = Twilio::Values.of({'Data' => Twilio.serialize_object(data)})
242
+ def update(data: :unset, ttl: :unset)
243
+ data = Twilio::Values.of({'Data' => Twilio.serialize_object(data), 'Ttl' => ttl})
242
244
 
243
245
  payload = @version.update(
244
246
  'POST',
@@ -286,6 +288,7 @@ module Twilio
286
288
  'url' => payload['url'],
287
289
  'revision' => payload['revision'],
288
290
  'data' => payload['data'],
291
+ 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
289
292
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
290
293
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
291
294
  'created_by' => payload['created_by'],
@@ -354,6 +357,12 @@ module Twilio
354
357
  @properties['data']
355
358
  end
356
359
 
360
+ ##
361
+ # @return [Time] The date_expires
362
+ def date_expires
363
+ @properties['date_expires']
364
+ end
365
+
357
366
  ##
358
367
  # @return [Time] The date_created
359
368
  def date_created
@@ -389,9 +398,10 @@ module Twilio
389
398
  ##
390
399
  # Update the SyncMapItemInstance
391
400
  # @param [Hash] data The data
401
+ # @param [String] ttl The ttl
392
402
  # @return [SyncMapItemInstance] Updated SyncMapItemInstance
393
- def update(data: nil)
394
- context.update(data: data)
403
+ def update(data: :unset, ttl: :unset)
404
+ context.update(data: data, ttl: ttl)
395
405
  end
396
406
 
397
407
  ##
@@ -30,9 +30,11 @@ module Twilio
30
30
  # Request is executed immediately.
31
31
  # @param [String] unique_name The unique and addressable name of this Stream.
32
32
  # Optional, up to 256 characters long.
33
+ # @param [String] ttl Optional time-to-live of this Stream in seconds. In the
34
+ # range [1, 31 536 000 (1 year)], or 0 for infinity.
33
35
  # @return [SyncStreamInstance] Newly created SyncStreamInstance
34
- def create(unique_name: :unset)
35
- data = Twilio::Values.of({'UniqueName' => unique_name})
36
+ def create(unique_name: :unset, ttl: :unset)
37
+ data = Twilio::Values.of({'UniqueName' => unique_name, 'Ttl' => ttl})
36
38
 
37
39
  payload = @version.create(
38
40
  'POST',
@@ -205,6 +207,23 @@ module Twilio
205
207
  @version.delete('delete', @uri)
206
208
  end
207
209
 
210
+ ##
211
+ # Update the SyncStreamInstance
212
+ # @param [String] ttl Time-to-live of this Stream in seconds. In the range [1, 31
213
+ # 536 000 (1 year)], or 0 for infinity.
214
+ # @return [SyncStreamInstance] Updated SyncStreamInstance
215
+ def update(ttl: :unset)
216
+ data = Twilio::Values.of({'Ttl' => ttl})
217
+
218
+ payload = @version.update(
219
+ 'POST',
220
+ @uri,
221
+ data: data,
222
+ )
223
+
224
+ SyncStreamInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid])
225
+ end
226
+
208
227
  ##
209
228
  # Access the stream_messages
210
229
  # @return [StreamMessageList]
@@ -250,6 +269,7 @@ module Twilio
250
269
  'service_sid' => payload['service_sid'],
251
270
  'url' => payload['url'],
252
271
  'links' => payload['links'],
272
+ 'date_expires' => Twilio.deserialize_iso8601_datetime(payload['date_expires']),
253
273
  'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
254
274
  'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
255
275
  'created_by' => payload['created_by'],
@@ -307,6 +327,12 @@ module Twilio
307
327
  @properties['links']
308
328
  end
309
329
 
330
+ ##
331
+ # @return [Time] The date this Stream expires.
332
+ def date_expires
333
+ @properties['date_expires']
334
+ end
335
+
310
336
  ##
311
337
  # @return [Time] The date this Stream was created.
312
338
  def date_created
@@ -339,6 +365,15 @@ module Twilio
339
365
  context.delete
340
366
  end
341
367
 
368
+ ##
369
+ # Update the SyncStreamInstance
370
+ # @param [String] ttl Time-to-live of this Stream in seconds. In the range [1, 31
371
+ # 536 000 (1 year)], or 0 for infinity.
372
+ # @return [SyncStreamInstance] Updated SyncStreamInstance
373
+ def update(ttl: :unset)
374
+ context.update(ttl: ttl)
375
+ end
376
+
342
377
  ##
343
378
  # Access the stream_messages
344
379
  # @return [stream_messages] stream_messages