twilio-ruby 5.0.0.rc24 → 5.0.0.rc25

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +32 -12
  3. data/LICENSE.md +12 -12
  4. data/README.md +28 -29
  5. data/examples/examples.rb +47 -58
  6. data/examples/print-call-log.rb +6 -6
  7. data/lib/twilio-ruby/jwt/jwt.rb +2 -2
  8. data/lib/twilio-ruby/rest/accounts/v1.rb +3 -1
  9. data/lib/twilio-ruby/rest/accounts/v1/credential.rb +4 -1
  10. data/lib/twilio-ruby/rest/api/v2010.rb +3 -1
  11. data/lib/twilio-ruby/rest/api/v2010/account.rb +80 -23
  12. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +2 -1
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +6 -3
  14. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +14 -4
  15. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +10 -0
  16. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +4 -1
  17. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +10 -4
  18. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +4 -1
  19. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +6 -2
  20. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +4 -1
  21. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +18 -2
  22. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +4 -1
  23. data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +14 -4
  24. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +4 -1
  25. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +8 -2
  26. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +4 -1
  27. data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +6 -2
  28. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +16 -8
  29. data/lib/twilio-ruby/rest/chat/v1.rb +6 -2
  30. data/lib/twilio-ruby/rest/chat/v1/service.rb +12 -3
  31. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +12 -3
  32. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +2 -1
  33. data/lib/twilio-ruby/rest/chat/v2.rb +6 -2
  34. data/lib/twilio-ruby/rest/chat/v2/service.rb +12 -3
  35. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +12 -3
  36. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +2 -1
  37. data/lib/twilio-ruby/rest/fax/v1.rb +3 -1
  38. data/lib/twilio-ruby/rest/fax/v1/fax.rb +4 -1
  39. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +6 -2
  40. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +12 -3
  41. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +12 -3
  42. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +2 -1
  43. data/lib/twilio-ruby/rest/ip_messaging/v2.rb +6 -2
  44. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +12 -3
  45. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +12 -3
  46. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +2 -1
  47. data/lib/twilio-ruby/rest/lookups/v1.rb +3 -1
  48. data/lib/twilio-ruby/rest/messaging/v1.rb +3 -1
  49. data/lib/twilio-ruby/rest/messaging/v1/service.rb +26 -6
  50. data/lib/twilio-ruby/rest/monitor/v1.rb +6 -2
  51. data/lib/twilio-ruby/rest/notify/v1.rb +6 -2
  52. data/lib/twilio-ruby/rest/notify/v1/service.rb +12 -4
  53. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +3 -1
  54. data/lib/twilio-ruby/rest/notify/v1/service/user.rb +8 -2
  55. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +6 -2
  56. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +2 -1
  57. data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +3 -1
  58. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +18 -12
  59. data/lib/twilio-ruby/rest/preview/marketplace.rb +6 -2
  60. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +4 -1
  61. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +4 -1
  62. data/lib/twilio-ruby/rest/preview/proxy.rb +3 -1
  63. data/lib/twilio-ruby/rest/preview/proxy/service.rb +12 -3
  64. data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +8 -2
  65. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +4 -1
  66. data/lib/twilio-ruby/rest/preview/sync.rb +3 -1
  67. data/lib/twilio-ruby/rest/preview/sync/service.rb +12 -3
  68. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +4 -1
  69. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +8 -2
  70. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +8 -2
  71. data/lib/twilio-ruby/rest/preview/wireless.rb +9 -3
  72. data/lib/twilio-ruby/rest/preview/wireless/sim.rb +2 -1
  73. data/lib/twilio-ruby/rest/pricing/v1.rb +9 -3
  74. data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +4 -1
  75. data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +4 -1
  76. data/lib/twilio-ruby/rest/pricing/v1/voice.rb +8 -2
  77. data/lib/twilio-ruby/rest/sync/v1.rb +3 -1
  78. data/lib/twilio-ruby/rest/sync/v1/service.rb +12 -3
  79. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +4 -1
  80. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +8 -2
  81. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +8 -2
  82. data/lib/twilio-ruby/rest/taskrouter/v1.rb +3 -1
  83. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +30 -8
  84. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +4 -1
  85. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +4 -2
  86. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +12 -4
  87. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +2 -1
  88. data/lib/twilio-ruby/rest/trunking/v1.rb +3 -1
  89. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +16 -4
  90. data/lib/twilio-ruby/rest/video/v1.rb +6 -2
  91. data/lib/twilio-ruby/rest/video/v1/recording.rb +17 -3
  92. data/lib/twilio-ruby/rest/video/v1/room.rb +4 -1
  93. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +31 -3
  94. data/lib/twilio-ruby/rest/wireless/v1.rb +9 -3
  95. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +16 -1
  96. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +2 -1
  97. data/lib/twilio-ruby/twiml/messaging_response.rb +8 -2
  98. data/lib/twilio-ruby/twiml/twiml.rb +3 -5
  99. data/lib/twilio-ruby/twiml/voice_response.rb +60 -42
  100. data/lib/twilio-ruby/version.rb +1 -1
  101. data/spec/integration/api/v2010/account/call/recording_spec.rb +14 -2
  102. data/spec/integration/api/v2010/account/recording_spec.rb +14 -2
  103. data/spec/integration/messaging/v1/service/phone_number_spec.rb +28 -0
  104. data/spec/integration/messaging/v1/service_spec.rb +4 -0
  105. data/spec/integration/notify/v1/service/notification_spec.rb +35 -0
  106. data/spec/integration/video/v1/recording_spec.rb +45 -0
  107. data/spec/integration/video/v1/room/recording_spec.rb +4 -3
  108. data/spec/integration/wireless/v1/rate_plan_spec.rb +8 -0
  109. data/spec/twiml/messaging_response_spec.rb +28 -0
  110. data/spec/twiml/voice_response_spec.rb +9 -0
  111. metadata +2 -2
