twilio-ruby 5.0.0.rc26 → 5.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (328) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +21 -0
  3. data/.rubocop_todo.yml +187 -0
  4. data/.travis.yml +13 -0
  5. data/CHANGES.md +4 -0
  6. data/Gemfile +2 -2
  7. data/Makefile +8 -1
  8. data/Rakefile +3 -7
  9. data/examples/examples.rb +12 -10
  10. data/examples/{print-call-log.rb → print_call_log.rb} +4 -4
  11. data/lib/rack/twilio_webhook_authentication.rb +2 -3
  12. data/lib/twilio-ruby/framework/domain.rb +2 -6
  13. data/lib/twilio-ruby/framework/error.rb +0 -1
  14. data/lib/twilio-ruby/framework/helper.rb +1 -1
  15. data/lib/twilio-ruby/framework/page.rb +23 -25
  16. data/lib/twilio-ruby/framework/resource.rb +2 -2
  17. data/lib/twilio-ruby/framework/serialize.rb +5 -12
  18. data/lib/twilio-ruby/framework/twilio_response.rb +1 -1
  19. data/lib/twilio-ruby/framework/values.rb +2 -2
  20. data/lib/twilio-ruby/framework/version.rb +19 -37
  21. data/lib/twilio-ruby/http/http_client.rb +5 -6
  22. data/lib/twilio-ruby/jwt/access_token.rb +27 -41
  23. data/lib/twilio-ruby/jwt/client_capability.rb +11 -16
  24. data/lib/twilio-ruby/jwt/jwt.rb +7 -13
  25. data/lib/twilio-ruby/jwt/task_router.rb +40 -38
  26. data/lib/twilio-ruby/rest/accounts.rb +2 -0
  27. data/lib/twilio-ruby/rest/accounts/v1.rb +2 -0
  28. data/lib/twilio-ruby/rest/accounts/v1/credential.rb +2 -2
  29. data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +12 -7
  30. data/lib/twilio-ruby/rest/api.rb +96 -0
  31. data/lib/twilio-ruby/rest/api/v2010.rb +5 -0
  32. data/lib/twilio-ruby/rest/api/v2010/account.rb +66 -56
  33. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +30 -13
  34. data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +22 -8
  35. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +40 -11
  36. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +20 -9
  37. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +16 -15
  38. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +26 -28
  39. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +26 -28
  40. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +26 -28
  41. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +64 -34
  42. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +12 -4
  43. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +28 -3
  44. data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +37 -16
  45. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +25 -15
  46. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +28 -27
  47. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +28 -19
  48. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +22 -9
  49. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +62 -58
  50. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +52 -12
  51. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +52 -12
  52. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +52 -12
  53. data/lib/twilio-ruby/rest/api/v2010/account/key.rb +8 -9
  54. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +47 -20
  55. data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +12 -2
  56. data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +17 -17
  57. data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +10 -2
  58. data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +10 -2
  59. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +37 -16
  60. data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +14 -13
  61. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +20 -10
  62. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +10 -10
  63. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +37 -21
  64. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +22 -13
  65. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +22 -13
  66. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +26 -9
  67. data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +24 -13
  68. data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +8 -9
  69. data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +8 -10
  70. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +16 -11
  71. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +14 -9
  72. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +36 -13
  73. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +14 -10
  74. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +14 -10
  75. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +16 -11
  76. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +16 -9
  77. data/lib/twilio-ruby/rest/api/v2010/account/token.rb +14 -2
  78. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +26 -9
  79. data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +4 -6
  80. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +44 -33
  81. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +28 -11
  82. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +28 -11
  83. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +28 -11
  84. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +28 -11
  85. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +28 -11
  86. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +28 -11
  87. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +28 -11
  88. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +28 -11
  89. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +32 -15
  90. data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +10 -1
  91. data/lib/twilio-ruby/rest/chat.rb +8 -0
  92. data/lib/twilio-ruby/rest/chat/v1.rb +8 -0
  93. data/lib/twilio-ruby/rest/chat/v1/credential.rb +16 -7
  94. data/lib/twilio-ruby/rest/chat/v1/service.rb +48 -13
  95. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +34 -15
  96. data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +20 -10
  97. data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +22 -10
  98. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +26 -10
  99. data/lib/twilio-ruby/rest/chat/v1/service/role.rb +18 -8
  100. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +30 -10
  101. data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +16 -8
  102. data/lib/twilio-ruby/rest/chat/v2.rb +8 -0
  103. data/lib/twilio-ruby/rest/chat/v2/credential.rb +16 -7
  104. data/lib/twilio-ruby/rest/chat/v2/service.rb +46 -13
  105. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +34 -15
  106. data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +20 -10
  107. data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +22 -10
  108. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +26 -10
  109. data/lib/twilio-ruby/rest/chat/v2/service/role.rb +18 -8
  110. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +30 -10
  111. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +16 -8
  112. data/lib/twilio-ruby/rest/client.rb +94 -45
  113. data/lib/twilio-ruby/rest/ip_messaging.rb +8 -0
  114. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +8 -0
  115. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +16 -7
  116. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +48 -13
  117. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +34 -15
  118. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +20 -10
  119. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +22 -10
  120. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +26 -10
  121. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +18 -8
  122. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +30 -10
  123. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +16 -8
  124. data/lib/twilio-ruby/rest/ip_messaging/v2.rb +8 -0
  125. data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +16 -7
  126. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +46 -13
  127. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +34 -15
  128. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +20 -10
  129. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +22 -10
  130. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +26 -10
  131. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +18 -8
  132. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +30 -10
  133. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +16 -8
  134. data/lib/twilio-ruby/rest/lookups.rb +4 -0
  135. data/lib/twilio-ruby/rest/lookups/v1.rb +9 -5
  136. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +14 -1
  137. data/lib/twilio-ruby/rest/monitor.rb +8 -0
  138. data/lib/twilio-ruby/rest/monitor/v1.rb +8 -0
  139. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +34 -10
  140. data/lib/twilio-ruby/rest/monitor/v1/event.rb +28 -13
  141. data/lib/twilio-ruby/rest/pricing.rb +6 -0
  142. data/lib/twilio-ruby/rest/pricing/v1.rb +6 -0
  143. data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +8 -2
  144. data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +12 -7
  145. data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +8 -2
  146. data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +10 -7
  147. data/lib/twilio-ruby/rest/pricing/v1/voice.rb +10 -4
  148. data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +12 -7
  149. data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +14 -1
  150. data/lib/twilio-ruby/rest/taskrouter.rb +4 -0
  151. data/lib/twilio-ruby/rest/taskrouter/v1.rb +4 -0
  152. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +46 -24
  153. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +16 -10
  154. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +30 -17
  155. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +42 -19
  156. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +22 -10
  157. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +16 -8
  158. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +34 -15
  159. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +12 -3
  160. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +10 -11
  161. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +34 -23
  162. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +22 -10
  163. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +28 -9
  164. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +10 -3
  165. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +10 -2
  166. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +28 -11
  167. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +12 -3
  168. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +10 -2
  169. data/lib/twilio-ruby/rest/trunking.rb +4 -0
  170. data/lib/twilio-ruby/rest/trunking/v1.rb +4 -0
  171. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +36 -15
  172. data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +14 -8
  173. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +14 -8
  174. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +22 -8
  175. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +52 -8
  176. data/lib/twilio-ruby/rest/video.rb +8 -0
  177. data/lib/twilio-ruby/rest/video/v1.rb +8 -0
  178. data/lib/twilio-ruby/rest/video/v1/recording.rb +26 -12
  179. data/lib/twilio-ruby/rest/video/v1/room.rb +34 -13
  180. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +28 -12
  181. data/lib/twilio-ruby/security/request_validator.rb +1 -2
  182. data/lib/twilio-ruby/twiml/messaging_response.rb +7 -19
  183. data/lib/twilio-ruby/twiml/twiml.rb +8 -14
  184. data/lib/twilio-ruby/twiml/voice_response.rb +157 -169
  185. data/lib/twilio-ruby/util.rb +1 -1
  186. data/lib/twilio-ruby/version.rb +1 -1
  187. data/spec/framework/serialize_spec.rb +17 -30
  188. data/spec/holodeck/holodeck.rb +6 -6
  189. data/spec/jwt/access_token_spec.rb +0 -6
  190. data/spec/jwt/client_capability_spec.rb +3 -3
  191. data/spec/jwt/task_router_spec.rb +16 -21
  192. data/spec/rack/twilio_webhook_authentication_spec.rb +12 -16
  193. data/spec/spec_helper.rb +2 -2
  194. data/spec/support/fakeweb.rb +1 -1
  195. data/spec/twiml/voice_response_spec.rb +33 -20
  196. data/twilio-ruby.gemspec +7 -3
  197. metadata +21 -193
  198. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +0 -420
  199. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +0 -345
  200. data/lib/twilio-ruby/rest/fax.rb +0 -40
  201. data/lib/twilio-ruby/rest/fax/v1.rb +0 -37
  202. data/lib/twilio-ruby/rest/fax/v1/fax.rb +0 -520
  203. data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +0 -321
  204. data/lib/twilio-ruby/rest/messaging.rb +0 -40
  205. data/lib/twilio-ruby/rest/messaging/v1.rb +0 -37
  206. data/lib/twilio-ruby/rest/messaging/v1/service.rb +0 -604
  207. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +0 -344
  208. data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +0 -349
  209. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +0 -349
  210. data/lib/twilio-ruby/rest/notify.rb +0 -44
  211. data/lib/twilio-ruby/rest/notify/v1.rb +0 -48
  212. data/lib/twilio-ruby/rest/notify/v1/credential.rb +0 -394
  213. data/lib/twilio-ruby/rest/notify/v1/service.rb +0 -611
  214. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +0 -414
  215. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +0 -249
  216. data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +0 -219
  217. data/lib/twilio-ruby/rest/notify/v1/service/user.rb +0 -437
  218. data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +0 -247
  219. data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +0 -418
  220. data/lib/twilio-ruby/rest/preview.rb +0 -107
  221. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +0 -48
  222. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +0 -198
  223. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +0 -209
  224. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +0 -232
  225. data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +0 -37
  226. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +0 -539
  227. data/lib/twilio-ruby/rest/preview/marketplace.rb +0 -48
  228. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +0 -326
  229. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +0 -297
  230. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +0 -427
  231. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +0 -335
  232. data/lib/twilio-ruby/rest/preview/proxy.rb +0 -37
  233. data/lib/twilio-ruby/rest/preview/proxy/service.rb +0 -489
  234. data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +0 -349
  235. data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +0 -525
  236. data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +0 -406
  237. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +0 -495
  238. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +0 -422
  239. data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +0 -349
  240. data/lib/twilio-ruby/rest/preview/sync.rb +0 -37
  241. data/lib/twilio-ruby/rest/preview/sync/service.rb +0 -491
  242. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +0 -431
  243. data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +0 -390
  244. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +0 -426
  245. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +0 -422
  246. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +0 -390
  247. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +0 -426
  248. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +0 -424
  249. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +0 -390
  250. data/lib/twilio-ruby/rest/preview/wireless.rb +0 -59
  251. data/lib/twilio-ruby/rest/preview/wireless/command.rb +0 -371
  252. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +0 -414
  253. data/lib/twilio-ruby/rest/preview/wireless/sim.rb +0 -512
  254. data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +0 -220
  255. data/lib/twilio-ruby/rest/sync.rb +0 -40
  256. data/lib/twilio-ruby/rest/sync/v1.rb +0 -37
  257. data/lib/twilio-ruby/rest/sync/v1/service.rb +0 -491
  258. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +0 -431
  259. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +0 -390
  260. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +0 -426
  261. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +0 -422
  262. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +0 -390
  263. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +0 -426
  264. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +0 -424
  265. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +0 -390
  266. data/lib/twilio-ruby/rest/wireless.rb +0 -48
  267. data/lib/twilio-ruby/rest/wireless/v1.rb +0 -59
  268. data/lib/twilio-ruby/rest/wireless/v1/command.rb +0 -357
  269. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +0 -427
  270. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +0 -516
  271. data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +0 -235
  272. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +0 -135
  273. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +0 -223
  274. data/spec/integration/fax/v1/fax/fax_media_spec.rb +0 -126
  275. data/spec/integration/fax/v1/fax_spec.rb +0 -272
  276. data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +0 -170
  277. data/spec/integration/messaging/v1/service/phone_number_spec.rb +0 -201
  278. data/spec/integration/messaging/v1/service/short_code_spec.rb +0 -173
  279. data/spec/integration/messaging/v1/service_spec.rb +0 -263
  280. data/spec/integration/notify/v1/credential_spec.rb +0 -223
  281. data/spec/integration/notify/v1/service/binding_spec.rb +0 -227
  282. data/spec/integration/notify/v1/service/notification_spec.rb +0 -97
  283. data/spec/integration/notify/v1/service/segment_spec.rb +0 -84
  284. data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +0 -118
  285. data/spec/integration/notify/v1/service/user/user_binding_spec.rb +0 -269
  286. data/spec/integration/notify/v1/service/user_spec.rb +0 -213
  287. data/spec/integration/notify/v1/service_spec.rb +0 -280
  288. data/spec/integration/preview/bulk_exports/export/day_spec.rb +0 -56
  289. data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +0 -79
  290. data/spec/integration/preview/bulk_exports/export_spec.rb +0 -43
  291. data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +0 -276
  292. data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +0 -121
  293. data/spec/integration/preview/marketplace/available_add_on_spec.rb +0 -142
  294. data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +0 -164
  295. data/spec/integration/preview/marketplace/installed_add_on_spec.rb +0 -252
  296. data/spec/integration/preview/proxy/service/phone_number_spec.rb +0 -173
  297. data/spec/integration/preview/proxy/service/session/interaction_spec.rb +0 -104
  298. data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +0 -164
  299. data/spec/integration/preview/proxy/service/session/participant_spec.rb +0 -226
  300. data/spec/integration/preview/proxy/service/session_spec.rb +0 -216
  301. data/spec/integration/preview/proxy/service/short_code_spec.rb +0 -173
  302. data/spec/integration/preview/proxy/service_spec.rb +0 -200
  303. data/spec/integration/preview/sync/service/document/document_permission_spec.rb +0 -206
  304. data/spec/integration/preview/sync/service/document_spec.rb +0 -254
  305. data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +0 -256
  306. data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +0 -206
  307. data/spec/integration/preview/sync/service/sync_list_spec.rb +0 -207
  308. data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +0 -257
  309. data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +0 -206
  310. data/spec/integration/preview/sync/service/sync_map_spec.rb +0 -207
  311. data/spec/integration/preview/sync/service_spec.rb +0 -244
  312. data/spec/integration/preview/wireless/command_spec.rb +0 -169
  313. data/spec/integration/preview/wireless/rate_plan_spec.rb +0 -260
  314. data/spec/integration/preview/wireless/sim/usage_spec.rb +0 -49
  315. data/spec/integration/preview/wireless/sim_spec.rb +0 -208
  316. data/spec/integration/sync/v1/service/document/document_permission_spec.rb +0 -206
  317. data/spec/integration/sync/v1/service/document_spec.rb +0 -254
  318. data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +0 -256
  319. data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +0 -206
  320. data/spec/integration/sync/v1/service/sync_list_spec.rb +0 -207
  321. data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +0 -257
  322. data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +0 -206
  323. data/spec/integration/sync/v1/service/sync_map_spec.rb +0 -207
  324. data/spec/integration/sync/v1/service_spec.rb +0 -244
  325. data/spec/integration/wireless/v1/command_spec.rb +0 -166
  326. data/spec/integration/wireless/v1/rate_plan_spec.rb +0 -268
  327. data/spec/integration/wireless/v1/sim/usage_record_spec.rb +0 -65
  328. data/spec/integration/wireless/v1/sim_spec.rb +0 -208
