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
@@ -0,0 +1,384 @@
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
+ class FlowContext < InstanceContext
12
+ ##
13
+ # 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.
14
+ class EngagementList < ListResource
15
+ ##
16
+ # Initialize the EngagementList
17
+ # @param [Version] version Version that contains the resource
18
+ # @param [String] flow_sid The unique SID identifier of the Flow.
19
+ # @return [EngagementList] EngagementList
20
+ def initialize(version, flow_sid: nil)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {flow_sid: flow_sid}
25
+ @uri = "/Flows/#{@solution[:flow_sid]}/Engagements"
26
+ end
27
+
28
+ ##
29
+ # Lists EngagementInstance records from the API as a list.
30
+ # Unlike stream(), this operation is eager and will load `limit` records into
31
+ # memory before returning.
32
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
33
+ # guarantees to never return more than limit. Default is no limit
34
+ # @param [Integer] page_size Number of records to fetch per request, when
35
+ # not set will use the default value of 50 records. If no page_size is defined
36
+ # but a limit is defined, stream() will attempt to read the limit with the most
37
+ # efficient page size, i.e. min(limit, 1000)
38
+ # @return [Array] Array of up to limit results
39
+ def list(limit: nil, page_size: nil)
40
+ self.stream(limit: limit, page_size: page_size).entries
41
+ end
42
+
43
+ ##
44
+ # Streams EngagementInstance records from the API as an Enumerable.
45
+ # This operation lazily loads records as efficiently as possible until the limit
46
+ # is reached.
47
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
48
+ # guarantees to never return more than limit. Default is no limit.
49
+ # @param [Integer] page_size Number of records to fetch per request, when
50
+ # not set will use the default value of 50 records. If no page_size is defined
51
+ # but a limit is defined, stream() will attempt to read the limit with the most
52
+ # efficient page size, i.e. min(limit, 1000)
53
+ # @return [Enumerable] Enumerable that will yield up to limit results
54
+ def stream(limit: nil, page_size: nil)
55
+ limits = @version.read_limits(limit, page_size)
56
+
57
+ page = self.page(page_size: limits[:page_size])
58
+
59
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
60
+ end
61
+
62
+ ##
63
+ # When passed a block, yields EngagementInstance records from the API.
64
+ # This operation lazily loads records as efficiently as possible until the limit
65
+ # is reached.
66
+ def each
67
+ limits = @version.read_limits
68
+
69
+ page = self.page(page_size: limits[:page_size])
70
+
71
+ @version.stream(page,
72
+ limit: limits[:limit],
73
+ page_limit: limits[:page_limit]).each {|x| yield x}
74
+ end
75
+
76
+ ##
77
+ # Retrieve a single page of EngagementInstance records from the API.
78
+ # Request is executed immediately.
79
+ # @param [String] page_token PageToken provided by the API
80
+ # @param [Integer] page_number Page Number, this value is simply for client state
81
+ # @param [Integer] page_size Number of records to return, defaults to 50
82
+ # @return [Page] Page of EngagementInstance
83
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
84
+ params = Twilio::Values.of({
85
+ 'PageToken' => page_token,
86
+ 'Page' => page_number,
87
+ 'PageSize' => page_size,
88
+ })
89
+ response = @version.page(
90
+ 'GET',
91
+ @uri,
92
+ params
93
+ )
94
+ EngagementPage.new(@version, response, @solution)
95
+ end
96
+
97
+ ##
98
+ # Retrieve a single page of EngagementInstance records from the API.
99
+ # Request is executed immediately.
100
+ # @param [String] target_url API-generated URL for the requested results page
101
+ # @return [Page] Page of EngagementInstance
102
+ def get_page(target_url)
103
+ response = @version.domain.request(
104
+ 'GET',
105
+ target_url
106
+ )
107
+ EngagementPage.new(@version, response, @solution)
108
+ end
109
+
110
+ ##
111
+ # Retrieve a single page of EngagementInstance records from the API.
112
+ # Request is executed immediately.
113
+ # @param [String] to The to
114
+ # @param [String] from The from
115
+ # @param [String] parameters The parameters
116
+ # @return [EngagementInstance] Newly created EngagementInstance
117
+ def create(to: nil, from: nil, parameters: :unset)
118
+ data = Twilio::Values.of({'To' => to, 'From' => from, 'Parameters' => parameters})
119
+
120
+ payload = @version.create(
121
+ 'POST',
122
+ @uri,
123
+ data: data
124
+ )
125
+
126
+ EngagementInstance.new(@version, payload, flow_sid: @solution[:flow_sid])
127
+ end
128
+
129
+ ##
130
+ # Provide a user friendly representation
131
+ def to_s
132
+ '#<Twilio.Preview.Studio.EngagementList>'
133
+ end
134
+ end
135
+
136
+ ##
137
+ # 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.
138
+ class EngagementPage < Page
139
+ ##
140
+ # Initialize the EngagementPage
141
+ # @param [Version] version Version that contains the resource
142
+ # @param [Response] response Response from the API
143
+ # @param [Hash] solution Path solution for the resource
144
+ # @return [EngagementPage] EngagementPage
145
+ def initialize(version, response, solution)
146
+ super(version, response)
147
+
148
+ # Path Solution
149
+ @solution = solution
150
+ end
151
+
152
+ ##
153
+ # Build an instance of EngagementInstance
154
+ # @param [Hash] payload Payload response from the API
155
+ # @return [EngagementInstance] EngagementInstance
156
+ def get_instance(payload)
157
+ EngagementInstance.new(@version, payload, flow_sid: @solution[:flow_sid])
158
+ end
159
+
160
+ ##
161
+ # Provide a user friendly representation
162
+ def to_s
163
+ '<Twilio.Preview.Studio.EngagementPage>'
164
+ end
165
+ end
166
+
167
+ ##
168
+ # 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.
169
+ class EngagementContext < InstanceContext
170
+ ##
171
+ # Initialize the EngagementContext
172
+ # @param [Version] version Version that contains the resource
173
+ # @param [String] flow_sid The flow_sid
174
+ # @param [String] sid The sid
175
+ # @return [EngagementContext] EngagementContext
176
+ def initialize(version, flow_sid, sid)
177
+ super(version)
178
+
179
+ # Path Solution
180
+ @solution = {flow_sid: flow_sid, sid: sid}
181
+ @uri = "/Flows/#{@solution[:flow_sid]}/Engagements/#{@solution[:sid]}"
182
+
183
+ # Dependents
184
+ @steps = nil
185
+ end
186
+
187
+ ##
188
+ # Fetch a EngagementInstance
189
+ # @return [EngagementInstance] Fetched EngagementInstance
190
+ def fetch
191
+ params = Twilio::Values.of({})
192
+
193
+ payload = @version.fetch(
194
+ 'GET',
195
+ @uri,
196
+ params,
197
+ )
198
+
199
+ EngagementInstance.new(@version, payload, flow_sid: @solution[:flow_sid], sid: @solution[:sid])
200
+ end
201
+
202
+ ##
203
+ # Deletes the EngagementInstance
204
+ # @return [Boolean] true if delete succeeds, true otherwise
205
+ def delete
206
+ @version.delete('delete', @uri)
207
+ end
208
+
209
+ ##
210
+ # Access the steps
211
+ # @return [StepList]
212
+ # @return [StepContext] if sid was passed.
213
+ def steps(sid=:unset)
214
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
215
+
216
+ if sid != :unset
217
+ return StepContext.new(@version, @solution[:flow_sid], @solution[:sid], sid)
218
+ end
219
+
220
+ unless @steps
221
+ @steps = StepList.new(@version, flow_sid: @solution[:flow_sid], engagement_sid: @solution[:sid])
222
+ end
223
+
224
+ @steps
225
+ end
226
+
227
+ ##
228
+ # Provide a user friendly representation
229
+ def to_s
230
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
231
+ "#<Twilio.Preview.Studio.EngagementContext #{context}>"
232
+ end
233
+ end
234
+
235
+ ##
236
+ # 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.
237
+ class EngagementInstance < InstanceResource
238
+ ##
239
+ # Initialize the EngagementInstance
240
+ # @param [Version] version Version that contains the resource
241
+ # @param [Hash] payload payload that contains response from Twilio
242
+ # @param [String] flow_sid The unique SID identifier of the Flow.
243
+ # @param [String] sid The sid
244
+ # @return [EngagementInstance] EngagementInstance
245
+ def initialize(version, payload, flow_sid: nil, sid: nil)
246
+ super(version)
247
+
248
+ # Marshaled Properties
249
+ @properties = {
250
+ 'sid' => payload['sid'],
251
+ 'account_sid' => payload['account_sid'],
252
+ 'flow_sid' => payload['flow_sid'],
253
+ 'contact_sid' => payload['contact_sid'],
254
+ 'contact_channel_address' => payload['contact_channel_address'],
255
+ 'status' => payload['status'],
256
+ 'context' => payload['context'],
257
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
258
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
259
+ 'url' => payload['url'],
260
+ 'links' => payload['links'],
261
+ }
262
+
263
+ # Context
264
+ @instance_context = nil
265
+ @params = {'flow_sid' => flow_sid, 'sid' => sid || @properties['sid']}
266
+ end
267
+
268
+ ##
269
+ # Generate an instance context for the instance, the context is capable of
270
+ # performing various actions. All instance actions are proxied to the context
271
+ # @return [EngagementContext] EngagementContext for this EngagementInstance
272
+ def context
273
+ unless @instance_context
274
+ @instance_context = EngagementContext.new(@version, @params['flow_sid'], @params['sid'])
275
+ end
276
+ @instance_context
277
+ end
278
+
279
+ ##
280
+ # @return [String] A string that uniquely identifies this Engagement.
281
+ def sid
282
+ @properties['sid']
283
+ end
284
+
285
+ ##
286
+ # @return [String] Account Sid.
287
+ def account_sid
288
+ @properties['account_sid']
289
+ end
290
+
291
+ ##
292
+ # @return [String] Flow Sid.
293
+ def flow_sid
294
+ @properties['flow_sid']
295
+ end
296
+
297
+ ##
298
+ # @return [String] Contact Sid.
299
+ def contact_sid
300
+ @properties['contact_sid']
301
+ end
302
+
303
+ ##
304
+ # @return [String] The phone number, SIP address or Client identifier that triggered this Engagement.
305
+ def contact_channel_address
306
+ @properties['contact_channel_address']
307
+ end
308
+
309
+ ##
310
+ # @return [engagement.Status] The Status of this Engagement
311
+ def status
312
+ @properties['status']
313
+ end
314
+
315
+ ##
316
+ # @return [Hash] Nested resource URLs.
317
+ def context
318
+ @properties['context']
319
+ end
320
+
321
+ ##
322
+ # @return [Time] The date this Engagement was created
323
+ def date_created
324
+ @properties['date_created']
325
+ end
326
+
327
+ ##
328
+ # @return [Time] The date this Engagement was updated
329
+ def date_updated
330
+ @properties['date_updated']
331
+ end
332
+
333
+ ##
334
+ # @return [String] The URL of this resource.
335
+ def url
336
+ @properties['url']
337
+ end
338
+
339
+ ##
340
+ # @return [String] Nested resource URLs.
341
+ def links
342
+ @properties['links']
343
+ end
344
+
345
+ ##
346
+ # Fetch a EngagementInstance
347
+ # @return [EngagementInstance] Fetched EngagementInstance
348
+ def fetch
349
+ context.fetch
350
+ end
351
+
352
+ ##
353
+ # Deletes the EngagementInstance
354
+ # @return [Boolean] true if delete succeeds, true otherwise
355
+ def delete
356
+ context.delete
357
+ end
358
+
359
+ ##
360
+ # Access the steps
361
+ # @return [steps] steps
362
+ def steps
363
+ context.steps
364
+ end
365
+
366
+ ##
367
+ # Provide a user friendly representation
368
+ def to_s
369
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
370
+ "<Twilio.Preview.Studio.EngagementInstance #{values}>"
371
+ end
372
+
373
+ ##
374
+ # Provide a detailed, user friendly representation
375
+ def inspect
376
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
377
+ "<Twilio.Preview.Studio.EngagementInstance #{values}>"
378
+ end
379
+ end
380
+ end
381
+ end
382
+ end
383
+ end
384
+ end
@@ -0,0 +1,348 @@
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
+ class FlowContext < InstanceContext
12
+ class EngagementContext < InstanceContext
13
+ ##
14
+ # 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.
15
+ class StepList < ListResource
16
+ ##
17
+ # Initialize the StepList
18
+ # @param [Version] version Version that contains the resource
19
+ # @param [String] flow_sid The unique SID identifier of the Flow.
20
+ # @param [String] engagement_sid The unique SID identifier of the Engagement.
21
+ # @return [StepList] StepList
22
+ def initialize(version, flow_sid: nil, engagement_sid: nil)
23
+ super(version)
24
+
25
+ # Path Solution
26
+ @solution = {flow_sid: flow_sid, engagement_sid: engagement_sid}
27
+ @uri = "/Flows/#{@solution[:flow_sid]}/Engagements/#{@solution[:engagement_sid]}/Steps"
28
+ end
29
+
30
+ ##
31
+ # Lists StepInstance records from the API as a list.
32
+ # Unlike stream(), this operation is eager and will load `limit` records into
33
+ # memory before returning.
34
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
35
+ # guarantees to never return more than limit. Default is no limit
36
+ # @param [Integer] page_size Number of records to fetch per request, when
37
+ # not set will use the default value of 50 records. If no page_size is defined
38
+ # but a limit is defined, stream() will attempt to read the limit with the most
39
+ # efficient page size, i.e. min(limit, 1000)
40
+ # @return [Array] Array of up to limit results
41
+ def list(limit: nil, page_size: nil)
42
+ self.stream(limit: limit, page_size: page_size).entries
43
+ end
44
+
45
+ ##
46
+ # Streams StepInstance records from the API as an Enumerable.
47
+ # This operation lazily loads records as efficiently as possible until the limit
48
+ # is reached.
49
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
50
+ # guarantees to never return more than limit. Default is no limit.
51
+ # @param [Integer] page_size Number of records to fetch per request, when
52
+ # not set will use the default value of 50 records. If no page_size is defined
53
+ # but a limit is defined, stream() will attempt to read the limit with the most
54
+ # efficient page size, i.e. min(limit, 1000)
55
+ # @return [Enumerable] Enumerable that will yield up to limit results
56
+ def stream(limit: nil, page_size: nil)
57
+ limits = @version.read_limits(limit, page_size)
58
+
59
+ page = self.page(page_size: limits[:page_size])
60
+
61
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
62
+ end
63
+
64
+ ##
65
+ # When passed a block, yields StepInstance records from the API.
66
+ # This operation lazily loads records as efficiently as possible until the limit
67
+ # is reached.
68
+ def each
69
+ limits = @version.read_limits
70
+
71
+ page = self.page(page_size: limits[:page_size])
72
+
73
+ @version.stream(page,
74
+ limit: limits[:limit],
75
+ page_limit: limits[:page_limit]).each {|x| yield x}
76
+ end
77
+
78
+ ##
79
+ # Retrieve a single page of StepInstance records from the API.
80
+ # Request is executed immediately.
81
+ # @param [String] page_token PageToken provided by the API
82
+ # @param [Integer] page_number Page Number, this value is simply for client state
83
+ # @param [Integer] page_size Number of records to return, defaults to 50
84
+ # @return [Page] Page of StepInstance
85
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
86
+ params = Twilio::Values.of({
87
+ 'PageToken' => page_token,
88
+ 'Page' => page_number,
89
+ 'PageSize' => page_size,
90
+ })
91
+ response = @version.page(
92
+ 'GET',
93
+ @uri,
94
+ params
95
+ )
96
+ StepPage.new(@version, response, @solution)
97
+ end
98
+
99
+ ##
100
+ # Retrieve a single page of StepInstance records from the API.
101
+ # Request is executed immediately.
102
+ # @param [String] target_url API-generated URL for the requested results page
103
+ # @return [Page] Page of StepInstance
104
+ def get_page(target_url)
105
+ response = @version.domain.request(
106
+ 'GET',
107
+ target_url
108
+ )
109
+ StepPage.new(@version, response, @solution)
110
+ end
111
+
112
+ ##
113
+ # Provide a user friendly representation
114
+ def to_s
115
+ '#<Twilio.Preview.Studio.StepList>'
116
+ end
117
+ end
118
+
119
+ ##
120
+ # 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.
121
+ class StepPage < Page
122
+ ##
123
+ # Initialize the StepPage
124
+ # @param [Version] version Version that contains the resource
125
+ # @param [Response] response Response from the API
126
+ # @param [Hash] solution Path solution for the resource
127
+ # @return [StepPage] StepPage
128
+ def initialize(version, response, solution)
129
+ super(version, response)
130
+
131
+ # Path Solution
132
+ @solution = solution
133
+ end
134
+
135
+ ##
136
+ # Build an instance of StepInstance
137
+ # @param [Hash] payload Payload response from the API
138
+ # @return [StepInstance] StepInstance
139
+ def get_instance(payload)
140
+ StepInstance.new(
141
+ @version,
142
+ payload,
143
+ flow_sid: @solution[:flow_sid],
144
+ engagement_sid: @solution[:engagement_sid],
145
+ )
146
+ end
147
+
148
+ ##
149
+ # Provide a user friendly representation
150
+ def to_s
151
+ '<Twilio.Preview.Studio.StepPage>'
152
+ end
153
+ end
154
+
155
+ ##
156
+ # 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.
157
+ class StepContext < InstanceContext
158
+ ##
159
+ # Initialize the StepContext
160
+ # @param [Version] version Version that contains the resource
161
+ # @param [String] flow_sid The flow_sid
162
+ # @param [String] engagement_sid The engagement_sid
163
+ # @param [String] sid The sid
164
+ # @return [StepContext] StepContext
165
+ def initialize(version, flow_sid, engagement_sid, sid)
166
+ super(version)
167
+
168
+ # Path Solution
169
+ @solution = {flow_sid: flow_sid, engagement_sid: engagement_sid, sid: sid}
170
+ @uri = "/Flows/#{@solution[:flow_sid]}/Engagements/#{@solution[:engagement_sid]}/Steps/#{@solution[:sid]}"
171
+ end
172
+
173
+ ##
174
+ # Fetch a StepInstance
175
+ # @return [StepInstance] Fetched StepInstance
176
+ def fetch
177
+ params = Twilio::Values.of({})
178
+
179
+ payload = @version.fetch(
180
+ 'GET',
181
+ @uri,
182
+ params,
183
+ )
184
+
185
+ StepInstance.new(
186
+ @version,
187
+ payload,
188
+ flow_sid: @solution[:flow_sid],
189
+ engagement_sid: @solution[:engagement_sid],
190
+ sid: @solution[:sid],
191
+ )
192
+ end
193
+
194
+ ##
195
+ # Provide a user friendly representation
196
+ def to_s
197
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
198
+ "#<Twilio.Preview.Studio.StepContext #{context}>"
199
+ end
200
+ end
201
+
202
+ ##
203
+ # 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.
204
+ class StepInstance < InstanceResource
205
+ ##
206
+ # Initialize the StepInstance
207
+ # @param [Version] version Version that contains the resource
208
+ # @param [Hash] payload payload that contains response from Twilio
209
+ # @param [String] flow_sid The unique SID identifier of the Flow.
210
+ # @param [String] engagement_sid The unique SID identifier of the Engagement.
211
+ # @param [String] sid The sid
212
+ # @return [StepInstance] StepInstance
213
+ def initialize(version, payload, flow_sid: nil, engagement_sid: nil, sid: nil)
214
+ super(version)
215
+
216
+ # Marshaled Properties
217
+ @properties = {
218
+ 'sid' => payload['sid'],
219
+ 'account_sid' => payload['account_sid'],
220
+ 'flow_sid' => payload['flow_sid'],
221
+ 'engagement_sid' => payload['engagement_sid'],
222
+ 'name' => payload['name'],
223
+ 'context' => payload['context'],
224
+ 'transitioned_from' => payload['transitioned_from'],
225
+ 'transitioned_to' => payload['transitioned_to'],
226
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
227
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
228
+ 'url' => payload['url'],
229
+ }
230
+
231
+ # Context
232
+ @instance_context = nil
233
+ @params = {
234
+ 'flow_sid' => flow_sid,
235
+ 'engagement_sid' => engagement_sid,
236
+ 'sid' => sid || @properties['sid'],
237
+ }
238
+ end
239
+
240
+ ##
241
+ # Generate an instance context for the instance, the context is capable of
242
+ # performing various actions. All instance actions are proxied to the context
243
+ # @return [StepContext] StepContext for this StepInstance
244
+ def context
245
+ unless @instance_context
246
+ @instance_context = StepContext.new(
247
+ @version,
248
+ @params['flow_sid'],
249
+ @params['engagement_sid'],
250
+ @params['sid'],
251
+ )
252
+ end
253
+ @instance_context
254
+ end
255
+
256
+ ##
257
+ # @return [String] A string that uniquely identifies this Step.
258
+ def sid
259
+ @properties['sid']
260
+ end
261
+
262
+ ##
263
+ # @return [String] Account Sid.
264
+ def account_sid
265
+ @properties['account_sid']
266
+ end
267
+
268
+ ##
269
+ # @return [String] Flow Sid.
270
+ def flow_sid
271
+ @properties['flow_sid']
272
+ end
273
+
274
+ ##
275
+ # @return [String] Engagement Sid.
276
+ def engagement_sid
277
+ @properties['engagement_sid']
278
+ end
279
+
280
+ ##
281
+ # @return [String] The Widget that implemented this Step.
282
+ def name
283
+ @properties['name']
284
+ end
285
+
286
+ ##
287
+ # @return [Hash] Nested resource URLs.
288
+ def context
289
+ @properties['context']
290
+ end
291
+
292
+ ##
293
+ # @return [String] The Widget that preceded the Widget for this Step.
294
+ def transitioned_from
295
+ @properties['transitioned_from']
296
+ end
297
+
298
+ ##
299
+ # @return [String] The Widget that will follow the Widget for this Step.
300
+ def transitioned_to
301
+ @properties['transitioned_to']
302
+ end
303
+
304
+ ##
305
+ # @return [Time] The date this Step was created
306
+ def date_created
307
+ @properties['date_created']
308
+ end
309
+
310
+ ##
311
+ # @return [Time] The date this Step was updated
312
+ def date_updated
313
+ @properties['date_updated']
314
+ end
315
+
316
+ ##
317
+ # @return [String] The URL of this resource.
318
+ def url
319
+ @properties['url']
320
+ end
321
+
322
+ ##
323
+ # Fetch a StepInstance
324
+ # @return [StepInstance] Fetched StepInstance
325
+ def fetch
326
+ context.fetch
327
+ end
328
+
329
+ ##
330
+ # Provide a user friendly representation
331
+ def to_s
332
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
333
+ "<Twilio.Preview.Studio.StepInstance #{values}>"
334
+ end
335
+
336
+ ##
337
+ # Provide a detailed, user friendly representation
338
+ def inspect
339
+ values = @properties.map{|k, v| "#{k}: #{v}"}.join(" ")
340
+ "<Twilio.Preview.Studio.StepInstance #{values}>"
341
+ end
342
+ end
343
+ end
344
+ end
345
+ end
346
+ end
347
+ end
348
+ end