twilio-ruby 5.4.4 → 5.4.5

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 (371) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +12 -0
  3. data/README.md +16 -2
  4. data/lib/twilio-ruby/rest/accounts/v1.rb +3 -9
  5. data/lib/twilio-ruby/rest/accounts/v1/credential.rb +19 -3
  6. data/lib/twilio-ruby/rest/accounts/v1/credential/aws.rb +338 -0
  7. data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +11 -11
  8. data/lib/twilio-ruby/rest/api/v2010.rb +1 -1
  9. data/lib/twilio-ruby/rest/api/v2010/account.rb +51 -51
  10. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +8 -8
  11. data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +2 -2
  12. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +9 -9
  13. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +4 -4
  14. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +4 -4
  15. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +1 -1
  16. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +1 -1
  17. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +1 -1
  18. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +13 -13
  19. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback.rb +5 -5
  20. data/lib/twilio-ruby/rest/api/v2010/account/call/feedback_summary.rb +5 -5
  21. data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +3 -3
  22. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +3 -3
  23. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +10 -10
  24. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +3 -3
  25. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +8 -8
  26. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +10 -10
  27. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +4 -4
  28. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +2 -2
  29. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +3 -3
  30. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +3 -3
  31. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +3 -3
  32. data/lib/twilio-ruby/rest/api/v2010/account/key.rb +10 -10
  33. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +12 -12
  34. data/lib/twilio-ruby/rest/api/v2010/account/message/feedback.rb +1 -1
  35. data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +2 -2
  36. data/lib/twilio-ruby/rest/api/v2010/account/new_key.rb +3 -3
  37. data/lib/twilio-ruby/rest/api/v2010/account/new_signing_key.rb +3 -3
  38. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +6 -6
  39. data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +7 -7
  40. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +14 -14
  41. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +5 -5
  42. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +8 -8
  43. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +3 -3
  44. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +2 -2
  45. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +3 -3
  46. data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +8 -8
  47. data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +10 -10
  48. data/lib/twilio-ruby/rest/api/v2010/account/sip.rb +7 -7
  49. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +11 -11
  50. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +6 -6
  51. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +11 -11
  52. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +4 -4
  53. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +4 -4
  54. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +11 -11
  55. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +5 -5
  56. data/lib/twilio-ruby/rest/api/v2010/account/token.rb +3 -3
  57. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +6 -6
  58. data/lib/twilio-ruby/rest/api/v2010/account/usage.rb +4 -4
  59. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +10 -10
  60. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +2 -2
  61. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +2 -2
  62. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +2 -2
  63. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +2 -2
  64. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +2 -2
  65. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +2 -2
  66. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +2 -2
  67. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +2 -2
  68. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +8 -8
  69. data/lib/twilio-ruby/rest/api/v2010/account/validation_request.rb +2 -2
  70. data/lib/twilio-ruby/rest/chat/v1.rb +2 -2
  71. data/lib/twilio-ruby/rest/chat/v1/credential.rb +9 -9
  72. data/lib/twilio-ruby/rest/chat/v1/service.rb +16 -16
  73. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +13 -13
  74. data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +4 -4
  75. data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +5 -5
  76. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +6 -6
  77. data/lib/twilio-ruby/rest/chat/v1/service/role.rb +11 -11
  78. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +10 -10
  79. data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +2 -2
  80. data/lib/twilio-ruby/rest/chat/v2.rb +2 -2
  81. data/lib/twilio-ruby/rest/chat/v2/credential.rb +9 -9
  82. data/lib/twilio-ruby/rest/chat/v2/service.rb +18 -18
  83. data/lib/twilio-ruby/rest/chat/v2/service/binding.rb +7 -7
  84. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +12 -12
  85. data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +4 -4
  86. data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +3 -3
  87. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +3 -3
  88. data/lib/twilio-ruby/rest/chat/v2/service/role.rb +11 -11
  89. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +11 -11
  90. data/lib/twilio-ruby/rest/chat/v2/service/user/user_binding.rb +4 -4
  91. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +2 -2
  92. data/lib/twilio-ruby/rest/fax/v1.rb +1 -1
  93. data/lib/twilio-ruby/rest/fax/v1/fax.rb +12 -12
  94. data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +7 -7
  95. data/lib/twilio-ruby/rest/ip_messaging/v1.rb +2 -2
  96. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +9 -9
  97. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +16 -16
  98. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +13 -13
  99. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +4 -4
  100. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +5 -5
  101. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +6 -6
  102. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +11 -11
  103. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +10 -10
  104. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +2 -2
  105. data/lib/twilio-ruby/rest/ip_messaging/v2.rb +2 -2
  106. data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +9 -9
  107. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +18 -18
  108. data/lib/twilio-ruby/rest/ip_messaging/v2/service/binding.rb +7 -7
  109. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +12 -12
  110. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +4 -4
  111. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +3 -3
  112. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +3 -3
  113. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +11 -11
  114. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +11 -11
  115. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_binding.rb +4 -4
  116. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +2 -2
  117. data/lib/twilio-ruby/rest/lookups/v1.rb +1 -1
  118. data/lib/twilio-ruby/rest/lookups/v1/phone_number.rb +6 -6
  119. data/lib/twilio-ruby/rest/messaging/v1.rb +1 -1
  120. data/lib/twilio-ruby/rest/messaging/v1/service.rb +15 -15
  121. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +9 -9
  122. data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +9 -9
  123. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +9 -9
  124. data/lib/twilio-ruby/rest/monitor/v1.rb +2 -2
  125. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +6 -6
  126. data/lib/twilio-ruby/rest/monitor/v1/event.rb +6 -6
  127. data/lib/twilio-ruby/rest/notify/v1.rb +2 -2
  128. data/lib/twilio-ruby/rest/notify/v1/credential.rb +9 -9
  129. data/lib/twilio-ruby/rest/notify/v1/service.rb +15 -15
  130. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +7 -7
  131. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +2 -2
  132. data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +3 -3
  133. data/lib/twilio-ruby/rest/notify/v1/service/user.rb +9 -9
  134. data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +2 -2
  135. data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +4 -4
  136. data/lib/twilio-ruby/rest/preview.rb +15 -0
  137. data/lib/twilio-ruby/rest/preview/acc_security.rb +1 -1
  138. data/lib/twilio-ruby/rest/preview/acc_security/service.rb +14 -14
  139. data/lib/twilio-ruby/rest/preview/acc_security/service/verification.rb +3 -3
  140. data/lib/twilio-ruby/rest/preview/acc_security/service/verification_check.rb +3 -3
  141. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +2 -2
  142. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +6 -6
  143. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +3 -3
  144. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +7 -7
  145. data/lib/twilio-ruby/rest/preview/deployed_devices.rb +1 -1
  146. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet.rb +19 -19
  147. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/certificate.rb +11 -11
  148. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/deployment.rb +12 -12
  149. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/device.rb +9 -9
  150. data/lib/twilio-ruby/rest/preview/deployed_devices/fleet/key.rb +12 -12
  151. data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +2 -2
  152. data/lib/twilio-ruby/rest/preview/hosted_numbers/authorization_document.rb +9 -9
  153. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +9 -11
  154. data/lib/twilio-ruby/rest/preview/marketplace.rb +2 -2
  155. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +9 -9
  156. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +4 -4
  157. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +12 -12
  158. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +6 -6
  159. data/lib/twilio-ruby/rest/preview/proxy.rb +1 -1
  160. data/lib/twilio-ruby/rest/preview/proxy/service.rb +16 -16
  161. data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +9 -9
  162. data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +12 -12
  163. data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +2 -2
  164. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +2 -2
  165. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +3 -3
  166. data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +9 -9
  167. data/lib/twilio-ruby/rest/preview/studio.rb +41 -0
  168. data/lib/twilio-ruby/rest/preview/studio/flow.rb +353 -0
  169. data/lib/twilio-ruby/rest/preview/studio/flow/engagement.rb +384 -0
  170. data/lib/twilio-ruby/rest/preview/studio/flow/engagement/step.rb +348 -0
  171. data/lib/twilio-ruby/rest/preview/sync.rb +1 -1
  172. data/lib/twilio-ruby/rest/preview/sync/service.rb +15 -15
  173. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +13 -13
  174. data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +5 -5
  175. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +11 -11
  176. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +6 -6
  177. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +5 -5
  178. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +11 -11
  179. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +7 -7
  180. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +5 -5
  181. data/lib/twilio-ruby/rest/preview/understand.rb +1 -1
  182. data/lib/twilio-ruby/rest/preview/understand/service.rb +17 -17
  183. data/lib/twilio-ruby/rest/preview/understand/service/field_type.rb +13 -13
  184. data/lib/twilio-ruby/rest/preview/understand/service/field_type/field_value.rb +4 -4
  185. data/lib/twilio-ruby/rest/preview/understand/service/intent.rb +16 -16
  186. data/lib/twilio-ruby/rest/preview/understand/service/intent/field.rb +4 -4
  187. data/lib/twilio-ruby/rest/preview/understand/service/intent/sample.rb +6 -6
  188. data/lib/twilio-ruby/rest/preview/understand/service/model_build.rb +12 -12
  189. data/lib/twilio-ruby/rest/preview/understand/service/query.rb +10 -10
  190. data/lib/twilio-ruby/rest/preview/wireless.rb +3 -3
  191. data/lib/twilio-ruby/rest/preview/wireless/command.rb +7 -7
  192. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +11 -11
  193. data/lib/twilio-ruby/rest/preview/wireless/sim.rb +8 -8
  194. data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +7 -7
  195. data/lib/twilio-ruby/rest/pricing/v1.rb +9 -27
  196. data/lib/twilio-ruby/rest/pricing/v1/messaging.rb +4 -4
  197. data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +7 -7
  198. data/lib/twilio-ruby/rest/pricing/v1/phone_number.rb +4 -4
  199. data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +7 -7
  200. data/lib/twilio-ruby/rest/pricing/v1/voice.rb +6 -6
  201. data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +7 -7
  202. data/lib/twilio-ruby/rest/pricing/v1/voice/number.rb +5 -5
  203. data/lib/twilio-ruby/rest/proxy/v1.rb +1 -1
  204. data/lib/twilio-ruby/rest/proxy/v1/service.rb +87 -19
  205. data/lib/twilio-ruby/rest/proxy/v1/service/phone_number.rb +11 -10
  206. data/lib/twilio-ruby/rest/proxy/v1/service/session.rb +35 -19
  207. data/lib/twilio-ruby/rest/proxy/v1/service/session/interaction.rb +2 -2
  208. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant.rb +11 -40
  209. data/lib/twilio-ruby/rest/proxy/v1/service/session/participant/message_interaction.rb +3 -3
  210. data/lib/twilio-ruby/rest/proxy/v1/service/short_code.rb +10 -10
  211. data/lib/twilio-ruby/rest/sync/v1.rb +1 -1
  212. data/lib/twilio-ruby/rest/sync/v1/service.rb +17 -17
  213. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +13 -13
  214. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +5 -5
  215. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +11 -11
  216. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +6 -6
  217. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +5 -5
  218. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +11 -11
  219. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +7 -7
  220. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +5 -5
  221. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream.rb +9 -9
  222. data/lib/twilio-ruby/rest/sync/v1/service/sync_stream/stream_message.rb +2 -2
  223. data/lib/twilio-ruby/rest/taskrouter/v1.rb +1 -1
  224. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +26 -26
  225. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +12 -12
  226. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +6 -6
  227. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +9 -9
  228. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +3 -3
  229. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +6 -6
  230. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +10 -10
  231. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_cumulative_statistics.rb +2 -2
  232. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_real_time_statistics.rb +4 -4
  233. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queue_statistics.rb +2 -2
  234. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +2 -2
  235. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +16 -16
  236. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +3 -3
  237. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +5 -5
  238. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_statistics.rb +3 -3
  239. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_cumulative_statistics.rb +6 -6
  240. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_real_time_statistics.rb +7 -7
  241. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/workers_statistics.rb +5 -5
  242. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +12 -12
  243. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_cumulative_statistics.rb +2 -2
  244. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_real_time_statistics.rb +4 -4
  245. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow/workflow_statistics.rb +2 -2
  246. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_cumulative_statistics.rb +5 -5
  247. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_real_time_statistics.rb +7 -7
  248. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workspace_statistics.rb +5 -5
  249. data/lib/twilio-ruby/rest/trunking/v1.rb +1 -1
  250. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +17 -17
  251. data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +9 -9
  252. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +8 -8
  253. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +9 -9
  254. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +9 -9
  255. data/lib/twilio-ruby/rest/video/v1.rb +2 -2
  256. data/lib/twilio-ruby/rest/video/v1/recording.rb +6 -6
  257. data/lib/twilio-ruby/rest/video/v1/room.rb +14 -14
  258. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +6 -6
  259. data/lib/twilio-ruby/rest/video/v1/room/room_participant.rb +10 -10
  260. data/lib/twilio-ruby/rest/video/v1/room/room_participant/room_participant_published_track.rb +3 -3
  261. data/lib/twilio-ruby/rest/wireless/v1.rb +3 -3
  262. data/lib/twilio-ruby/rest/wireless/v1/command.rb +8 -8
  263. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +11 -11
  264. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +9 -9
  265. data/lib/twilio-ruby/rest/wireless/v1/sim/data_session.rb +3 -3
  266. data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +3 -3
  267. data/lib/twilio-ruby/version.rb +1 -1
  268. data/spec/integration/accounts/v1/credential/aws_spec.rb +224 -0
  269. data/spec/integration/accounts/v1/credential/public_key_spec.rb +1 -1
  270. data/spec/integration/api/v2010/account/application_spec.rb +1 -1
  271. data/spec/integration/api/v2010/account/call/feedback_spec.rb +2 -2
  272. data/spec/integration/api/v2010/account/call_spec.rb +1 -1
  273. data/spec/integration/api/v2010/account/conference/participant_spec.rb +1 -1
  274. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +1 -1
  275. data/spec/integration/api/v2010/account/incoming_phone_number/local_spec.rb +1 -1
  276. data/spec/integration/api/v2010/account/incoming_phone_number/mobile_spec.rb +1 -1
  277. data/spec/integration/api/v2010/account/incoming_phone_number/toll_free_spec.rb +1 -1
  278. data/spec/integration/api/v2010/account/message_spec.rb +2 -2
  279. data/spec/integration/api/v2010/account/queue/member_spec.rb +1 -1
  280. data/spec/integration/api/v2010/account/queue_spec.rb +1 -1
  281. data/spec/integration/api/v2010/account/sip/credential_list/credential_spec.rb +1 -1
  282. data/spec/integration/api/v2010/account/sip/credential_list_spec.rb +2 -2
  283. data/spec/integration/api/v2010/account/sip/domain/credential_list_mapping_spec.rb +1 -1
  284. data/spec/integration/api/v2010/account/sip/domain/ip_access_control_list_mapping_spec.rb +1 -1
  285. data/spec/integration/api/v2010/account/sip/domain_spec.rb +1 -1
  286. data/spec/integration/api/v2010/account/sip/ip_access_control_list/ip_address_spec.rb +1 -1
  287. data/spec/integration/api/v2010/account/sip/ip_access_control_list_spec.rb +2 -2
  288. data/spec/integration/api/v2010/account/validation_request_spec.rb +1 -1
  289. data/spec/integration/chat/v1/credential_spec.rb +1 -1
  290. data/spec/integration/chat/v1/service/channel/invite_spec.rb +1 -1
  291. data/spec/integration/chat/v1/service/channel/member_spec.rb +1 -1
  292. data/spec/integration/chat/v1/service/channel/message_spec.rb +1 -1
  293. data/spec/integration/chat/v1/service/role_spec.rb +1 -1
  294. data/spec/integration/chat/v1/service/user_spec.rb +1 -1
  295. data/spec/integration/chat/v1/service_spec.rb +1 -1
  296. data/spec/integration/chat/v2/credential_spec.rb +1 -1
  297. data/spec/integration/chat/v2/service/channel/invite_spec.rb +1 -1
  298. data/spec/integration/chat/v2/service/channel/member_spec.rb +1 -1
  299. data/spec/integration/chat/v2/service/role_spec.rb +1 -1
  300. data/spec/integration/chat/v2/service/user_spec.rb +1 -1
  301. data/spec/integration/chat/v2/service_spec.rb +1 -1
  302. data/spec/integration/fax/v1/fax_spec.rb +1 -1
  303. data/spec/integration/ip_messaging/v1/credential_spec.rb +1 -1
  304. data/spec/integration/ip_messaging/v1/service/channel/invite_spec.rb +1 -1
  305. data/spec/integration/ip_messaging/v1/service/channel/member_spec.rb +1 -1
  306. data/spec/integration/ip_messaging/v1/service/channel/message_spec.rb +1 -1
  307. data/spec/integration/ip_messaging/v1/service/role_spec.rb +1 -1
  308. data/spec/integration/ip_messaging/v1/service/user_spec.rb +1 -1
  309. data/spec/integration/ip_messaging/v1/service_spec.rb +1 -1
  310. data/spec/integration/ip_messaging/v2/credential_spec.rb +1 -1
  311. data/spec/integration/ip_messaging/v2/service/channel/invite_spec.rb +1 -1
  312. data/spec/integration/ip_messaging/v2/service/channel/member_spec.rb +1 -1
  313. data/spec/integration/ip_messaging/v2/service/role_spec.rb +1 -1
  314. data/spec/integration/ip_messaging/v2/service/user_spec.rb +1 -1
  315. data/spec/integration/ip_messaging/v2/service_spec.rb +1 -1
  316. data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +1 -1
  317. data/spec/integration/messaging/v1/service/phone_number_spec.rb +1 -1
  318. data/spec/integration/messaging/v1/service/short_code_spec.rb +1 -1
  319. data/spec/integration/messaging/v1/service_spec.rb +1 -1
  320. data/spec/integration/notify/v1/credential_spec.rb +1 -1
  321. data/spec/integration/notify/v1/service/binding_spec.rb +1 -1
  322. data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +1 -1
  323. data/spec/integration/notify/v1/service/user/user_binding_spec.rb +1 -1
  324. data/spec/integration/notify/v1/service/user_spec.rb +1 -1
  325. data/spec/integration/preview/acc_security/service/verification_check_spec.rb +1 -1
  326. data/spec/integration/preview/acc_security/service/verification_spec.rb +1 -1
  327. data/spec/integration/preview/acc_security/service_spec.rb +1 -1
  328. data/spec/integration/preview/deployed_devices/fleet/certificate_spec.rb +1 -1
  329. data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +4 -4
  330. data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +1 -1
  331. data/spec/integration/preview/proxy/service/phone_number_spec.rb +1 -1
  332. data/spec/integration/preview/proxy/service/session/participant_spec.rb +1 -1
  333. data/spec/integration/preview/proxy/service/short_code_spec.rb +1 -1
  334. data/spec/integration/preview/studio/flow/engagement/step_spec.rb +96 -0
  335. data/spec/integration/preview/studio/flow/engagement_spec.rb +171 -0
  336. data/spec/integration/preview/studio/flow_spec.rb +115 -0
  337. data/spec/integration/preview/sync/service/document/document_permission_spec.rb +1 -1
  338. data/spec/integration/preview/sync/service/document_spec.rb +1 -1
  339. data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +2 -2
  340. data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +1 -1
  341. data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +2 -2
  342. data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +1 -1
  343. data/spec/integration/preview/understand/service/field_type/field_value_spec.rb +1 -1
  344. data/spec/integration/preview/understand/service/field_type_spec.rb +1 -1
  345. data/spec/integration/preview/understand/service/intent/field_spec.rb +1 -1
  346. data/spec/integration/preview/understand/service/intent/sample_spec.rb +1 -1
  347. data/spec/integration/preview/understand/service/intent_spec.rb +1 -1
  348. data/spec/integration/preview/understand/service/query_spec.rb +1 -1
  349. data/spec/integration/preview/wireless/command_spec.rb +1 -1
  350. data/spec/integration/proxy/v1/service/phone_number_spec.rb +15 -7
  351. data/spec/integration/proxy/v1/service/session/participant_spec.rb +1 -4
  352. data/spec/integration/proxy/v1/service/session_spec.rb +3 -0
  353. data/spec/integration/proxy/v1/service/short_code_spec.rb +13 -4
  354. data/spec/integration/proxy/v1/service_spec.rb +12 -0
  355. data/spec/integration/sync/v1/service/document/document_permission_spec.rb +1 -1
  356. data/spec/integration/sync/v1/service/document_spec.rb +1 -1
  357. data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +2 -2
  358. data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +1 -1
  359. data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +2 -2
  360. data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +1 -1
  361. data/spec/integration/sync/v1/service/sync_stream/stream_message_spec.rb +1 -1
  362. data/spec/integration/taskrouter/v1/workspace/activity_spec.rb +1 -1
  363. data/spec/integration/taskrouter/v1/workspace/worker_spec.rb +1 -1
  364. data/spec/integration/taskrouter/v1/workspace/workflow_spec.rb +1 -1
  365. data/spec/integration/taskrouter/v1/workspace_spec.rb +1 -1
  366. data/spec/integration/trunking/v1/trunk/credential_list_spec.rb +1 -1
  367. data/spec/integration/trunking/v1/trunk/ip_access_control_list_spec.rb +1 -1
  368. data/spec/integration/trunking/v1/trunk/phone_number_spec.rb +1 -1
  369. data/spec/integration/video/v1/room_spec.rb +1 -1
  370. data/spec/integration/wireless/v1/command_spec.rb +1 -1
  371. metadata +16 -3