@@ -84,16 +84,6 @@ module Twilio
84
84
  # When passed a block, yields RoomRecordingInstance records from the API.
85
85
  # This operation lazily loads records as efficiently as possible until the limit
86
86
  # is reached.
87
- # @param [room_recording.Status] status The status
88
- # @param [String] source_sid The source_sid
89
- # @param [Time] date_created_after The date_created_after
90
- # @param [Time] date_created_before The date_created_before
91
- # @param [Integer] limit Upper limit for the number of records to return. stream()
92
- # guarantees to never return more than limit. Default is no limit
93
- # @param [Integer] page_size Number of records to fetch per request, when not set will use
94
- # the default value of 50 records. If no page_size is defined
95
- # but a limit is defined, stream() will attempt to read the
96
- # limit with the most efficient page size, i.e. min(limit, 1000)
97
87
  def each
98
88
  limits = @version.read_limits
99
89
 
@@ -161,7 +151,6 @@ module Twilio
161
151
  # @param [Version] version Version that contains the resource
162
152
  # @param [Response] response Response from the API
163
153
  # @param [Hash] solution Path solution for the resource
164
- # @param [String] room_sid The room_sid
165
154
  # @return [RoomRecordingPage] RoomRecordingPage
166
155
  def initialize(version, response, solution)