@@ -267,7 +267,8 @@ module Twilio
267
267
 
268
268
  ##
269
269
  # Access the user_channels
270
- # @return [UserChannelList] UserChannelList
270
+ # @return [UserChannelList] if a(n) UserChannelList object was created.
271
+ # @return [UserChannelContext] if a(n) UserChannelContext object was created.
271
272
  def user_channels
272
273
  unless @user_channels
273
274
  @user_channels = UserChannelList.new(
@@ -18,7 +18,9 @@ module Twilio
18
18
  end
19
19
 
20
20
  def credentials(sid=:unset)
21
- if sid == :unset
21
+ if sid.nil?
22
+ raise ArgumentError, 'sid cannot be nil'
23
+ elsif sid == :unset
22
24
  @credentials ||= CredentialList.new self
23
25
  else
24
26
  CredentialContext.new(self, sid)
@@ -26,7 +28,9 @@ module Twilio
26
28
  end
27
29
 
28
30
  def services(sid=:unset)
29
- if sid == :unset
31
+ if sid.nil?
32
+ raise ArgumentError, 'sid cannot be nil'
33
+ elsif sid == :unset
30
34
  @services ||= ServiceList.new self
31
35
  else
32
36
  ServiceContext.new(self, sid)
@@ -314,8 +314,11 @@ module Twilio
314
314
 
315
315
  ##
316
316
  # Access the channels
317
- # @return [ChannelList] ChannelList
317
+ # @return [ChannelList] if a(n) ChannelList object was created.
318
+ # @return [ChannelContext] if a(n) ChannelContext object was created.
318
319
  def channels(sid=:unset)
320
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
321
+
319
322
  if sid != :unset
320
323
  return ChannelContext.new(
321
324
  @version,
@@ -336,8 +339,11 @@ module Twilio
336
339
 
337
340
  ##
338
341
  # Access the roles
339
- # @return [RoleList] RoleList
342
+ # @return [RoleList] if a(n) RoleList object was created.
343
+ # @return [RoleContext] if a(n) RoleContext object was created.
340
344
  def roles(sid=:unset)
345
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
346
+
341
347
  if sid != :unset
342
348
  return RoleContext.new(
343
349
  @version,
@@ -358,8 +364,11 @@ module Twilio
358
364
 
359
365
  ##
360
366
  # Access the users
361
- # @return [UserList] UserList
367
+ # @return [UserList] if a(n) UserList object was created.
368
+ # @return [UserContext] if a(n) UserContext object was created.
362
369
  def users(sid=:unset)
370
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
371
+
363
372
  if sid != :unset
364
373
  return UserContext.new(
365
374
  @version,
@@ -276,8 +276,11 @@ module Twilio
276
276
 
277
277
  ##
278
278
  # Access the members
279
- # @return [MemberList] MemberList
279
+ # @return [MemberList] if a(n) MemberList object was created.
280
+ # @return [MemberContext] if a(n) MemberContext object was created.
280
281
  def members(sid=:unset)
282
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
283
+
281
284
  if sid != :unset
282
285
  return MemberContext.new(
283
286
  @version,
@@ -300,8 +303,11 @@ module Twilio
300
303
 
301
304
  ##
302
305
  # Access the messages
303
- # @return [MessageList] MessageList
306
+ # @return [MessageList] if a(n) MessageList object was created.
307
+ # @return [MessageContext] if a(n) MessageContext object was created.
304
308
  def messages(sid=:unset)
309
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
310
+
305
311
  if sid != :unset
306
312
  return MessageContext.new(
307
313
  @version,
@@ -324,8 +330,11 @@ module Twilio
324
330
 
325
331
  ##
326
332
  # Access the invites
327
- # @return [InviteList] InviteList
333
+ # @return [InviteList] if a(n) InviteList object was created.
334
+ # @return [InviteContext] if a(n) InviteContext object was created.
328
335
  def invites(sid=:unset)
336
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
337
+
329
338
  if sid != :unset
330
339
  return InviteContext.new(
331
340
  @version,
@@ -267,7 +267,8 @@ module Twilio
267
267
 
268
268
  ##
269
269
  # Access the user_channels
270
- # @return [UserChannelList] UserChannelList
270
+ # @return [UserChannelList] if a(n) UserChannelList object was created.
271
+ # @return [UserChannelContext] if a(n) UserChannelContext object was created.
271
272
  def user_channels
272
273
  unless @user_channels
273
274
  @user_channels = UserChannelList.new(
@@ -17,7 +17,9 @@ module Twilio
17
17
  end
18
18
 
19
19
  def faxes(sid=:unset)
20
- if sid == :unset
20
+ if sid.nil?
21
+ raise ArgumentError, 'sid cannot be nil'
22
+ elsif sid == :unset
21
23
  @faxes ||= FaxList.new self
22
24
  else
23
25
  FaxContext.new(self, sid)
@@ -317,8 +317,11 @@ module Twilio
317
317
 
318
318
  ##
319
319
  # Access the media
320
- # @return [FaxMediaList] FaxMediaList
320
+ # @return [FaxMediaList] if a(n) FaxMediaList object was created.
321
+ # @return [FaxMediaContext] if a(n) FaxMediaContext object was created.
321
322
  def media(sid=:unset)
323
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
324
+
322
325
  if sid != :unset
323
326
  return FaxMediaContext.new(
324
327
  @version,
@@ -18,7 +18,9 @@ module Twilio
18
18
  end
19
19
 
20
20
  def credentials(sid=:unset)
21
- if sid == :unset
21
+ if sid.nil?
22
+ raise ArgumentError, 'sid cannot be nil'
23
+ elsif sid == :unset
22
24
  @credentials ||= CredentialList.new self
23
25
  else
24
26
  CredentialContext.new(self, sid)
@@ -26,7 +28,9 @@ module Twilio
26
28
  end
27
29
 
28
30
  def services(sid=:unset)
29
- if sid == :unset
31
+ if sid.nil?
32
+ raise ArgumentError, 'sid cannot be nil'
33
+ elsif sid == :unset
30
34
  @services ||= ServiceList.new self
31
35
  else
32
36
  ServiceContext.new(self, sid)
@@ -434,8 +434,11 @@ module Twilio
434
434
 
435
435
  ##
436
436
  # Access the channels
437
- # @return [ChannelList] ChannelList
437
+ # @return [ChannelList] if a(n) ChannelList object was created.
438
+ # @return [ChannelContext] if a(n) ChannelContext object was created.
438
439
  def channels(sid=:unset)
440
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
441
+
439
442
  if sid != :unset
440
443
  return ChannelContext.new(
441
444
  @version,
@@ -456,8 +459,11 @@ module Twilio
456
459
 
457
460
  ##
458
461
  # Access the roles
459
- # @return [RoleList] RoleList
462
+ # @return [RoleList] if a(n) RoleList object was created.
463
+ # @return [RoleContext] if a(n) RoleContext object was created.
460
464
  def roles(sid=:unset)
465
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
466
+
461
467
  if sid != :unset
462
468
  return RoleContext.new(
463
469
  @version,
@@ -478,8 +484,11 @@ module Twilio
478
484
 
479
485
  ##
480
486
  # Access the users
481
- # @return [UserList] UserList
487
+ # @return [UserList] if a(n) UserList object was created.
488
+ # @return [UserContext] if a(n) UserContext object was created.
482
489
  def users(sid=:unset)
490
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
491
+
483
492
  if sid != :unset
484
493
  return UserContext.new(
485
494
  @version,
@@ -276,8 +276,11 @@ module Twilio
276
276
 
277
277
  ##
278
278
  # Access the members
279
- # @return [MemberList] MemberList
279
+ # @return [MemberList] if a(n) MemberList object was created.
280
+ # @return [MemberContext] if a(n) MemberContext object was created.
280
281
  def members(sid=:unset)
282
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
283
+
281
284
  if sid != :unset
282
285
  return MemberContext.new(
283
286
  @version,
@@ -300,8 +303,11 @@ module Twilio
300
303
 
301
304
  ##
302
305
  # Access the messages
303
- # @return [MessageList] MessageList
306
+ # @return [MessageList] if a(n) MessageList object was created.
307
+ # @return [MessageContext] if a(n) MessageContext object was created.
304
308
  def messages(sid=:unset)
309
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
310
+
305
311
  if sid != :unset
306
312
  return MessageContext.new(
307
313
  @version,
@@ -324,8 +330,11 @@ module Twilio
324
330
 
325
331
  ##
326
332
  # Access the invites
327
- # @return [InviteList] InviteList
333
+ # @return [InviteList] if a(n) InviteList object was created.
334
+ # @return [InviteContext] if a(n) InviteContext object was created.
328
335
  def invites(sid=:unset)
336
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
337
+
329
338
  if sid != :unset
330
339
  return InviteContext.new(
331
340
  @version,
@@ -267,7 +267,8 @@ module Twilio
267
267
 
268
268
  ##
269
269
  # Access the user_channels
270
- # @return [UserChannelList] UserChannelList
270
+ # @return [UserChannelList] if a(n) UserChannelList object was created.
271
+ # @return [UserChannelContext] if a(n) UserChannelContext object was created.
271
272
  def user_channels
272
273
  unless @user_channels
273
274
  @user_channels = UserChannelList.new(
@@ -18,7 +18,9 @@ module Twilio
18
18
  end
19
19
 
20
20
  def credentials(sid=:unset)
21
- if sid == :unset
21
+ if sid.nil?
22
+ raise ArgumentError, 'sid cannot be nil'
23
+ elsif sid == :unset
22
24
  @credentials ||= CredentialList.new self
23
25
  else
24
26
  CredentialContext.new(self, sid)
@@ -26,7 +28,9 @@ module Twilio
26
28
  end
27
29
 
28
30
  def services(sid=:unset)
29
- if sid == :unset
31
+ if sid.nil?
32
+ raise ArgumentError, 'sid cannot be nil'
33
+ elsif sid == :unset
30
34
  @services ||= ServiceList.new self
31
35
  else
32
36
  ServiceContext.new(self, sid)
@@ -314,8 +314,11 @@ module Twilio
314
314
 
315
315
  ##
316
316
  # Access the channels
317
- # @return [ChannelList] ChannelList
317
+ # @return [ChannelList] if a(n) ChannelList object was created.
318
+ # @return [ChannelContext] if a(n) ChannelContext object was created.
318
319
  def channels(sid=:unset)
320
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
321
+
319
322
  if sid != :unset
320
323
  return ChannelContext.new(
321
324
  @version,
@@ -336,8 +339,11 @@ module Twilio
336
339
 
337
340
  ##
338
341
  # Access the roles
339
- # @return [RoleList] RoleList
342
+ # @return [RoleList] if a(n) RoleList object was created.
343
+ # @return [RoleContext] if a(n) RoleContext object was created.
340
344
  def roles(sid=:unset)
345
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
346
+
341
347
  if sid != :unset
342
348
  return RoleContext.new(
343
349
  @version,
@@ -358,8 +364,11 @@ module Twilio
358
364
 
359
365
  ##
360
366
  # Access the users
361
- # @return [UserList] UserList
367
+ # @return [UserList] if a(n) UserList object was created.
368
+ # @return [UserContext] if a(n) UserContext object was created.
362
369
  def users(sid=:unset)
370
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
371
+
363
372
  if sid != :unset
364
373
  return UserContext.new(
365
374
  @version,
@@ -276,8 +276,11 @@ module Twilio
276
276
 
277
277
  ##
278
278
  # Access the members
279
- # @return [MemberList] MemberList
279
+ # @return [MemberList] if a(n) MemberList object was created.
280
+ # @return [MemberContext] if a(n) MemberContext object was created.
280
281
  def members(sid=:unset)
282
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
283
+
281
284
  if sid != :unset
282
285
  return MemberContext.new(
283
286
  @version,
@@ -300,8 +303,11 @@ module Twilio
300
303
 
301
304
  ##
302
305
  # Access the messages
303
- # @return [MessageList] MessageList
306
+ # @return [MessageList] if a(n) MessageList object was created.
307
+ # @return [MessageContext] if a(n) MessageContext object was created.
304
308
  def messages(sid=:unset)
309
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
310
+
305
311
  if sid != :unset
306
312
  return MessageContext.new(
307
313
  @version,
@@ -324,8 +330,11 @@ module Twilio
324
330
 
325
331
  ##
326
332
  # Access the invites
327
- # @return [InviteList] InviteList
333
+ # @return [InviteList] if a(n) InviteList object was created.
334
+ # @return [InviteContext] if a(n) InviteContext object was created.
328
335
  def invites(sid=:unset)
336
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
337
+
329
338
  if sid != :unset
330
339
  return InviteContext.new(
331
340
  @version,
@@ -267,7 +267,8 @@ module Twilio
267
267
 
268
268
  ##
269
269
  # Access the user_channels
270
- # @return [UserChannelList] UserChannelList
270
+ # @return [UserChannelList] if a(n) UserChannelList object was created.
271
+ # @return [UserChannelContext] if a(n) UserChannelContext object was created.
271
272
  def user_channels
272
273
  unless @user_channels
273
274
  @user_channels = UserChannelList.new(
@@ -17,7 +17,9 @@ module Twilio
17
17
  end
18
18
 
19
19
  def phone_numbers(sid=:unset)
20
- if sid == :unset
20
+ if sid.nil?
21
+ raise ArgumentError, 'sid cannot be nil'
22
+ elsif sid == :unset
21
23
  @phone_numbers ||= PhoneNumberList.new self
22
24
  else
23
25
  PhoneNumberContext.new(self, sid)
@@ -17,7 +17,9 @@ module Twilio
17
17
  end
18
18
 
19
19
  def services(sid=:unset)
20
- if sid == :unset
20
+ if sid.nil?
21
+ raise ArgumentError, 'sid cannot be nil'
22
+ elsif sid == :unset
21
23
  @services ||= ServiceList.new self
22
24
  else
23
25
  ServiceContext.new(self, sid)
@@ -38,8 +38,9 @@ module Twilio
38
38
  # @param [Boolean] fallback_to_long_code The fallback_to_long_code
39
39
  # @param [Boolean] area_code_geomatch The area_code_geomatch
40
40
  # @param [String] validity_period The validity_period
41
+ # @param [Boolean] synchronous_validation The synchronous_validation
41
42
  # @return [ServiceInstance] Newly created ServiceInstance
42
- def create(friendly_name: nil, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset)
43
+ def create(friendly_name: nil, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
43
44
  data = Twilio::Values.of({
44
45
  'FriendlyName' => friendly_name,
45
46
  'InboundRequestUrl' => inbound_request_url,
@@ -54,6 +55,7 @@ module Twilio
54
55
  'FallbackToLongCode' => fallback_to_long_code,
55
56
  'AreaCodeGeomatch' => area_code_geomatch,
56
57
  'ValidityPeriod' => validity_period,
58
+ 'SynchronousValidation' => synchronous_validation,
57
59
  })
58
60
 
59
61
  payload = @version.create(
@@ -239,8 +241,9 @@ module Twilio
239
241
  # @param [Boolean] fallback_to_long_code The fallback_to_long_code
240
242
  # @param [Boolean] area_code_geomatch The area_code_geomatch
241
243
  # @param [String] validity_period The validity_period
244
+ # @param [Boolean] synchronous_validation The synchronous_validation
242
245
  # @return [ServiceInstance] Updated ServiceInstance
243
- def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset)
246
+ def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
244
247
  data = Twilio::Values.of({
245
248
  'FriendlyName' => friendly_name,
246
249
  'InboundRequestUrl' => inbound_request_url,
@@ -255,6 +258,7 @@ module Twilio
255
258
  'FallbackToLongCode' => fallback_to_long_code,
256
259
  'AreaCodeGeomatch' => area_code_geomatch,
257
260
  'ValidityPeriod' => validity_period,
261
+ 'SynchronousValidation' => synchronous_validation,
258
262
  })
259
263
 
260
264
  payload = @version.update(
@@ -298,8 +302,11 @@ module Twilio
298
302
 
299
303
  ##
300
304
  # Access the phone_numbers
301
- # @return [PhoneNumberList] PhoneNumberList
305
+ # @return [PhoneNumberList] if a(n) PhoneNumberList object was created.
306
+ # @return [PhoneNumberContext] if a(n) PhoneNumberContext object was created.
302
307
  def phone_numbers(sid=:unset)
308
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
309
+
303
310
  if sid != :unset
304
311
  return PhoneNumberContext.new(
305
312
  @version,
@@ -320,8 +327,11 @@ module Twilio
320
327
 
321
328
  ##
322
329
  # Access the short_codes
323
- # @return [ShortCodeList] ShortCodeList
330
+ # @return [ShortCodeList] if a(n) ShortCodeList object was created.
331
+ # @return [ShortCodeContext] if a(n) ShortCodeContext object was created.
324
332
  def short_codes(sid=:unset)
333
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
334
+
325
335
  if sid != :unset
326
336
  return ShortCodeContext.new(
327
337
  @version,
@@ -342,8 +352,11 @@ module Twilio
342
352
 
343
353
  ##
344
354
  # Access the alpha_senders
345
- # @return [AlphaSenderList] AlphaSenderList
355
+ # @return [AlphaSenderList] if a(n) AlphaSenderList object was created.
356
+ # @return [AlphaSenderContext] if a(n) AlphaSenderContext object was created.
346
357
  def alpha_senders(sid=:unset)
358
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
359
+
347
360
  if sid != :unset
348
361
  return AlphaSenderContext.new(
349
362
  @version,
@@ -398,6 +411,7 @@ module Twilio
398
411
  'scan_message_content' => payload['scan_message_content'],
399
412
  'fallback_to_long_code' => payload['fallback_to_long_code'],
400
413
  'area_code_geomatch' => payload['area_code_geomatch'],
414
+ 'synchronous_validation' => payload['synchronous_validation'],
401
415
  'validity_period' => payload['validity_period'].to_i,
402
416
  'url' => payload['url'],
403
417
  'links' => payload['links'],
@@ -489,6 +503,10 @@ module Twilio
489
503
  @properties['area_code_geomatch']
490
504
  end
491
505
 
506
+ def synchronous_validation
507
+ @properties['synchronous_validation']
508
+ end
509
+
492
510
  def validity_period
493
511
  @properties['validity_period']
494
512
  end
@@ -517,8 +535,9 @@ module Twilio
517
535
  # @param [Boolean] fallback_to_long_code The fallback_to_long_code
518
536
  # @param [Boolean] area_code_geomatch The area_code_geomatch
519
537
  # @param [String] validity_period The validity_period
538
+ # @param [Boolean] synchronous_validation The synchronous_validation
520
539
  # @return [ServiceInstance] Updated ServiceInstance
521
- def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset)
540
+ def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
522
541
  context.update(
523
542
  friendly_name: friendly_name,
524
543
  inbound_request_url: inbound_request_url,
@@ -533,6 +552,7 @@ module Twilio
533
552
  fallback_to_long_code: fallback_to_long_code,
534
553
  area_code_geomatch: area_code_geomatch,
535
554
  validity_period: validity_period,
555
+ synchronous_validation: synchronous_validation,
536
556
  )
537
557
  end
538
558