@@ -64,7 +64,7 @@ module Twilio
64
64
  def stream(unique_name: :unset, status: :unset, limit: nil, page_size: nil)
65
65
  limits = @version.read_limits(limit, page_size)
66
66
 
67
- page = self.page(unique_name: unique_name, status: status, page_size: limits[:page_size],)
67
+ page = self.page(unique_name: unique_name, status: status, page_size: limits[:page_size])
68
68
 
69
69
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
70
70
  end
@@ -76,7 +76,7 @@ module Twilio
76
76
  def each
77
77
  limits = @version.read_limits
78
78
 
79
- page = self.page(page_size: limits[:page_size],)
79
+ page = self.page(page_size: limits[:page_size])
80
80
 
81
81
  @version.stream(page,
82
82
  limit: limits[:limit],
@@ -150,7 +150,7 @@ module Twilio
150
150
  data: data
151
151
  )
152
152
 
153
- SessionInstance.new(@version, payload, service_sid: @solution[:service_sid],)
153
+ SessionInstance.new(@version, payload, service_sid: @solution[:service_sid])
154
154
  end
155
155
 
156
156
  ##
@@ -181,7 +181,7 @@ module Twilio
181
181
  # @param [Hash] payload Payload response from the API
182
182
  # @return [SessionInstance] SessionInstance