167
156
  super(version, response)
@@ -275,7 +264,6 @@ module Twilio
275
264
  ##
276
265
  # Generate an instance context for the instance, the context is capable of
277
266
  # performing various actions. All instance actions are proxied to the context
278
- # @param [Version] version Version that contains the resource
279
267
  # @return [RoomRecordingContext] RoomRecordingContext for this RoomRecordingInstance
280
268
  def context
281
269
  unless @instance_context
@@ -288,58 +276,86 @@ module Twilio
288
276
  @instance_context
289
277
  end
290
278
 
279
+ ##
280
+ # @return [String] The account_sid
291
281
  def account_sid
292
282
  @properties['account_sid']
293
283
  end
294
284
 
285
+ ##
286
+ # @return [room_recording.Status] The status
295
287
  def status
296
288
  @properties['status']
297
289
  end
298
290
 
291
+ ##
292
+ # @return [Time] The date_created
299
293
  def date_created
300
294
  @properties['date_created']
301
295
  end
302
296
 
297
+ ##
298
+ # @return [String] The sid
303
299
  def sid
304
300
  @properties['sid']
305
301
  end
306
302
 
303
+ ##
304
+ # @return [String] The source_sid
307
305
  def source_sid
308
306
  @properties['source_sid']
309
307
  end
