twilio-ruby 5.0.0.rc24 → 5.0.0.rc25

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 (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
@@ -18,7 +18,9 @@ module Twilio
18
18
  end
19
19
 
20
20
  def alerts(sid=:unset)
21
- if sid == :unset
21
+ if sid.nil?
22
+ raise ArgumentError, 'sid cannot be nil'
23
+ elsif sid == :unset
22
24
  @alerts ||= AlertList.new self
23
25
  else
24
26
  AlertContext.new(self, sid)
@@ -26,7 +28,9 @@ module Twilio
26
28
  end
27
29
 
28
30
  def events(sid=:unset)
29
- if sid == :unset
31
+ if sid.nil?
32
+ raise ArgumentError, 'sid cannot be nil'
33
+ elsif sid == :unset
30
34
  @events ||= EventList.new self
31
35
  else
32
36
  EventContext.new(self, sid)
@@ -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)
@@ -308,8 +308,11 @@ module Twilio
308
308
 
309
309
  ##
310
310
  # Access the bindings
311
- # @return [BindingList] BindingList
311
+ # @return [BindingList] if a(n) BindingList object was created.
312
+ # @return [BindingContext] if a(n) BindingContext object was created.
312
313
  def bindings(sid=:unset)
314
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
315
+
313
316
  if sid != :unset