183
183
  def get_instance(payload)
184
- SessionInstance.new(@version, payload, service_sid: @solution[:service_sid],)
184
+ SessionInstance.new(@version, payload, service_sid: @solution[:service_sid])
185
185
  end
186
186
 
187
187
  ##
@@ -204,7 +204,7 @@ module Twilio
204
204
  super(version)
205
205
 
206
206
  # Path Solution
207
- @solution = {service_sid: service_sid, sid: sid,}
207
+ @solution = {service_sid: service_sid, sid: sid}
208
208
  @uri = "/Services/#{@solution[:service_sid]}/Sessions/#{@solution[:sid]}"
209
209
 
210
210
  # Dependents
@@ -224,7 +224,7 @@ module Twilio
224
224
  params,
225
225
  )
226
226
 
227
- SessionInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid],)
227
+ SessionInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid])
228
228
  end
229
229
 
230
230
  ##
@@ -259,7 +259,7 @@ module Twilio
259
259
  data: data,
260
260
  )
261
261
 
262
- SessionInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid],)
262
+ SessionInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid])
263
263
  end
264
264
 
265
265
  ##
@@ -270,7 +270,7 @@ module Twilio
270
270
  raise ArgumentError, 'sid cannot be nil' if sid.nil?
271
271
 