310
308
 
309
+ ##
310
+ # @return [String] The size
311
311
  def size
312
312
  @properties['size']
313
313
  end
314
314
 
315
+ ##
316
+ # @return [room_recording.Type] The type
315
317
  def type
316
318
  @properties['type']
317
319
  end
318
320
 
321
+ ##
322
+ # @return [String] The duration
319
323
  def duration
320
324
  @properties['duration']
321
325
  end
322
326
 
327
+ ##
328
+ # @return [room_recording.Format] The container_format
323
329
  def container_format
324
330
  @properties['container_format']
325
331
  end
326
332
 
333
+ ##
334
+ # @return [room_recording.Codec] The codec
327
335
  def codec
328
336
  @properties['codec']
329
337
  end
330
338
 
339
+ ##
340
+ # @return [Hash] The grouping_sids
331
341
  def grouping_sids
332
342
  @properties['grouping_sids']
333
343
  end
334
344
 
345
+ ##
346
+ # @return [String] The room_sid
335
347
  def room_sid
336
348
  @properties['room_sid']
337
349
  end
338
350
 
351
+ ##
352
+ # @return [String] The url
339
353
  def url
340
354
  @properties['url']
341
355
  end
342
356
 
357
+ ##
358
+ # @return [String] The links
343
359
  def links
344
360
  @properties['links']
345
361
  end
@@ -1,7 +1,6 @@
1
1
  module Twilio
2
2
  module Security
3
3
  class RequestValidator
4
-
5
4
  def initialize(auth_token = nil)
6
5
  @auth_token = auth_token || Twilio.auth_token
7
6
  raise ArgumentError, 'Auth token is required' if @auth_token.nil?
@@ -31,7 +30,7 @@ module Twilio
31
30
 
32
31
  res = 0
33
32
  b.each_byte { |byte| res |= byte ^ l.shift }
34
- res == 0
33
+ res.zero?
35
34
  end
36
35
 
37
36
  # `ActionController::Parameters` no longer, as of Rails 5, inherits
@@ -1,10 +1,9 @@
1
1
  module Twilio
2
2
  module TwiML
3
-
4
3
  # Messaging TwiML Response
5
4
  class MessagingResponse < TwiML
6
5
  # Create a new <Response>
7
- def initialize()
6
+ def initialize
8
7
  super()
9
8
  self.name = 'Response'
10
9
  yield(self) if block_given?
@@ -23,15 +22,7 @@ module Twilio
23
22
  #
24
23
  # == Returns:
25
24
  # A <Response> element with a <Message> child element
26
- def message(
27
- body: nil,
28
- to: nil,
29
- from: nil,
30
- method: nil,
31
- action: nil,
32
- status_callback: nil,
33
- **keyword_args)
34
-
25
+ def message(body: nil, to: nil, from: nil, method: nil, action: nil, status_callback: nil, **keyword_args)
35
26
  message = Message.new(
36
27
  body: body,
37
28
  to: to,
@@ -43,8 +34,7 @@ module Twilio
43
34
  )
