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
@@ -293,8 +293,11 @@ module Twilio
293
293
 
294
294
  ##
295
295
  # Access the participants
296
- # @return [ParticipantList] ParticipantList
296
+ # @return [ParticipantList] if a(n) ParticipantList object was created.
297
+ # @return [ParticipantContext] if a(n) ParticipantContext object was created.
297
298
  def participants(call_sid=:unset)
299
+ raise ArgumentError, 'call_sid cannot be nil' if call_sid.nil?
300
+
298
301
  if call_sid != :unset
299
302
  return ParticipantContext.new(
300
303
  @version,
@@ -254,7 +254,8 @@ module Twilio
254
254
 
255
255
  ##
256
256
  # Access the local
257
- # @return [LocalList] LocalList
257
+ # @return [LocalList] if a(n) LocalList object was created.
258
+ # @return [LocalContext] if a(n) LocalContext object was created.
258
259
  def local
259
260
  @local ||= LocalList.new(
260
261
  @version,
@@ -264,7 +265,8 @@ module Twilio
264
265
 
265
266
  ##
266
267
  # Access the mobile
267
- # @return [MobileList] MobileList
268
+ # @return [MobileList] if a(n) MobileList object was created.
269
+ # @return [MobileContext] if a(n) MobileContext object was created.
268
270
  def mobile
269
271
  @mobile ||= MobileList.new(
270
272
  @version,
@@ -274,7 +276,8 @@ module Twilio
274
276
 
275
277
  ##
276
278
  # Access the toll_free
277
- # @return [TollFreeList] TollFreeList
279
+ # @return [TollFreeList] if a(n) TollFreeList object was created.
280
+ # @return [TollFreeContext] if a(n) TollFreeContext object was created.
278
281
  def toll_free
279
282
  @toll_free ||= TollFreeList.new(
280
283
  @version,
@@ -459,8 +462,11 @@ module Twilio
459
462
 
460
463
  ##
461
464
  # Access the assigned_add_ons
462
- # @return [AssignedAddOnList] AssignedAddOnList
465
+ # @return [AssignedAddOnList] if a(n) AssignedAddOnList object was created.
466
+ # @return [AssignedAddOnContext] if a(n) AssignedAddOnContext object was created.
463
467
  def assigned_add_ons(sid=:unset)
468
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
469
+
464
470
  if sid != :unset
465
471
  return AssignedAddOnContext.new(
466
472
  @version,
@@ -249,8 +249,11 @@ module Twilio
249
249
 
250
250
  ##
251
251
  # Access the extensions
252
- # @return [AssignedAddOnExtensionList] AssignedAddOnExtensionList
252
+ # @return [AssignedAddOnExtensionList] if a(n) AssignedAddOnExtensionList object was created.
253
+ # @return [AssignedAddOnExtensionContext] if a(n) AssignedAddOnExtensionContext object was created.
253
254
  def extensions(sid=:unset)
255
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
256
+
254
257
  if sid != :unset
255
258
  return AssignedAddOnExtensionContext.new(
256
259
  @version,
@@ -316,8 +316,11 @@ module Twilio
316
316
 
317
317
  ##
318
318
  # Access the media
319
- # @return [MediaList] MediaList
319
+ # @return [MediaList] if a(n) MediaList object was created.
320
+ # @return [MediaContext] if a(n) MediaContext object was created.
320
321
  def media(sid=:unset)
322
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
323
+
321
324
  if sid != :unset
322
325
  return MediaContext.new(
323
326
  @version,
@@ -340,7 +343,8 @@ module Twilio
340
343
 
341
344
  ##
342
345
  # Access the feedback
343
- # @return [FeedbackList] FeedbackList
346
+ # @return [FeedbackList] if a(n) FeedbackList object was created.
347
+ # @return [FeedbackContext] if a(n) FeedbackContext object was created.
344
348
  def feedback
345
349
  unless @feedback
346
350
  @feedback = FeedbackList.new(
@@ -263,8 +263,11 @@ module Twilio
263
263
 
264
264
  ##
265
265
  # Access the members
266
- # @return [MemberList] MemberList
266
+ # @return [MemberList] if a(n) MemberList object was created.
267
+ # @return [MemberContext] if a(n) MemberContext object was created.
267
268
  def members(call_sid=:unset)
269
+ raise ArgumentError, 'call_sid cannot be nil' if call_sid.nil?
270
+
268
271
  if call_sid != :unset
269
272
  return MemberContext.new(
270
273
  @version,
@@ -246,8 +246,11 @@ module Twilio
246
246
 
247
247
  ##
248
248
  # Access the transcriptions
249
- # @return [TranscriptionList] TranscriptionList
249
+ # @return [TranscriptionList] if a(n) TranscriptionList object was created.
250
+ # @return [TranscriptionContext] if a(n) TranscriptionContext object was created.
250
251
  def transcriptions(sid=:unset)
252
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
253
+
251
254
  if sid != :unset
252
255
  return TranscriptionContext.new(
253
256
  @version,
@@ -270,8 +273,11 @@ module Twilio
270
273
 
271
274
  ##
272
275
  # Access the add_on_results
273
- # @return [AddOnResultList] AddOnResultList
276
+ # @return [AddOnResultList] if a(n) AddOnResultList object was created.
277
+ # @return [AddOnResultContext] if a(n) AddOnResultContext object was created.
274
278
  def add_on_results(sid=:unset)
279
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
280
+
275
281
  if sid != :unset
276
282
  return AddOnResultContext.new(
277
283
  @version,
@@ -327,6 +333,8 @@ module Twilio
327
333
  'channels' => payload['channels'].to_i,
328
334
  'source' => payload['source'],
329
335
  'uri' => payload['uri'],
336
+ 'encryption_type' => payload['encryption_type'],
337
+ 'encryption_details' => payload['encryption_details'],
330
338
  }
331
339
 
332
340
  # Context
@@ -405,6 +413,14 @@ module Twilio
405
413
  @properties['uri']
406
414
  end
407
415
 
416
+ def encryption_type
417
+ @properties['encryption_type']
418
+ end
419
+
420
+ def encryption_details
421
+ @properties['encryption_details']
422
+ end
423
+
408
424
  ##
409
425
  # Fetch a RecordingInstance
410
426
  # @return [RecordingInstance] Fetched RecordingInstance
@@ -223,8 +223,11 @@ module Twilio
223
223
 
224
224
  ##
225
225
  # Access the payloads
226
- # @return [PayloadList] PayloadList
226
+ # @return [PayloadList] if a(n) PayloadList object was created.
227
+ # @return [PayloadContext] if a(n) PayloadContext object was created.
227
228
  def payloads(sid=:unset)
229
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
230
+
228
231
  if sid != :unset
229
232
  return PayloadContext.new(
230
233
  @version,
@@ -34,8 +34,11 @@ module Twilio
34
34
  ##
35
35
  # Access the domains
36
36
  # @param [String] sid The domain sid that uniquely identifies the resource
37
- # @return [DomainList] DomainList
37
+ # @return [DomainList] if a(n) DomainList object was created.
38
+ # @return [DomainContext] if a(n) DomainContext object was created.
38
39
  def domains(sid=:unset)
40
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
41
+
39
42
  if sid != :unset
40
43
  return DomainContext.new(
41
44
  @version,
@@ -52,7 +55,8 @@ module Twilio
52
55
 
53
56
  ##
54
57
  # Access the regions
55
- # @return [RegionList] RegionList
58
+ # @return [RegionList] if a(n) RegionList object was created.
59
+ # @return [RegionContext] if a(n) RegionContext object was created.
56
60
  def regions
57
61
  @regions ||= RegionList.new(
58
62
  @version,
@@ -64,8 +68,11 @@ module Twilio
64
68
  # Access the ip_access_control_lists
65
69
  # @param [String] sid The ip-access-control-list Sid that uniquely identifies this
66
70
  # resource
67
- # @return [IpAccessControlListList] IpAccessControlListList
71
+ # @return [IpAccessControlListList] if a(n) IpAccessControlListList object was created.
72
+ # @return [IpAccessControlListContext] if a(n) IpAccessControlListContext object was created.
68
73
  def ip_access_control_lists(sid=:unset)
74
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
75
+
69
76
  if sid != :unset
70
77
  return IpAccessControlListContext.new(
71
78
  @version,
@@ -83,8 +90,11 @@ module Twilio
83
90
  ##
84
91
  # Access the credential_lists
85
92
  # @param [String] sid The credential Sid that uniquely identifies this resource
86
- # @return [CredentialListList] CredentialListList
93
+ # @return [CredentialListList] if a(n) CredentialListList object was created.
94
+ # @return [CredentialListContext] if a(n) CredentialListContext object was created.
87
95
  def credential_lists(sid=:unset)
96
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
97
+
88
98
  if sid != :unset
89
99
  return CredentialListContext.new(
90
100
  @version,
@@ -260,8 +260,11 @@ module Twilio
260
260
 
261
261
  ##
262
262
  # Access the credentials
263
- # @return [CredentialList] CredentialList
263
+ # @return [CredentialList] if a(n) CredentialList object was created.
264
+ # @return [CredentialContext] if a(n) CredentialContext object was created.
264
265
  def credentials(sid=:unset)
266
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
267
+
265
268
  if sid != :unset
266
269
  return CredentialContext.new(
267
270
  @version,
@@ -299,8 +299,11 @@ module Twilio
299
299
 
300
300
  ##
301
301
  # Access the ip_access_control_list_mappings
302
- # @return [IpAccessControlListMappingList] IpAccessControlListMappingList
302
+ # @return [IpAccessControlListMappingList] if a(n) IpAccessControlListMappingList object was created.
303
+ # @return [IpAccessControlListMappingContext] if a(n) IpAccessControlListMappingContext object was created.
303
304
  def ip_access_control_list_mappings(sid=:unset)
305
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
306
+
304
307
  if sid != :unset
305
308
  return IpAccessControlListMappingContext.new(
306
309
  @version,
@@ -323,8 +326,11 @@ module Twilio
323
326
 
324
327
  ##
325
328
  # Access the credential_list_mappings
326
- # @return [CredentialListMappingList] CredentialListMappingList
329
+ # @return [CredentialListMappingList] if a(n) CredentialListMappingList object was created.
330
+ # @return [CredentialListMappingContext] if a(n) CredentialListMappingContext object was created.
327
331
  def credential_list_mappings(sid=:unset)
332
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
333
+
328
334
  if sid != :unset
329
335
  return CredentialListMappingContext.new(
330
336
  @version,
@@ -263,8 +263,11 @@ module Twilio
263
263
 
264
264
  ##
265
265
  # Access the ip_addresses
266
- # @return [IpAddressList] IpAddressList
266
+ # @return [IpAddressList] if a(n) IpAddressList object was created.
267
+ # @return [IpAddressContext] if a(n) IpAddressContext object was created.
267
268
  def ip_addresses(sid=:unset)
269
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
270
+
268
271
  if sid != :unset
269
272
  return IpAddressContext.new(
270
273
  @version,
@@ -31,7 +31,8 @@ module Twilio
31
31
 
32
32
  ##
33
33
  # Access the records
34
- # @return [RecordList] RecordList
34
+ # @return [RecordList] if a(n) RecordList object was created.
35
+ # @return [RecordContext] if a(n) RecordContext object was created.
35
36
  def records
36
37
  @records ||= RecordList.new(
37
38
  @version,
@@ -42,8 +43,11 @@ module Twilio
42
43
  ##
43
44
  # Access the triggers
44
45
  # @param [String] sid The usage-trigger Sid that uniquely identifies this resource
45
- # @return [TriggerList] TriggerList
46
+ # @return [TriggerList] if a(n) TriggerList object was created.
47
+ # @return [TriggerContext] if a(n) TriggerContext object was created.
46
48
  def triggers(sid=:unset)
49
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
50
+
47
51
  if sid != :unset
48
52
  return TriggerContext.new(
49
53
  @version,
@@ -179,7 +179,8 @@ module Twilio
179
179
 
180
180
  ##
181
181
  # Access the all_time
182
- # @return [AllTimeList] AllTimeList
182
+ # @return [AllTimeList] if a(n) AllTimeList object was created.
183
+ # @return [AllTimeContext] if a(n) AllTimeContext object was created.
183
184
  def all_time
184
185
  @all_time ||= AllTimeList.new(
185
186
  @version,
@@ -189,7 +190,8 @@ module Twilio
189
190
 
190
191
  ##
191
192
  # Access the daily
192
- # @return [DailyList] DailyList
193
+ # @return [DailyList] if a(n) DailyList object was created.
194
+ # @return [DailyContext] if a(n) DailyContext object was created.
193
195
  def daily
194
196
  @daily ||= DailyList.new(
195
197
  @version,
@@ -199,7 +201,8 @@ module Twilio
199
201
 
200
202
  ##
201
203
  # Access the last_month
202
- # @return [LastMonthList] LastMonthList
204
+ # @return [LastMonthList] if a(n) LastMonthList object was created.
205
+ # @return [LastMonthContext] if a(n) LastMonthContext object was created.
203
206
  def last_month
204
207
  @last_month ||= LastMonthList.new(
205
208
  @version,
@@ -209,7 +212,8 @@ module Twilio
209
212
 
210
213
  ##
211
214
  # Access the monthly
212
- # @return [MonthlyList] MonthlyList
215
+ # @return [MonthlyList] if a(n) MonthlyList object was created.
216
+ # @return [MonthlyContext] if a(n) MonthlyContext object was created.
213
217
  def monthly
214
218
  @monthly ||= MonthlyList.new(
215
219
  @version,
@@ -219,7 +223,8 @@ module Twilio
219
223
 
220
224
  ##
221
225
  # Access the this_month
222
- # @return [ThisMonthList] ThisMonthList
226
+ # @return [ThisMonthList] if a(n) ThisMonthList object was created.
227
+ # @return [ThisMonthContext] if a(n) ThisMonthContext object was created.
223
228
  def this_month
224
229
  @this_month ||= ThisMonthList.new(
225
230
  @version,
@@ -229,7 +234,8 @@ module Twilio
229
234
 
230
235
  ##
231
236
  # Access the today
232
- # @return [TodayList] TodayList
237
+ # @return [TodayList] if a(n) TodayList object was created.
238
+ # @return [TodayContext] if a(n) TodayContext object was created.
233
239
  def today
234
240
  @today ||= TodayList.new(
235
241
  @version,
@@ -239,7 +245,8 @@ module Twilio
239
245
 
240
246
  ##
241
247
  # Access the yearly
242
- # @return [YearlyList] YearlyList
248
+ # @return [YearlyList] if a(n) YearlyList object was created.
249
+ # @return [YearlyContext] if a(n) YearlyContext object was created.
243
250
  def yearly
244
251
  @yearly ||= YearlyList.new(
245
252
  @version,
@@ -249,7 +256,8 @@ module Twilio
249
256
 
250
257
  ##
251
258
  # Access the yesterday
252
- # @return [YesterdayList] YesterdayList
259
+ # @return [YesterdayList] if a(n) YesterdayList object was created.
260
+ # @return [YesterdayContext] if a(n) YesterdayContext object was created.
253
261
  def yesterday
254
262
  @yesterday ||= YesterdayList.new(
255
263
  @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,