272
272
  if sid != :unset
273
- return InteractionContext.new(@version, @solution[:service_sid], @solution[:sid], sid,)
273
+ return InteractionContext.new(@version, @solution[:service_sid], @solution[:sid], sid)
274
274
  end
275
275
 
276
276
  unless @interactions
@@ -292,7 +292,7 @@ module Twilio
292
292
  raise ArgumentError, 'sid cannot be nil' if sid.nil?
293
293
 
294
294
  if sid != :unset
295
- return ParticipantContext.new(@version, @solution[:service_sid], @solution[:sid], sid,)
295
+ return ParticipantContext.new(@version, @solution[:service_sid], @solution[:sid], sid)
296
296
  end
297
297
 
298
298
  unless @participants
@@ -345,7 +345,7 @@ module Twilio
345
345
 
346
346
  # Context
347
347
  @instance_context = nil
348
- @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'],}
348
+ @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid']}
349
349
  end
350
350
 
351
351
  ##
@@ -354,7 +354,7 @@ module Twilio
354
354
  # @return [SessionContext] SessionContext for this SessionInstance
355
355
  def context
356
356
  unless @instance_context
357
- @instance_context = SessionContext.new(@version, @params['service_sid'], @params['sid'],)
357
+ @instance_context = SessionContext.new(@version, @params['service_sid'], @params['sid'])
358
358
  end