44
35
 
45
36
  yield(message) if block_given?
46
-
47
- self.append(message)
37
+ append(message)
48
38
  end
49
39
 
50
40
  # Create an <Redirect> element
@@ -57,7 +47,7 @@ module Twilio
57
47
  # == Returns:
58
48
  # A <Response> element with an <Redirect> child element
59
49
  def redirect(url, method: nil, **keyword_args)
60
- self.append(Redirect.new(url, method: method, **keyword_args))
50
+ append(Redirect.new(url, method: method, **keyword_args))
61
51
  end
62
52
  end
63
53
 
@@ -73,9 +63,7 @@ module Twilio
73
63
  # A <Message> element
74
64
  def initialize(body: nil, **keyword_args)
75
65
  super(**keyword_args)
76
- if !(body.nil?)
77
- @value = body
78
- end
66
+ @value = body unless body.nil?
79
67
  yield(self) if block_given?
80
68
  end
81
69
 
@@ -88,7 +76,7 @@ module Twilio
88
76
  # == Returns:
89
77
  # A <Message> element with a <Body> child element
90
78
  def body(body)
91
- self.append(Body.new(body))
79
+ append(Body.new(body))
92
80
  end
93
81
 
94
82
  # Create a <Media> element
@@ -100,7 +88,7 @@ module Twilio
100
88
  # == Returns:
101
89
  # A <Message> element with a <Media> child element
102
90
  def media(url)
103
- self.append(Media.new(url))
91
+ append(Media.new(url))
104
92
  end
105
93
  end
106
94
 
@@ -5,12 +5,13 @@ module Twilio
5
5
  class TwiMLError < StandardError
6
6
  end
7
7
 
8
+ # TwiML Base Class
8
9
  class TwiML
9
10
  # Generate getter/setter methods
10
11
  attr_accessor :name
11
12
  attr_accessor :indent
12
13
 
13
- alias_method :to_xml, :to_s
14
+ alias to_xml to_s
14
15
 
15
16
  def initialize(indent: false, **keyword_args)
16
17
  @name = self.class.name.split('::').last
@@ -20,9 +21,7 @@ module Twilio
20
21
  @attrs = {}
21
22
 
22
23
  keyword_args.each do |key, val|
23
- if !(val.nil?)
24
- @attrs[TwiML.to_lower_camel_case(key)] = val
25
- end
24
+ @attrs[TwiML.to_lower_camel_case(key)] = val unless val.nil?
26
25
  end
27
26
  end
28
27
 
@@ -33,13 +32,13 @@ module Twilio
33
32
  end
34
33
 
35
34
  def to_s(xml_declaration = true)
36
- xml = self.xml.to_s(:indent => self.indent)
35
+ xml = self.xml.to_s(indent: indent)
37
36
 
38
37
  return ('<?xml version="1.0" encoding="UTF-8"?>' + xml) if xml_declaration
39
38
  xml
40
39
  end
41
40
 
42
- def xml()
41
+ def xml
43
42
  # create XML element
44
43
  elem = LibXML::XML::Node.new(@name, @value)
45
44
 
@@ -48,11 +47,8 @@ module Twilio
48
47
  keys.each do |key|
49
48
  value = @attrs[key]
50
49
 
51
- if (value.is_a?(TrueClass) || value.is_a?(FalseClass))
52
- elem[key] = value.to_s.downcase
53
- else
54
- elem[key] = value.to_s
55
- end
50
+ value_is_boolean = value.is_a?(TrueClass) || value.is_a?(FalseClass)
51
+ elem[key] = value_is_boolean ? value.to_s.downcase : value.to_s
56
52
  end
57
53
 
58
54
  @verbs.each do |verb|
@@ -63,9 +59,7 @@ module Twilio
63
59
  end
64
60
 
65
61
  def append(verb)
66
- if !(verb.is_a?(TwiML))
67
- raise TwiMLError.new "Only appending of TwiML is allowed"
68
- end
62
+ raise TwiMLError, 'Only appending of TwiML is allowed' unless verb.is_a?(TwiML)
69
63
 
70
64
  @verbs << verb
71
65
  self
@@ -1,12 +1,11 @@
1
1
  module Twilio
2
2
  module TwiML
3
-
4
3
  # Voice TwiML Response
5
4
  class VoiceResponse < TwiML
6
5
  # Create a new <Response>
7
- def initialize()
6
+ def initialize
8
7
  super()
9
- self.name = 'Response'
8
+ @name = 'Response'
10
9
  yield(self) if block_given?
11
10
  end
12
11
 
@@ -29,37 +28,37 @@ module Twilio
29
28
  # == Returns:
30
29
  # A <Response> element with a <Dial> child element
31
30
  def dial(
32
- number: nil,
33
- action: nil,
34
- method: nil,
35
- timeout: nil,
36
- hangup_on_star: nil,
37
- time_limit: nil,
38
- caller_id: nil,
39
- record: nil,
40
- trim: nil,
41
- recording_status_callback: nil,
42
- recording_status_callback_method: nil,
43
- **keyword_args)
31
+ number: nil,
32
+ action: nil,
33
+ method: nil,
34
+ timeout: nil,
35
+ hangup_on_star: nil,
36
+ time_limit: nil,
37
+ caller_id: nil,
38
+ record: nil,
39
+ trim: nil,
40
+ recording_status_callback: nil,
41
+ recording_status_callback_method: nil,
42
+ **keyword_args
43
+ )
44
44
 
