twilio-ruby 5.0.0 → 5.1.0

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 (258) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGES.md +30 -2
  3. data/CONTRIBUTING.md +159 -0
  4. data/ISSUE_TEMPLATE.md +26 -0
  5. data/LICENSE.md +1 -1
  6. data/README.md +6 -7
  7. data/VERSIONS.md +21 -49
  8. data/lib/twilio-ruby/rest/accounts/v1/credential/public_key.rb +11 -11
  9. data/lib/twilio-ruby/rest/api/v2010/account/address/dependent_phone_number.rb +11 -11
  10. data/lib/twilio-ruby/rest/api/v2010/account/address.rb +11 -11
  11. data/lib/twilio-ruby/rest/api/v2010/account/application.rb +11 -11
  12. data/lib/twilio-ruby/rest/api/v2010/account/authorized_connect_app.rb +11 -11
  13. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/local.rb +11 -11
  14. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/mobile.rb +11 -11
  15. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number/toll_free.rb +11 -11
  16. data/lib/twilio-ruby/rest/api/v2010/account/available_phone_number.rb +11 -11
  17. data/lib/twilio-ruby/rest/api/v2010/account/call/notification.rb +11 -11
  18. data/lib/twilio-ruby/rest/api/v2010/account/call/recording.rb +11 -18
  19. data/lib/twilio-ruby/rest/api/v2010/account/call.rb +11 -11
  20. data/lib/twilio-ruby/rest/api/v2010/account/conference/participant.rb +11 -11
  21. data/lib/twilio-ruby/rest/api/v2010/account/conference.rb +11 -11
  22. data/lib/twilio-ruby/rest/api/v2010/account/connect_app.rb +11 -11
  23. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension.rb +358 -0
  24. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/assigned_add_on.rb +439 -0
  25. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/local.rb +11 -11
  26. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/mobile.rb +11 -11
  27. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number/toll_free.rb +11 -11
  28. data/lib/twilio-ruby/rest/api/v2010/account/incoming_phone_number.rb +48 -11
  29. data/lib/twilio-ruby/rest/api/v2010/account/key.rb +11 -11
  30. data/lib/twilio-ruby/rest/api/v2010/account/message/media.rb +11 -11
  31. data/lib/twilio-ruby/rest/api/v2010/account/message.rb +22 -12
  32. data/lib/twilio-ruby/rest/api/v2010/account/notification.rb +11 -11
  33. data/lib/twilio-ruby/rest/api/v2010/account/outgoing_caller_id.rb +11 -11
  34. data/lib/twilio-ruby/rest/api/v2010/account/queue/member.rb +11 -11
  35. data/lib/twilio-ruby/rest/api/v2010/account/queue.rb +11 -11
  36. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result/payload.rb +11 -11
  37. data/lib/twilio-ruby/rest/api/v2010/account/recording/add_on_result.rb +11 -11
  38. data/lib/twilio-ruby/rest/api/v2010/account/recording/transcription.rb +11 -11
  39. data/lib/twilio-ruby/rest/api/v2010/account/recording.rb +11 -18
  40. data/lib/twilio-ruby/rest/api/v2010/account/short_code.rb +11 -11
  41. data/lib/twilio-ruby/rest/api/v2010/account/signing_key.rb +11 -11
  42. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list/credential.rb +11 -11
  43. data/lib/twilio-ruby/rest/api/v2010/account/sip/credential_list.rb +11 -11
  44. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/credential_list_mapping.rb +11 -11
  45. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain/ip_access_control_list_mapping.rb +11 -11
  46. data/lib/twilio-ruby/rest/api/v2010/account/sip/domain.rb +11 -11
  47. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list/ip_address.rb +11 -11
  48. data/lib/twilio-ruby/rest/api/v2010/account/sip/ip_access_control_list.rb +11 -11
  49. data/lib/twilio-ruby/rest/api/v2010/account/transcription.rb +11 -11
  50. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/all_time.rb +11 -11
  51. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/daily.rb +11 -11
  52. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/last_month.rb +11 -11
  53. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/monthly.rb +11 -11
  54. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/this_month.rb +11 -11
  55. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/today.rb +11 -11
  56. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yearly.rb +11 -11
  57. data/lib/twilio-ruby/rest/api/v2010/account/usage/record/yesterday.rb +11 -11
  58. data/lib/twilio-ruby/rest/api/v2010/account/usage/record.rb +11 -11
  59. data/lib/twilio-ruby/rest/api/v2010/account/usage/trigger.rb +11 -11
  60. data/lib/twilio-ruby/rest/api/v2010/account.rb +11 -11
  61. data/lib/twilio-ruby/rest/chat/v1/credential.rb +11 -11
  62. data/lib/twilio-ruby/rest/chat/v1/service/channel/invite.rb +11 -11
  63. data/lib/twilio-ruby/rest/chat/v1/service/channel/member.rb +11 -11
  64. data/lib/twilio-ruby/rest/chat/v1/service/channel/message.rb +11 -11
  65. data/lib/twilio-ruby/rest/chat/v1/service/channel.rb +11 -11
  66. data/lib/twilio-ruby/rest/chat/v1/service/role.rb +11 -11
  67. data/lib/twilio-ruby/rest/chat/v1/service/user/user_channel.rb +11 -11
  68. data/lib/twilio-ruby/rest/chat/v1/service/user.rb +11 -11
  69. data/lib/twilio-ruby/rest/chat/v1/service.rb +11 -11
  70. data/lib/twilio-ruby/rest/chat/v2/credential.rb +11 -11
  71. data/lib/twilio-ruby/rest/chat/v2/service/channel/invite.rb +11 -11
  72. data/lib/twilio-ruby/rest/chat/v2/service/channel/member.rb +11 -11
  73. data/lib/twilio-ruby/rest/chat/v2/service/channel/message.rb +11 -11
  74. data/lib/twilio-ruby/rest/chat/v2/service/channel.rb +11 -11
  75. data/lib/twilio-ruby/rest/chat/v2/service/role.rb +11 -11
  76. data/lib/twilio-ruby/rest/chat/v2/service/user/user_channel.rb +11 -11
  77. data/lib/twilio-ruby/rest/chat/v2/service/user.rb +11 -11
  78. data/lib/twilio-ruby/rest/chat/v2/service.rb +11 -11
  79. data/lib/twilio-ruby/rest/client.rb +42 -0
  80. data/lib/twilio-ruby/rest/fax/v1/fax/fax_media.rb +334 -0
  81. data/lib/twilio-ruby/rest/fax/v1/fax.rb +549 -0
  82. data/lib/twilio-ruby/rest/fax/v1.rb +41 -0
  83. data/lib/twilio-ruby/rest/fax.rb +44 -0
  84. data/lib/twilio-ruby/rest/ip_messaging/v1/credential.rb +11 -11
  85. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/invite.rb +11 -11
  86. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/member.rb +11 -11
  87. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel/message.rb +11 -11
  88. data/lib/twilio-ruby/rest/ip_messaging/v1/service/channel.rb +11 -11
  89. data/lib/twilio-ruby/rest/ip_messaging/v1/service/role.rb +11 -11
  90. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user/user_channel.rb +11 -11
  91. data/lib/twilio-ruby/rest/ip_messaging/v1/service/user.rb +11 -11
  92. data/lib/twilio-ruby/rest/ip_messaging/v1/service.rb +11 -11
  93. data/lib/twilio-ruby/rest/ip_messaging/v2/credential.rb +11 -11
  94. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/invite.rb +11 -11
  95. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/member.rb +11 -11
  96. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel/message.rb +11 -11
  97. data/lib/twilio-ruby/rest/ip_messaging/v2/service/channel.rb +11 -11
  98. data/lib/twilio-ruby/rest/ip_messaging/v2/service/role.rb +11 -11
  99. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user/user_channel.rb +11 -11
  100. data/lib/twilio-ruby/rest/ip_messaging/v2/service/user.rb +11 -11
  101. data/lib/twilio-ruby/rest/ip_messaging/v2/service.rb +11 -11
  102. data/lib/twilio-ruby/rest/messaging/v1/service/alpha_sender.rb +360 -0
  103. data/lib/twilio-ruby/rest/messaging/v1/service/phone_number.rb +367 -0
  104. data/lib/twilio-ruby/rest/messaging/v1/service/short_code.rb +367 -0
  105. data/lib/twilio-ruby/rest/messaging/v1/service.rb +645 -0
  106. data/lib/twilio-ruby/rest/messaging/v1.rb +41 -0
  107. data/lib/twilio-ruby/rest/messaging.rb +44 -0
  108. data/lib/twilio-ruby/rest/monitor/v1/alert.rb +11 -11
  109. data/lib/twilio-ruby/rest/monitor/v1/event.rb +11 -11
  110. data/lib/twilio-ruby/rest/notify/v1/credential.rb +411 -0
  111. data/lib/twilio-ruby/rest/notify/v1/service/binding.rb +438 -0
  112. data/lib/twilio-ruby/rest/notify/v1/service/notification.rb +294 -0
  113. data/lib/twilio-ruby/rest/notify/v1/service/segment.rb +230 -0
  114. data/lib/twilio-ruby/rest/notify/v1/service/user/segment_memberships.rb +262 -0
  115. data/lib/twilio-ruby/rest/notify/v1/service/user/user_binding.rb +442 -0
  116. data/lib/twilio-ruby/rest/notify/v1/service/user.rb +453 -0
  117. data/lib/twilio-ruby/rest/notify/v1/service.rb +647 -0
  118. data/lib/twilio-ruby/rest/notify/v1.rb +56 -0
  119. data/lib/twilio-ruby/rest/notify.rb +52 -0
  120. data/lib/twilio-ruby/rest/preview/bulk_exports/export/day.rb +216 -0
  121. data/lib/twilio-ruby/rest/preview/bulk_exports/export.rb +211 -0
  122. data/lib/twilio-ruby/rest/preview/bulk_exports/export_configuration.rb +251 -0
  123. data/lib/twilio-ruby/rest/preview/bulk_exports.rb +56 -0
  124. data/lib/twilio-ruby/rest/preview/hosted_numbers/hosted_number_order.rb +570 -0
  125. data/lib/twilio-ruby/rest/preview/hosted_numbers.rb +42 -0
  126. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on/available_add_on_extension.rb +309 -0
  127. data/lib/twilio-ruby/rest/preview/marketplace/available_add_on.rb +341 -0
  128. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on/installed_add_on_extension.rb +349 -0
  129. data/lib/twilio-ruby/rest/preview/marketplace/installed_add_on.rb +448 -0
  130. data/lib/twilio-ruby/rest/preview/marketplace.rb +58 -0
  131. data/lib/twilio-ruby/rest/preview/proxy/service/phone_number.rb +367 -0
  132. data/lib/twilio-ruby/rest/preview/proxy/service/session/interaction.rb +437 -0
  133. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant/message_interaction.rb +460 -0
  134. data/lib/twilio-ruby/rest/preview/proxy/service/session/participant.rb +514 -0
  135. data/lib/twilio-ruby/rest/preview/proxy/service/session.rb +544 -0
  136. data/lib/twilio-ruby/rest/preview/proxy/service/short_code.rb +367 -0
  137. data/lib/twilio-ruby/rest/preview/proxy/service.rb +508 -0
  138. data/lib/twilio-ruby/rest/preview/proxy.rb +41 -0
  139. data/lib/twilio-ruby/rest/preview/sync/service/document/document_permission.rb +403 -0
  140. data/lib/twilio-ruby/rest/preview/sync/service/document.rb +453 -0
  141. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_item.rb +438 -0
  142. data/lib/twilio-ruby/rest/preview/sync/service/sync_list/sync_list_permission.rb +403 -0
  143. data/lib/twilio-ruby/rest/preview/sync/service/sync_list.rb +446 -0
  144. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_item.rb +440 -0
  145. data/lib/twilio-ruby/rest/preview/sync/service/sync_map/sync_map_permission.rb +403 -0
  146. data/lib/twilio-ruby/rest/preview/sync/service/sync_map.rb +446 -0
  147. data/lib/twilio-ruby/rest/preview/sync/service.rb +512 -0
  148. data/lib/twilio-ruby/rest/preview/sync.rb +41 -0
  149. data/lib/twilio-ruby/rest/preview/wireless/command.rb +390 -0
  150. data/lib/twilio-ruby/rest/preview/wireless/rate_plan.rb +443 -0
  151. data/lib/twilio-ruby/rest/preview/wireless/sim/usage.rb +244 -0
  152. data/lib/twilio-ruby/rest/preview/wireless/sim.rb +552 -0
  153. data/lib/twilio-ruby/rest/preview/wireless.rb +71 -0
  154. data/lib/twilio-ruby/rest/preview.rb +145 -0
  155. data/lib/twilio-ruby/rest/pricing/v1/messaging/country.rb +11 -11
  156. data/lib/twilio-ruby/rest/pricing/v1/phone_number/country.rb +11 -11
  157. data/lib/twilio-ruby/rest/pricing/v1/voice/country.rb +11 -11
  158. data/lib/twilio-ruby/rest/sync/v1/service/document/document_permission.rb +403 -0
  159. data/lib/twilio-ruby/rest/sync/v1/service/document.rb +453 -0
  160. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_item.rb +438 -0
  161. data/lib/twilio-ruby/rest/sync/v1/service/sync_list/sync_list_permission.rb +403 -0
  162. data/lib/twilio-ruby/rest/sync/v1/service/sync_list.rb +446 -0
  163. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_item.rb +440 -0
  164. data/lib/twilio-ruby/rest/sync/v1/service/sync_map/sync_map_permission.rb +403 -0
  165. data/lib/twilio-ruby/rest/sync/v1/service/sync_map.rb +446 -0
  166. data/lib/twilio-ruby/rest/sync/v1/service.rb +512 -0
  167. data/lib/twilio-ruby/rest/sync/v1.rb +41 -0
  168. data/lib/twilio-ruby/rest/sync.rb +44 -0
  169. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/activity.rb +11 -11
  170. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/event.rb +11 -11
  171. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task/reservation.rb +143 -13
  172. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task.rb +11 -11
  173. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_channel.rb +11 -11
  174. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue/task_queues_statistics.rb +11 -11
  175. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/task_queue.rb +11 -11
  176. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/reservation.rb +143 -13
  177. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker/worker_channel.rb +11 -11
  178. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/worker.rb +11 -11
  179. data/lib/twilio-ruby/rest/taskrouter/v1/workspace/workflow.rb +11 -11
  180. data/lib/twilio-ruby/rest/taskrouter/v1/workspace.rb +11 -11
  181. data/lib/twilio-ruby/rest/trunking/v1/trunk/credential_list.rb +11 -11
  182. data/lib/twilio-ruby/rest/trunking/v1/trunk/ip_access_control_list.rb +11 -11
  183. data/lib/twilio-ruby/rest/trunking/v1/trunk/origination_url.rb +11 -11
  184. data/lib/twilio-ruby/rest/trunking/v1/trunk/phone_number.rb +11 -11
  185. data/lib/twilio-ruby/rest/trunking/v1/trunk.rb +11 -11
  186. data/lib/twilio-ruby/rest/video/v1/recording.rb +11 -11
  187. data/lib/twilio-ruby/rest/video/v1/room/recording.rb +11 -11
  188. data/lib/twilio-ruby/rest/video/v1/room.rb +11 -11
  189. data/lib/twilio-ruby/rest/wireless/v1/command.rb +375 -0
  190. data/lib/twilio-ruby/rest/wireless/v1/rate_plan.rb +460 -0
  191. data/lib/twilio-ruby/rest/wireless/v1/sim/usage_record.rb +241 -0
  192. data/lib/twilio-ruby/rest/wireless/v1/sim.rb +556 -0
  193. data/lib/twilio-ruby/rest/wireless/v1.rb +71 -0
  194. data/lib/twilio-ruby/rest/wireless.rb +60 -0
  195. data/lib/twilio-ruby/version.rb +1 -1
  196. data/spec/integration/api/v2010/account/call/recording_spec.rb +0 -2
  197. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on/assigned_add_on_extension_spec.rb +135 -0
  198. data/spec/integration/api/v2010/account/incoming_phone_number/assigned_add_on_spec.rb +223 -0
  199. data/spec/integration/api/v2010/account/recording_spec.rb +0 -2
  200. data/spec/integration/fax/v1/fax/fax_media_spec.rb +126 -0
  201. data/spec/integration/fax/v1/fax_spec.rb +272 -0
  202. data/spec/integration/messaging/v1/service/alpha_sender_spec.rb +170 -0
  203. data/spec/integration/messaging/v1/service/phone_number_spec.rb +201 -0
  204. data/spec/integration/messaging/v1/service/short_code_spec.rb +173 -0
  205. data/spec/integration/messaging/v1/service_spec.rb +263 -0
  206. data/spec/integration/notify/v1/credential_spec.rb +223 -0
  207. data/spec/integration/notify/v1/service/binding_spec.rb +227 -0
  208. data/spec/integration/notify/v1/service/notification_spec.rb +97 -0
  209. data/spec/integration/notify/v1/service/segment_spec.rb +84 -0
  210. data/spec/integration/notify/v1/service/user/segment_memberships_spec.rb +118 -0
  211. data/spec/integration/notify/v1/service/user/user_binding_spec.rb +269 -0
  212. data/spec/integration/notify/v1/service/user_spec.rb +213 -0
  213. data/spec/integration/notify/v1/service_spec.rb +280 -0
  214. data/spec/integration/preview/bulk_exports/export/day_spec.rb +56 -0
  215. data/spec/integration/preview/bulk_exports/export_configuration_spec.rb +79 -0
  216. data/spec/integration/preview/bulk_exports/export_spec.rb +43 -0
  217. data/spec/integration/preview/hosted_numbers/hosted_number_order_spec.rb +280 -0
  218. data/spec/integration/preview/marketplace/available_add_on/available_add_on_extension_spec.rb +121 -0
  219. data/spec/integration/preview/marketplace/available_add_on_spec.rb +142 -0
  220. data/spec/integration/preview/marketplace/installed_add_on/installed_add_on_extension_spec.rb +164 -0
  221. data/spec/integration/preview/marketplace/installed_add_on_spec.rb +252 -0
  222. data/spec/integration/preview/proxy/service/phone_number_spec.rb +173 -0
  223. data/spec/integration/preview/proxy/service/session/interaction_spec.rb +104 -0
  224. data/spec/integration/preview/proxy/service/session/participant/message_interaction_spec.rb +164 -0
  225. data/spec/integration/preview/proxy/service/session/participant_spec.rb +226 -0
  226. data/spec/integration/preview/proxy/service/session_spec.rb +216 -0
  227. data/spec/integration/preview/proxy/service/short_code_spec.rb +173 -0
  228. data/spec/integration/preview/proxy/service_spec.rb +200 -0
  229. data/spec/integration/preview/sync/service/document/document_permission_spec.rb +206 -0
  230. data/spec/integration/preview/sync/service/document_spec.rb +254 -0
  231. data/spec/integration/preview/sync/service/sync_list/sync_list_item_spec.rb +256 -0
  232. data/spec/integration/preview/sync/service/sync_list/sync_list_permission_spec.rb +206 -0
  233. data/spec/integration/preview/sync/service/sync_list_spec.rb +207 -0
  234. data/spec/integration/preview/sync/service/sync_map/sync_map_item_spec.rb +257 -0
  235. data/spec/integration/preview/sync/service/sync_map/sync_map_permission_spec.rb +206 -0
  236. data/spec/integration/preview/sync/service/sync_map_spec.rb +207 -0
  237. data/spec/integration/preview/sync/service_spec.rb +244 -0
  238. data/spec/integration/preview/wireless/command_spec.rb +169 -0
  239. data/spec/integration/preview/wireless/rate_plan_spec.rb +260 -0
  240. data/spec/integration/preview/wireless/sim/usage_spec.rb +49 -0
  241. data/spec/integration/preview/wireless/sim_spec.rb +208 -0
  242. data/spec/integration/sync/v1/service/document/document_permission_spec.rb +206 -0
  243. data/spec/integration/sync/v1/service/document_spec.rb +254 -0
  244. data/spec/integration/sync/v1/service/sync_list/sync_list_item_spec.rb +256 -0
  245. data/spec/integration/sync/v1/service/sync_list/sync_list_permission_spec.rb +206 -0
  246. data/spec/integration/sync/v1/service/sync_list_spec.rb +207 -0
  247. data/spec/integration/sync/v1/service/sync_map/sync_map_item_spec.rb +257 -0
  248. data/spec/integration/sync/v1/service/sync_map/sync_map_permission_spec.rb +206 -0
  249. data/spec/integration/sync/v1/service/sync_map_spec.rb +207 -0
  250. data/spec/integration/sync/v1/service_spec.rb +244 -0
  251. data/spec/integration/taskrouter/v1/workspace/task/reservation_spec.rb +5 -5
  252. data/spec/integration/taskrouter/v1/workspace/worker/reservation_spec.rb +5 -5
  253. data/spec/integration/wireless/v1/command_spec.rb +166 -0
  254. data/spec/integration/wireless/v1/rate_plan_spec.rb +268 -0
  255. data/spec/integration/wireless/v1/sim/usage_record_spec.rb +65 -0
  256. data/spec/integration/wireless/v1/sim_spec.rb +208 -0
  257. data/twilio-ruby.gemspec +1 -3
  258. metadata +192 -2