359
359
  @instance_context
360
360
  end
@@ -457,7 +457,7 @@ module Twilio
457
457
  # @param [String] participants The participants
458
458
  # @return [SessionInstance] Updated SessionInstance
459
459
  def update(unique_name: :unset, ttl: :unset, status: :unset, participants: :unset)
460
- context.update(unique_name: unique_name, ttl: ttl, status: status, participants: participants,)
460
+ context.update(unique_name: unique_name, ttl: ttl, status: status, participants: participants)
461
461
  end
462
462
 
463
463
  ##
@@ -89,7 +89,7 @@ module Twilio
89
89
  def each
90
90
  limits = @version.read_limits
91
91
 
92
- page = self.page(page_size: limits[:page_size],)
92
+ page = self.page(page_size: limits[:page_size])
93
93
 
94
94
  @version.stream(page,
95
95
  limit: limits[:limit],
@@ -196,7 +196,7 @@ module Twilio
196
196
  super(version)
197
197
 
198
198
  # Path Solution
199
- @solution = {service_sid: service_sid, session_sid: session_sid, sid: sid,}
199
+ @solution = {service_sid: service_sid, session_sid: session_sid, sid: sid}
200
200
  @uri = "/Services/#{@solution[:service_sid]}/Sessions/#{@solution[:session_sid]}/Interactions/#{@solution[:sid]}"
201
201
  end
202
202
 
@@ -85,7 +85,7 @@ module Twilio
85
85
  def each
86
86
  limits = @version.read_limits
87
87
 
88
- page = self.page(page_size: limits[:page_size],)
88
+ page = self.page(page_size: limits[:page_size])
89
89
 
90
90
  @version.stream(page,
91
91
  limit: limits[:limit],
@@ -221,7 +221,7 @@ module Twilio
221
221
  super(version)
222
222
 
223
223
  # Path Solution
224
- @solution = {service_sid: service_sid, session_sid: session_sid, sid: sid,}
224
+ @solution = {service_sid: service_sid, session_sid: session_sid, sid: sid}
225
225
  @uri = "/Services/#{@solution[:service_sid]}/Sessions/#{@solution[:session_sid]}/Participants/#{@solution[:sid]}"
226
226
 
227
227
  # Dependents
@@ -38,7 +38,7 @@ module Twilio
38
38
  # Participant.
39
39
  # @return [MessageInteractionInstance] Newly created MessageInteractionInstance
40
40
  def create(body: :unset, media_url: :unset)
41
- data = Twilio::Values.of({'Body' => body, 'MediaUrl' => Twilio.serialize_list(media_url) { |e| e },})
41
+ data = Twilio::Values.of({'Body' => body, 'MediaUrl' => Twilio.serialize_list(media_url) { |e| e }})
42
42
 
43
43
  payload = @version.create(
44
44
  'POST',
@@ -84,7 +84,7 @@ module Twilio
84
84
  def stream(limit: nil, page_size: nil)
85
85
  limits = @version.read_limits(limit, page_size)
86
86
 
87
- page = self.page(page_size: limits[:page_size],)
87
+ page = self.page(page_size: limits[:page_size])
88
88
 
89
89
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
90
90
  end
@@ -96,7 +96,7 @@ module Twilio
96
96
  def each
97
97
  limits = @version.read_limits
98
98
 
99
- page = self.page(page_size: limits[:page_size],)
99
+ page = self.page(page_size: limits[:page_size])
100
100
 
101
101
  @version.stream(page,
102
102
  limit: limits[:limit],
@@ -31,7 +31,7 @@ module Twilio
31
31
  # @param [String] sid The shortcode Sid that uniquely identifies this resource
32
32
  # @return [ShortCodeInstance] Newly created ShortCodeInstance
33
33
  def create(sid: nil)
34
- data = Twilio::Values.of({'Sid' => sid,})
34
+ data = Twilio::Values.of({'Sid' => sid})
35
35
 
36
36
  payload = @version.create(
37
37
  'POST',
@@ -39,7 +39,7 @@ module Twilio
39
39
  data: data
40
40
  )
41
41
 
42
- ShortCodeInstance.new(@version, payload, service_sid: @solution[:service_sid],)
42
+ ShortCodeInstance.new(@version, payload, service_sid: @solution[:service_sid])
43
43
  end
44
44
 
45
45
  ##
@@ -71,7 +71,7 @@ module Twilio
71
71
  def stream(limit: nil, page_size: nil)
72
72
  limits = @version.read_limits(limit, page_size)
73
73
 
74
- page = self.page(page_size: limits[:page_size],)
74
+ page = self.page(page_size: limits[:page_size])
75
75
 
76
76
  @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
77
77
  end
@@ -83,7 +83,7 @@ module Twilio
83
83
  def each
84
84
  limits = @version.read_limits
85
85
 
86
- page = self.page(page_size: limits[:page_size],)
86
+ page = self.page(page_size: limits[:page_size])
87
87
 
88
88
  @version.stream(page,
89
89
  limit: limits[:limit],
@@ -152,7 +152,7 @@ module Twilio
152
152
  # @param [Hash] payload Payload response from the API
153
153
  # @return [ShortCodeInstance] ShortCodeInstance
154
154
  def get_instance(payload)
155
- ShortCodeInstance.new(@version, payload, service_sid: @solution[:service_sid],)
155
+ ShortCodeInstance.new(@version, payload, service_sid: @solution[:service_sid])
156
156
  end
157
157
 
158
158
  ##
@@ -175,7 +175,7 @@ module Twilio
175
175
  super(version)
176
176
 
177
177
  # Path Solution
178
- @solution = {service_sid: service_sid, sid: sid,}
178
+ @solution = {service_sid: service_sid, sid: sid}
179
179
  @uri = "/Services/#{@solution[:service_sid]}/ShortCodes/#{@solution[:sid]}"
180
180
  end
181
181
 
@@ -198,7 +198,7 @@ module Twilio
198
198
  params,
199
199
  )
200
200
 
201
- ShortCodeInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid],)
201
+ ShortCodeInstance.new(@version, payload, service_sid: @solution[:service_sid], sid: @solution[:sid])
202
202
  end
203
203
 
204
204
  ##
@@ -237,7 +237,7 @@ module Twilio
237
237
 
238
238
  # Context
239
239
  @instance_context = nil
240
- @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid'],}
240
+ @params = {'service_sid' => service_sid, 'sid' => sid || @properties['sid']}
241
241
  end
242
242
 
243
243
  ##
@@ -246,7 +246,7 @@ module Twilio
246
246
  # @return [ShortCodeContext] ShortCodeContext for this ShortCodeInstance
247
247
  def context
248
248
  unless @instance_context
249
- @instance_context = ShortCodeContext.new(@version, @params['service_sid'], @params['sid'],)
249
+ @instance_context = ShortCodeContext.new(@version, @params['service_sid'], @params['sid'])
250
250
  end
251
251
  @instance_context
252
252
  end
@@ -0,0 +1,41 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview
10
+ class Studio < Version
11
+ ##
12
+ # Initialize the Studio version of Preview
13
+ def initialize(domain)
14
+ super
15
+ @version = 'Studio'
16
+ @flows = nil
17
+ end
18
+
19
+ ##
20
+ # @param [String] sid The sid
21
+ # @return [Twilio::REST::Preview::Studio::FlowContext] if sid was passed.
22
+ # @return [Twilio::REST::Preview::Studio::FlowList]
23
+ def flows(sid=:unset)
24
+ if sid.nil?
25
+ raise ArgumentError, 'sid cannot be nil'
26
+ elsif sid == :unset
27
+ @flows ||= FlowList.new self
28
+ else
29
+ FlowContext.new(self, sid)
30
+ end
31
+ end
32
+
33
+ ##
34
+ # Provide a user friendly representation
35
+ def to_s
36
+ '<Twilio::REST::Preview::Studio>'
37
+ end
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,353 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Preview < Domain
10
+ class Studio < Version
11
+ ##
12
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
13
+ class FlowList < ListResource
14
+ ##
15
+ # Initialize the FlowList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [FlowList] FlowList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/Flows"
24
+ end
25
+
26
+ ##
27
+ # Lists FlowInstance records from the API as a list.
28
+ # Unlike stream(), this operation is eager and will load `limit` records into
29
+ # memory before returning.
30
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
31
+ # guarantees to never return more than limit. Default is no limit
32
+ # @param [Integer] page_size Number of records to fetch per request, when
33
+ # not set will use the default value of 50 records. If no page_size is defined
34
+ # but a limit is defined, stream() will attempt to read the limit with the most
35
+ # efficient page size, i.e. min(limit, 1000)
36
+ # @return [Array] Array of up to limit results
37
+ def list(limit: nil, page_size: nil)
38
+ self.stream(limit: limit, page_size: page_size).entries
39
+ end
40
+
41
+ ##
42
+ # Streams FlowInstance records from the API as an Enumerable.
43
+ # This operation lazily loads records as efficiently as possible until the limit
44
+ # is reached.
45
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
46
+ # guarantees to never return more than limit. Default is no limit.
47
+ # @param [Integer] page_size Number of records to fetch per request, when
48
+ # not set will use the default value of 50 records. If no page_size is defined
49
+ # but a limit is defined, stream() will attempt to read the limit with the most
50
+ # efficient page size, i.e. min(limit, 1000)
51
+ # @return [Enumerable] Enumerable that will yield up to limit results
52
+ def stream(limit: nil, page_size: nil)
53
+ limits = @version.read_limits(limit, page_size)
54
+
55
+ page = self.page(page_size: limits[:page_size])
56
+
57
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
58
+ end
59
+
60
+ ##
61
+ # When passed a block, yields FlowInstance records from the API.
62
+ # This operation lazily loads records as efficiently as possible until the limit
63
+ # is reached.
64
+ def each
65
+ limits = @version.read_limits
66
+
67
+ page = self.page(page_size: limits[:page_size])
68
+
69
+ @version.stream(page,
70
+ limit: limits[:limit],
71
+ page_limit: limits[:page_limit]).each {|x| yield x}
72
+ end
73
+
74
+ ##
75
+ # Retrieve a single page of FlowInstance records from the API.
76
+ # Request is executed immediately.
77
+ # @param [String] page_token PageToken provided by the API
78
+ # @param [Integer] page_number Page Number, this value is simply for client state
79
+ # @param [Integer] page_size Number of records to return, defaults to 50
80
+ # @return [Page] Page of FlowInstance
81
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
82
+ params = Twilio::Values.of({
83
+ 'PageToken' => page_token,
84
+ 'Page' => page_number,
85
+ 'PageSize' => page_size,
86
+ })
87
+ response = @version.page(
88
+ 'GET',
89
+ @uri,
90
+ params
91
+ )
92
+ FlowPage.new(@version, response, @solution)
93
+ end
94
+
95
+ ##
96
+ # Retrieve a single page of FlowInstance records from the API.
97
+ # Request is executed immediately.
98
+ # @param [String] target_url API-generated URL for the requested results page
99
+ # @return [Page] Page of FlowInstance
100
+ def get_page(target_url)
101
+ response = @version.domain.request(
102
+ 'GET',
103
+ target_url
104
+ )
105
+ FlowPage.new(@version, response, @solution)
106
+ end
107
+
108
+ ##
109
+ # Provide a user friendly representation
110
+ def to_s
111
+ '#<Twilio.Preview.Studio.FlowList>'
112
+ end
113
+ end
114
+
115
+ ##
116
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
117
+ class FlowPage < Page
118
+ ##
119
+ # Initialize the FlowPage
120
+ # @param [Version] version Version that contains the resource
121
+ # @param [Response] response Response from the API
122
+ # @param [Hash] solution Path solution for the resource
123
+ # @return [FlowPage] FlowPage
124
+ def initialize(version, response, solution)
125
+ super(version, response)
126
+
127
+ # Path Solution
128
+ @solution = solution
129
+ end
130
+
131
+ ##
132
+ # Build an instance of FlowInstance
133
+ # @param [Hash] payload Payload response from the API
134
+ # @return [FlowInstance] FlowInstance
135
+ def get_instance(payload)
136
+ FlowInstance.new(@version, payload)
137
+ end
138
+
139
+ ##
140
+ # Provide a user friendly representation
141
+ def to_s
142
+ '<Twilio.Preview.Studio.FlowPage>'
143
+ end
144
+ end
145
+
146
+ ##
147
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
148
+ class FlowContext < InstanceContext
149
+ ##
150
+ # Initialize the FlowContext
151
+ # @param [Version] version Version that contains the resource
152
+ # @param [String] sid The sid
153
+ # @return [FlowContext] FlowContext
154
+ def initialize(version, sid)
155
+ super(version)
156
+
157
+ # Path Solution
158
+ @solution = {sid: sid}
159
+ @uri = "/Flows/#{@solution[:sid]}"
160
+
161
+ # Dependents
162
+ @engagements = nil
163
+ end
164
+
165
+ ##
166
+ # Fetch a FlowInstance
167
+ # @return [FlowInstance] Fetched FlowInstance
168
+ def fetch
169
+ params = Twilio::Values.of({})
170
+
171
+ payload = @version.fetch(
172
+ 'GET',
173
+ @uri,
174
+ params,
175
+ )
176
+
177
+ FlowInstance.new(@version, payload, sid: @solution[:sid])
178
+ end
179
+
180
+ ##
181
+ # Deletes the FlowInstance
182
+ # @return [Boolean] true if delete succeeds, true otherwise
183
+ def delete
184
+ @version.delete('delete', @uri)
185
+ end
186
+
187
+ ##
188
+ # Access the engagements
189
+ # @return [EngagementList]
190
+ # @return [EngagementContext] if sid was passed.
191
+ def engagements(sid=:unset)
192
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
193
+
194
+ if sid != :unset
195
+ return EngagementContext.new(@version, @solution[:sid], sid)
196
+ end
197
+
198
+ unless @engagements
199
+ @engagements = EngagementList.new(@version, flow_sid: @solution[:sid])
200
+ end
201
+
202
+ @engagements
203
+ end
204
+
205
+ ##
206
+ # Provide a user friendly representation
207
+ def to_s
208
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
209
+ "#<Twilio.Preview.Studio.FlowContext #{context}>"
210
+ end
211
+ end
212
+
213
+ ##
214
+ # PLEASE NOTE that this class contains preview products that are subject to change. Use them with caution. If you currently do not have developer preview access, please contact help@twilio.com.
215
+ class FlowInstance < InstanceResource
216
+ ##
217
+ # Initialize the FlowInstance
218
+ # @param [Version] version Version that contains the resource
219
+ # @param [Hash] payload payload that contains response from Twilio
220
+ # @param [String] sid The sid
221
+ # @return [FlowInstance] FlowInstance
222
+ def initialize(version, payload, sid: nil)
223
+ super(version)
224
+
225
+ # Marshaled Properties
226
+ @properties = {
227
+ 'sid' => payload['sid'],
228
+ 'account_sid' => payload['account_sid'],
229
+ 'friendly_name' => payload['friendly_name'],
230
+ 'status' => payload['status'],
231
+ 'debug' => payload['debug'],
232
+ 'version' => payload['version'].to_i,
233
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
234
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
235
+ 'url' => payload['url'],
236
+ 'links' => payload['links'],
237
+ }
238
+
239
+ # Context
240
+ @instance_context = nil
241
+ @params = {'sid' => sid || @properties['sid']}
242
+ end
243
+
244
+ ##
245
+ # Generate an instance context for the instance, the context is capable of
246
+ # performing various actions. All instance actions are proxied to the context
247
+ # @return [FlowContext] FlowContext for this FlowInstance
248
+ def context
249
+ unless @instance_context
250
+ @instance_context = FlowContext.new(@version, @params['sid'])
251
+ end
252
+ @instance_context
253
+ end
254
+
255
+ ##
256
+ # @return [String] A string that uniquely identifies this Flow.
257
+ def sid
258
+ @properties['sid']
259
+ end
260
+
261
+ ##
262
+ # @return [String] Account Sid.
263
+ def account_sid
264
+ @properties['account_sid']
265
+ end
266
+
267
+ ##
268
+ # @return [String] A human readable description of this resource.
269
+ def friendly_name
270
+ @properties['friendly_name']
271
+ end
272
+
273
+ ##
274
+ # @return [flow.Status] The Status of this Flow
275
+ def status
276
+ @properties['status']
277
+ end
278
+
279
+ ##
280
+ # @return [Boolean] Toggle extra logging.
281
+ def debug
282
+ @properties['debug']
283
+ end
284
+
285
+ ##
286
+ # @return [String] The latest version number of this Flow's definition.
287
+ def version
288
+ @properties['version']
289
+ end
290
+
291
+ ##
292
+ # @return [Time] The date this Flow was created
293
+ def date_created
294
+ @properties['date_created']
295
+ end
296
+
297
+ ##
298
+ # @return [Time] The date this Flow was updated
299
+ def date_updated
300
+ @properties['date_updated']
301
+ end
302
+
303
+ ##
304
+ # @return [String] The URL of this resource.
305
+ def url
306
+ @properties['url']
307
+ end
308
+
309
+ ##
310
+ # @return [String] Nested resource URLs.
311
+ def links
312
+ @properties['links']
313
+ end
314
+
315
+ ##
316
+ # Fetch a FlowInstance
317
+ # @return [FlowInstance] Fetched FlowInstance
318
+ def fetch
319
+ context.fetch
320
+ end
321
+
322
+ ##
323
+ # Deletes the FlowInstance
324
+ # @return [Boolean] true if delete succeeds, true otherwise
325
+ def delete
326
+ context.delete
327
+ end
328
+
329
+ ##
330
+ # Access the engagements
331
+ # @return [engagements] engagements
332
+ def engagements
333
+ context.engagements
334
+ end
335
+
336
+ ##
337
+ # Provide a user friendly representation
338
+ def to_s
339
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
340
+ "<Twilio.Preview.Studio.FlowInstance #{values}>"
341
+ end
342
+
343
+ ##
344
+ # Provide a detailed, user friendly representation
345
+ def inspect
346
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
347
+ "<Twilio.Preview.Studio.FlowInstance #{values}>"
348
+ end
349
+ end
350
+ end
351
+ end
352
+ end
353
+ end