45
45
  dial = Dial.new(
46
- number: number,
47
- action: action,
48
- method: method,
49
- timeout: timeout,
50
- hangup_on_star: hangup_on_star,
51
- time_limit: time_limit,
52
- caller_id: caller_id,
53
- record: record,
54
- trim: trim,
55
- recording_status_callback: recording_status_callback,
56
- recording_status_callback_method: recording_status_callback_method,
57
- **keyword_args
46
+ number: number,
47
+ action: action,
48
+ method: method,
49
+ timeout: timeout,
50
+ hangup_on_star: hangup_on_star,
51
+ time_limit: time_limit,
52
+ caller_id: caller_id,
53
+ record: record,
54
+ trim: trim,
55
+ recording_status_callback: recording_status_callback,
56
+ recording_status_callback_method: recording_status_callback_method,
57
+ **keyword_args
58
58
  )
59
59
 
60
60
  yield(dial) if block_given?
61
-
62
- self.append(dial)
61
+ append(dial)
63
62
  end
64
63
 
65
64
  # Create an <Echo> element
@@ -70,7 +69,7 @@ module Twilio
70
69
  # == Returns:
71
70
  # A <Response> element with an <Echo> child element
72
71
  def echo(**keyword_args)
73
- self.append(Echo.new(**keyword_args))
72
+ append(Echo.new(**keyword_args))
74
73
  end
75
74
 
76
75
  # Create an <Enqueue> element
@@ -93,7 +92,8 @@ module Twilio
93
92
  wait_url: nil,
94
93
  wait_url_method: nil,
95
94
  workflow_sid: nil,
96
- **keyword_args)
95
+ **keyword_args
96
+ )
97
97
 
98
98
  enqueue = Enqueue.new(
99
99
  name,
@@ -106,8 +106,7 @@ module Twilio
106
106
  )
107
107
 
108
108
  yield(enqueue) if block_given?
109
-
110
- self.append(enqueue)
109
+ append(enqueue)
111
110
  end
112
111
 
113
112
  # Create a <Gather> element
@@ -140,7 +139,8 @@ module Twilio
140
139
  hints: nil,
141
140
  barge_in: nil,
142
141
  acknowledge_sound_url: nil,
143
- **keyword_args)
142
+ **keyword_args
143
+ )
144
144
 
145
145
  gather = Gather.new(
146
146
  action: action,
@@ -158,24 +158,23 @@ module Twilio
158
158
  )
159
159
 
160
160
  yield(gather) if block_given?
161
-
162
- self.append(gather)
161
+ append(gather)
163
162
  end
164
163
 
165
164
  # Create a <Hangup> element
166
165
  #
167
166
  # == Returns:
168
167
  # A <Response> element with a <Hangup> child element
169
- def hangup()
170
- self.append(Hangup.new)
168
+ def hangup
169
+ append(Hangup.new)
171
170
  end
172
171
 
173
172
  # Create a <Leave> element
174
173
  #
175
174
  # == Returns:
176
175
  # A <Response> element with a <Leave> child element
177
- def leave()
178
- self.append(Leave.new)
176
+ def leave
177
+ append(Leave.new)
179
178
  end
180
179
 
181
180
  # Create a <Pause> element
@@ -186,7 +185,7 @@ module Twilio
186
185
  # == Returns:
187
186
  # A <Response> element with a <Pause> child element
188
187
  def pause(length: nil)
189
- self.append(Pause.new(length: length))
188
+ append(Pause.new(length: length))
190
189
  end
191
190
 
192
191
  # Create a <Play> element
@@ -200,11 +199,11 @@ module Twilio
200
199
  # == Returns:
201
200
  # A <Response> element with a <Play> child element
202
201
  def play(url: nil, loop: nil, digits: nil, **keyword_args)