314
317
  return BindingContext.new(
315
318
  @version,
@@ -330,7 +333,8 @@ module Twilio
330
333
 
331
334
  ##
332
335
  # Access the notifications
333
- # @return [NotificationList] NotificationList
336
+ # @return [NotificationList] if a(n) NotificationList object was created.
337
+ # @return [NotificationContext] if a(n) NotificationContext object was created.
334
338
  def notifications
335
339
  unless @notifications
336
340
  @notifications = NotificationList.new(
@@ -344,8 +348,11 @@ module Twilio
344
348
 
345
349
  ##
346
350
  # Access the users
347
- # @return [UserList] UserList
351
+ # @return [UserList] if a(n) UserList object was created.
352
+ # @return [UserContext] if a(n) UserContext object was created.
348
353
  def users(identity=:unset)
354
+ raise ArgumentError, 'identity cannot be nil' if identity.nil?
355
+
349
356
  if identity != :unset
350
357
  return UserContext.new(
351
358
  @version,
@@ -366,7 +373,8 @@ module Twilio
366
373
 
367
374
  ##
368
375
  # Access the segments
369
- # @return [SegmentList] SegmentList
376
+ # @return [SegmentList] if a(n) SegmentList object was created.
377
+ # @return [SegmentContext] if a(n) SegmentContext object was created.
370
378
  def segments
371
379
  unless @segments
372
380
  @segments = SegmentList.new(
@@ -42,10 +42,11 @@ module Twilio
42
42
  # @param [String] fcm The fcm
43
43
  # @param [String] segment The segment
44
44
  # @param [String] alexa The alexa
45
+ # @param [String] to_binding The to_binding
45
46
  # @param [String] identity The identity
46
47
  # @param [String] tag The tag
47
48
  # @return [NotificationInstance] Newly created NotificationInstance
48
- def create(body: :unset, priority: :unset, ttl: :unset, title: :unset, sound: :unset, action: :unset, data: :unset, apn: :unset, gcm: :unset, sms: :unset, facebook_messenger: :unset, fcm: :unset, segment: :unset, alexa: :unset, identity: :unset, tag: :unset)
49
+ def create(body: :unset, priority: :unset, ttl: :unset, title: :unset, sound: :unset, action: :unset, data: :unset, apn: :unset, gcm: :unset, sms: :unset, facebook_messenger: :unset, fcm: :unset, segment: :unset, alexa: :unset, to_binding: :unset, identity: :unset, tag: :unset)
49
50
  data = Twilio::Values.of({
50
51
  'Identity' => identity,
51
52
  'Tag' => tag,
@@ -63,6 +64,7 @@ module Twilio
63
64
  'Fcm' => fcm,
64
65
  'Segment' => segment,
65
66
  'Alexa' => alexa,
67
+ 'ToBinding' => to_binding,
66
68
  })
67
69
 
68
70
  payload = @version.create(
@@ -251,8 +251,11 @@ module Twilio
251
251
 
252
252
  ##
253
253
  # Access the bindings
254
- # @return [UserBindingList] UserBindingList
254
+ # @return [UserBindingList] if a(n) UserBindingList object was created.
255
+ # @return [UserBindingContext] if a(n) UserBindingContext object was created.
255
256
  def bindings(sid=:unset)
257
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
258
+
256
259
  if sid != :unset
257
260
  return UserBindingContext.new(
258
261
  @version,
@@ -275,8 +278,11 @@ module Twilio
275
278
 
276
279
  ##
277
280
  # Access the segment_memberships
278
- # @return [SegmentMembershipList] SegmentMembershipList
281
+ # @return [SegmentMembershipList] if a(n) SegmentMembershipList object was created.
282
+ # @return [SegmentMembershipContext] if a(n) SegmentMembershipContext object was created.
279
283
  def segment_memberships(segment=:unset)
284
+ raise ArgumentError, 'segment cannot be nil' if segment.nil?
285
+
280
286
  if segment != :unset
281
287
  return SegmentMembershipContext.new(
282
288
  @version,
@@ -18,7 +18,9 @@ module Twilio
18
18
  end
19
19
 
20
20
  def exports(sid=:unset)
21
- if sid == :unset
21
+ if sid.nil?
22
+ raise ArgumentError, 'sid cannot be nil'
23
+ elsif sid == :unset
22
24
  @exports ||= ExportList.new self
23
25
  else
24
26
  ExportContext.new(self, sid)
@@ -26,7 +28,9 @@ module Twilio
26
28
  end
27
29
 
28
30
  def export_configuration(sid=:unset)
29
- if sid == :unset
31
+ if sid.nil?
32
+ raise ArgumentError, 'sid cannot be nil'
33
+ elsif sid == :unset
30
34
  @export_configuration ||= ExportConfigurationList.new self
31
35
  else
32
36
  ExportConfigurationContext.new(self, sid)
@@ -99,7 +99,8 @@ module Twilio
99
99
 
100
100
  ##
101
101
  # Access the days
102
- # @return [DayList] DayList
102
+ # @return [DayList] if a(n) DayList object was created.
103
+ # @return [DayContext] if a(n) DayContext object was created.
103
104
  def days
104
105
  unless @days
105
106
  @days = DayList.new(
@@ -17,7 +17,9 @@ module Twilio
17
17
  end
18
18
 
19
19
  def hosted_number_orders(sid=:unset)
20
- if sid == :unset
20
+ if sid.nil?
21
+ raise ArgumentError, 'sid cannot be nil'
22
+ elsif sid == :unset
21
23
  @hosted_number_orders ||= HostedNumberOrderList.new self
22
24
  else
23
25
  HostedNumberOrderContext.new(self, sid)
@@ -26,8 +26,8 @@ module Twilio
26
26
  # Unlike stream(), this operation is eager and will load `limit` records into
27
27
  # memory before returning.
28
28
  # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
29
- # One of `received`, `pending-loa`, `carrier-processing`, `testing`, `completed`,
30
- # `failed`, or `action-required`.
29
+ # One of `received`, `pending-verification`, `verified`, `pending-loa`,
30
+ # `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`.
31
31
  # @param [String] phone_number An E164 formatted phone number hosted by this
32
32
  # HostedNumberOrder.
33
33
  # @param [String] incoming_phone_number_sid A 34 character string that uniquely
@@ -61,8 +61,8 @@ module Twilio
61
61
  # This operation lazily loads records as efficiently as possible until the limit
62
62
  # is reached.
63
63
  # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
64
- # One of `received`, `pending-loa`, `carrier-processing`, `testing`, `completed`,
65
- # `failed`, or `action-required`.
64
+ # One of `received`, `pending-verification`, `verified`, `pending-loa`,
65
+ # `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`.
66
66
  # @param [String] phone_number An E164 formatted phone number hosted by this
67
67
  # HostedNumberOrder.
68
68
  # @param [String] incoming_phone_number_sid A 34 character string that uniquely
@@ -99,8 +99,8 @@ module Twilio
99
99
  # This operation lazily loads records as efficiently as possible until the limit
100
100
  # is reached.
101
101
  # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
102
- # One of `received`, `pending-loa`, `carrier-processing`, `testing`, `completed`,
103
- # `failed`, or `action-required`.
102
+ # One of `received`, `pending-verification`, `verified`, `pending-loa`,
103
+ # `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`.
104
104
  # @param [String] phone_number An E164 formatted phone number hosted by this
105
105
  # HostedNumberOrder.
106
106
  # @param [String] incoming_phone_number_sid A 34 character string that uniquely
@@ -132,8 +132,8 @@ module Twilio
132
132
  # Retrieve a single page of HostedNumberOrderInstance records from the API.
133
133
  # Request is executed immediately.
134
134
  # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
135
- # One of `received`, `pending-loa`, `carrier-processing`, `testing`, `completed`,
136
- # `failed`, or `action-required`.
135
+ # One of `received`, `pending-verification`, `verified`, `pending-loa`,
136
+ # `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`.
137
137
  # @param [String] phone_number An E164 formatted phone number hosted by this
138
138
  # HostedNumberOrder.
139
139
  # @param [String] incoming_phone_number_sid A 34 character string that uniquely
@@ -332,15 +332,18 @@ module Twilio
332
332
  # @param [String] cc_emails Optional. A list of emails that LOA document for this
333
333
  # HostedNumberOrder will be carbon copied to.
334
334
  # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
335
- # User can only update this to `pending-loa`.
335
+ # User can only update this to `pending-loa` or `pending-verification`.
336
+ # @param [String] verification_code A verification code that is given to the user
337
+ # via a phone call to the phone number that is being hosted.
336
338
  # @return [HostedNumberOrderInstance] Updated HostedNumberOrderInstance
337
- def update(friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset)
339
+ def update(friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset, verification_code: :unset)
338
340
  data = Twilio::Values.of({
339
341
  'FriendlyName' => friendly_name,
340
342
  'UniqueName' => unique_name,
341
343
  'Email' => email,
342
344
  'CcEmails' => cc_emails,
343
345
  'Status' => status,
346
+ 'VerificationCode' => verification_code,
344
347
  })
345
348
 
346
349
  payload = @version.update(
@@ -502,15 +505,18 @@ module Twilio
502
505
  # @param [String] cc_emails Optional. A list of emails that LOA document for this
503
506
  # HostedNumberOrder will be carbon copied to.
504
507
  # @param [hosted_number_order.Status] status The Status of this HostedNumberOrder.
505
- # User can only update this to `pending-loa`.
508
+ # User can only update this to `pending-loa` or `pending-verification`.
509
+ # @param [String] verification_code A verification code that is given to the user
510
+ # via a phone call to the phone number that is being hosted.
506
511
  # @return [HostedNumberOrderInstance] Updated HostedNumberOrderInstance
507
- def update(friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset)
512
+ def update(friendly_name: :unset, unique_name: :unset, email: :unset, cc_emails: :unset, status: :unset, verification_code: :unset)
508
513
  context.update(
509
514
  friendly_name: friendly_name,
510
515
  unique_name: unique_name,
511
516
  email: email,
512
517
  cc_emails: cc_emails,
513
518
  status: status,
519
+ verification_code: verification_code,
514
520
  )
515
521
  end
516
522
 
@@ -18,7 +18,9 @@ module Twilio
18
18
  end
19
19
 
20
20
  def available_add_ons(sid=:unset)
21
- if sid == :unset
21
+ if sid.nil?
22
+ raise ArgumentError, 'sid cannot be nil'
23
+ elsif sid == :unset
22
24
  @available_add_ons ||= AvailableAddOnList.new self
23
25
  else
24
26
  AvailableAddOnContext.new(self, sid)
@@ -26,7 +28,9 @@ module Twilio
26
28
  end
27
29
 
28
30
  def installed_add_ons(sid=:unset)
29
- if sid == :unset
31
+ if sid.nil?
32
+ raise ArgumentError, 'sid cannot be nil'
33
+ elsif sid == :unset
30
34
  @installed_add_ons ||= InstalledAddOnList.new self
31
35
  else
32
36
  InstalledAddOnContext.new(self, sid)
@@ -196,8 +196,11 @@ module Twilio
196
196
 
197
197
  ##
198
198
  # Access the extensions
199
- # @return [AvailableAddOnExtensionList] AvailableAddOnExtensionList
199
+ # @return [AvailableAddOnExtensionList] if a(n) AvailableAddOnExtensionList object was created.
200
+ # @return [AvailableAddOnExtensionContext] if a(n) AvailableAddOnExtensionContext object was created.
200
201
  def extensions(sid=:unset)
202
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
203
+
201
204
  if sid != :unset
202
205
  return AvailableAddOnExtensionContext.new(
203
206
  @version,
@@ -261,8 +261,11 @@ module Twilio
261
261
 
262
262
  ##
263
263
  # Access the extensions
264
- # @return [InstalledAddOnExtensionList] InstalledAddOnExtensionList
264
+ # @return [InstalledAddOnExtensionList] if a(n) InstalledAddOnExtensionList object was created.
265
+ # @return [InstalledAddOnExtensionContext] if a(n) InstalledAddOnExtensionContext object was created.
265
266
  def extensions(sid=:unset)
267
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
268
+
266
269
  if sid != :unset
267
270
  return InstalledAddOnExtensionContext.new(
268
271
  @version,
@@ -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)
@@ -262,8 +262,11 @@ module Twilio
262
262
 
263
263
  ##
264
264
  # Access the sessions
265
- # @return [SessionList] SessionList
265
+ # @return [SessionList] if a(n) SessionList object was created.
266
+ # @return [SessionContext] if a(n) SessionContext object was created.
266
267
  def sessions(sid=:unset)
268
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
269
+
267
270
  if sid != :unset
268
271
  return SessionContext.new(
269
272
  @version,
@@ -284,8 +287,11 @@ module Twilio
284
287
 
285
288
  ##
286
289
  # Access the phone_numbers
287
- # @return [PhoneNumberList] PhoneNumberList
290
+ # @return [PhoneNumberList] if a(n) PhoneNumberList object was created.
291
+ # @return [PhoneNumberContext] if a(n) PhoneNumberContext object was created.
288
292
  def phone_numbers(sid=:unset)
293
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
294
+
289
295
  if sid != :unset
290
296
  return PhoneNumberContext.new(
291
297
  @version,
@@ -306,8 +312,11 @@ module Twilio
306
312
 
307
313
  ##
308
314
  # Access the short_codes
309
- # @return [ShortCodeList] ShortCodeList
315
+ # @return [ShortCodeList] if a(n) ShortCodeList object was created.
316
+ # @return [ShortCodeContext] if a(n) ShortCodeContext object was created.
310
317
  def short_codes(sid=:unset)
318
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
319
+
311
320
  if sid != :unset
312
321
  return ShortCodeContext.new(
313
322
  @version,
@@ -304,8 +304,11 @@ module Twilio
304
304
 
305
305
  ##
306
306
  # Access the interactions
307
- # @return [InteractionList] InteractionList
307
+ # @return [InteractionList] if a(n) InteractionList object was created.
308
+ # @return [InteractionContext] if a(n) InteractionContext object was created.
308
309
  def interactions(sid=:unset)
310
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
311
+
309
312
  if sid != :unset
310
313
  return InteractionContext.new(
311
314
  @version,
@@ -328,8 +331,11 @@ module Twilio
328
331
 
329
332
  ##
330
333
  # Access the participants
331
- # @return [ParticipantList] ParticipantList
334
+ # @return [ParticipantList] if a(n) ParticipantList object was created.
335
+ # @return [ParticipantContext] if a(n) ParticipantContext object was created.
332
336
  def participants(sid=:unset)
337
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
338
+
333
339
  if sid != :unset
334
340
  return ParticipantContext.new(
335
341
  @version,
@@ -304,8 +304,11 @@ module Twilio
304
304
 
305
305
  ##
306
306
  # Access the message_interactions
307
- # @return [MessageInteractionList] MessageInteractionList
307
+ # @return [MessageInteractionList] if a(n) MessageInteractionList object was created.
308
+ # @return [MessageInteractionContext] if a(n) MessageInteractionContext object was created.
308
309
  def message_interactions(sid=:unset)
310
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
311
+
309
312
  if sid != :unset
310
313
  return MessageInteractionContext.new(
311
314
  @version,
@@ -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)
@@ -260,8 +260,11 @@ module Twilio
260
260
 
261
261
  ##
262
262
  # Access the documents
263
- # @return [DocumentList] DocumentList
263
+ # @return [DocumentList] if a(n) DocumentList object was created.
264
+ # @return [DocumentContext] if a(n) DocumentContext object was created.
264
265
  def documents(sid=:unset)
266
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
267
+
265
268
  if sid != :unset
266
269
  return DocumentContext.new(
267
270
  @version,
@@ -282,8 +285,11 @@ module Twilio
282
285
 
283
286
  ##
284
287
  # Access the sync_lists
285
- # @return [SyncListList] SyncListList
288
+ # @return [SyncListList] if a(n) SyncListList object was created.
289
+ # @return [SyncListContext] if a(n) SyncListContext object was created.
286
290
  def sync_lists(sid=:unset)
291
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
292
+
287
293
  if sid != :unset
288
294
  return SyncListContext.new(
289
295
  @version,
@@ -304,8 +310,11 @@ module Twilio
304
310
 
305
311
  ##
306
312
  # Access the sync_maps
307
- # @return [SyncMapList] SyncMapList
313
+ # @return [SyncMapList] if a(n) SyncMapList object was created.
314
+ # @return [SyncMapContext] if a(n) SyncMapContext object was created.
308
315
  def sync_maps(sid=:unset)
316
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
317
+
309
318
  if sid != :unset
310
319
  return SyncMapContext.new(
311
320
  @version,