@@ -0,0 +1,645 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Messaging < Domain
10
+ class V1 < Version
11
+ ##
12
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
13
+ class ServiceList < ListResource
14
+ ##
15
+ # Initialize the ServiceList
16
+ # @param [Version] version Version that contains the resource
17
+ # @return [ServiceList] ServiceList
18
+ def initialize(version)
19
+ super(version)
20
+
21
+ # Path Solution
22
+ @solution = {}
23
+ @uri = "/Services"
24
+ end
25
+
26
+ ##
27
+ # Retrieve a single page of ServiceInstance records from the API.
28
+ # Request is executed immediately.
29
+ # @param [String] friendly_name The friendly_name
30
+ # @param [String] inbound_request_url The inbound_request_url
31
+ # @param [String] inbound_method The inbound_method
32
+ # @param [String] fallback_url The fallback_url
33
+ # @param [String] fallback_method The fallback_method
34
+ # @param [String] status_callback The status_callback
35
+ # @param [Boolean] sticky_sender The sticky_sender
36
+ # @param [Boolean] mms_converter The mms_converter
37
+ # @param [Boolean] smart_encoding The smart_encoding
38
+ # @param [service.ScanMessageContent] scan_message_content The
39
+ # scan_message_content
40
+ # @param [Boolean] fallback_to_long_code The fallback_to_long_code
41
+ # @param [Boolean] area_code_geomatch The area_code_geomatch
42
+ # @param [String] validity_period The validity_period
43
+ # @param [Boolean] synchronous_validation The synchronous_validation
44
+ # @return [ServiceInstance] Newly created ServiceInstance
45
+ def create(friendly_name: nil, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
46
+ data = Twilio::Values.of({
47
+ 'FriendlyName' => friendly_name,
48
+ 'InboundRequestUrl' => inbound_request_url,
49
+ 'InboundMethod' => inbound_method,
50
+ 'FallbackUrl' => fallback_url,
51
+ 'FallbackMethod' => fallback_method,
52
+ 'StatusCallback' => status_callback,
53
+ 'StickySender' => sticky_sender,
54
+ 'MmsConverter' => mms_converter,
55
+ 'SmartEncoding' => smart_encoding,
56
+ 'ScanMessageContent' => scan_message_content,
57
+ 'FallbackToLongCode' => fallback_to_long_code,
58
+ 'AreaCodeGeomatch' => area_code_geomatch,
59
+ 'ValidityPeriod' => validity_period,
60
+ 'SynchronousValidation' => synchronous_validation,
61
+ })
62
+
63
+ payload = @version.create(
64
+ 'POST',
65
+ @uri,
66
+ data: data
67
+ )
68
+
69
+ ServiceInstance.new(
70
+ @version,
71
+ payload,
72
+ )
73
+ end
74
+
75
+ ##
76
+ # Lists ServiceInstance records from the API as a list.
77
+ # Unlike stream(), this operation is eager and will load `limit` records into
78
+ # memory before returning.
79
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
80
+ # guarantees to never return more than limit. Default is no limit
81
+ # @param [Integer] page_size Number of records to fetch per request, when
82
+ # not set will use the default value of 50 records. If no page_size is defined
83
+ # but a limit is defined, stream() will attempt to read the limit with the most
84
+ # efficient page size, i.e. min(limit, 1000)
85
+ # @return [Array] Array of up to limit results
86
+ def list(limit: nil, page_size: nil)
87
+ self.stream(
88
+ limit: limit,
89
+ page_size: page_size
90
+ ).entries
91
+ end
92
+
93
+ ##
94
+ # Streams ServiceInstance records from the API as an Enumerable.
95
+ # This operation lazily loads records as efficiently as possible until the limit
96
+ # is reached.
97
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
98
+ # guarantees to never return more than limit. Default is no limit.
99
+ # @param [Integer] page_size Number of records to fetch per request, when
100
+ # not set will use the default value of 50 records. If no page_size is defined
101
+ # but a limit is defined, stream() will attempt to read the limit with the most
102
+ # efficient page size, i.e. min(limit, 1000)
103
+ # @return [Enumerable] Enumerable that will yield up to limit results
104
+ def stream(limit: nil, page_size: nil)
105
+ limits = @version.read_limits(limit, page_size)
106
+
107
+ page = self.page(
108
+ page_size: limits[:page_size],
109
+ )
110
+
111
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
112
+ end
113
+
114
+ ##
115
+ # When passed a block, yields ServiceInstance records from the API.
116
+ # This operation lazily loads records as efficiently as possible until the limit
117
+ # is reached.
118
+ def each
119
+ limits = @version.read_limits
120
+
121
+ page = self.page(
122
+ page_size: limits[:page_size],
123
+ )
124
+
125
+ @version.stream(page,
126
+ limit: limits[:limit],
127
+ page_limit: limits[:page_limit]).each {|x| yield x}
128
+ end
129
+
130
+ ##
131
+ # Retrieve a single page of ServiceInstance records from the API.
132
+ # Request is executed immediately.
133
+ # @param [String] page_token PageToken provided by the API
134
+ # @param [Integer] page_number Page Number, this value is simply for client state
135
+ # @param [Integer] page_size Number of records to return, defaults to 50
136
+ # @return [Page] Page of ServiceInstance
137
+ def page(page_token: :unset, page_number: :unset, page_size: :unset)
138
+ params = Twilio::Values.of({
139
+ 'PageToken' => page_token,
140
+ 'Page' => page_number,
141
+ 'PageSize' => page_size,
142
+ })
143
+ response = @version.page(
144
+ 'GET',
145
+ @uri,
146
+ params
147
+ )
148
+ ServicePage.new(@version, response, @solution)
149
+ end
150
+
151
+ ##
152
+ # Retrieve a single page of ServiceInstance records from the API.
153
+ # Request is executed immediately.
154
+ # @param [String] target_url API-generated URL for the requested results page
155
+ # @return [Page] Page of ServiceInstance
156
+ def get_page(target_url)
157
+ response = @version.domain.request(
158
+ 'GET',
159
+ target_url
160
+ )
161
+ ServicePage.new(@version, response, @solution)
162
+ end
163
+
164
+ ##
165
+ # Provide a user friendly representation
166
+ def to_s
167
+ '#<Twilio.Messaging.V1.ServiceList>'
168
+ end
169
+ end
170
+
171
+ ##
172
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
173
+ class ServicePage < Page
174
+ ##
175
+ # Initialize the ServicePage
176
+ # @param [Version] version Version that contains the resource
177
+ # @param [Response] response Response from the API
178
+ # @param [Hash] solution Path solution for the resource
179
+ # @return [ServicePage] ServicePage
180
+ def initialize(version, response, solution)
181
+ super(version, response)
182
+
183
+ # Path Solution
184
+ @solution = solution
185
+ end
186
+
187
+ ##
188
+ # Build an instance of ServiceInstance
189
+ # @param [Hash] payload Payload response from the API
190
+ # @return [ServiceInstance] ServiceInstance
191
+ def get_instance(payload)
192
+ ServiceInstance.new(
193
+ @version,
194
+ payload,
195
+ )
196
+ end
197
+
198
+ ##
199
+ # Provide a user friendly representation
200
+ def to_s
201
+ '<Twilio.Messaging.V1.ServicePage>'
202
+ end
203
+ end
204
+
205
+ ##
206
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
207
+ class ServiceContext < InstanceContext
208
+ ##
209
+ # Initialize the ServiceContext
210
+ # @param [Version] version Version that contains the resource
211
+ # @param [String] sid The sid
212
+ # @return [ServiceContext] ServiceContext
213
+ def initialize(version, sid)
214
+ super(version)
215
+
216
+ # Path Solution
217
+ @solution = {
218
+ sid: sid,
219
+ }
220
+ @uri = "/Services/#{@solution[:sid]}"
221
+
222
+ # Dependents
223
+ @phone_numbers = nil
224
+ @short_codes = nil
225
+ @alpha_senders = nil
226
+ end
227
+
228
+ ##
229
+ # Update the ServiceInstance
230
+ # @param [String] friendly_name The friendly_name
231
+ # @param [String] inbound_request_url The inbound_request_url
232
+ # @param [String] inbound_method The inbound_method
233
+ # @param [String] fallback_url The fallback_url
234
+ # @param [String] fallback_method The fallback_method
235
+ # @param [String] status_callback The status_callback
236
+ # @param [Boolean] sticky_sender The sticky_sender
237
+ # @param [Boolean] mms_converter The mms_converter
238
+ # @param [Boolean] smart_encoding The smart_encoding
239
+ # @param [service.ScanMessageContent] scan_message_content The
240
+ # scan_message_content
241
+ # @param [Boolean] fallback_to_long_code The fallback_to_long_code
242
+ # @param [Boolean] area_code_geomatch The area_code_geomatch
243
+ # @param [String] validity_period The validity_period
244
+ # @param [Boolean] synchronous_validation The synchronous_validation
245
+ # @return [ServiceInstance] Updated ServiceInstance
246
+ def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
247
+ data = Twilio::Values.of({
248
+ 'FriendlyName' => friendly_name,
249
+ 'InboundRequestUrl' => inbound_request_url,
250
+ 'InboundMethod' => inbound_method,
251
+ 'FallbackUrl' => fallback_url,
252
+ 'FallbackMethod' => fallback_method,
253
+ 'StatusCallback' => status_callback,
254
+ 'StickySender' => sticky_sender,
255
+ 'MmsConverter' => mms_converter,
256
+ 'SmartEncoding' => smart_encoding,
257
+ 'ScanMessageContent' => scan_message_content,
258
+ 'FallbackToLongCode' => fallback_to_long_code,
259
+ 'AreaCodeGeomatch' => area_code_geomatch,
260
+ 'ValidityPeriod' => validity_period,
261
+ 'SynchronousValidation' => synchronous_validation,
262
+ })
263
+
264
+ payload = @version.update(
265
+ 'POST',
266
+ @uri,
267
+ data: data,
268
+ )
269
+
270
+ ServiceInstance.new(
271
+ @version,
272
+ payload,
273
+ sid: @solution[:sid],
274
+ )
275
+ end
276
+
277
+ ##
278
+ # Fetch a ServiceInstance
279
+ # @return [ServiceInstance] Fetched ServiceInstance
280
+ def fetch
281
+ params = Twilio::Values.of({})
282
+
283
+ payload = @version.fetch(
284
+ 'GET',
285
+ @uri,
286
+ params,
287
+ )
288
+
289
+ ServiceInstance.new(
290
+ @version,
291
+ payload,
292
+ sid: @solution[:sid],
293
+ )
294
+ end
295
+
296
+ ##
297
+ # Deletes the ServiceInstance
298
+ # @return [Boolean] true if delete succeeds, true otherwise
299
+ def delete
300
+ @version.delete('delete', @uri)
301
+ end
302
+
303
+ ##
304
+ # Access the phone_numbers
305
+ # @return [PhoneNumberList]
306
+ # @return [PhoneNumberContext] if sid was passed.
307
+ def phone_numbers(sid=:unset)
308
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
309
+
310
+ if sid != :unset
311
+ return PhoneNumberContext.new(
312
+ @version,
313
+ @solution[:sid],
314
+ sid,
315
+ )
316
+ end
317
+
318
+ unless @phone_numbers
319
+ @phone_numbers = PhoneNumberList.new(
320
+ @version,
321
+ service_sid: @solution[:sid],
322
+ )
323
+ end
324
+
325
+ @phone_numbers
326
+ end
327
+
328
+ ##
329
+ # Access the short_codes
330
+ # @return [ShortCodeList]
331
+ # @return [ShortCodeContext] if sid was passed.
332
+ def short_codes(sid=:unset)
333
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
334
+
335
+ if sid != :unset
336
+ return ShortCodeContext.new(
337
+ @version,
338
+ @solution[:sid],
339
+ sid,
340
+ )
341
+ end
342
+
343
+ unless @short_codes
344
+ @short_codes = ShortCodeList.new(
345
+ @version,
346
+ service_sid: @solution[:sid],
347
+ )
348
+ end
349
+
350
+ @short_codes
351
+ end
352
+
353
+ ##
354
+ # Access the alpha_senders
355
+ # @return [AlphaSenderList]
356
+ # @return [AlphaSenderContext] if sid was passed.
357
+ def alpha_senders(sid=:unset)
358
+ raise ArgumentError, 'sid cannot be nil' if sid.nil?
359
+
360
+ if sid != :unset
361
+ return AlphaSenderContext.new(
362
+ @version,
363
+ @solution[:sid],
364
+ sid,
365
+ )
366
+ end
367
+
368
+ unless @alpha_senders
369
+ @alpha_senders = AlphaSenderList.new(
370
+ @version,
371
+ service_sid: @solution[:sid],
372
+ )
373
+ end
374
+
375
+ @alpha_senders
376
+ end
377
+
378
+ ##
379
+ # Provide a user friendly representation
380
+ def to_s
381
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
382
+ "#<Twilio.Messaging.V1.ServiceContext #{context}>"
383
+ end
384
+ end
385
+
386
+ ##
387
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
388
+ class ServiceInstance < InstanceResource
389
+ ##
390
+ # Initialize the ServiceInstance
391
+ # @param [Version] version Version that contains the resource
392
+ # @param [Hash] payload payload that contains response from Twilio
393
+ # @param [String] sid The sid
394
+ # @return [ServiceInstance] ServiceInstance
395
+ def initialize(version, payload, sid: nil)
396
+ super(version)
397
+
398
+ # Marshaled Properties
399
+ @properties = {
400
+ 'sid' => payload['sid'],
401
+ 'account_sid' => payload['account_sid'],
402
+ 'friendly_name' => payload['friendly_name'],
403
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
404
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
405
+ 'inbound_request_url' => payload['inbound_request_url'],
406
+ 'inbound_method' => payload['inbound_method'],
407
+ 'fallback_url' => payload['fallback_url'],
408
+ 'fallback_method' => payload['fallback_method'],
409
+ 'status_callback' => payload['status_callback'],
410
+ 'sticky_sender' => payload['sticky_sender'],
411
+ 'mms_converter' => payload['mms_converter'],
412
+ 'smart_encoding' => payload['smart_encoding'],
413
+ 'scan_message_content' => payload['scan_message_content'],
414
+ 'fallback_to_long_code' => payload['fallback_to_long_code'],
415
+ 'area_code_geomatch' => payload['area_code_geomatch'],
416
+ 'synchronous_validation' => payload['synchronous_validation'],
417
+ 'validity_period' => payload['validity_period'].to_i,
418
+ 'url' => payload['url'],
419
+ 'links' => payload['links'],
420
+ }
421
+
422
+ # Context
423
+ @instance_context = nil
424
+ @params = {
425
+ 'sid' => sid || @properties['sid'],
426
+ }
427
+ end
428
+
429
+ ##
430
+ # Generate an instance context for the instance, the context is capable of
431
+ # performing various actions. All instance actions are proxied to the context
432
+ # @return [ServiceContext] ServiceContext for this ServiceInstance
433
+ def context
434
+ unless @instance_context
435
+ @instance_context = ServiceContext.new(
436
+ @version,
437
+ @params['sid'],
438
+ )
439
+ end
440
+ @instance_context
441
+ end
442
+
443
+ ##
444
+ # @return [String] The sid
445
+ def sid
446
+ @properties['sid']
447
+ end
448
+
449
+ ##
450
+ # @return [String] The account_sid
451
+ def account_sid
452
+ @properties['account_sid']
453
+ end
454
+
455
+ ##
456
+ # @return [String] The friendly_name
457
+ def friendly_name
458
+ @properties['friendly_name']
459
+ end
460
+
461
+ ##
462
+ # @return [Time] The date_created
463
+ def date_created
464
+ @properties['date_created']
465
+ end
466
+
467
+ ##
468
+ # @return [Time] The date_updated
469
+ def date_updated
470
+ @properties['date_updated']
471
+ end
472
+
473
+ ##
474
+ # @return [String] The inbound_request_url
475
+ def inbound_request_url
476
+ @properties['inbound_request_url']
477
+ end
478
+
479
+ ##
480
+ # @return [String] The inbound_method
481
+ def inbound_method
482
+ @properties['inbound_method']
483
+ end
484
+
485
+ ##
486
+ # @return [String] The fallback_url
487
+ def fallback_url
488
+ @properties['fallback_url']
489
+ end
490
+
491
+ ##
492
+ # @return [String] The fallback_method
493
+ def fallback_method
494
+ @properties['fallback_method']
495
+ end
496
+
497
+ ##
498
+ # @return [String] The status_callback
499
+ def status_callback
500
+ @properties['status_callback']
501
+ end
502
+
503
+ ##
504
+ # @return [Boolean] The sticky_sender
505
+ def sticky_sender
506
+ @properties['sticky_sender']
507
+ end
508
+
509
+ ##
510
+ # @return [Boolean] The mms_converter
511
+ def mms_converter
512
+ @properties['mms_converter']
513
+ end
514
+
515
+ ##
516
+ # @return [Boolean] The smart_encoding
517
+ def smart_encoding
518
+ @properties['smart_encoding']
519
+ end
520
+
521
+ ##
522
+ # @return [service.ScanMessageContent] The scan_message_content
523
+ def scan_message_content
524
+ @properties['scan_message_content']
525
+ end
526
+
527
+ ##
528
+ # @return [Boolean] The fallback_to_long_code
529
+ def fallback_to_long_code
530
+ @properties['fallback_to_long_code']
531
+ end
532
+
533
+ ##
534
+ # @return [Boolean] The area_code_geomatch
535
+ def area_code_geomatch
536
+ @properties['area_code_geomatch']
537
+ end
538
+
539
+ ##
540
+ # @return [Boolean] The synchronous_validation
541
+ def synchronous_validation
542
+ @properties['synchronous_validation']
543
+ end
544
+
545
+ ##
546
+ # @return [String] The validity_period
547
+ def validity_period
548
+ @properties['validity_period']
549
+ end
550
+
551
+ ##
552
+ # @return [String] The url
553
+ def url
554
+ @properties['url']
555
+ end
556
+
557
+ ##
558
+ # @return [String] The links
559
+ def links
560
+ @properties['links']
561
+ end
562
+
563
+ ##
564
+ # Update the ServiceInstance
565
+ # @param [String] friendly_name The friendly_name
566
+ # @param [String] inbound_request_url The inbound_request_url
567
+ # @param [String] inbound_method The inbound_method
568
+ # @param [String] fallback_url The fallback_url
569
+ # @param [String] fallback_method The fallback_method
570
+ # @param [String] status_callback The status_callback
571
+ # @param [Boolean] sticky_sender The sticky_sender
572
+ # @param [Boolean] mms_converter The mms_converter
573
+ # @param [Boolean] smart_encoding The smart_encoding
574
+ # @param [service.ScanMessageContent] scan_message_content The
575
+ # scan_message_content
576
+ # @param [Boolean] fallback_to_long_code The fallback_to_long_code
577
+ # @param [Boolean] area_code_geomatch The area_code_geomatch
578
+ # @param [String] validity_period The validity_period
579
+ # @param [Boolean] synchronous_validation The synchronous_validation
580
+ # @return [ServiceInstance] Updated ServiceInstance
581
+ def update(friendly_name: :unset, inbound_request_url: :unset, inbound_method: :unset, fallback_url: :unset, fallback_method: :unset, status_callback: :unset, sticky_sender: :unset, mms_converter: :unset, smart_encoding: :unset, scan_message_content: :unset, fallback_to_long_code: :unset, area_code_geomatch: :unset, validity_period: :unset, synchronous_validation: :unset)
582
+ context.update(
583
+ friendly_name: friendly_name,
584
+ inbound_request_url: inbound_request_url,
585
+ inbound_method: inbound_method,
586
+ fallback_url: fallback_url,
587
+ fallback_method: fallback_method,
588
+ status_callback: status_callback,
589
+ sticky_sender: sticky_sender,
590
+ mms_converter: mms_converter,
591
+ smart_encoding: smart_encoding,
592
+ scan_message_content: scan_message_content,
593
+ fallback_to_long_code: fallback_to_long_code,
594
+ area_code_geomatch: area_code_geomatch,
595
+ validity_period: validity_period,
596
+ synchronous_validation: synchronous_validation,
597
+ )
598
+ end
599
+
600
+ ##
601
+ # Fetch a ServiceInstance
602
+ # @return [ServiceInstance] Fetched ServiceInstance
603
+ def fetch
604
+ context.fetch
605
+ end
606
+
607
+ ##
608
+ # Deletes the ServiceInstance
609
+ # @return [Boolean] true if delete succeeds, true otherwise
610
+ def delete
611
+ context.delete
612
+ end
613
+
614
+ ##
615
+ # Access the phone_numbers
616
+ # @return [phone_numbers] phone_numbers
617
+ def phone_numbers
618
+ context.phone_numbers
619
+ end
620
+
621
+ ##
622
+ # Access the short_codes
623
+ # @return [short_codes] short_codes
624
+ def short_codes
625
+ context.short_codes
626
+ end
627
+
628
+ ##
629
+ # Access the alpha_senders
630
+ # @return [alpha_senders] alpha_senders
631
+ def alpha_senders
632
+ context.alpha_senders
633
+ end
634
+
635
+ ##
636
+ # Provide a user friendly representation
637
+ def to_s
638
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
639
+ "<Twilio.Messaging.V1.ServiceInstance #{values}>"
640
+ end
641
+ end
642
+ end
643
+ end
644
+ end
645
+ end