203
- self.append(Play.new(
204
- url: url,
205
- loop: loop,
206
- digits: digits,
207
- **keyword_args
202
+ append(Play.new(
203
+ url: url,
204
+ loop: loop,
205
+ digits: digits,
206
+ **keyword_args
208
207
  ))
209
208
  end
210
209
 
@@ -238,20 +237,21 @@ module Twilio
238
237
  recording_status_callback_method: nil,
239
238
  transcribe: nil,
240
239
  transcribe_callback: nil,
241
- **keyword_args)
242
- self.append(Record.new(
243
- action: action,
244
- method: method,
245
- timeout: timeout,
246
- finish_on_key: finish_on_key,
247
- max_length: max_length,
248
- play_beep: play_beep,
249
- trim: trim,
250
- recording_status_callback: recording_status_callback,
251
- recording_status_callback_method: recording_status_callback_method,
252
- transcribe: transcribe,
253
- transcribe_callback: transcribe_callback,
254
- **keyword_args
240
+ **keyword_args
241
+ )
242
+ append(Record.new(
243
+ action: action,
244
+ method: method,
245
+ timeout: timeout,
246
+ finish_on_key: finish_on_key,
247
+ max_length: max_length,
248
+ play_beep: play_beep,
249
+ trim: trim,
250
+ recording_status_callback: recording_status_callback,
251
+ recording_status_callback_method: recording_status_callback_method,
252
+ transcribe: transcribe,
253
+ transcribe_callback: transcribe_callback,
254
+ **keyword_args
255
255
  ))
256
256
  end
257
257
 
@@ -265,7 +265,7 @@ module Twilio
265
265
  # == Returns:
266
266
  # A <Response> element with a <Redirect> child element
267
267
  def redirect(url, method: nil, **keyword_args)
268
- self.append(Redirect.new(url, method: method, **keyword_args))
268
+ append(Redirect.new(url, method: method, **keyword_args))
269
269
  end
270
270
 
271
271
  # Create a <Reject> element
@@ -277,7 +277,7 @@ module Twilio
277
277
  # == Returns:
278
278
  # A <Response> element with a <Reject> child element
279
279
  def reject(reason: nil, **keyword_args)
280
- self.append(Reject.new(reason: reason, **keyword_args))
280
+ append(Reject.new(reason: reason, **keyword_args))
281
281
  end
282
282
 
283
283
  # Create a <Say> element
@@ -292,12 +292,12 @@ module Twilio
292
292
  # == Returns:
293
293
  # A <Response> element with a <Say> child element
294
294
  def say(body, loop: nil, language: nil, voice: nil, **keyword_args)
295
- self.append(Say.new(
296
- body,
297
- loop: loop,
298
- language: language,
299
- voice: voice,
300
- **keyword_args
295
+ append(Say.new(
296
+ body,
297
+ loop: loop,
298
+ language: language,
299
+ voice: voice,
300
+ **keyword_args
301
301
  ))
302
302
  end
303
303
 
@@ -314,22 +314,15 @@ module Twilio
314
314
  #
315
315
  # == Returns:
316
316
  # A <Response> element with a <Sms> child element
317
- def sms(
318
- body,
319
- to: nil,
320
- from: nil,
321
- method: nil,
322
- action: nil,
323
- status_callback: nil,
324
- **keyword_args)
325
- self.append(Sms.new(
326
- body,
327
- to: to,
328
- from: from,
329
- method: method,
330
- action: action,
331
- status_callback: status_callback,
332
- **keyword_args
317
+ def sms(body, to: nil, from: nil, method: nil, action: nil, status_callback: nil, **keyword_args)
318
+ append(Sms.new(
319
+ body,
320
+ to: to,
321
+ from: from,
322
+ method: method,
323
+ action: action,
324
+ status_callback: status_callback,
325
+ **keyword_args
333
326
  ))
334
327
  end
335
328
  end
@@ -346,9 +339,7 @@ module Twilio
346
339
  # A <Dial> element
347
340
  def initialize(number: nil, **keyword_args)
348
341
  super(**keyword_args)
349
- if !(number.nil?)
350
- @value = number
351
- end
342
+ @value = number unless number.nil?
352
343
  yield(self) if block_given?
353
344
  end
354
345
 
@@ -372,15 +363,16 @@ module Twilio
372
363
  status_callback_event: nil,
373
364
  status_callback_method: nil,
374
365
  status_callback: nil,
375
- **keyword_args)
376
- self.append(Client.new(
377
- name,
378
- method: method,
379
- url: url,
380
- status_callback_event: status_callback_event,
381
- status_callback_method: status_callback_method,
382
- status_callback: status_callback,
383
- **keyword_args
366
+ **keyword_args
367
+ )
368
+ append(Client.new(
369
+ name,
370
+ method: method,
371
+ url: url,
372
+ status_callback_event: status_callback_event,
373
+ status_callback_method: status_callback_method,
374
+ status_callback: status_callback,
375
+ **keyword_args
384
376
  ))
385
377
  end
386
378
 
@@ -424,25 +416,26 @@ module Twilio
424
416
  status_callback_method: nil,
425
417
  recording_status_callback: nil,
426
418
  recording_status_callback_method: nil,
427
- **keyword_args)
428
- self.append(Conference.new(
429
- name,
430
- muted: muted,
431
- start_conference_on_enter: start_conference_on_enter,
432
- end_conference_on_exit: end_conference_on_exit,
433
- max_participants: max_participants,
434
- beep: beep,
435
- record: record,
436
- trim: trim,
437
- wait_url: wait_url,
438
- wait_method: wait_method,
439
- event_callback_url: event_callback_url,
440
- status_callback: status_callback,
441
- status_callback_event: status_callback_event,
442
- status_callback_method: status_callback_method,
443
- recording_status_callback: recording_status_callback,
444
- recording_status_callback_method: recording_status_callback_method,
445
- **keyword_args
419
+ **keyword_args
420
+ )
421
+ append(Conference.new(
422
+ name,
423
+ muted: muted,
424
+ start_conference_on_enter: start_conference_on_enter,
425
+ end_conference_on_exit: end_conference_on_exit,
426
+ max_participants: max_participants,
427
+ beep: beep,
428
+ record: record,
429
+ trim: trim,
430
+ wait_url: wait_url,
431
+ wait_method: wait_method,
432
+ event_callback_url: event_callback_url,
433
+ status_callback: status_callback,
434
+ status_callback_event: status_callback_event,
435
+ status_callback_method: status_callback_method,
436
+ recording_status_callback: recording_status_callback,
437
+ recording_status_callback_method: recording_status_callback_method,
438
+ **keyword_args
446
439
  ))
447
440
  end
448
441
 
@@ -468,16 +461,17 @@ module Twilio
468
461
  status_callback: nil,
469
462
  status_callback_event: nil,
470
463
  status_callback_method: nil,
471
- **keyword_args)
472
- self.append(Number.new(
473
- number,
474
- send_digits: send_digits,
475
- url: url,
476
- method: method,
477
- status_callback: status_callback,
478
- status_callback_event: status_callback_event,
479
- status_callback_method: status_callback_method,
480
- **keyword_args
464
+ **keyword_args
465
+ )
466
+ append(Number.new(
467
+ number,
468
+ send_digits: send_digits,
469
+ url: url,
470
+ method: method,
471
+ status_callback: status_callback,
472
+ status_callback_event: status_callback_event,
473
+ status_callback_method: status_callback_method,
474
+ **keyword_args
481
475
  ))
482
476
  end
483
477
 
@@ -499,14 +493,15 @@ module Twilio
499
493
  method: nil,
500
494
  reservation_sid: nil,
501
495
  post_work_activity_sid: nil,
502
- **keyword_args)
503
- self.append(Queue.new(
504
- queue_name,
505
- url: url,
506
- method: method,
507
- reservation_sid: reservation_sid,
508
- post_work_activity_sid: post_work_activity_sid,
509
- **keyword_args
496
+ **keyword_args
497
+ )
498
+ append(Queue.new(
499
+ queue_name,
500
+ url: url,
501
+ method: method,
502
+ reservation_sid: reservation_sid,
503
+ post_work_activity_sid: post_work_activity_sid,
504
+ **keyword_args
510
505
  ))
511
506
  end
512
507
 
@@ -519,7 +514,7 @@ module Twilio
519
514
  # == Returns:
520
515
  # A <Dial> element with a <Sim> child element
521
516
  def sim(sid, **keyword_args)
522
- self.append(Sim.new(sid, **keyword_args))
517
+ append(Sim.new(sid, **keyword_args))
523
518
  end
524
519
 
525
520
  # Create a <Sip> element
@@ -546,17 +541,18 @@ module Twilio
546
541
  status_callback: nil,
547
542
  status_callback_event: nil,
548
543
  status_callback_method: nil,
549
- **keyword_args)
550
- self.append(Sip.new(
551
- uri,
552
- username: username,
553
- password: password,
554
- url: url,
555
- method: method,
556
- status_callback: status_callback,
557
- status_callback_event: status_callback_event,
558
- status_callback_method: status_callback_method,
559
- **keyword_args
544
+ **keyword_args
545
+ )
546
+ append(Sip.new(
547
+ uri,
548
+ username: username,
549
+ password: password,
550
+ url: url,
551
+ method: method,
552
+ status_callback: status_callback,
553
+ status_callback_event: status_callback_event,
554
+ status_callback_method: status_callback_method,
555
+ **keyword_args
560
556
  ))
561
557
  end
562
558
  end
@@ -640,6 +636,7 @@ module Twilio
640
636
  @value = sid
641
637
  end
642
638
  end
639
+
643
640
  # <Sip> element
644
641
  class Sip < TwiML
645
642
  # Create a <Sip> element
@@ -695,7 +692,7 @@ module Twilio
695
692
  # == Returns:
696
693
  # An <Enqueue> element with a <Task> child element
697
694
  def task(attributes, **keyword_args)
698
- self.append(Task.new(attributes, **keyword_args))
695
+ append(Task.new(attributes, **keyword_args))
699
696
  end
700
697
  end
701
698
 
@@ -711,11 +708,7 @@ module Twilio
711
708
  # A <Task> element
712
709
  def initialize(attributes, **keyword_args)
713
710
  super(**keyword_args)
714
- if attributes.is_a?(String)
715
- @value = attributes
716
- else
717
- @value = JSON.generate(attributes)
718
- end
711
+ @value = attributes.is_a?(String) ? attributes : JSON.generate(attributes)
719
712
  end
720
713
  end
721
714
 
@@ -745,18 +738,13 @@ module Twilio
745
738
  #
746
739
  # == Returns:
747
740
  # A <Gather> element with a <Say> child element
748
- def say(
749
- body,
750
- loop: nil,
751
- language: nil,
752
- voice: nil,
753
- **keyword_args)
754
- self.append(Say.new(
755
- body,
756
- loop: loop,
757
- language: language,
758
- voice: voice,
759
- **keyword_args
741
+ def say(body, loop: nil, language: nil, voice: nil, **keyword_args)
742
+ append(Say.new(
743
+ body,
744
+ loop: loop,
745
+ language: language,
746
+ voice: voice,
747
+ **keyword_args
760
748
  ))
761
749
  end
762
750
 
@@ -771,11 +759,11 @@ module Twilio
771
759
  # == Returns:
772
760
  # A <Gather> element with a <Play> child element
773
761
  def play(url: nil, loop: nil, digits: nil, **keyword_args)
774
- self.append(Play.new(
775
- url: url,
776
- loop: loop,
777
- digits: digits,
778
- **keyword_args
762
+ append(Play.new(
763
+ url: url,
764
+ loop: loop,
765
+ digits: digits,
766
+ **keyword_args
779
767
  ))
780
768
  end
781
769
 
@@ -787,7 +775,7 @@ module Twilio
787
775
  # == Returns:
788
776
  # A <Gather> element with a <Pause> child element
789
777
  def pause(length: nil)
790
- self.append(Pause.new(length: length))
778
+ append(Pause.new(length: length))
791
779
  end
792
780
  end
793
781