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,438 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Notify < Domain
10
+ class V1 < Version
11
+ class ServiceContext < InstanceContext
12
+ ##
13
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
14
+ class BindingList < ListResource
15
+ ##
16
+ # Initialize the BindingList
17
+ # @param [Version] version Version that contains the resource
18
+ # @param [String] service_sid The service_sid
19
+ # @return [BindingList] BindingList
20
+ def initialize(version, service_sid: nil)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {
25
+ service_sid: service_sid
26
+ }
27
+ @uri = "/Services/#{@solution[:service_sid]}/Bindings"
28
+ end
29
+
30
+ ##
31
+ # Retrieve a single page of BindingInstance records from the API.
32
+ # Request is executed immediately.
33
+ # @param [String] identity The identity
34
+ # @param [binding.BindingType] binding_type The binding_type
35
+ # @param [String] address The address
36
+ # @param [String] tag The tag
37
+ # @param [String] notification_protocol_version The notification_protocol_version
38
+ # @param [String] credential_sid The credential_sid
39
+ # @param [String] endpoint The endpoint
40
+ # @return [BindingInstance] Newly created BindingInstance
41
+ def create(identity: nil, binding_type: nil, address: nil, tag: :unset, notification_protocol_version: :unset, credential_sid: :unset, endpoint: :unset)
42
+ data = Twilio::Values.of({
43
+ 'Identity' => identity,
44
+ 'BindingType' => binding_type,
45
+ 'Address' => address,
46
+ 'Tag' => tag,
47
+ 'NotificationProtocolVersion' => notification_protocol_version,
48
+ 'CredentialSid' => credential_sid,
49
+ 'Endpoint' => endpoint,
50
+ })
51
+
52
+ payload = @version.create(
53
+ 'POST',
54
+ @uri,
55
+ data: data
56
+ )
57
+
58
+ BindingInstance.new(
59
+ @version,
60
+ payload,
61
+ service_sid: @solution[:service_sid],
62
+ )
63
+ end
64
+
65
+ ##
66
+ # Lists BindingInstance records from the API as a list.
67
+ # Unlike stream(), this operation is eager and will load `limit` records into
68
+ # memory before returning.
69
+ # @param [Date] start_date The start_date
70
+ # @param [Date] end_date The end_date
71
+ # @param [String] identity The identity
72
+ # @param [String] tag The tag
73
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
74
+ # guarantees to never return more than limit. Default is no limit
75
+ # @param [Integer] page_size Number of records to fetch per request, when
76
+ # not set will use the default value of 50 records. If no page_size is defined
77
+ # but a limit is defined, stream() will attempt to read the limit with the most
78
+ # efficient page size, i.e. min(limit, 1000)
79
+ # @return [Array] Array of up to limit results
80
+ def list(start_date: :unset, end_date: :unset, identity: :unset, tag: :unset, limit: nil, page_size: nil)
81
+ self.stream(
82
+ start_date: start_date,
83
+ end_date: end_date,
84
+ identity: identity,
85
+ tag: tag,
86
+ limit: limit,
87
+ page_size: page_size
88
+ ).entries
89
+ end
90
+
91
+ ##
92
+ # Streams BindingInstance records from the API as an Enumerable.
93
+ # This operation lazily loads records as efficiently as possible until the limit
94
+ # is reached.
95
+ # @param [Date] start_date The start_date
96
+ # @param [Date] end_date The end_date
97
+ # @param [String] identity The identity
98
+ # @param [String] tag The tag
99
+ # @param [Integer] limit Upper limit for the number of records to return. stream()
100
+ # guarantees to never return more than limit. Default is no limit.
101
+ # @param [Integer] page_size Number of records to fetch per request, when
102
+ # not set will use the default value of 50 records. If no page_size is defined
103
+ # but a limit is defined, stream() will attempt to read the limit with the most
104
+ # efficient page size, i.e. min(limit, 1000)
105
+ # @return [Enumerable] Enumerable that will yield up to limit results
106
+ def stream(start_date: :unset, end_date: :unset, identity: :unset, tag: :unset, limit: nil, page_size: nil)
107
+ limits = @version.read_limits(limit, page_size)
108
+
109
+ page = self.page(
110
+ start_date: start_date,
111
+ end_date: end_date,
112
+ identity: identity,
113
+ tag: tag,
114
+ page_size: limits[:page_size],
115
+ )
116
+
117
+ @version.stream(page, limit: limits[:limit], page_limit: limits[:page_limit])
118
+ end
119
+
120
+ ##
121
+ # When passed a block, yields BindingInstance records from the API.
122
+ # This operation lazily loads records as efficiently as possible until the limit
123
+ # is reached.
124
+ def each
125
+ limits = @version.read_limits
126
+
127
+ page = self.page(
128
+ page_size: limits[:page_size],
129
+ )
130
+
131
+ @version.stream(page,
132
+ limit: limits[:limit],
133
+ page_limit: limits[:page_limit]).each {|x| yield x}
134
+ end
135
+
136
+ ##
137
+ # Retrieve a single page of BindingInstance records from the API.
138
+ # Request is executed immediately.
139
+ # @param [Date] start_date The start_date
140
+ # @param [Date] end_date The end_date
141
+ # @param [String] identity The identity
142
+ # @param [String] tag The tag
143
+ # @param [String] page_token PageToken provided by the API
144
+ # @param [Integer] page_number Page Number, this value is simply for client state
145
+ # @param [Integer] page_size Number of records to return, defaults to 50
146
+ # @return [Page] Page of BindingInstance
147
+ def page(start_date: :unset, end_date: :unset, identity: :unset, tag: :unset, page_token: :unset, page_number: :unset, page_size: :unset)
148
+ params = Twilio::Values.of({
149
+ 'StartDate' => Twilio.serialize_iso8601_date(start_date),
150
+ 'EndDate' => Twilio.serialize_iso8601_date(end_date),
151
+ 'Identity' => identity,
152
+ 'Tag' => tag,
153
+ 'PageToken' => page_token,
154
+ 'Page' => page_number,
155
+ 'PageSize' => page_size,
156
+ })
157
+ response = @version.page(
158
+ 'GET',
159
+ @uri,
160
+ params
161
+ )
162
+ BindingPage.new(@version, response, @solution)
163
+ end
164
+
165
+ ##
166
+ # Retrieve a single page of BindingInstance records from the API.
167
+ # Request is executed immediately.
168
+ # @param [String] target_url API-generated URL for the requested results page
169
+ # @return [Page] Page of BindingInstance
170
+ def get_page(target_url)
171
+ response = @version.domain.request(
172
+ 'GET',
173
+ target_url
174
+ )
175
+ BindingPage.new(@version, response, @solution)
176
+ end
177
+
178
+ ##
179
+ # Provide a user friendly representation
180
+ def to_s
181
+ '#<Twilio.Notify.V1.BindingList>'
182
+ end
183
+ end
184
+
185
+ ##
186
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
187
+ class BindingPage < Page
188
+ ##
189
+ # Initialize the BindingPage
190
+ # @param [Version] version Version that contains the resource
191
+ # @param [Response] response Response from the API
192
+ # @param [Hash] solution Path solution for the resource
193
+ # @return [BindingPage] BindingPage
194
+ def initialize(version, response, solution)
195
+ super(version, response)
196
+
197
+ # Path Solution
198
+ @solution = solution
199
+ end
200
+
201
+ ##
202
+ # Build an instance of BindingInstance
203
+ # @param [Hash] payload Payload response from the API
204
+ # @return [BindingInstance] BindingInstance
205
+ def get_instance(payload)
206
+ BindingInstance.new(
207
+ @version,
208
+ payload,
209
+ service_sid: @solution[:service_sid],
210
+ )
211
+ end
212
+
213
+ ##
214
+ # Provide a user friendly representation
215
+ def to_s
216
+ '<Twilio.Notify.V1.BindingPage>'
217
+ end
218
+ end
219
+
220
+ ##
221
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
222
+ class BindingContext < InstanceContext
223
+ ##
224
+ # Initialize the BindingContext
225
+ # @param [Version] version Version that contains the resource
226
+ # @param [String] service_sid The service_sid
227
+ # @param [String] sid The sid
228
+ # @return [BindingContext] BindingContext
229
+ def initialize(version, service_sid, sid)
230
+ super(version)
231
+
232
+ # Path Solution
233
+ @solution = {
234
+ service_sid: service_sid,
235
+ sid: sid,
236
+ }
237
+ @uri = "/Services/#{@solution[:service_sid]}/Bindings/#{@solution[:sid]}"
238
+ end
239
+
240
+ ##
241
+ # Fetch a BindingInstance
242
+ # @return [BindingInstance] Fetched BindingInstance
243
+ def fetch
244
+ params = Twilio::Values.of({})
245
+
246
+ payload = @version.fetch(
247
+ 'GET',
248
+ @uri,
249
+ params,
250
+ )
251
+
252
+ BindingInstance.new(
253
+ @version,
254
+ payload,
255
+ service_sid: @solution[:service_sid],
256
+ sid: @solution[:sid],
257
+ )
258
+ end
259
+
260
+ ##
261
+ # Deletes the BindingInstance
262
+ # @return [Boolean] true if delete succeeds, true otherwise
263
+ def delete
264
+ @version.delete('delete', @uri)
265
+ end
266
+
267
+ ##
268
+ # Provide a user friendly representation
269
+ def to_s
270
+ context = @solution.map {|k, v| "#{k}: #{v}"}.join(',')
271
+ "#<Twilio.Notify.V1.BindingContext #{context}>"
272
+ end
273
+ end
274
+
275
+ ##
276
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
277
+ class BindingInstance < InstanceResource
278
+ ##
279
+ # Initialize the BindingInstance
280
+ # @param [Version] version Version that contains the resource
281
+ # @param [Hash] payload payload that contains response from Twilio
282
+ # @param [String] service_sid The service_sid
283
+ # @param [String] sid The sid
284
+ # @return [BindingInstance] BindingInstance
285
+ def initialize(version, payload, service_sid: nil, sid: nil)
286
+ super(version)
287
+
288
+ # Marshaled Properties
289
+ @properties = {
290
+ 'sid' => payload['sid'],
291
+ 'account_sid' => payload['account_sid'],
292
+ 'service_sid' => payload['service_sid'],
293
+ 'credential_sid' => payload['credential_sid'],
294
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
295
+ 'date_updated' => Twilio.deserialize_iso8601_datetime(payload['date_updated']),
296
+ 'notification_protocol_version' => payload['notification_protocol_version'],
297
+ 'endpoint' => payload['endpoint'],
298
+ 'identity' => payload['identity'],
299
+ 'binding_type' => payload['binding_type'],
300
+ 'address' => payload['address'],
301
+ 'tags' => payload['tags'],
302
+ 'url' => payload['url'],
303
+ 'links' => payload['links'],
304
+ }
305
+
306
+ # Context
307
+ @instance_context = nil
308
+ @params = {
309
+ 'service_sid' => service_sid,
310
+ 'sid' => sid || @properties['sid'],
311
+ }
312
+ end
313
+
314
+ ##
315
+ # Generate an instance context for the instance, the context is capable of
316
+ # performing various actions. All instance actions are proxied to the context
317
+ # @return [BindingContext] BindingContext for this BindingInstance
318
+ def context
319
+ unless @instance_context
320
+ @instance_context = BindingContext.new(
321
+ @version,
322
+ @params['service_sid'],
323
+ @params['sid'],
324
+ )
325
+ end
326
+ @instance_context
327
+ end
328
+
329
+ ##
330
+ # @return [String] The sid
331
+ def sid
332
+ @properties['sid']
333
+ end
334
+
335
+ ##
336
+ # @return [String] The account_sid
337
+ def account_sid
338
+ @properties['account_sid']
339
+ end
340
+
341
+ ##
342
+ # @return [String] The service_sid
343
+ def service_sid
344
+ @properties['service_sid']
345
+ end
346
+
347
+ ##
348
+ # @return [String] The credential_sid
349
+ def credential_sid
350
+ @properties['credential_sid']
351
+ end
352
+
353
+ ##
354
+ # @return [Time] The date_created
355
+ def date_created
356
+ @properties['date_created']
357
+ end
358
+
359
+ ##
360
+ # @return [Time] The date_updated
361
+ def date_updated
362
+ @properties['date_updated']
363
+ end
364
+
365
+ ##
366
+ # @return [String] The notification_protocol_version
367
+ def notification_protocol_version
368
+ @properties['notification_protocol_version']
369
+ end
370
+
371
+ ##
372
+ # @return [String] The endpoint
373
+ def endpoint
374
+ @properties['endpoint']
375
+ end
376
+
377
+ ##
378
+ # @return [String] The identity
379
+ def identity
380
+ @properties['identity']
381
+ end
382
+
383
+ ##
384
+ # @return [String] The binding_type
385
+ def binding_type
386
+ @properties['binding_type']
387
+ end
388
+
389
+ ##
390
+ # @return [String] The address
391
+ def address
392
+ @properties['address']
393
+ end
394
+
395
+ ##
396
+ # @return [String] The tags
397
+ def tags
398
+ @properties['tags']
399
+ end
400
+
401
+ ##
402
+ # @return [String] The url
403
+ def url
404
+ @properties['url']
405
+ end
406
+
407
+ ##
408
+ # @return [String] The links
409
+ def links
410
+ @properties['links']
411
+ end
412
+
413
+ ##
414
+ # Fetch a BindingInstance
415
+ # @return [BindingInstance] Fetched BindingInstance
416
+ def fetch
417
+ context.fetch
418
+ end
419
+
420
+ ##
421
+ # Deletes the BindingInstance
422
+ # @return [Boolean] true if delete succeeds, true otherwise
423
+ def delete
424
+ context.delete
425
+ end
426
+
427
+ ##
428
+ # Provide a user friendly representation
429
+ def to_s
430
+ values = @params.map{|k, v| "#{k}: #{v}"}.join(" ")
431
+ "<Twilio.Notify.V1.BindingInstance #{values}>"
432
+ end
433
+ end
434
+ end
435
+ end
436
+ end
437
+ end
438
+ end
@@ -0,0 +1,294 @@
1
+ ##
2
+ # This code was generated by
3
+ # \ / _ _ _| _ _
4
+ # | (_)\/(_)(_|\/| |(/_ v1.0.0
5
+ # / /
6
+
7
+ module Twilio
8
+ module REST
9
+ class Notify < Domain
10
+ class V1 < Version
11
+ class ServiceContext < InstanceContext
12
+ ##
13
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
14
+ class NotificationList < ListResource
15
+ ##
16
+ # Initialize the NotificationList
17
+ # @param [Version] version Version that contains the resource
18
+ # @param [String] service_sid The service_sid
19
+ # @return [NotificationList] NotificationList
20
+ def initialize(version, service_sid: nil)
21
+ super(version)
22
+
23
+ # Path Solution
24
+ @solution = {
25
+ service_sid: service_sid
26
+ }
27
+ @uri = "/Services/#{@solution[:service_sid]}/Notifications"
28
+ end
29
+
30
+ ##
31
+ # Retrieve a single page of NotificationInstance records from the API.
32
+ # Request is executed immediately.
33
+ # @param [String] body The body
34
+ # @param [notification.Priority] priority The priority
35
+ # @param [String] ttl The ttl
36
+ # @param [String] title The title
37
+ # @param [String] sound The sound
38
+ # @param [String] action The action
39
+ # @param [String] data The data
40
+ # @param [String] apn The apn
41
+ # @param [String] gcm The gcm
42
+ # @param [String] sms The sms
43
+ # @param [Hash] facebook_messenger The facebook_messenger
44
+ # @param [String] fcm The fcm
45
+ # @param [String] segment The segment
46
+ # @param [String] alexa The alexa
47
+ # @param [String] to_binding The to_binding
48
+ # @param [String] identity The identity
49
+ # @param [String] tag The tag
50
+ # @return [NotificationInstance] Newly created NotificationInstance
51
+ def create(body: :unset, priority: :unset, ttl: :unset, title: :unset, sound: :unset, action: :unset, data: :unset, apn: :unset, gcm: :unset, sms: :unset, facebook_messenger: :unset, fcm: :unset, segment: :unset, alexa: :unset, to_binding: :unset, identity: :unset, tag: :unset)
52
+ data = Twilio::Values.of({
53
+ 'Identity' => identity,
54
+ 'Tag' => tag,
55
+ 'Body' => body,
56
+ 'Priority' => priority,
57
+ 'Ttl' => ttl,
58
+ 'Title' => title,
59
+ 'Sound' => sound,
60
+ 'Action' => action,
61
+ 'Data' => data,
62
+ 'Apn' => apn,
63
+ 'Gcm' => gcm,
64
+ 'Sms' => sms,
65
+ 'FacebookMessenger' => Twilio.serialize_object(facebook_messenger),
66
+ 'Fcm' => fcm,
67
+ 'Segment' => segment,
68
+ 'Alexa' => alexa,
69
+ 'ToBinding' => to_binding,
70
+ })
71
+
72
+ payload = @version.create(
73
+ 'POST',
74
+ @uri,
75
+ data: data
76
+ )
77
+
78
+ NotificationInstance.new(
79
+ @version,
80
+ payload,
81
+ service_sid: @solution[:service_sid],
82
+ )
83
+ end
84
+
85
+ ##
86
+ # Provide a user friendly representation
87
+ def to_s
88
+ '#<Twilio.Notify.V1.NotificationList>'
89
+ end
90
+ end
91
+
92
+ ##
93
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
94
+ class NotificationPage < Page
95
+ ##
96
+ # Initialize the NotificationPage
97
+ # @param [Version] version Version that contains the resource
98
+ # @param [Response] response Response from the API
99
+ # @param [Hash] solution Path solution for the resource
100
+ # @return [NotificationPage] NotificationPage
101
+ def initialize(version, response, solution)
102
+ super(version, response)
103
+
104
+ # Path Solution
105
+ @solution = solution
106
+ end
107
+
108
+ ##
109
+ # Build an instance of NotificationInstance
110
+ # @param [Hash] payload Payload response from the API
111
+ # @return [NotificationInstance] NotificationInstance
112
+ def get_instance(payload)
113
+ NotificationInstance.new(
114
+ @version,
115
+ payload,
116
+ service_sid: @solution[:service_sid],
117
+ )
118
+ end
119
+
120
+ ##
121
+ # Provide a user friendly representation
122
+ def to_s
123
+ '<Twilio.Notify.V1.NotificationPage>'
124
+ end
125
+ end
126
+
127
+ ##
128
+ # PLEASE NOTE that this class contains beta products that are subject to change. Use them with caution.
129
+ class NotificationInstance < InstanceResource
130
+ ##
131
+ # Initialize the NotificationInstance
132
+ # @param [Version] version Version that contains the resource
133
+ # @param [Hash] payload payload that contains response from Twilio
134
+ # @param [String] service_sid The service_sid
135
+ # @return [NotificationInstance] NotificationInstance
136
+ def initialize(version, payload, service_sid: nil)
137
+ super(version)
138
+
139
+ # Marshaled Properties
140
+ @properties = {
141
+ 'sid' => payload['sid'],
142
+ 'account_sid' => payload['account_sid'],
143
+ 'service_sid' => payload['service_sid'],
144
+ 'date_created' => Twilio.deserialize_iso8601_datetime(payload['date_created']),
145
+ 'identities' => payload['identities'],
146
+ 'tags' => payload['tags'],
147
+ 'segments' => payload['segments'],
148
+ 'priority' => payload['priority'],
149
+ 'ttl' => payload['ttl'].to_i,
150
+ 'title' => payload['title'],
151
+ 'body' => payload['body'],
152
+ 'sound' => payload['sound'],
153
+ 'action' => payload['action'],
154
+ 'data' => payload['data'],
155
+ 'apn' => payload['apn'],
156
+ 'gcm' => payload['gcm'],
157
+ 'fcm' => payload['fcm'],
158
+ 'sms' => payload['sms'],
159
+ 'facebook_messenger' => payload['facebook_messenger'],
160
+ 'alexa' => payload['alexa'],
161
+ }
162
+ end
163
+
164
+ ##
165
+ # @return [String] The sid
166
+ def sid
167
+ @properties['sid']
168
+ end
169
+
170
+ ##
171
+ # @return [String] The account_sid
172
+ def account_sid
173
+ @properties['account_sid']
174
+ end
175
+
176
+ ##
177
+ # @return [String] The service_sid
178
+ def service_sid
179
+ @properties['service_sid']
180
+ end
181
+
182
+ ##
183
+ # @return [Time] The date_created
184
+ def date_created
185
+ @properties['date_created']
186
+ end
187
+
188
+ ##
189
+ # @return [String] The identities
190
+ def identities
191
+ @properties['identities']
192
+ end
193
+
194
+ ##
195
+ # @return [String] The tags
196
+ def tags
197
+ @properties['tags']
198
+ end
199
+
200
+ ##
201
+ # @return [String] The segments
202
+ def segments
203
+ @properties['segments']
204
+ end
205
+
206
+ ##
207
+ # @return [notification.Priority] The priority
208
+ def priority
209
+ @properties['priority']
210
+ end
211
+
212
+ ##
213
+ # @return [String] The ttl
214
+ def ttl
215
+ @properties['ttl']
216
+ end
217
+
218
+ ##
219
+ # @return [String] The title
220
+ def title
221
+ @properties['title']
222
+ end
223
+
224
+ ##
225
+ # @return [String] The body
226
+ def body
227
+ @properties['body']
228
+ end
229
+
230
+ ##
231
+ # @return [String] The sound
232
+ def sound
233
+ @properties['sound']
234
+ end
235
+
236
+ ##
237
+ # @return [String] The action
238
+ def action
239
+ @properties['action']
240
+ end
241
+
242
+ ##
243
+ # @return [Hash] The data
244
+ def data
245
+ @properties['data']
246
+ end
247
+
248
+ ##
249
+ # @return [Hash] The apn
250
+ def apn
251
+ @properties['apn']
252
+ end
253
+
254
+ ##
255
+ # @return [Hash] The gcm
256
+ def gcm
257
+ @properties['gcm']
258
+ end
259
+
260
+ ##
261
+ # @return [Hash] The fcm
262
+ def fcm
263
+ @properties['fcm']
264
+ end
265
+
266
+ ##
267
+ # @return [Hash] The sms
268
+ def sms
269
+ @properties['sms']
270
+ end
271
+
272
+ ##
273
+ # @return [Hash] The facebook_messenger
274
+ def facebook_messenger
275
+ @properties['facebook_messenger']
276
+ end
277
+
278
+ ##
279
+ # @return [Hash] The alexa
280
+ def alexa
281
+ @properties['alexa']
282
+ end
283
+
284
+ ##
285
+ # Provide a user friendly representation
286
+ def to_s
287
+ "<Twilio.Notify.V1.NotificationInstance>"
288
+ end
289
+ end
290
+ end
291
+ end
292
+ end
293
+ end
294
+ end